-
Notifications
You must be signed in to change notification settings - Fork 0
/
mmtp.proto
126 lines (105 loc) · 2.25 KB
/
mmtp.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";
message ApplicationMessage {
ApplicationMessageHeader header = 1;
bytes body = 2;
bytes signature = 3;
}
message ApplicationMessageHeader {
oneof SubjectOrRecipient {
string subject = 1;
Recipients recipients = 2;
}
int64 expires = 3;
string sender = 4;
optional string qosProfile = 5;
uint32 bodySizeNumBytes = 6;
}
message Recipients {
repeated string recipients = 1;
}
message MmtpMessage {
MsgType msgType = 1;
string uuid = 2;
oneof body {
ProtocolMessage protocolMessage = 3;
ResponseMessage responseMessage = 4;
}
}
enum MsgType {
UNSPECIFIED_MESSAGE = 0;
PROTOCOL_MESSAGE = 1;
RESPONSE_MESSAGE = 2;
}
message ProtocolMessage {
ProtocolMessageType protocolMsgType = 1;
oneof body {
Subscribe subscribeMessage = 2;
Unsubscribe unsubscribeMessage = 3;
Send sendMessage = 4;
Receive receiveMessage = 5;
Fetch fetchMessage = 6;
Disconnect disconnectMessage = 7;
Connect connectMessage = 8;
Notify notifyMessage = 9;
}
}
enum ProtocolMessageType {
UNSPECIFIED = 0;
SUBSCRIBE_MESSAGE = 1;
UNSUBSCRIBE_MESSAGE = 2;
SEND_MESSAGE = 3;
RECEIVE_MESSAGE = 4;
FETCH_MESSAGE = 5;
DISCONNECT_MESSAGE = 6;
CONNECT_MESSAGE = 7;
NOTIFY_MESSAGE = 8;
}
message Subscribe {
oneof subjectOrDirectMessages {
string subject = 1;
bool directMessages = 2;
}
}
message Unsubscribe {
oneof subjectOrDirectMessages {
string subject = 1;
bool directMessages = 2;
}
}
message Send {
ApplicationMessage applicationMessage = 1;
}
message Receive {
optional Filter filter = 1;
}
message Filter {
repeated string messageUuids = 1;
}
message Fetch {
}
message Disconnect {
}
message Connect {
optional string ownMrn = 1;
optional string reconnectToken = 2;
}
message Notify {
repeated MessageMetadata messageMetadata = 1;
}
message ResponseMessage {
string responseToUuid = 1;
ResponseEnum response = 2;
optional string reasonText = 3;
repeated MessageMetadata messageMetadata = 4;
repeated ApplicationMessage applicationMessages = 5;
optional string reconnectToken = 6;
}
enum ResponseEnum {
UNSPECIFIED_RESPONSE = 0;
GOOD = 1;
ERROR = 2;
}
message MessageMetadata {
string uuid = 1;
ApplicationMessageHeader header = 2;
}