forked from stripe/stripe-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
listen.proto
87 lines (65 loc) · 1.94 KB
/
listen.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
syntax = "proto3";
package rpc;
import "common.proto";
option go_package = "github.com/stripe/stripe-cli/rpc";
message ListenRequest {
// A list of custom headers to forward for Connect
repeated string connect_headers = 1;
// A list of specific events to listen for. For a list of all possible events, see:
// https://stripe.com/docs/api/events/types (default [*])
repeated string events = 2;
// The URL to forward Connect webhook events to (default: same as normal events)
string forward_connect_to = 3;
// The URL to forward webhook events to
string forward_to = 4;
// A list of custom headers to forward
repeated string headers = 5;
// Receive events formatted with the latest API version (default: your account's default API
// version)
bool latest = 6;
// Receive live events (default: test)
bool live = 7;
// Skip certificate verification when forwarding to HTTPS endpoints
bool skip_verify = 8;
// Load webhook endpoint configuration from the webhooks API/dashboard
bool use_configured_webhooks = 9;
}
message ListenResponse {
enum State {
STATE_UNSPECIFIED = 0;
STATE_LOADING = 1;
STATE_RECONNECTING = 2;
STATE_READY = 3;
STATE_DONE = 4;
}
message EndpointResponse {
message Data {
enum HttpMethod {
HTTP_METHOD_UNSPECIFIED = 0;
HTTP_METHOD_GET = 1;
HTTP_METHOD_POST = 2;
HTTP_METHOD_DELETE = 3;
}
// HTTP status code
int64 status = 1;
// HTTP method
HttpMethod http_method = 2;
// URL of the webhook endpoint
string url = 3;
// ID of the Stripe event that caused this response
string event_id = 4;
}
oneof content {
Data data = 1;
string error = 2;
}
}
oneof content {
// Check if the stream ready
State state = 1;
// A Stripe event
StripeEvent stripe_event = 2;
// A response from an endpoint
EndpointResponse endpoint_response = 3;
}
}