-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebhookd.proto
126 lines (107 loc) · 2.48 KB
/
webhookd.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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
syntax = "proto3";
package webhookd;
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
option (gogoproto.goproto_enum_prefix_all) = false;
option go_package = "github.com/webhookd/api-proto-go/webhookd";
option java_multiple_files = true;
option java_outer_classname = "WebhookdApiProto";
option java_package = "com.webhookd";
service WebhookdApi {
rpc SubscriptionCreate (SubscriptionCreateRequest) returns (SubscriptionInviteResponse);
rpc SubscriptionInvite (SubscriptionInviteRequest) returns (SubscriptionInviteResponse);
rpc SubscriptionAccept (SubscriptionAcceptRequest) returns (SubscriptionAcceptResponse);
rpc Transmit (TransmitRequest) returns (TransmitResponse);
}
message SubscriptionCreateRequest {
Provider provider = 1;
string key = 2;
string name = 3;
}
message SubscriptionInviteRequest {
Subscription subscription = 1;
string name = 2;
}
message SubscriptionInviteResponse {
Subscription subscription = 1;
string name = 2;
string token = 3;
string accept_url = 4;
}
message SubscriptionAcceptRequest {
Consumer consumer = 1;
Subscription subscription = 2;
string token = 3;
}
message SubscriptionAcceptResponse {
bool received = 1;
}
message TransmitRequest {
Provider provider = 1;
Subscription subscription = 2;
Message message = 3;
}
message TransmitResponse {
bool received = 1;
string message = 2;
}
enum HttpMethod {
HTTP_METHOD_UNKNOWN = 0;
HTTP_METHOD_GET = 1;
HTTP_METHOD_HEAD = 2;
HTTP_METHOD_POST = 3;
HTTP_METHOD_PUT = 4;
HTTP_METHOD_DELETE = 5;
HTTP_METHOD_CONNECT = 6;
HTTP_METHOD_OPTIONS = 7;
HTTP_METHOD_TRACE = 8;
}
enum State {
STATE_UNKNOWN = 0;
STATE_ACTIVE = 1;
STATE_PAUSED = 2;
STATE_SUSPENDED = 3;
STATE_CANCELLED = 4;
STATE_DELETED = 5;
}
enum Plan {
PLAN_UNKNOWN = 0;
PLAN_TRIAL = 1;
PLAN_FREE = 2;
PLAN_PAID = 3;
PLAN_BESPOKE = 4;
}
message Message {
string id = 1;
string provider_reference = 2;
HttpMethod method = 3;
string body = 4;
map<string, string> query = 5;
map<string, string> headers = 6;
}
message Provider {
string id = 1;
string name = 2;
State state = 3;
Plan plan = 4;
}
message Consumer {
string id = 1;
string name = 2;
State state = 3;
Plan plan = 4;
}
message Subscription {
string id = 1;
string key = 2;
string name = 3;
State state = 4;
}
message Destination {
string id = 1;
string name = 2;
string url = 3;
int32 retry_count = 4;
string retry_policy = 5;
map<string, string> headers = 6;
State state = 7;
}