@azure/web-pubsub-client-protobuf 1.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +64 -0
- package/dist/index.js +4392 -0
- package/dist/index.js.map +1 -0
- package/dist-esm/samples-dev/basicusage.js +63 -0
- package/dist-esm/samples-dev/basicusage.js.map +1 -0
- package/dist-esm/src/generated/clientProto.js +4137 -0
- package/dist-esm/src/index.js +17 -0
- package/dist-esm/src/index.js.map +1 -0
- package/dist-esm/src/logger.js +8 -0
- package/dist-esm/src/logger.js.map +1 -0
- package/dist-esm/src/webPubSubProtobufProtocol.js +33 -0
- package/dist-esm/src/webPubSubProtobufProtocol.js.map +1 -0
- package/dist-esm/src/webPubSubProtobufProtocolBase.js +187 -0
- package/dist-esm/src/webPubSubProtobufProtocolBase.js.map +1 -0
- package/dist-esm/src/webPubSubProtobufReliableProtocol.js +33 -0
- package/dist-esm/src/webPubSubProtobufReliableProtocol.js.map +1 -0
- package/dist-esm/test/client.spec.js +294 -0
- package/dist-esm/test/client.spec.js.map +1 -0
- package/package.json +123 -0
- package/types/web-pubsub-client-protobuf.d.ts +13 -0
|
@@ -0,0 +1,4137 @@
|
|
|
1
|
+
/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/
|
|
2
|
+
import * as $protobuf from "protobufjs/minimal";
|
|
3
|
+
|
|
4
|
+
// Common aliases
|
|
5
|
+
const $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util;
|
|
6
|
+
|
|
7
|
+
// Exported root namespace
|
|
8
|
+
const $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {});
|
|
9
|
+
|
|
10
|
+
export const UpstreamMessage = $root.UpstreamMessage = (() => {
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Properties of an UpstreamMessage.
|
|
14
|
+
* @exports IUpstreamMessage
|
|
15
|
+
* @interface IUpstreamMessage
|
|
16
|
+
* @property {UpstreamMessage.ISendToGroupMessage|null} [sendToGroupMessage] UpstreamMessage sendToGroupMessage
|
|
17
|
+
* @property {UpstreamMessage.IEventMessage|null} [eventMessage] UpstreamMessage eventMessage
|
|
18
|
+
* @property {UpstreamMessage.IJoinGroupMessage|null} [joinGroupMessage] UpstreamMessage joinGroupMessage
|
|
19
|
+
* @property {UpstreamMessage.ILeaveGroupMessage|null} [leaveGroupMessage] UpstreamMessage leaveGroupMessage
|
|
20
|
+
* @property {UpstreamMessage.ISequenceAckMessage|null} [sequenceAckMessage] UpstreamMessage sequenceAckMessage
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Constructs a new UpstreamMessage.
|
|
25
|
+
* @exports UpstreamMessage
|
|
26
|
+
* @classdesc Represents an UpstreamMessage.
|
|
27
|
+
* @implements IUpstreamMessage
|
|
28
|
+
* @constructor
|
|
29
|
+
* @param {IUpstreamMessage=} [properties] Properties to set
|
|
30
|
+
*/
|
|
31
|
+
function UpstreamMessage(properties) {
|
|
32
|
+
if (properties)
|
|
33
|
+
for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
34
|
+
if (properties[keys[i]] != null)
|
|
35
|
+
this[keys[i]] = properties[keys[i]];
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* UpstreamMessage sendToGroupMessage.
|
|
40
|
+
* @member {UpstreamMessage.ISendToGroupMessage|null|undefined} sendToGroupMessage
|
|
41
|
+
* @memberof UpstreamMessage
|
|
42
|
+
* @instance
|
|
43
|
+
*/
|
|
44
|
+
UpstreamMessage.prototype.sendToGroupMessage = null;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* UpstreamMessage eventMessage.
|
|
48
|
+
* @member {UpstreamMessage.IEventMessage|null|undefined} eventMessage
|
|
49
|
+
* @memberof UpstreamMessage
|
|
50
|
+
* @instance
|
|
51
|
+
*/
|
|
52
|
+
UpstreamMessage.prototype.eventMessage = null;
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* UpstreamMessage joinGroupMessage.
|
|
56
|
+
* @member {UpstreamMessage.IJoinGroupMessage|null|undefined} joinGroupMessage
|
|
57
|
+
* @memberof UpstreamMessage
|
|
58
|
+
* @instance
|
|
59
|
+
*/
|
|
60
|
+
UpstreamMessage.prototype.joinGroupMessage = null;
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* UpstreamMessage leaveGroupMessage.
|
|
64
|
+
* @member {UpstreamMessage.ILeaveGroupMessage|null|undefined} leaveGroupMessage
|
|
65
|
+
* @memberof UpstreamMessage
|
|
66
|
+
* @instance
|
|
67
|
+
*/
|
|
68
|
+
UpstreamMessage.prototype.leaveGroupMessage = null;
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* UpstreamMessage sequenceAckMessage.
|
|
72
|
+
* @member {UpstreamMessage.ISequenceAckMessage|null|undefined} sequenceAckMessage
|
|
73
|
+
* @memberof UpstreamMessage
|
|
74
|
+
* @instance
|
|
75
|
+
*/
|
|
76
|
+
UpstreamMessage.prototype.sequenceAckMessage = null;
|
|
77
|
+
|
|
78
|
+
// OneOf field names bound to virtual getters and setters
|
|
79
|
+
let $oneOfFields;
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* UpstreamMessage message.
|
|
83
|
+
* @member {"sendToGroupMessage"|"eventMessage"|"joinGroupMessage"|"leaveGroupMessage"|"sequenceAckMessage"|undefined} message
|
|
84
|
+
* @memberof UpstreamMessage
|
|
85
|
+
* @instance
|
|
86
|
+
*/
|
|
87
|
+
Object.defineProperty(UpstreamMessage.prototype, "message", {
|
|
88
|
+
get: $util.oneOfGetter($oneOfFields = ["sendToGroupMessage", "eventMessage", "joinGroupMessage", "leaveGroupMessage", "sequenceAckMessage"]),
|
|
89
|
+
set: $util.oneOfSetter($oneOfFields)
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Creates a new UpstreamMessage instance using the specified properties.
|
|
94
|
+
* @function create
|
|
95
|
+
* @memberof UpstreamMessage
|
|
96
|
+
* @static
|
|
97
|
+
* @param {IUpstreamMessage=} [properties] Properties to set
|
|
98
|
+
* @returns {UpstreamMessage} UpstreamMessage instance
|
|
99
|
+
*/
|
|
100
|
+
UpstreamMessage.create = function create(properties) {
|
|
101
|
+
return new UpstreamMessage(properties);
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Encodes the specified UpstreamMessage message. Does not implicitly {@link UpstreamMessage.verify|verify} messages.
|
|
106
|
+
* @function encode
|
|
107
|
+
* @memberof UpstreamMessage
|
|
108
|
+
* @static
|
|
109
|
+
* @param {IUpstreamMessage} message UpstreamMessage message or plain object to encode
|
|
110
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
111
|
+
* @returns {$protobuf.Writer} Writer
|
|
112
|
+
*/
|
|
113
|
+
UpstreamMessage.encode = function encode(message, writer) {
|
|
114
|
+
if (!writer)
|
|
115
|
+
writer = $Writer.create();
|
|
116
|
+
if (message.sendToGroupMessage != null && Object.hasOwnProperty.call(message, "sendToGroupMessage"))
|
|
117
|
+
$root.UpstreamMessage.SendToGroupMessage.encode(message.sendToGroupMessage, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
|
|
118
|
+
if (message.eventMessage != null && Object.hasOwnProperty.call(message, "eventMessage"))
|
|
119
|
+
$root.UpstreamMessage.EventMessage.encode(message.eventMessage, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();
|
|
120
|
+
if (message.joinGroupMessage != null && Object.hasOwnProperty.call(message, "joinGroupMessage"))
|
|
121
|
+
$root.UpstreamMessage.JoinGroupMessage.encode(message.joinGroupMessage, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();
|
|
122
|
+
if (message.leaveGroupMessage != null && Object.hasOwnProperty.call(message, "leaveGroupMessage"))
|
|
123
|
+
$root.UpstreamMessage.LeaveGroupMessage.encode(message.leaveGroupMessage, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim();
|
|
124
|
+
if (message.sequenceAckMessage != null && Object.hasOwnProperty.call(message, "sequenceAckMessage"))
|
|
125
|
+
$root.UpstreamMessage.SequenceAckMessage.encode(message.sequenceAckMessage, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim();
|
|
126
|
+
return writer;
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Encodes the specified UpstreamMessage message, length delimited. Does not implicitly {@link UpstreamMessage.verify|verify} messages.
|
|
131
|
+
* @function encodeDelimited
|
|
132
|
+
* @memberof UpstreamMessage
|
|
133
|
+
* @static
|
|
134
|
+
* @param {IUpstreamMessage} message UpstreamMessage message or plain object to encode
|
|
135
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
136
|
+
* @returns {$protobuf.Writer} Writer
|
|
137
|
+
*/
|
|
138
|
+
UpstreamMessage.encodeDelimited = function encodeDelimited(message, writer) {
|
|
139
|
+
return this.encode(message, writer).ldelim();
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* Decodes an UpstreamMessage message from the specified reader or buffer.
|
|
144
|
+
* @function decode
|
|
145
|
+
* @memberof UpstreamMessage
|
|
146
|
+
* @static
|
|
147
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
148
|
+
* @param {number} [length] Message length if known beforehand
|
|
149
|
+
* @returns {UpstreamMessage} UpstreamMessage
|
|
150
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
151
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
152
|
+
*/
|
|
153
|
+
UpstreamMessage.decode = function decode(reader, length) {
|
|
154
|
+
if (!(reader instanceof $Reader))
|
|
155
|
+
reader = $Reader.create(reader);
|
|
156
|
+
let end = length === undefined ? reader.len : reader.pos + length, message = new $root.UpstreamMessage();
|
|
157
|
+
while (reader.pos < end) {
|
|
158
|
+
let tag = reader.uint32();
|
|
159
|
+
switch (tag >>> 3) {
|
|
160
|
+
case 1: {
|
|
161
|
+
message.sendToGroupMessage = $root.UpstreamMessage.SendToGroupMessage.decode(reader, reader.uint32());
|
|
162
|
+
break;
|
|
163
|
+
}
|
|
164
|
+
case 5: {
|
|
165
|
+
message.eventMessage = $root.UpstreamMessage.EventMessage.decode(reader, reader.uint32());
|
|
166
|
+
break;
|
|
167
|
+
}
|
|
168
|
+
case 6: {
|
|
169
|
+
message.joinGroupMessage = $root.UpstreamMessage.JoinGroupMessage.decode(reader, reader.uint32());
|
|
170
|
+
break;
|
|
171
|
+
}
|
|
172
|
+
case 7: {
|
|
173
|
+
message.leaveGroupMessage = $root.UpstreamMessage.LeaveGroupMessage.decode(reader, reader.uint32());
|
|
174
|
+
break;
|
|
175
|
+
}
|
|
176
|
+
case 8: {
|
|
177
|
+
message.sequenceAckMessage = $root.UpstreamMessage.SequenceAckMessage.decode(reader, reader.uint32());
|
|
178
|
+
break;
|
|
179
|
+
}
|
|
180
|
+
default:
|
|
181
|
+
reader.skipType(tag & 7);
|
|
182
|
+
break;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
return message;
|
|
186
|
+
};
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* Decodes an UpstreamMessage message from the specified reader or buffer, length delimited.
|
|
190
|
+
* @function decodeDelimited
|
|
191
|
+
* @memberof UpstreamMessage
|
|
192
|
+
* @static
|
|
193
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
194
|
+
* @returns {UpstreamMessage} UpstreamMessage
|
|
195
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
196
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
197
|
+
*/
|
|
198
|
+
UpstreamMessage.decodeDelimited = function decodeDelimited(reader) {
|
|
199
|
+
if (!(reader instanceof $Reader))
|
|
200
|
+
reader = new $Reader(reader);
|
|
201
|
+
return this.decode(reader, reader.uint32());
|
|
202
|
+
};
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* Verifies an UpstreamMessage message.
|
|
206
|
+
* @function verify
|
|
207
|
+
* @memberof UpstreamMessage
|
|
208
|
+
* @static
|
|
209
|
+
* @param {Object.<string,*>} message Plain object to verify
|
|
210
|
+
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
211
|
+
*/
|
|
212
|
+
UpstreamMessage.verify = function verify(message) {
|
|
213
|
+
if (typeof message !== "object" || message === null)
|
|
214
|
+
return "object expected";
|
|
215
|
+
let properties = {};
|
|
216
|
+
if (message.sendToGroupMessage != null && message.hasOwnProperty("sendToGroupMessage")) {
|
|
217
|
+
properties.message = 1;
|
|
218
|
+
{
|
|
219
|
+
let error = $root.UpstreamMessage.SendToGroupMessage.verify(message.sendToGroupMessage);
|
|
220
|
+
if (error)
|
|
221
|
+
return "sendToGroupMessage." + error;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
if (message.eventMessage != null && message.hasOwnProperty("eventMessage")) {
|
|
225
|
+
if (properties.message === 1)
|
|
226
|
+
return "message: multiple values";
|
|
227
|
+
properties.message = 1;
|
|
228
|
+
{
|
|
229
|
+
let error = $root.UpstreamMessage.EventMessage.verify(message.eventMessage);
|
|
230
|
+
if (error)
|
|
231
|
+
return "eventMessage." + error;
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
if (message.joinGroupMessage != null && message.hasOwnProperty("joinGroupMessage")) {
|
|
235
|
+
if (properties.message === 1)
|
|
236
|
+
return "message: multiple values";
|
|
237
|
+
properties.message = 1;
|
|
238
|
+
{
|
|
239
|
+
let error = $root.UpstreamMessage.JoinGroupMessage.verify(message.joinGroupMessage);
|
|
240
|
+
if (error)
|
|
241
|
+
return "joinGroupMessage." + error;
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
if (message.leaveGroupMessage != null && message.hasOwnProperty("leaveGroupMessage")) {
|
|
245
|
+
if (properties.message === 1)
|
|
246
|
+
return "message: multiple values";
|
|
247
|
+
properties.message = 1;
|
|
248
|
+
{
|
|
249
|
+
let error = $root.UpstreamMessage.LeaveGroupMessage.verify(message.leaveGroupMessage);
|
|
250
|
+
if (error)
|
|
251
|
+
return "leaveGroupMessage." + error;
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
if (message.sequenceAckMessage != null && message.hasOwnProperty("sequenceAckMessage")) {
|
|
255
|
+
if (properties.message === 1)
|
|
256
|
+
return "message: multiple values";
|
|
257
|
+
properties.message = 1;
|
|
258
|
+
{
|
|
259
|
+
let error = $root.UpstreamMessage.SequenceAckMessage.verify(message.sequenceAckMessage);
|
|
260
|
+
if (error)
|
|
261
|
+
return "sequenceAckMessage." + error;
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
return null;
|
|
265
|
+
};
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* Creates an UpstreamMessage message from a plain object. Also converts values to their respective internal types.
|
|
269
|
+
* @function fromObject
|
|
270
|
+
* @memberof UpstreamMessage
|
|
271
|
+
* @static
|
|
272
|
+
* @param {Object.<string,*>} object Plain object
|
|
273
|
+
* @returns {UpstreamMessage} UpstreamMessage
|
|
274
|
+
*/
|
|
275
|
+
UpstreamMessage.fromObject = function fromObject(object) {
|
|
276
|
+
if (object instanceof $root.UpstreamMessage)
|
|
277
|
+
return object;
|
|
278
|
+
let message = new $root.UpstreamMessage();
|
|
279
|
+
if (object.sendToGroupMessage != null) {
|
|
280
|
+
if (typeof object.sendToGroupMessage !== "object")
|
|
281
|
+
throw TypeError(".UpstreamMessage.sendToGroupMessage: object expected");
|
|
282
|
+
message.sendToGroupMessage = $root.UpstreamMessage.SendToGroupMessage.fromObject(object.sendToGroupMessage);
|
|
283
|
+
}
|
|
284
|
+
if (object.eventMessage != null) {
|
|
285
|
+
if (typeof object.eventMessage !== "object")
|
|
286
|
+
throw TypeError(".UpstreamMessage.eventMessage: object expected");
|
|
287
|
+
message.eventMessage = $root.UpstreamMessage.EventMessage.fromObject(object.eventMessage);
|
|
288
|
+
}
|
|
289
|
+
if (object.joinGroupMessage != null) {
|
|
290
|
+
if (typeof object.joinGroupMessage !== "object")
|
|
291
|
+
throw TypeError(".UpstreamMessage.joinGroupMessage: object expected");
|
|
292
|
+
message.joinGroupMessage = $root.UpstreamMessage.JoinGroupMessage.fromObject(object.joinGroupMessage);
|
|
293
|
+
}
|
|
294
|
+
if (object.leaveGroupMessage != null) {
|
|
295
|
+
if (typeof object.leaveGroupMessage !== "object")
|
|
296
|
+
throw TypeError(".UpstreamMessage.leaveGroupMessage: object expected");
|
|
297
|
+
message.leaveGroupMessage = $root.UpstreamMessage.LeaveGroupMessage.fromObject(object.leaveGroupMessage);
|
|
298
|
+
}
|
|
299
|
+
if (object.sequenceAckMessage != null) {
|
|
300
|
+
if (typeof object.sequenceAckMessage !== "object")
|
|
301
|
+
throw TypeError(".UpstreamMessage.sequenceAckMessage: object expected");
|
|
302
|
+
message.sequenceAckMessage = $root.UpstreamMessage.SequenceAckMessage.fromObject(object.sequenceAckMessage);
|
|
303
|
+
}
|
|
304
|
+
return message;
|
|
305
|
+
};
|
|
306
|
+
|
|
307
|
+
/**
|
|
308
|
+
* Creates a plain object from an UpstreamMessage message. Also converts values to other types if specified.
|
|
309
|
+
* @function toObject
|
|
310
|
+
* @memberof UpstreamMessage
|
|
311
|
+
* @static
|
|
312
|
+
* @param {UpstreamMessage} message UpstreamMessage
|
|
313
|
+
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
314
|
+
* @returns {Object.<string,*>} Plain object
|
|
315
|
+
*/
|
|
316
|
+
UpstreamMessage.toObject = function toObject(message, options) {
|
|
317
|
+
if (!options)
|
|
318
|
+
options = {};
|
|
319
|
+
let object = {};
|
|
320
|
+
if (message.sendToGroupMessage != null && message.hasOwnProperty("sendToGroupMessage")) {
|
|
321
|
+
object.sendToGroupMessage = $root.UpstreamMessage.SendToGroupMessage.toObject(message.sendToGroupMessage, options);
|
|
322
|
+
if (options.oneofs)
|
|
323
|
+
object.message = "sendToGroupMessage";
|
|
324
|
+
}
|
|
325
|
+
if (message.eventMessage != null && message.hasOwnProperty("eventMessage")) {
|
|
326
|
+
object.eventMessage = $root.UpstreamMessage.EventMessage.toObject(message.eventMessage, options);
|
|
327
|
+
if (options.oneofs)
|
|
328
|
+
object.message = "eventMessage";
|
|
329
|
+
}
|
|
330
|
+
if (message.joinGroupMessage != null && message.hasOwnProperty("joinGroupMessage")) {
|
|
331
|
+
object.joinGroupMessage = $root.UpstreamMessage.JoinGroupMessage.toObject(message.joinGroupMessage, options);
|
|
332
|
+
if (options.oneofs)
|
|
333
|
+
object.message = "joinGroupMessage";
|
|
334
|
+
}
|
|
335
|
+
if (message.leaveGroupMessage != null && message.hasOwnProperty("leaveGroupMessage")) {
|
|
336
|
+
object.leaveGroupMessage = $root.UpstreamMessage.LeaveGroupMessage.toObject(message.leaveGroupMessage, options);
|
|
337
|
+
if (options.oneofs)
|
|
338
|
+
object.message = "leaveGroupMessage";
|
|
339
|
+
}
|
|
340
|
+
if (message.sequenceAckMessage != null && message.hasOwnProperty("sequenceAckMessage")) {
|
|
341
|
+
object.sequenceAckMessage = $root.UpstreamMessage.SequenceAckMessage.toObject(message.sequenceAckMessage, options);
|
|
342
|
+
if (options.oneofs)
|
|
343
|
+
object.message = "sequenceAckMessage";
|
|
344
|
+
}
|
|
345
|
+
return object;
|
|
346
|
+
};
|
|
347
|
+
|
|
348
|
+
/**
|
|
349
|
+
* Converts this UpstreamMessage to JSON.
|
|
350
|
+
* @function toJSON
|
|
351
|
+
* @memberof UpstreamMessage
|
|
352
|
+
* @instance
|
|
353
|
+
* @returns {Object.<string,*>} JSON object
|
|
354
|
+
*/
|
|
355
|
+
UpstreamMessage.prototype.toJSON = function toJSON() {
|
|
356
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
357
|
+
};
|
|
358
|
+
|
|
359
|
+
/**
|
|
360
|
+
* Gets the default type url for UpstreamMessage
|
|
361
|
+
* @function getTypeUrl
|
|
362
|
+
* @memberof UpstreamMessage
|
|
363
|
+
* @static
|
|
364
|
+
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
|
365
|
+
* @returns {string} The default type url
|
|
366
|
+
*/
|
|
367
|
+
UpstreamMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
368
|
+
if (typeUrlPrefix === undefined) {
|
|
369
|
+
typeUrlPrefix = "type.googleapis.com";
|
|
370
|
+
}
|
|
371
|
+
return typeUrlPrefix + "/UpstreamMessage";
|
|
372
|
+
};
|
|
373
|
+
|
|
374
|
+
UpstreamMessage.SendToGroupMessage = (function() {
|
|
375
|
+
|
|
376
|
+
/**
|
|
377
|
+
* Properties of a SendToGroupMessage.
|
|
378
|
+
* @memberof UpstreamMessage
|
|
379
|
+
* @interface ISendToGroupMessage
|
|
380
|
+
* @property {string|null} [group] SendToGroupMessage group
|
|
381
|
+
* @property {number|Long|null} [ackId] SendToGroupMessage ackId
|
|
382
|
+
* @property {IMessageData|null} [data] SendToGroupMessage data
|
|
383
|
+
* @property {boolean|null} [noEcho] SendToGroupMessage noEcho
|
|
384
|
+
*/
|
|
385
|
+
|
|
386
|
+
/**
|
|
387
|
+
* Constructs a new SendToGroupMessage.
|
|
388
|
+
* @memberof UpstreamMessage
|
|
389
|
+
* @classdesc Represents a SendToGroupMessage.
|
|
390
|
+
* @implements ISendToGroupMessage
|
|
391
|
+
* @constructor
|
|
392
|
+
* @param {UpstreamMessage.ISendToGroupMessage=} [properties] Properties to set
|
|
393
|
+
*/
|
|
394
|
+
function SendToGroupMessage(properties) {
|
|
395
|
+
if (properties)
|
|
396
|
+
for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
397
|
+
if (properties[keys[i]] != null)
|
|
398
|
+
this[keys[i]] = properties[keys[i]];
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
/**
|
|
402
|
+
* SendToGroupMessage group.
|
|
403
|
+
* @member {string} group
|
|
404
|
+
* @memberof UpstreamMessage.SendToGroupMessage
|
|
405
|
+
* @instance
|
|
406
|
+
*/
|
|
407
|
+
SendToGroupMessage.prototype.group = "";
|
|
408
|
+
|
|
409
|
+
/**
|
|
410
|
+
* SendToGroupMessage ackId.
|
|
411
|
+
* @member {number|Long|null|undefined} ackId
|
|
412
|
+
* @memberof UpstreamMessage.SendToGroupMessage
|
|
413
|
+
* @instance
|
|
414
|
+
*/
|
|
415
|
+
SendToGroupMessage.prototype.ackId = null;
|
|
416
|
+
|
|
417
|
+
/**
|
|
418
|
+
* SendToGroupMessage data.
|
|
419
|
+
* @member {IMessageData|null|undefined} data
|
|
420
|
+
* @memberof UpstreamMessage.SendToGroupMessage
|
|
421
|
+
* @instance
|
|
422
|
+
*/
|
|
423
|
+
SendToGroupMessage.prototype.data = null;
|
|
424
|
+
|
|
425
|
+
/**
|
|
426
|
+
* SendToGroupMessage noEcho.
|
|
427
|
+
* @member {boolean|null|undefined} noEcho
|
|
428
|
+
* @memberof UpstreamMessage.SendToGroupMessage
|
|
429
|
+
* @instance
|
|
430
|
+
*/
|
|
431
|
+
SendToGroupMessage.prototype.noEcho = null;
|
|
432
|
+
|
|
433
|
+
// OneOf field names bound to virtual getters and setters
|
|
434
|
+
let $oneOfFields;
|
|
435
|
+
|
|
436
|
+
/**
|
|
437
|
+
* SendToGroupMessage _ackId.
|
|
438
|
+
* @member {"ackId"|undefined} _ackId
|
|
439
|
+
* @memberof UpstreamMessage.SendToGroupMessage
|
|
440
|
+
* @instance
|
|
441
|
+
*/
|
|
442
|
+
Object.defineProperty(SendToGroupMessage.prototype, "_ackId", {
|
|
443
|
+
get: $util.oneOfGetter($oneOfFields = ["ackId"]),
|
|
444
|
+
set: $util.oneOfSetter($oneOfFields)
|
|
445
|
+
});
|
|
446
|
+
|
|
447
|
+
/**
|
|
448
|
+
* SendToGroupMessage _noEcho.
|
|
449
|
+
* @member {"noEcho"|undefined} _noEcho
|
|
450
|
+
* @memberof UpstreamMessage.SendToGroupMessage
|
|
451
|
+
* @instance
|
|
452
|
+
*/
|
|
453
|
+
Object.defineProperty(SendToGroupMessage.prototype, "_noEcho", {
|
|
454
|
+
get: $util.oneOfGetter($oneOfFields = ["noEcho"]),
|
|
455
|
+
set: $util.oneOfSetter($oneOfFields)
|
|
456
|
+
});
|
|
457
|
+
|
|
458
|
+
/**
|
|
459
|
+
* Creates a new SendToGroupMessage instance using the specified properties.
|
|
460
|
+
* @function create
|
|
461
|
+
* @memberof UpstreamMessage.SendToGroupMessage
|
|
462
|
+
* @static
|
|
463
|
+
* @param {UpstreamMessage.ISendToGroupMessage=} [properties] Properties to set
|
|
464
|
+
* @returns {UpstreamMessage.SendToGroupMessage} SendToGroupMessage instance
|
|
465
|
+
*/
|
|
466
|
+
SendToGroupMessage.create = function create(properties) {
|
|
467
|
+
return new SendToGroupMessage(properties);
|
|
468
|
+
};
|
|
469
|
+
|
|
470
|
+
/**
|
|
471
|
+
* Encodes the specified SendToGroupMessage message. Does not implicitly {@link UpstreamMessage.SendToGroupMessage.verify|verify} messages.
|
|
472
|
+
* @function encode
|
|
473
|
+
* @memberof UpstreamMessage.SendToGroupMessage
|
|
474
|
+
* @static
|
|
475
|
+
* @param {UpstreamMessage.ISendToGroupMessage} message SendToGroupMessage message or plain object to encode
|
|
476
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
477
|
+
* @returns {$protobuf.Writer} Writer
|
|
478
|
+
*/
|
|
479
|
+
SendToGroupMessage.encode = function encode(message, writer) {
|
|
480
|
+
if (!writer)
|
|
481
|
+
writer = $Writer.create();
|
|
482
|
+
if (message.group != null && Object.hasOwnProperty.call(message, "group"))
|
|
483
|
+
writer.uint32(/* id 1, wireType 2 =*/10).string(message.group);
|
|
484
|
+
if (message.ackId != null && Object.hasOwnProperty.call(message, "ackId"))
|
|
485
|
+
writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.ackId);
|
|
486
|
+
if (message.data != null && Object.hasOwnProperty.call(message, "data"))
|
|
487
|
+
$root.MessageData.encode(message.data, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
|
|
488
|
+
if (message.noEcho != null && Object.hasOwnProperty.call(message, "noEcho"))
|
|
489
|
+
writer.uint32(/* id 4, wireType 0 =*/32).bool(message.noEcho);
|
|
490
|
+
return writer;
|
|
491
|
+
};
|
|
492
|
+
|
|
493
|
+
/**
|
|
494
|
+
* Encodes the specified SendToGroupMessage message, length delimited. Does not implicitly {@link UpstreamMessage.SendToGroupMessage.verify|verify} messages.
|
|
495
|
+
* @function encodeDelimited
|
|
496
|
+
* @memberof UpstreamMessage.SendToGroupMessage
|
|
497
|
+
* @static
|
|
498
|
+
* @param {UpstreamMessage.ISendToGroupMessage} message SendToGroupMessage message or plain object to encode
|
|
499
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
500
|
+
* @returns {$protobuf.Writer} Writer
|
|
501
|
+
*/
|
|
502
|
+
SendToGroupMessage.encodeDelimited = function encodeDelimited(message, writer) {
|
|
503
|
+
return this.encode(message, writer).ldelim();
|
|
504
|
+
};
|
|
505
|
+
|
|
506
|
+
/**
|
|
507
|
+
* Decodes a SendToGroupMessage message from the specified reader or buffer.
|
|
508
|
+
* @function decode
|
|
509
|
+
* @memberof UpstreamMessage.SendToGroupMessage
|
|
510
|
+
* @static
|
|
511
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
512
|
+
* @param {number} [length] Message length if known beforehand
|
|
513
|
+
* @returns {UpstreamMessage.SendToGroupMessage} SendToGroupMessage
|
|
514
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
515
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
516
|
+
*/
|
|
517
|
+
SendToGroupMessage.decode = function decode(reader, length) {
|
|
518
|
+
if (!(reader instanceof $Reader))
|
|
519
|
+
reader = $Reader.create(reader);
|
|
520
|
+
let end = length === undefined ? reader.len : reader.pos + length, message = new $root.UpstreamMessage.SendToGroupMessage();
|
|
521
|
+
while (reader.pos < end) {
|
|
522
|
+
let tag = reader.uint32();
|
|
523
|
+
switch (tag >>> 3) {
|
|
524
|
+
case 1: {
|
|
525
|
+
message.group = reader.string();
|
|
526
|
+
break;
|
|
527
|
+
}
|
|
528
|
+
case 2: {
|
|
529
|
+
message.ackId = reader.uint64();
|
|
530
|
+
break;
|
|
531
|
+
}
|
|
532
|
+
case 3: {
|
|
533
|
+
message.data = $root.MessageData.decode(reader, reader.uint32());
|
|
534
|
+
break;
|
|
535
|
+
}
|
|
536
|
+
case 4: {
|
|
537
|
+
message.noEcho = reader.bool();
|
|
538
|
+
break;
|
|
539
|
+
}
|
|
540
|
+
default:
|
|
541
|
+
reader.skipType(tag & 7);
|
|
542
|
+
break;
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
return message;
|
|
546
|
+
};
|
|
547
|
+
|
|
548
|
+
/**
|
|
549
|
+
* Decodes a SendToGroupMessage message from the specified reader or buffer, length delimited.
|
|
550
|
+
* @function decodeDelimited
|
|
551
|
+
* @memberof UpstreamMessage.SendToGroupMessage
|
|
552
|
+
* @static
|
|
553
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
554
|
+
* @returns {UpstreamMessage.SendToGroupMessage} SendToGroupMessage
|
|
555
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
556
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
557
|
+
*/
|
|
558
|
+
SendToGroupMessage.decodeDelimited = function decodeDelimited(reader) {
|
|
559
|
+
if (!(reader instanceof $Reader))
|
|
560
|
+
reader = new $Reader(reader);
|
|
561
|
+
return this.decode(reader, reader.uint32());
|
|
562
|
+
};
|
|
563
|
+
|
|
564
|
+
/**
|
|
565
|
+
* Verifies a SendToGroupMessage message.
|
|
566
|
+
* @function verify
|
|
567
|
+
* @memberof UpstreamMessage.SendToGroupMessage
|
|
568
|
+
* @static
|
|
569
|
+
* @param {Object.<string,*>} message Plain object to verify
|
|
570
|
+
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
571
|
+
*/
|
|
572
|
+
SendToGroupMessage.verify = function verify(message) {
|
|
573
|
+
if (typeof message !== "object" || message === null)
|
|
574
|
+
return "object expected";
|
|
575
|
+
let properties = {};
|
|
576
|
+
if (message.group != null && message.hasOwnProperty("group"))
|
|
577
|
+
if (!$util.isString(message.group))
|
|
578
|
+
return "group: string expected";
|
|
579
|
+
if (message.ackId != null && message.hasOwnProperty("ackId")) {
|
|
580
|
+
properties._ackId = 1;
|
|
581
|
+
if (!$util.isInteger(message.ackId) && !(message.ackId && $util.isInteger(message.ackId.low) && $util.isInteger(message.ackId.high)))
|
|
582
|
+
return "ackId: integer|Long expected";
|
|
583
|
+
}
|
|
584
|
+
if (message.data != null && message.hasOwnProperty("data")) {
|
|
585
|
+
let error = $root.MessageData.verify(message.data);
|
|
586
|
+
if (error)
|
|
587
|
+
return "data." + error;
|
|
588
|
+
}
|
|
589
|
+
if (message.noEcho != null && message.hasOwnProperty("noEcho")) {
|
|
590
|
+
properties._noEcho = 1;
|
|
591
|
+
if (typeof message.noEcho !== "boolean")
|
|
592
|
+
return "noEcho: boolean expected";
|
|
593
|
+
}
|
|
594
|
+
return null;
|
|
595
|
+
};
|
|
596
|
+
|
|
597
|
+
/**
|
|
598
|
+
* Creates a SendToGroupMessage message from a plain object. Also converts values to their respective internal types.
|
|
599
|
+
* @function fromObject
|
|
600
|
+
* @memberof UpstreamMessage.SendToGroupMessage
|
|
601
|
+
* @static
|
|
602
|
+
* @param {Object.<string,*>} object Plain object
|
|
603
|
+
* @returns {UpstreamMessage.SendToGroupMessage} SendToGroupMessage
|
|
604
|
+
*/
|
|
605
|
+
SendToGroupMessage.fromObject = function fromObject(object) {
|
|
606
|
+
if (object instanceof $root.UpstreamMessage.SendToGroupMessage)
|
|
607
|
+
return object;
|
|
608
|
+
let message = new $root.UpstreamMessage.SendToGroupMessage();
|
|
609
|
+
if (object.group != null)
|
|
610
|
+
message.group = String(object.group);
|
|
611
|
+
if (object.ackId != null)
|
|
612
|
+
if ($util.Long)
|
|
613
|
+
(message.ackId = $util.Long.fromValue(object.ackId)).unsigned = true;
|
|
614
|
+
else if (typeof object.ackId === "string")
|
|
615
|
+
message.ackId = parseInt(object.ackId, 10);
|
|
616
|
+
else if (typeof object.ackId === "number")
|
|
617
|
+
message.ackId = object.ackId;
|
|
618
|
+
else if (typeof object.ackId === "object")
|
|
619
|
+
message.ackId = new $util.LongBits(object.ackId.low >>> 0, object.ackId.high >>> 0).toNumber(true);
|
|
620
|
+
if (object.data != null) {
|
|
621
|
+
if (typeof object.data !== "object")
|
|
622
|
+
throw TypeError(".UpstreamMessage.SendToGroupMessage.data: object expected");
|
|
623
|
+
message.data = $root.MessageData.fromObject(object.data);
|
|
624
|
+
}
|
|
625
|
+
if (object.noEcho != null)
|
|
626
|
+
message.noEcho = Boolean(object.noEcho);
|
|
627
|
+
return message;
|
|
628
|
+
};
|
|
629
|
+
|
|
630
|
+
/**
|
|
631
|
+
* Creates a plain object from a SendToGroupMessage message. Also converts values to other types if specified.
|
|
632
|
+
* @function toObject
|
|
633
|
+
* @memberof UpstreamMessage.SendToGroupMessage
|
|
634
|
+
* @static
|
|
635
|
+
* @param {UpstreamMessage.SendToGroupMessage} message SendToGroupMessage
|
|
636
|
+
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
637
|
+
* @returns {Object.<string,*>} Plain object
|
|
638
|
+
*/
|
|
639
|
+
SendToGroupMessage.toObject = function toObject(message, options) {
|
|
640
|
+
if (!options)
|
|
641
|
+
options = {};
|
|
642
|
+
let object = {};
|
|
643
|
+
if (options.defaults) {
|
|
644
|
+
object.group = "";
|
|
645
|
+
object.data = null;
|
|
646
|
+
}
|
|
647
|
+
if (message.group != null && message.hasOwnProperty("group"))
|
|
648
|
+
object.group = message.group;
|
|
649
|
+
if (message.ackId != null && message.hasOwnProperty("ackId")) {
|
|
650
|
+
if (typeof message.ackId === "number")
|
|
651
|
+
object.ackId = options.longs === String ? String(message.ackId) : message.ackId;
|
|
652
|
+
else
|
|
653
|
+
object.ackId = options.longs === String ? $util.Long.prototype.toString.call(message.ackId) : options.longs === Number ? new $util.LongBits(message.ackId.low >>> 0, message.ackId.high >>> 0).toNumber(true) : message.ackId;
|
|
654
|
+
if (options.oneofs)
|
|
655
|
+
object._ackId = "ackId";
|
|
656
|
+
}
|
|
657
|
+
if (message.data != null && message.hasOwnProperty("data"))
|
|
658
|
+
object.data = $root.MessageData.toObject(message.data, options);
|
|
659
|
+
if (message.noEcho != null && message.hasOwnProperty("noEcho")) {
|
|
660
|
+
object.noEcho = message.noEcho;
|
|
661
|
+
if (options.oneofs)
|
|
662
|
+
object._noEcho = "noEcho";
|
|
663
|
+
}
|
|
664
|
+
return object;
|
|
665
|
+
};
|
|
666
|
+
|
|
667
|
+
/**
|
|
668
|
+
* Converts this SendToGroupMessage to JSON.
|
|
669
|
+
* @function toJSON
|
|
670
|
+
* @memberof UpstreamMessage.SendToGroupMessage
|
|
671
|
+
* @instance
|
|
672
|
+
* @returns {Object.<string,*>} JSON object
|
|
673
|
+
*/
|
|
674
|
+
SendToGroupMessage.prototype.toJSON = function toJSON() {
|
|
675
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
676
|
+
};
|
|
677
|
+
|
|
678
|
+
/**
|
|
679
|
+
* Gets the default type url for SendToGroupMessage
|
|
680
|
+
* @function getTypeUrl
|
|
681
|
+
* @memberof UpstreamMessage.SendToGroupMessage
|
|
682
|
+
* @static
|
|
683
|
+
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
|
684
|
+
* @returns {string} The default type url
|
|
685
|
+
*/
|
|
686
|
+
SendToGroupMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
687
|
+
if (typeUrlPrefix === undefined) {
|
|
688
|
+
typeUrlPrefix = "type.googleapis.com";
|
|
689
|
+
}
|
|
690
|
+
return typeUrlPrefix + "/UpstreamMessage.SendToGroupMessage";
|
|
691
|
+
};
|
|
692
|
+
|
|
693
|
+
return SendToGroupMessage;
|
|
694
|
+
})();
|
|
695
|
+
|
|
696
|
+
UpstreamMessage.EventMessage = (function() {
|
|
697
|
+
|
|
698
|
+
/**
|
|
699
|
+
* Properties of an EventMessage.
|
|
700
|
+
* @memberof UpstreamMessage
|
|
701
|
+
* @interface IEventMessage
|
|
702
|
+
* @property {string|null} [event] EventMessage event
|
|
703
|
+
* @property {IMessageData|null} [data] EventMessage data
|
|
704
|
+
* @property {number|Long|null} [ackId] EventMessage ackId
|
|
705
|
+
*/
|
|
706
|
+
|
|
707
|
+
/**
|
|
708
|
+
* Constructs a new EventMessage.
|
|
709
|
+
* @memberof UpstreamMessage
|
|
710
|
+
* @classdesc Represents an EventMessage.
|
|
711
|
+
* @implements IEventMessage
|
|
712
|
+
* @constructor
|
|
713
|
+
* @param {UpstreamMessage.IEventMessage=} [properties] Properties to set
|
|
714
|
+
*/
|
|
715
|
+
function EventMessage(properties) {
|
|
716
|
+
if (properties)
|
|
717
|
+
for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
718
|
+
if (properties[keys[i]] != null)
|
|
719
|
+
this[keys[i]] = properties[keys[i]];
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
/**
|
|
723
|
+
* EventMessage event.
|
|
724
|
+
* @member {string} event
|
|
725
|
+
* @memberof UpstreamMessage.EventMessage
|
|
726
|
+
* @instance
|
|
727
|
+
*/
|
|
728
|
+
EventMessage.prototype.event = "";
|
|
729
|
+
|
|
730
|
+
/**
|
|
731
|
+
* EventMessage data.
|
|
732
|
+
* @member {IMessageData|null|undefined} data
|
|
733
|
+
* @memberof UpstreamMessage.EventMessage
|
|
734
|
+
* @instance
|
|
735
|
+
*/
|
|
736
|
+
EventMessage.prototype.data = null;
|
|
737
|
+
|
|
738
|
+
/**
|
|
739
|
+
* EventMessage ackId.
|
|
740
|
+
* @member {number|Long|null|undefined} ackId
|
|
741
|
+
* @memberof UpstreamMessage.EventMessage
|
|
742
|
+
* @instance
|
|
743
|
+
*/
|
|
744
|
+
EventMessage.prototype.ackId = null;
|
|
745
|
+
|
|
746
|
+
// OneOf field names bound to virtual getters and setters
|
|
747
|
+
let $oneOfFields;
|
|
748
|
+
|
|
749
|
+
/**
|
|
750
|
+
* EventMessage _ackId.
|
|
751
|
+
* @member {"ackId"|undefined} _ackId
|
|
752
|
+
* @memberof UpstreamMessage.EventMessage
|
|
753
|
+
* @instance
|
|
754
|
+
*/
|
|
755
|
+
Object.defineProperty(EventMessage.prototype, "_ackId", {
|
|
756
|
+
get: $util.oneOfGetter($oneOfFields = ["ackId"]),
|
|
757
|
+
set: $util.oneOfSetter($oneOfFields)
|
|
758
|
+
});
|
|
759
|
+
|
|
760
|
+
/**
|
|
761
|
+
* Creates a new EventMessage instance using the specified properties.
|
|
762
|
+
* @function create
|
|
763
|
+
* @memberof UpstreamMessage.EventMessage
|
|
764
|
+
* @static
|
|
765
|
+
* @param {UpstreamMessage.IEventMessage=} [properties] Properties to set
|
|
766
|
+
* @returns {UpstreamMessage.EventMessage} EventMessage instance
|
|
767
|
+
*/
|
|
768
|
+
EventMessage.create = function create(properties) {
|
|
769
|
+
return new EventMessage(properties);
|
|
770
|
+
};
|
|
771
|
+
|
|
772
|
+
/**
|
|
773
|
+
* Encodes the specified EventMessage message. Does not implicitly {@link UpstreamMessage.EventMessage.verify|verify} messages.
|
|
774
|
+
* @function encode
|
|
775
|
+
* @memberof UpstreamMessage.EventMessage
|
|
776
|
+
* @static
|
|
777
|
+
* @param {UpstreamMessage.IEventMessage} message EventMessage message or plain object to encode
|
|
778
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
779
|
+
* @returns {$protobuf.Writer} Writer
|
|
780
|
+
*/
|
|
781
|
+
EventMessage.encode = function encode(message, writer) {
|
|
782
|
+
if (!writer)
|
|
783
|
+
writer = $Writer.create();
|
|
784
|
+
if (message.event != null && Object.hasOwnProperty.call(message, "event"))
|
|
785
|
+
writer.uint32(/* id 1, wireType 2 =*/10).string(message.event);
|
|
786
|
+
if (message.data != null && Object.hasOwnProperty.call(message, "data"))
|
|
787
|
+
$root.MessageData.encode(message.data, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
|
|
788
|
+
if (message.ackId != null && Object.hasOwnProperty.call(message, "ackId"))
|
|
789
|
+
writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.ackId);
|
|
790
|
+
return writer;
|
|
791
|
+
};
|
|
792
|
+
|
|
793
|
+
/**
|
|
794
|
+
* Encodes the specified EventMessage message, length delimited. Does not implicitly {@link UpstreamMessage.EventMessage.verify|verify} messages.
|
|
795
|
+
* @function encodeDelimited
|
|
796
|
+
* @memberof UpstreamMessage.EventMessage
|
|
797
|
+
* @static
|
|
798
|
+
* @param {UpstreamMessage.IEventMessage} message EventMessage message or plain object to encode
|
|
799
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
800
|
+
* @returns {$protobuf.Writer} Writer
|
|
801
|
+
*/
|
|
802
|
+
EventMessage.encodeDelimited = function encodeDelimited(message, writer) {
|
|
803
|
+
return this.encode(message, writer).ldelim();
|
|
804
|
+
};
|
|
805
|
+
|
|
806
|
+
/**
|
|
807
|
+
* Decodes an EventMessage message from the specified reader or buffer.
|
|
808
|
+
* @function decode
|
|
809
|
+
* @memberof UpstreamMessage.EventMessage
|
|
810
|
+
* @static
|
|
811
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
812
|
+
* @param {number} [length] Message length if known beforehand
|
|
813
|
+
* @returns {UpstreamMessage.EventMessage} EventMessage
|
|
814
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
815
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
816
|
+
*/
|
|
817
|
+
EventMessage.decode = function decode(reader, length) {
|
|
818
|
+
if (!(reader instanceof $Reader))
|
|
819
|
+
reader = $Reader.create(reader);
|
|
820
|
+
let end = length === undefined ? reader.len : reader.pos + length, message = new $root.UpstreamMessage.EventMessage();
|
|
821
|
+
while (reader.pos < end) {
|
|
822
|
+
let tag = reader.uint32();
|
|
823
|
+
switch (tag >>> 3) {
|
|
824
|
+
case 1: {
|
|
825
|
+
message.event = reader.string();
|
|
826
|
+
break;
|
|
827
|
+
}
|
|
828
|
+
case 2: {
|
|
829
|
+
message.data = $root.MessageData.decode(reader, reader.uint32());
|
|
830
|
+
break;
|
|
831
|
+
}
|
|
832
|
+
case 3: {
|
|
833
|
+
message.ackId = reader.uint64();
|
|
834
|
+
break;
|
|
835
|
+
}
|
|
836
|
+
default:
|
|
837
|
+
reader.skipType(tag & 7);
|
|
838
|
+
break;
|
|
839
|
+
}
|
|
840
|
+
}
|
|
841
|
+
return message;
|
|
842
|
+
};
|
|
843
|
+
|
|
844
|
+
/**
|
|
845
|
+
* Decodes an EventMessage message from the specified reader or buffer, length delimited.
|
|
846
|
+
* @function decodeDelimited
|
|
847
|
+
* @memberof UpstreamMessage.EventMessage
|
|
848
|
+
* @static
|
|
849
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
850
|
+
* @returns {UpstreamMessage.EventMessage} EventMessage
|
|
851
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
852
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
853
|
+
*/
|
|
854
|
+
EventMessage.decodeDelimited = function decodeDelimited(reader) {
|
|
855
|
+
if (!(reader instanceof $Reader))
|
|
856
|
+
reader = new $Reader(reader);
|
|
857
|
+
return this.decode(reader, reader.uint32());
|
|
858
|
+
};
|
|
859
|
+
|
|
860
|
+
/**
|
|
861
|
+
* Verifies an EventMessage message.
|
|
862
|
+
* @function verify
|
|
863
|
+
* @memberof UpstreamMessage.EventMessage
|
|
864
|
+
* @static
|
|
865
|
+
* @param {Object.<string,*>} message Plain object to verify
|
|
866
|
+
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
867
|
+
*/
|
|
868
|
+
EventMessage.verify = function verify(message) {
|
|
869
|
+
if (typeof message !== "object" || message === null)
|
|
870
|
+
return "object expected";
|
|
871
|
+
let properties = {};
|
|
872
|
+
if (message.event != null && message.hasOwnProperty("event"))
|
|
873
|
+
if (!$util.isString(message.event))
|
|
874
|
+
return "event: string expected";
|
|
875
|
+
if (message.data != null && message.hasOwnProperty("data")) {
|
|
876
|
+
let error = $root.MessageData.verify(message.data);
|
|
877
|
+
if (error)
|
|
878
|
+
return "data." + error;
|
|
879
|
+
}
|
|
880
|
+
if (message.ackId != null && message.hasOwnProperty("ackId")) {
|
|
881
|
+
properties._ackId = 1;
|
|
882
|
+
if (!$util.isInteger(message.ackId) && !(message.ackId && $util.isInteger(message.ackId.low) && $util.isInteger(message.ackId.high)))
|
|
883
|
+
return "ackId: integer|Long expected";
|
|
884
|
+
}
|
|
885
|
+
return null;
|
|
886
|
+
};
|
|
887
|
+
|
|
888
|
+
/**
|
|
889
|
+
* Creates an EventMessage message from a plain object. Also converts values to their respective internal types.
|
|
890
|
+
* @function fromObject
|
|
891
|
+
* @memberof UpstreamMessage.EventMessage
|
|
892
|
+
* @static
|
|
893
|
+
* @param {Object.<string,*>} object Plain object
|
|
894
|
+
* @returns {UpstreamMessage.EventMessage} EventMessage
|
|
895
|
+
*/
|
|
896
|
+
EventMessage.fromObject = function fromObject(object) {
|
|
897
|
+
if (object instanceof $root.UpstreamMessage.EventMessage)
|
|
898
|
+
return object;
|
|
899
|
+
let message = new $root.UpstreamMessage.EventMessage();
|
|
900
|
+
if (object.event != null)
|
|
901
|
+
message.event = String(object.event);
|
|
902
|
+
if (object.data != null) {
|
|
903
|
+
if (typeof object.data !== "object")
|
|
904
|
+
throw TypeError(".UpstreamMessage.EventMessage.data: object expected");
|
|
905
|
+
message.data = $root.MessageData.fromObject(object.data);
|
|
906
|
+
}
|
|
907
|
+
if (object.ackId != null)
|
|
908
|
+
if ($util.Long)
|
|
909
|
+
(message.ackId = $util.Long.fromValue(object.ackId)).unsigned = true;
|
|
910
|
+
else if (typeof object.ackId === "string")
|
|
911
|
+
message.ackId = parseInt(object.ackId, 10);
|
|
912
|
+
else if (typeof object.ackId === "number")
|
|
913
|
+
message.ackId = object.ackId;
|
|
914
|
+
else if (typeof object.ackId === "object")
|
|
915
|
+
message.ackId = new $util.LongBits(object.ackId.low >>> 0, object.ackId.high >>> 0).toNumber(true);
|
|
916
|
+
return message;
|
|
917
|
+
};
|
|
918
|
+
|
|
919
|
+
/**
|
|
920
|
+
* Creates a plain object from an EventMessage message. Also converts values to other types if specified.
|
|
921
|
+
* @function toObject
|
|
922
|
+
* @memberof UpstreamMessage.EventMessage
|
|
923
|
+
* @static
|
|
924
|
+
* @param {UpstreamMessage.EventMessage} message EventMessage
|
|
925
|
+
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
926
|
+
* @returns {Object.<string,*>} Plain object
|
|
927
|
+
*/
|
|
928
|
+
EventMessage.toObject = function toObject(message, options) {
|
|
929
|
+
if (!options)
|
|
930
|
+
options = {};
|
|
931
|
+
let object = {};
|
|
932
|
+
if (options.defaults) {
|
|
933
|
+
object.event = "";
|
|
934
|
+
object.data = null;
|
|
935
|
+
}
|
|
936
|
+
if (message.event != null && message.hasOwnProperty("event"))
|
|
937
|
+
object.event = message.event;
|
|
938
|
+
if (message.data != null && message.hasOwnProperty("data"))
|
|
939
|
+
object.data = $root.MessageData.toObject(message.data, options);
|
|
940
|
+
if (message.ackId != null && message.hasOwnProperty("ackId")) {
|
|
941
|
+
if (typeof message.ackId === "number")
|
|
942
|
+
object.ackId = options.longs === String ? String(message.ackId) : message.ackId;
|
|
943
|
+
else
|
|
944
|
+
object.ackId = options.longs === String ? $util.Long.prototype.toString.call(message.ackId) : options.longs === Number ? new $util.LongBits(message.ackId.low >>> 0, message.ackId.high >>> 0).toNumber(true) : message.ackId;
|
|
945
|
+
if (options.oneofs)
|
|
946
|
+
object._ackId = "ackId";
|
|
947
|
+
}
|
|
948
|
+
return object;
|
|
949
|
+
};
|
|
950
|
+
|
|
951
|
+
/**
|
|
952
|
+
* Converts this EventMessage to JSON.
|
|
953
|
+
* @function toJSON
|
|
954
|
+
* @memberof UpstreamMessage.EventMessage
|
|
955
|
+
* @instance
|
|
956
|
+
* @returns {Object.<string,*>} JSON object
|
|
957
|
+
*/
|
|
958
|
+
EventMessage.prototype.toJSON = function toJSON() {
|
|
959
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
960
|
+
};
|
|
961
|
+
|
|
962
|
+
/**
|
|
963
|
+
* Gets the default type url for EventMessage
|
|
964
|
+
* @function getTypeUrl
|
|
965
|
+
* @memberof UpstreamMessage.EventMessage
|
|
966
|
+
* @static
|
|
967
|
+
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
|
968
|
+
* @returns {string} The default type url
|
|
969
|
+
*/
|
|
970
|
+
EventMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
971
|
+
if (typeUrlPrefix === undefined) {
|
|
972
|
+
typeUrlPrefix = "type.googleapis.com";
|
|
973
|
+
}
|
|
974
|
+
return typeUrlPrefix + "/UpstreamMessage.EventMessage";
|
|
975
|
+
};
|
|
976
|
+
|
|
977
|
+
return EventMessage;
|
|
978
|
+
})();
|
|
979
|
+
|
|
980
|
+
UpstreamMessage.JoinGroupMessage = (function() {
|
|
981
|
+
|
|
982
|
+
/**
|
|
983
|
+
* Properties of a JoinGroupMessage.
|
|
984
|
+
* @memberof UpstreamMessage
|
|
985
|
+
* @interface IJoinGroupMessage
|
|
986
|
+
* @property {string|null} [group] JoinGroupMessage group
|
|
987
|
+
* @property {number|Long|null} [ackId] JoinGroupMessage ackId
|
|
988
|
+
*/
|
|
989
|
+
|
|
990
|
+
/**
|
|
991
|
+
* Constructs a new JoinGroupMessage.
|
|
992
|
+
* @memberof UpstreamMessage
|
|
993
|
+
* @classdesc Represents a JoinGroupMessage.
|
|
994
|
+
* @implements IJoinGroupMessage
|
|
995
|
+
* @constructor
|
|
996
|
+
* @param {UpstreamMessage.IJoinGroupMessage=} [properties] Properties to set
|
|
997
|
+
*/
|
|
998
|
+
function JoinGroupMessage(properties) {
|
|
999
|
+
if (properties)
|
|
1000
|
+
for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
1001
|
+
if (properties[keys[i]] != null)
|
|
1002
|
+
this[keys[i]] = properties[keys[i]];
|
|
1003
|
+
}
|
|
1004
|
+
|
|
1005
|
+
/**
|
|
1006
|
+
* JoinGroupMessage group.
|
|
1007
|
+
* @member {string} group
|
|
1008
|
+
* @memberof UpstreamMessage.JoinGroupMessage
|
|
1009
|
+
* @instance
|
|
1010
|
+
*/
|
|
1011
|
+
JoinGroupMessage.prototype.group = "";
|
|
1012
|
+
|
|
1013
|
+
/**
|
|
1014
|
+
* JoinGroupMessage ackId.
|
|
1015
|
+
* @member {number|Long|null|undefined} ackId
|
|
1016
|
+
* @memberof UpstreamMessage.JoinGroupMessage
|
|
1017
|
+
* @instance
|
|
1018
|
+
*/
|
|
1019
|
+
JoinGroupMessage.prototype.ackId = null;
|
|
1020
|
+
|
|
1021
|
+
// OneOf field names bound to virtual getters and setters
|
|
1022
|
+
let $oneOfFields;
|
|
1023
|
+
|
|
1024
|
+
/**
|
|
1025
|
+
* JoinGroupMessage _ackId.
|
|
1026
|
+
* @member {"ackId"|undefined} _ackId
|
|
1027
|
+
* @memberof UpstreamMessage.JoinGroupMessage
|
|
1028
|
+
* @instance
|
|
1029
|
+
*/
|
|
1030
|
+
Object.defineProperty(JoinGroupMessage.prototype, "_ackId", {
|
|
1031
|
+
get: $util.oneOfGetter($oneOfFields = ["ackId"]),
|
|
1032
|
+
set: $util.oneOfSetter($oneOfFields)
|
|
1033
|
+
});
|
|
1034
|
+
|
|
1035
|
+
/**
|
|
1036
|
+
* Creates a new JoinGroupMessage instance using the specified properties.
|
|
1037
|
+
* @function create
|
|
1038
|
+
* @memberof UpstreamMessage.JoinGroupMessage
|
|
1039
|
+
* @static
|
|
1040
|
+
* @param {UpstreamMessage.IJoinGroupMessage=} [properties] Properties to set
|
|
1041
|
+
* @returns {UpstreamMessage.JoinGroupMessage} JoinGroupMessage instance
|
|
1042
|
+
*/
|
|
1043
|
+
JoinGroupMessage.create = function create(properties) {
|
|
1044
|
+
return new JoinGroupMessage(properties);
|
|
1045
|
+
};
|
|
1046
|
+
|
|
1047
|
+
/**
|
|
1048
|
+
* Encodes the specified JoinGroupMessage message. Does not implicitly {@link UpstreamMessage.JoinGroupMessage.verify|verify} messages.
|
|
1049
|
+
* @function encode
|
|
1050
|
+
* @memberof UpstreamMessage.JoinGroupMessage
|
|
1051
|
+
* @static
|
|
1052
|
+
* @param {UpstreamMessage.IJoinGroupMessage} message JoinGroupMessage message or plain object to encode
|
|
1053
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
1054
|
+
* @returns {$protobuf.Writer} Writer
|
|
1055
|
+
*/
|
|
1056
|
+
JoinGroupMessage.encode = function encode(message, writer) {
|
|
1057
|
+
if (!writer)
|
|
1058
|
+
writer = $Writer.create();
|
|
1059
|
+
if (message.group != null && Object.hasOwnProperty.call(message, "group"))
|
|
1060
|
+
writer.uint32(/* id 1, wireType 2 =*/10).string(message.group);
|
|
1061
|
+
if (message.ackId != null && Object.hasOwnProperty.call(message, "ackId"))
|
|
1062
|
+
writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.ackId);
|
|
1063
|
+
return writer;
|
|
1064
|
+
};
|
|
1065
|
+
|
|
1066
|
+
/**
|
|
1067
|
+
* Encodes the specified JoinGroupMessage message, length delimited. Does not implicitly {@link UpstreamMessage.JoinGroupMessage.verify|verify} messages.
|
|
1068
|
+
* @function encodeDelimited
|
|
1069
|
+
* @memberof UpstreamMessage.JoinGroupMessage
|
|
1070
|
+
* @static
|
|
1071
|
+
* @param {UpstreamMessage.IJoinGroupMessage} message JoinGroupMessage message or plain object to encode
|
|
1072
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
1073
|
+
* @returns {$protobuf.Writer} Writer
|
|
1074
|
+
*/
|
|
1075
|
+
JoinGroupMessage.encodeDelimited = function encodeDelimited(message, writer) {
|
|
1076
|
+
return this.encode(message, writer).ldelim();
|
|
1077
|
+
};
|
|
1078
|
+
|
|
1079
|
+
/**
|
|
1080
|
+
* Decodes a JoinGroupMessage message from the specified reader or buffer.
|
|
1081
|
+
* @function decode
|
|
1082
|
+
* @memberof UpstreamMessage.JoinGroupMessage
|
|
1083
|
+
* @static
|
|
1084
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
1085
|
+
* @param {number} [length] Message length if known beforehand
|
|
1086
|
+
* @returns {UpstreamMessage.JoinGroupMessage} JoinGroupMessage
|
|
1087
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
1088
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
1089
|
+
*/
|
|
1090
|
+
JoinGroupMessage.decode = function decode(reader, length) {
|
|
1091
|
+
if (!(reader instanceof $Reader))
|
|
1092
|
+
reader = $Reader.create(reader);
|
|
1093
|
+
let end = length === undefined ? reader.len : reader.pos + length, message = new $root.UpstreamMessage.JoinGroupMessage();
|
|
1094
|
+
while (reader.pos < end) {
|
|
1095
|
+
let tag = reader.uint32();
|
|
1096
|
+
switch (tag >>> 3) {
|
|
1097
|
+
case 1: {
|
|
1098
|
+
message.group = reader.string();
|
|
1099
|
+
break;
|
|
1100
|
+
}
|
|
1101
|
+
case 2: {
|
|
1102
|
+
message.ackId = reader.uint64();
|
|
1103
|
+
break;
|
|
1104
|
+
}
|
|
1105
|
+
default:
|
|
1106
|
+
reader.skipType(tag & 7);
|
|
1107
|
+
break;
|
|
1108
|
+
}
|
|
1109
|
+
}
|
|
1110
|
+
return message;
|
|
1111
|
+
};
|
|
1112
|
+
|
|
1113
|
+
/**
|
|
1114
|
+
* Decodes a JoinGroupMessage message from the specified reader or buffer, length delimited.
|
|
1115
|
+
* @function decodeDelimited
|
|
1116
|
+
* @memberof UpstreamMessage.JoinGroupMessage
|
|
1117
|
+
* @static
|
|
1118
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
1119
|
+
* @returns {UpstreamMessage.JoinGroupMessage} JoinGroupMessage
|
|
1120
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
1121
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
1122
|
+
*/
|
|
1123
|
+
JoinGroupMessage.decodeDelimited = function decodeDelimited(reader) {
|
|
1124
|
+
if (!(reader instanceof $Reader))
|
|
1125
|
+
reader = new $Reader(reader);
|
|
1126
|
+
return this.decode(reader, reader.uint32());
|
|
1127
|
+
};
|
|
1128
|
+
|
|
1129
|
+
/**
|
|
1130
|
+
* Verifies a JoinGroupMessage message.
|
|
1131
|
+
* @function verify
|
|
1132
|
+
* @memberof UpstreamMessage.JoinGroupMessage
|
|
1133
|
+
* @static
|
|
1134
|
+
* @param {Object.<string,*>} message Plain object to verify
|
|
1135
|
+
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
1136
|
+
*/
|
|
1137
|
+
JoinGroupMessage.verify = function verify(message) {
|
|
1138
|
+
if (typeof message !== "object" || message === null)
|
|
1139
|
+
return "object expected";
|
|
1140
|
+
let properties = {};
|
|
1141
|
+
if (message.group != null && message.hasOwnProperty("group"))
|
|
1142
|
+
if (!$util.isString(message.group))
|
|
1143
|
+
return "group: string expected";
|
|
1144
|
+
if (message.ackId != null && message.hasOwnProperty("ackId")) {
|
|
1145
|
+
properties._ackId = 1;
|
|
1146
|
+
if (!$util.isInteger(message.ackId) && !(message.ackId && $util.isInteger(message.ackId.low) && $util.isInteger(message.ackId.high)))
|
|
1147
|
+
return "ackId: integer|Long expected";
|
|
1148
|
+
}
|
|
1149
|
+
return null;
|
|
1150
|
+
};
|
|
1151
|
+
|
|
1152
|
+
/**
|
|
1153
|
+
* Creates a JoinGroupMessage message from a plain object. Also converts values to their respective internal types.
|
|
1154
|
+
* @function fromObject
|
|
1155
|
+
* @memberof UpstreamMessage.JoinGroupMessage
|
|
1156
|
+
* @static
|
|
1157
|
+
* @param {Object.<string,*>} object Plain object
|
|
1158
|
+
* @returns {UpstreamMessage.JoinGroupMessage} JoinGroupMessage
|
|
1159
|
+
*/
|
|
1160
|
+
JoinGroupMessage.fromObject = function fromObject(object) {
|
|
1161
|
+
if (object instanceof $root.UpstreamMessage.JoinGroupMessage)
|
|
1162
|
+
return object;
|
|
1163
|
+
let message = new $root.UpstreamMessage.JoinGroupMessage();
|
|
1164
|
+
if (object.group != null)
|
|
1165
|
+
message.group = String(object.group);
|
|
1166
|
+
if (object.ackId != null)
|
|
1167
|
+
if ($util.Long)
|
|
1168
|
+
(message.ackId = $util.Long.fromValue(object.ackId)).unsigned = true;
|
|
1169
|
+
else if (typeof object.ackId === "string")
|
|
1170
|
+
message.ackId = parseInt(object.ackId, 10);
|
|
1171
|
+
else if (typeof object.ackId === "number")
|
|
1172
|
+
message.ackId = object.ackId;
|
|
1173
|
+
else if (typeof object.ackId === "object")
|
|
1174
|
+
message.ackId = new $util.LongBits(object.ackId.low >>> 0, object.ackId.high >>> 0).toNumber(true);
|
|
1175
|
+
return message;
|
|
1176
|
+
};
|
|
1177
|
+
|
|
1178
|
+
/**
|
|
1179
|
+
* Creates a plain object from a JoinGroupMessage message. Also converts values to other types if specified.
|
|
1180
|
+
* @function toObject
|
|
1181
|
+
* @memberof UpstreamMessage.JoinGroupMessage
|
|
1182
|
+
* @static
|
|
1183
|
+
* @param {UpstreamMessage.JoinGroupMessage} message JoinGroupMessage
|
|
1184
|
+
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
1185
|
+
* @returns {Object.<string,*>} Plain object
|
|
1186
|
+
*/
|
|
1187
|
+
JoinGroupMessage.toObject = function toObject(message, options) {
|
|
1188
|
+
if (!options)
|
|
1189
|
+
options = {};
|
|
1190
|
+
let object = {};
|
|
1191
|
+
if (options.defaults)
|
|
1192
|
+
object.group = "";
|
|
1193
|
+
if (message.group != null && message.hasOwnProperty("group"))
|
|
1194
|
+
object.group = message.group;
|
|
1195
|
+
if (message.ackId != null && message.hasOwnProperty("ackId")) {
|
|
1196
|
+
if (typeof message.ackId === "number")
|
|
1197
|
+
object.ackId = options.longs === String ? String(message.ackId) : message.ackId;
|
|
1198
|
+
else
|
|
1199
|
+
object.ackId = options.longs === String ? $util.Long.prototype.toString.call(message.ackId) : options.longs === Number ? new $util.LongBits(message.ackId.low >>> 0, message.ackId.high >>> 0).toNumber(true) : message.ackId;
|
|
1200
|
+
if (options.oneofs)
|
|
1201
|
+
object._ackId = "ackId";
|
|
1202
|
+
}
|
|
1203
|
+
return object;
|
|
1204
|
+
};
|
|
1205
|
+
|
|
1206
|
+
/**
|
|
1207
|
+
* Converts this JoinGroupMessage to JSON.
|
|
1208
|
+
* @function toJSON
|
|
1209
|
+
* @memberof UpstreamMessage.JoinGroupMessage
|
|
1210
|
+
* @instance
|
|
1211
|
+
* @returns {Object.<string,*>} JSON object
|
|
1212
|
+
*/
|
|
1213
|
+
JoinGroupMessage.prototype.toJSON = function toJSON() {
|
|
1214
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
1215
|
+
};
|
|
1216
|
+
|
|
1217
|
+
/**
|
|
1218
|
+
* Gets the default type url for JoinGroupMessage
|
|
1219
|
+
* @function getTypeUrl
|
|
1220
|
+
* @memberof UpstreamMessage.JoinGroupMessage
|
|
1221
|
+
* @static
|
|
1222
|
+
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
|
1223
|
+
* @returns {string} The default type url
|
|
1224
|
+
*/
|
|
1225
|
+
JoinGroupMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
1226
|
+
if (typeUrlPrefix === undefined) {
|
|
1227
|
+
typeUrlPrefix = "type.googleapis.com";
|
|
1228
|
+
}
|
|
1229
|
+
return typeUrlPrefix + "/UpstreamMessage.JoinGroupMessage";
|
|
1230
|
+
};
|
|
1231
|
+
|
|
1232
|
+
return JoinGroupMessage;
|
|
1233
|
+
})();
|
|
1234
|
+
|
|
1235
|
+
UpstreamMessage.LeaveGroupMessage = (function() {
|
|
1236
|
+
|
|
1237
|
+
/**
|
|
1238
|
+
* Properties of a LeaveGroupMessage.
|
|
1239
|
+
* @memberof UpstreamMessage
|
|
1240
|
+
* @interface ILeaveGroupMessage
|
|
1241
|
+
* @property {string|null} [group] LeaveGroupMessage group
|
|
1242
|
+
* @property {number|Long|null} [ackId] LeaveGroupMessage ackId
|
|
1243
|
+
*/
|
|
1244
|
+
|
|
1245
|
+
/**
|
|
1246
|
+
* Constructs a new LeaveGroupMessage.
|
|
1247
|
+
* @memberof UpstreamMessage
|
|
1248
|
+
* @classdesc Represents a LeaveGroupMessage.
|
|
1249
|
+
* @implements ILeaveGroupMessage
|
|
1250
|
+
* @constructor
|
|
1251
|
+
* @param {UpstreamMessage.ILeaveGroupMessage=} [properties] Properties to set
|
|
1252
|
+
*/
|
|
1253
|
+
function LeaveGroupMessage(properties) {
|
|
1254
|
+
if (properties)
|
|
1255
|
+
for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
1256
|
+
if (properties[keys[i]] != null)
|
|
1257
|
+
this[keys[i]] = properties[keys[i]];
|
|
1258
|
+
}
|
|
1259
|
+
|
|
1260
|
+
/**
|
|
1261
|
+
* LeaveGroupMessage group.
|
|
1262
|
+
* @member {string} group
|
|
1263
|
+
* @memberof UpstreamMessage.LeaveGroupMessage
|
|
1264
|
+
* @instance
|
|
1265
|
+
*/
|
|
1266
|
+
LeaveGroupMessage.prototype.group = "";
|
|
1267
|
+
|
|
1268
|
+
/**
|
|
1269
|
+
* LeaveGroupMessage ackId.
|
|
1270
|
+
* @member {number|Long|null|undefined} ackId
|
|
1271
|
+
* @memberof UpstreamMessage.LeaveGroupMessage
|
|
1272
|
+
* @instance
|
|
1273
|
+
*/
|
|
1274
|
+
LeaveGroupMessage.prototype.ackId = null;
|
|
1275
|
+
|
|
1276
|
+
// OneOf field names bound to virtual getters and setters
|
|
1277
|
+
let $oneOfFields;
|
|
1278
|
+
|
|
1279
|
+
/**
|
|
1280
|
+
* LeaveGroupMessage _ackId.
|
|
1281
|
+
* @member {"ackId"|undefined} _ackId
|
|
1282
|
+
* @memberof UpstreamMessage.LeaveGroupMessage
|
|
1283
|
+
* @instance
|
|
1284
|
+
*/
|
|
1285
|
+
Object.defineProperty(LeaveGroupMessage.prototype, "_ackId", {
|
|
1286
|
+
get: $util.oneOfGetter($oneOfFields = ["ackId"]),
|
|
1287
|
+
set: $util.oneOfSetter($oneOfFields)
|
|
1288
|
+
});
|
|
1289
|
+
|
|
1290
|
+
/**
|
|
1291
|
+
* Creates a new LeaveGroupMessage instance using the specified properties.
|
|
1292
|
+
* @function create
|
|
1293
|
+
* @memberof UpstreamMessage.LeaveGroupMessage
|
|
1294
|
+
* @static
|
|
1295
|
+
* @param {UpstreamMessage.ILeaveGroupMessage=} [properties] Properties to set
|
|
1296
|
+
* @returns {UpstreamMessage.LeaveGroupMessage} LeaveGroupMessage instance
|
|
1297
|
+
*/
|
|
1298
|
+
LeaveGroupMessage.create = function create(properties) {
|
|
1299
|
+
return new LeaveGroupMessage(properties);
|
|
1300
|
+
};
|
|
1301
|
+
|
|
1302
|
+
/**
|
|
1303
|
+
* Encodes the specified LeaveGroupMessage message. Does not implicitly {@link UpstreamMessage.LeaveGroupMessage.verify|verify} messages.
|
|
1304
|
+
* @function encode
|
|
1305
|
+
* @memberof UpstreamMessage.LeaveGroupMessage
|
|
1306
|
+
* @static
|
|
1307
|
+
* @param {UpstreamMessage.ILeaveGroupMessage} message LeaveGroupMessage message or plain object to encode
|
|
1308
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
1309
|
+
* @returns {$protobuf.Writer} Writer
|
|
1310
|
+
*/
|
|
1311
|
+
LeaveGroupMessage.encode = function encode(message, writer) {
|
|
1312
|
+
if (!writer)
|
|
1313
|
+
writer = $Writer.create();
|
|
1314
|
+
if (message.group != null && Object.hasOwnProperty.call(message, "group"))
|
|
1315
|
+
writer.uint32(/* id 1, wireType 2 =*/10).string(message.group);
|
|
1316
|
+
if (message.ackId != null && Object.hasOwnProperty.call(message, "ackId"))
|
|
1317
|
+
writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.ackId);
|
|
1318
|
+
return writer;
|
|
1319
|
+
};
|
|
1320
|
+
|
|
1321
|
+
/**
|
|
1322
|
+
* Encodes the specified LeaveGroupMessage message, length delimited. Does not implicitly {@link UpstreamMessage.LeaveGroupMessage.verify|verify} messages.
|
|
1323
|
+
* @function encodeDelimited
|
|
1324
|
+
* @memberof UpstreamMessage.LeaveGroupMessage
|
|
1325
|
+
* @static
|
|
1326
|
+
* @param {UpstreamMessage.ILeaveGroupMessage} message LeaveGroupMessage message or plain object to encode
|
|
1327
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
1328
|
+
* @returns {$protobuf.Writer} Writer
|
|
1329
|
+
*/
|
|
1330
|
+
LeaveGroupMessage.encodeDelimited = function encodeDelimited(message, writer) {
|
|
1331
|
+
return this.encode(message, writer).ldelim();
|
|
1332
|
+
};
|
|
1333
|
+
|
|
1334
|
+
/**
|
|
1335
|
+
* Decodes a LeaveGroupMessage message from the specified reader or buffer.
|
|
1336
|
+
* @function decode
|
|
1337
|
+
* @memberof UpstreamMessage.LeaveGroupMessage
|
|
1338
|
+
* @static
|
|
1339
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
1340
|
+
* @param {number} [length] Message length if known beforehand
|
|
1341
|
+
* @returns {UpstreamMessage.LeaveGroupMessage} LeaveGroupMessage
|
|
1342
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
1343
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
1344
|
+
*/
|
|
1345
|
+
LeaveGroupMessage.decode = function decode(reader, length) {
|
|
1346
|
+
if (!(reader instanceof $Reader))
|
|
1347
|
+
reader = $Reader.create(reader);
|
|
1348
|
+
let end = length === undefined ? reader.len : reader.pos + length, message = new $root.UpstreamMessage.LeaveGroupMessage();
|
|
1349
|
+
while (reader.pos < end) {
|
|
1350
|
+
let tag = reader.uint32();
|
|
1351
|
+
switch (tag >>> 3) {
|
|
1352
|
+
case 1: {
|
|
1353
|
+
message.group = reader.string();
|
|
1354
|
+
break;
|
|
1355
|
+
}
|
|
1356
|
+
case 2: {
|
|
1357
|
+
message.ackId = reader.uint64();
|
|
1358
|
+
break;
|
|
1359
|
+
}
|
|
1360
|
+
default:
|
|
1361
|
+
reader.skipType(tag & 7);
|
|
1362
|
+
break;
|
|
1363
|
+
}
|
|
1364
|
+
}
|
|
1365
|
+
return message;
|
|
1366
|
+
};
|
|
1367
|
+
|
|
1368
|
+
/**
|
|
1369
|
+
* Decodes a LeaveGroupMessage message from the specified reader or buffer, length delimited.
|
|
1370
|
+
* @function decodeDelimited
|
|
1371
|
+
* @memberof UpstreamMessage.LeaveGroupMessage
|
|
1372
|
+
* @static
|
|
1373
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
1374
|
+
* @returns {UpstreamMessage.LeaveGroupMessage} LeaveGroupMessage
|
|
1375
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
1376
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
1377
|
+
*/
|
|
1378
|
+
LeaveGroupMessage.decodeDelimited = function decodeDelimited(reader) {
|
|
1379
|
+
if (!(reader instanceof $Reader))
|
|
1380
|
+
reader = new $Reader(reader);
|
|
1381
|
+
return this.decode(reader, reader.uint32());
|
|
1382
|
+
};
|
|
1383
|
+
|
|
1384
|
+
/**
|
|
1385
|
+
* Verifies a LeaveGroupMessage message.
|
|
1386
|
+
* @function verify
|
|
1387
|
+
* @memberof UpstreamMessage.LeaveGroupMessage
|
|
1388
|
+
* @static
|
|
1389
|
+
* @param {Object.<string,*>} message Plain object to verify
|
|
1390
|
+
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
1391
|
+
*/
|
|
1392
|
+
LeaveGroupMessage.verify = function verify(message) {
|
|
1393
|
+
if (typeof message !== "object" || message === null)
|
|
1394
|
+
return "object expected";
|
|
1395
|
+
let properties = {};
|
|
1396
|
+
if (message.group != null && message.hasOwnProperty("group"))
|
|
1397
|
+
if (!$util.isString(message.group))
|
|
1398
|
+
return "group: string expected";
|
|
1399
|
+
if (message.ackId != null && message.hasOwnProperty("ackId")) {
|
|
1400
|
+
properties._ackId = 1;
|
|
1401
|
+
if (!$util.isInteger(message.ackId) && !(message.ackId && $util.isInteger(message.ackId.low) && $util.isInteger(message.ackId.high)))
|
|
1402
|
+
return "ackId: integer|Long expected";
|
|
1403
|
+
}
|
|
1404
|
+
return null;
|
|
1405
|
+
};
|
|
1406
|
+
|
|
1407
|
+
/**
|
|
1408
|
+
* Creates a LeaveGroupMessage message from a plain object. Also converts values to their respective internal types.
|
|
1409
|
+
* @function fromObject
|
|
1410
|
+
* @memberof UpstreamMessage.LeaveGroupMessage
|
|
1411
|
+
* @static
|
|
1412
|
+
* @param {Object.<string,*>} object Plain object
|
|
1413
|
+
* @returns {UpstreamMessage.LeaveGroupMessage} LeaveGroupMessage
|
|
1414
|
+
*/
|
|
1415
|
+
LeaveGroupMessage.fromObject = function fromObject(object) {
|
|
1416
|
+
if (object instanceof $root.UpstreamMessage.LeaveGroupMessage)
|
|
1417
|
+
return object;
|
|
1418
|
+
let message = new $root.UpstreamMessage.LeaveGroupMessage();
|
|
1419
|
+
if (object.group != null)
|
|
1420
|
+
message.group = String(object.group);
|
|
1421
|
+
if (object.ackId != null)
|
|
1422
|
+
if ($util.Long)
|
|
1423
|
+
(message.ackId = $util.Long.fromValue(object.ackId)).unsigned = true;
|
|
1424
|
+
else if (typeof object.ackId === "string")
|
|
1425
|
+
message.ackId = parseInt(object.ackId, 10);
|
|
1426
|
+
else if (typeof object.ackId === "number")
|
|
1427
|
+
message.ackId = object.ackId;
|
|
1428
|
+
else if (typeof object.ackId === "object")
|
|
1429
|
+
message.ackId = new $util.LongBits(object.ackId.low >>> 0, object.ackId.high >>> 0).toNumber(true);
|
|
1430
|
+
return message;
|
|
1431
|
+
};
|
|
1432
|
+
|
|
1433
|
+
/**
|
|
1434
|
+
* Creates a plain object from a LeaveGroupMessage message. Also converts values to other types if specified.
|
|
1435
|
+
* @function toObject
|
|
1436
|
+
* @memberof UpstreamMessage.LeaveGroupMessage
|
|
1437
|
+
* @static
|
|
1438
|
+
* @param {UpstreamMessage.LeaveGroupMessage} message LeaveGroupMessage
|
|
1439
|
+
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
1440
|
+
* @returns {Object.<string,*>} Plain object
|
|
1441
|
+
*/
|
|
1442
|
+
LeaveGroupMessage.toObject = function toObject(message, options) {
|
|
1443
|
+
if (!options)
|
|
1444
|
+
options = {};
|
|
1445
|
+
let object = {};
|
|
1446
|
+
if (options.defaults)
|
|
1447
|
+
object.group = "";
|
|
1448
|
+
if (message.group != null && message.hasOwnProperty("group"))
|
|
1449
|
+
object.group = message.group;
|
|
1450
|
+
if (message.ackId != null && message.hasOwnProperty("ackId")) {
|
|
1451
|
+
if (typeof message.ackId === "number")
|
|
1452
|
+
object.ackId = options.longs === String ? String(message.ackId) : message.ackId;
|
|
1453
|
+
else
|
|
1454
|
+
object.ackId = options.longs === String ? $util.Long.prototype.toString.call(message.ackId) : options.longs === Number ? new $util.LongBits(message.ackId.low >>> 0, message.ackId.high >>> 0).toNumber(true) : message.ackId;
|
|
1455
|
+
if (options.oneofs)
|
|
1456
|
+
object._ackId = "ackId";
|
|
1457
|
+
}
|
|
1458
|
+
return object;
|
|
1459
|
+
};
|
|
1460
|
+
|
|
1461
|
+
/**
|
|
1462
|
+
* Converts this LeaveGroupMessage to JSON.
|
|
1463
|
+
* @function toJSON
|
|
1464
|
+
* @memberof UpstreamMessage.LeaveGroupMessage
|
|
1465
|
+
* @instance
|
|
1466
|
+
* @returns {Object.<string,*>} JSON object
|
|
1467
|
+
*/
|
|
1468
|
+
LeaveGroupMessage.prototype.toJSON = function toJSON() {
|
|
1469
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
1470
|
+
};
|
|
1471
|
+
|
|
1472
|
+
/**
|
|
1473
|
+
* Gets the default type url for LeaveGroupMessage
|
|
1474
|
+
* @function getTypeUrl
|
|
1475
|
+
* @memberof UpstreamMessage.LeaveGroupMessage
|
|
1476
|
+
* @static
|
|
1477
|
+
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
|
1478
|
+
* @returns {string} The default type url
|
|
1479
|
+
*/
|
|
1480
|
+
LeaveGroupMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
1481
|
+
if (typeUrlPrefix === undefined) {
|
|
1482
|
+
typeUrlPrefix = "type.googleapis.com";
|
|
1483
|
+
}
|
|
1484
|
+
return typeUrlPrefix + "/UpstreamMessage.LeaveGroupMessage";
|
|
1485
|
+
};
|
|
1486
|
+
|
|
1487
|
+
return LeaveGroupMessage;
|
|
1488
|
+
})();
|
|
1489
|
+
|
|
1490
|
+
UpstreamMessage.SequenceAckMessage = (function() {
|
|
1491
|
+
|
|
1492
|
+
/**
|
|
1493
|
+
* Properties of a SequenceAckMessage.
|
|
1494
|
+
* @memberof UpstreamMessage
|
|
1495
|
+
* @interface ISequenceAckMessage
|
|
1496
|
+
* @property {number|Long|null} [sequenceId] SequenceAckMessage sequenceId
|
|
1497
|
+
*/
|
|
1498
|
+
|
|
1499
|
+
/**
|
|
1500
|
+
* Constructs a new SequenceAckMessage.
|
|
1501
|
+
* @memberof UpstreamMessage
|
|
1502
|
+
* @classdesc Represents a SequenceAckMessage.
|
|
1503
|
+
* @implements ISequenceAckMessage
|
|
1504
|
+
* @constructor
|
|
1505
|
+
* @param {UpstreamMessage.ISequenceAckMessage=} [properties] Properties to set
|
|
1506
|
+
*/
|
|
1507
|
+
function SequenceAckMessage(properties) {
|
|
1508
|
+
if (properties)
|
|
1509
|
+
for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
1510
|
+
if (properties[keys[i]] != null)
|
|
1511
|
+
this[keys[i]] = properties[keys[i]];
|
|
1512
|
+
}
|
|
1513
|
+
|
|
1514
|
+
/**
|
|
1515
|
+
* SequenceAckMessage sequenceId.
|
|
1516
|
+
* @member {number|Long} sequenceId
|
|
1517
|
+
* @memberof UpstreamMessage.SequenceAckMessage
|
|
1518
|
+
* @instance
|
|
1519
|
+
*/
|
|
1520
|
+
SequenceAckMessage.prototype.sequenceId = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
|
|
1521
|
+
|
|
1522
|
+
/**
|
|
1523
|
+
* Creates a new SequenceAckMessage instance using the specified properties.
|
|
1524
|
+
* @function create
|
|
1525
|
+
* @memberof UpstreamMessage.SequenceAckMessage
|
|
1526
|
+
* @static
|
|
1527
|
+
* @param {UpstreamMessage.ISequenceAckMessage=} [properties] Properties to set
|
|
1528
|
+
* @returns {UpstreamMessage.SequenceAckMessage} SequenceAckMessage instance
|
|
1529
|
+
*/
|
|
1530
|
+
SequenceAckMessage.create = function create(properties) {
|
|
1531
|
+
return new SequenceAckMessage(properties);
|
|
1532
|
+
};
|
|
1533
|
+
|
|
1534
|
+
/**
|
|
1535
|
+
* Encodes the specified SequenceAckMessage message. Does not implicitly {@link UpstreamMessage.SequenceAckMessage.verify|verify} messages.
|
|
1536
|
+
* @function encode
|
|
1537
|
+
* @memberof UpstreamMessage.SequenceAckMessage
|
|
1538
|
+
* @static
|
|
1539
|
+
* @param {UpstreamMessage.ISequenceAckMessage} message SequenceAckMessage message or plain object to encode
|
|
1540
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
1541
|
+
* @returns {$protobuf.Writer} Writer
|
|
1542
|
+
*/
|
|
1543
|
+
SequenceAckMessage.encode = function encode(message, writer) {
|
|
1544
|
+
if (!writer)
|
|
1545
|
+
writer = $Writer.create();
|
|
1546
|
+
if (message.sequenceId != null && Object.hasOwnProperty.call(message, "sequenceId"))
|
|
1547
|
+
writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.sequenceId);
|
|
1548
|
+
return writer;
|
|
1549
|
+
};
|
|
1550
|
+
|
|
1551
|
+
/**
|
|
1552
|
+
* Encodes the specified SequenceAckMessage message, length delimited. Does not implicitly {@link UpstreamMessage.SequenceAckMessage.verify|verify} messages.
|
|
1553
|
+
* @function encodeDelimited
|
|
1554
|
+
* @memberof UpstreamMessage.SequenceAckMessage
|
|
1555
|
+
* @static
|
|
1556
|
+
* @param {UpstreamMessage.ISequenceAckMessage} message SequenceAckMessage message or plain object to encode
|
|
1557
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
1558
|
+
* @returns {$protobuf.Writer} Writer
|
|
1559
|
+
*/
|
|
1560
|
+
SequenceAckMessage.encodeDelimited = function encodeDelimited(message, writer) {
|
|
1561
|
+
return this.encode(message, writer).ldelim();
|
|
1562
|
+
};
|
|
1563
|
+
|
|
1564
|
+
/**
|
|
1565
|
+
* Decodes a SequenceAckMessage message from the specified reader or buffer.
|
|
1566
|
+
* @function decode
|
|
1567
|
+
* @memberof UpstreamMessage.SequenceAckMessage
|
|
1568
|
+
* @static
|
|
1569
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
1570
|
+
* @param {number} [length] Message length if known beforehand
|
|
1571
|
+
* @returns {UpstreamMessage.SequenceAckMessage} SequenceAckMessage
|
|
1572
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
1573
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
1574
|
+
*/
|
|
1575
|
+
SequenceAckMessage.decode = function decode(reader, length) {
|
|
1576
|
+
if (!(reader instanceof $Reader))
|
|
1577
|
+
reader = $Reader.create(reader);
|
|
1578
|
+
let end = length === undefined ? reader.len : reader.pos + length, message = new $root.UpstreamMessage.SequenceAckMessage();
|
|
1579
|
+
while (reader.pos < end) {
|
|
1580
|
+
let tag = reader.uint32();
|
|
1581
|
+
switch (tag >>> 3) {
|
|
1582
|
+
case 1: {
|
|
1583
|
+
message.sequenceId = reader.uint64();
|
|
1584
|
+
break;
|
|
1585
|
+
}
|
|
1586
|
+
default:
|
|
1587
|
+
reader.skipType(tag & 7);
|
|
1588
|
+
break;
|
|
1589
|
+
}
|
|
1590
|
+
}
|
|
1591
|
+
return message;
|
|
1592
|
+
};
|
|
1593
|
+
|
|
1594
|
+
/**
|
|
1595
|
+
* Decodes a SequenceAckMessage message from the specified reader or buffer, length delimited.
|
|
1596
|
+
* @function decodeDelimited
|
|
1597
|
+
* @memberof UpstreamMessage.SequenceAckMessage
|
|
1598
|
+
* @static
|
|
1599
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
1600
|
+
* @returns {UpstreamMessage.SequenceAckMessage} SequenceAckMessage
|
|
1601
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
1602
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
1603
|
+
*/
|
|
1604
|
+
SequenceAckMessage.decodeDelimited = function decodeDelimited(reader) {
|
|
1605
|
+
if (!(reader instanceof $Reader))
|
|
1606
|
+
reader = new $Reader(reader);
|
|
1607
|
+
return this.decode(reader, reader.uint32());
|
|
1608
|
+
};
|
|
1609
|
+
|
|
1610
|
+
/**
|
|
1611
|
+
* Verifies a SequenceAckMessage message.
|
|
1612
|
+
* @function verify
|
|
1613
|
+
* @memberof UpstreamMessage.SequenceAckMessage
|
|
1614
|
+
* @static
|
|
1615
|
+
* @param {Object.<string,*>} message Plain object to verify
|
|
1616
|
+
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
1617
|
+
*/
|
|
1618
|
+
SequenceAckMessage.verify = function verify(message) {
|
|
1619
|
+
if (typeof message !== "object" || message === null)
|
|
1620
|
+
return "object expected";
|
|
1621
|
+
if (message.sequenceId != null && message.hasOwnProperty("sequenceId"))
|
|
1622
|
+
if (!$util.isInteger(message.sequenceId) && !(message.sequenceId && $util.isInteger(message.sequenceId.low) && $util.isInteger(message.sequenceId.high)))
|
|
1623
|
+
return "sequenceId: integer|Long expected";
|
|
1624
|
+
return null;
|
|
1625
|
+
};
|
|
1626
|
+
|
|
1627
|
+
/**
|
|
1628
|
+
* Creates a SequenceAckMessage message from a plain object. Also converts values to their respective internal types.
|
|
1629
|
+
* @function fromObject
|
|
1630
|
+
* @memberof UpstreamMessage.SequenceAckMessage
|
|
1631
|
+
* @static
|
|
1632
|
+
* @param {Object.<string,*>} object Plain object
|
|
1633
|
+
* @returns {UpstreamMessage.SequenceAckMessage} SequenceAckMessage
|
|
1634
|
+
*/
|
|
1635
|
+
SequenceAckMessage.fromObject = function fromObject(object) {
|
|
1636
|
+
if (object instanceof $root.UpstreamMessage.SequenceAckMessage)
|
|
1637
|
+
return object;
|
|
1638
|
+
let message = new $root.UpstreamMessage.SequenceAckMessage();
|
|
1639
|
+
if (object.sequenceId != null)
|
|
1640
|
+
if ($util.Long)
|
|
1641
|
+
(message.sequenceId = $util.Long.fromValue(object.sequenceId)).unsigned = true;
|
|
1642
|
+
else if (typeof object.sequenceId === "string")
|
|
1643
|
+
message.sequenceId = parseInt(object.sequenceId, 10);
|
|
1644
|
+
else if (typeof object.sequenceId === "number")
|
|
1645
|
+
message.sequenceId = object.sequenceId;
|
|
1646
|
+
else if (typeof object.sequenceId === "object")
|
|
1647
|
+
message.sequenceId = new $util.LongBits(object.sequenceId.low >>> 0, object.sequenceId.high >>> 0).toNumber(true);
|
|
1648
|
+
return message;
|
|
1649
|
+
};
|
|
1650
|
+
|
|
1651
|
+
/**
|
|
1652
|
+
* Creates a plain object from a SequenceAckMessage message. Also converts values to other types if specified.
|
|
1653
|
+
* @function toObject
|
|
1654
|
+
* @memberof UpstreamMessage.SequenceAckMessage
|
|
1655
|
+
* @static
|
|
1656
|
+
* @param {UpstreamMessage.SequenceAckMessage} message SequenceAckMessage
|
|
1657
|
+
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
1658
|
+
* @returns {Object.<string,*>} Plain object
|
|
1659
|
+
*/
|
|
1660
|
+
SequenceAckMessage.toObject = function toObject(message, options) {
|
|
1661
|
+
if (!options)
|
|
1662
|
+
options = {};
|
|
1663
|
+
let object = {};
|
|
1664
|
+
if (options.defaults)
|
|
1665
|
+
if ($util.Long) {
|
|
1666
|
+
let long = new $util.Long(0, 0, true);
|
|
1667
|
+
object.sequenceId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
|
1668
|
+
} else
|
|
1669
|
+
object.sequenceId = options.longs === String ? "0" : 0;
|
|
1670
|
+
if (message.sequenceId != null && message.hasOwnProperty("sequenceId"))
|
|
1671
|
+
if (typeof message.sequenceId === "number")
|
|
1672
|
+
object.sequenceId = options.longs === String ? String(message.sequenceId) : message.sequenceId;
|
|
1673
|
+
else
|
|
1674
|
+
object.sequenceId = options.longs === String ? $util.Long.prototype.toString.call(message.sequenceId) : options.longs === Number ? new $util.LongBits(message.sequenceId.low >>> 0, message.sequenceId.high >>> 0).toNumber(true) : message.sequenceId;
|
|
1675
|
+
return object;
|
|
1676
|
+
};
|
|
1677
|
+
|
|
1678
|
+
/**
|
|
1679
|
+
* Converts this SequenceAckMessage to JSON.
|
|
1680
|
+
* @function toJSON
|
|
1681
|
+
* @memberof UpstreamMessage.SequenceAckMessage
|
|
1682
|
+
* @instance
|
|
1683
|
+
* @returns {Object.<string,*>} JSON object
|
|
1684
|
+
*/
|
|
1685
|
+
SequenceAckMessage.prototype.toJSON = function toJSON() {
|
|
1686
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
1687
|
+
};
|
|
1688
|
+
|
|
1689
|
+
/**
|
|
1690
|
+
* Gets the default type url for SequenceAckMessage
|
|
1691
|
+
* @function getTypeUrl
|
|
1692
|
+
* @memberof UpstreamMessage.SequenceAckMessage
|
|
1693
|
+
* @static
|
|
1694
|
+
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
|
1695
|
+
* @returns {string} The default type url
|
|
1696
|
+
*/
|
|
1697
|
+
SequenceAckMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
1698
|
+
if (typeUrlPrefix === undefined) {
|
|
1699
|
+
typeUrlPrefix = "type.googleapis.com";
|
|
1700
|
+
}
|
|
1701
|
+
return typeUrlPrefix + "/UpstreamMessage.SequenceAckMessage";
|
|
1702
|
+
};
|
|
1703
|
+
|
|
1704
|
+
return SequenceAckMessage;
|
|
1705
|
+
})();
|
|
1706
|
+
|
|
1707
|
+
return UpstreamMessage;
|
|
1708
|
+
})();
|
|
1709
|
+
|
|
1710
|
+
export const DownstreamMessage = $root.DownstreamMessage = (() => {
|
|
1711
|
+
|
|
1712
|
+
/**
|
|
1713
|
+
* Properties of a DownstreamMessage.
|
|
1714
|
+
* @exports IDownstreamMessage
|
|
1715
|
+
* @interface IDownstreamMessage
|
|
1716
|
+
* @property {DownstreamMessage.IAckMessage|null} [ackMessage] DownstreamMessage ackMessage
|
|
1717
|
+
* @property {DownstreamMessage.IDataMessage|null} [dataMessage] DownstreamMessage dataMessage
|
|
1718
|
+
* @property {DownstreamMessage.ISystemMessage|null} [systemMessage] DownstreamMessage systemMessage
|
|
1719
|
+
*/
|
|
1720
|
+
|
|
1721
|
+
/**
|
|
1722
|
+
* Constructs a new DownstreamMessage.
|
|
1723
|
+
* @exports DownstreamMessage
|
|
1724
|
+
* @classdesc Represents a DownstreamMessage.
|
|
1725
|
+
* @implements IDownstreamMessage
|
|
1726
|
+
* @constructor
|
|
1727
|
+
* @param {IDownstreamMessage=} [properties] Properties to set
|
|
1728
|
+
*/
|
|
1729
|
+
function DownstreamMessage(properties) {
|
|
1730
|
+
if (properties)
|
|
1731
|
+
for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
1732
|
+
if (properties[keys[i]] != null)
|
|
1733
|
+
this[keys[i]] = properties[keys[i]];
|
|
1734
|
+
}
|
|
1735
|
+
|
|
1736
|
+
/**
|
|
1737
|
+
* DownstreamMessage ackMessage.
|
|
1738
|
+
* @member {DownstreamMessage.IAckMessage|null|undefined} ackMessage
|
|
1739
|
+
* @memberof DownstreamMessage
|
|
1740
|
+
* @instance
|
|
1741
|
+
*/
|
|
1742
|
+
DownstreamMessage.prototype.ackMessage = null;
|
|
1743
|
+
|
|
1744
|
+
/**
|
|
1745
|
+
* DownstreamMessage dataMessage.
|
|
1746
|
+
* @member {DownstreamMessage.IDataMessage|null|undefined} dataMessage
|
|
1747
|
+
* @memberof DownstreamMessage
|
|
1748
|
+
* @instance
|
|
1749
|
+
*/
|
|
1750
|
+
DownstreamMessage.prototype.dataMessage = null;
|
|
1751
|
+
|
|
1752
|
+
/**
|
|
1753
|
+
* DownstreamMessage systemMessage.
|
|
1754
|
+
* @member {DownstreamMessage.ISystemMessage|null|undefined} systemMessage
|
|
1755
|
+
* @memberof DownstreamMessage
|
|
1756
|
+
* @instance
|
|
1757
|
+
*/
|
|
1758
|
+
DownstreamMessage.prototype.systemMessage = null;
|
|
1759
|
+
|
|
1760
|
+
// OneOf field names bound to virtual getters and setters
|
|
1761
|
+
let $oneOfFields;
|
|
1762
|
+
|
|
1763
|
+
/**
|
|
1764
|
+
* DownstreamMessage message.
|
|
1765
|
+
* @member {"ackMessage"|"dataMessage"|"systemMessage"|undefined} message
|
|
1766
|
+
* @memberof DownstreamMessage
|
|
1767
|
+
* @instance
|
|
1768
|
+
*/
|
|
1769
|
+
Object.defineProperty(DownstreamMessage.prototype, "message", {
|
|
1770
|
+
get: $util.oneOfGetter($oneOfFields = ["ackMessage", "dataMessage", "systemMessage"]),
|
|
1771
|
+
set: $util.oneOfSetter($oneOfFields)
|
|
1772
|
+
});
|
|
1773
|
+
|
|
1774
|
+
/**
|
|
1775
|
+
* Creates a new DownstreamMessage instance using the specified properties.
|
|
1776
|
+
* @function create
|
|
1777
|
+
* @memberof DownstreamMessage
|
|
1778
|
+
* @static
|
|
1779
|
+
* @param {IDownstreamMessage=} [properties] Properties to set
|
|
1780
|
+
* @returns {DownstreamMessage} DownstreamMessage instance
|
|
1781
|
+
*/
|
|
1782
|
+
DownstreamMessage.create = function create(properties) {
|
|
1783
|
+
return new DownstreamMessage(properties);
|
|
1784
|
+
};
|
|
1785
|
+
|
|
1786
|
+
/**
|
|
1787
|
+
* Encodes the specified DownstreamMessage message. Does not implicitly {@link DownstreamMessage.verify|verify} messages.
|
|
1788
|
+
* @function encode
|
|
1789
|
+
* @memberof DownstreamMessage
|
|
1790
|
+
* @static
|
|
1791
|
+
* @param {IDownstreamMessage} message DownstreamMessage message or plain object to encode
|
|
1792
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
1793
|
+
* @returns {$protobuf.Writer} Writer
|
|
1794
|
+
*/
|
|
1795
|
+
DownstreamMessage.encode = function encode(message, writer) {
|
|
1796
|
+
if (!writer)
|
|
1797
|
+
writer = $Writer.create();
|
|
1798
|
+
if (message.ackMessage != null && Object.hasOwnProperty.call(message, "ackMessage"))
|
|
1799
|
+
$root.DownstreamMessage.AckMessage.encode(message.ackMessage, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
|
|
1800
|
+
if (message.dataMessage != null && Object.hasOwnProperty.call(message, "dataMessage"))
|
|
1801
|
+
$root.DownstreamMessage.DataMessage.encode(message.dataMessage, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
|
|
1802
|
+
if (message.systemMessage != null && Object.hasOwnProperty.call(message, "systemMessage"))
|
|
1803
|
+
$root.DownstreamMessage.SystemMessage.encode(message.systemMessage, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
|
|
1804
|
+
return writer;
|
|
1805
|
+
};
|
|
1806
|
+
|
|
1807
|
+
/**
|
|
1808
|
+
* Encodes the specified DownstreamMessage message, length delimited. Does not implicitly {@link DownstreamMessage.verify|verify} messages.
|
|
1809
|
+
* @function encodeDelimited
|
|
1810
|
+
* @memberof DownstreamMessage
|
|
1811
|
+
* @static
|
|
1812
|
+
* @param {IDownstreamMessage} message DownstreamMessage message or plain object to encode
|
|
1813
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
1814
|
+
* @returns {$protobuf.Writer} Writer
|
|
1815
|
+
*/
|
|
1816
|
+
DownstreamMessage.encodeDelimited = function encodeDelimited(message, writer) {
|
|
1817
|
+
return this.encode(message, writer).ldelim();
|
|
1818
|
+
};
|
|
1819
|
+
|
|
1820
|
+
/**
|
|
1821
|
+
* Decodes a DownstreamMessage message from the specified reader or buffer.
|
|
1822
|
+
* @function decode
|
|
1823
|
+
* @memberof DownstreamMessage
|
|
1824
|
+
* @static
|
|
1825
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
1826
|
+
* @param {number} [length] Message length if known beforehand
|
|
1827
|
+
* @returns {DownstreamMessage} DownstreamMessage
|
|
1828
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
1829
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
1830
|
+
*/
|
|
1831
|
+
DownstreamMessage.decode = function decode(reader, length) {
|
|
1832
|
+
if (!(reader instanceof $Reader))
|
|
1833
|
+
reader = $Reader.create(reader);
|
|
1834
|
+
let end = length === undefined ? reader.len : reader.pos + length, message = new $root.DownstreamMessage();
|
|
1835
|
+
while (reader.pos < end) {
|
|
1836
|
+
let tag = reader.uint32();
|
|
1837
|
+
switch (tag >>> 3) {
|
|
1838
|
+
case 1: {
|
|
1839
|
+
message.ackMessage = $root.DownstreamMessage.AckMessage.decode(reader, reader.uint32());
|
|
1840
|
+
break;
|
|
1841
|
+
}
|
|
1842
|
+
case 2: {
|
|
1843
|
+
message.dataMessage = $root.DownstreamMessage.DataMessage.decode(reader, reader.uint32());
|
|
1844
|
+
break;
|
|
1845
|
+
}
|
|
1846
|
+
case 3: {
|
|
1847
|
+
message.systemMessage = $root.DownstreamMessage.SystemMessage.decode(reader, reader.uint32());
|
|
1848
|
+
break;
|
|
1849
|
+
}
|
|
1850
|
+
default:
|
|
1851
|
+
reader.skipType(tag & 7);
|
|
1852
|
+
break;
|
|
1853
|
+
}
|
|
1854
|
+
}
|
|
1855
|
+
return message;
|
|
1856
|
+
};
|
|
1857
|
+
|
|
1858
|
+
/**
|
|
1859
|
+
* Decodes a DownstreamMessage message from the specified reader or buffer, length delimited.
|
|
1860
|
+
* @function decodeDelimited
|
|
1861
|
+
* @memberof DownstreamMessage
|
|
1862
|
+
* @static
|
|
1863
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
1864
|
+
* @returns {DownstreamMessage} DownstreamMessage
|
|
1865
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
1866
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
1867
|
+
*/
|
|
1868
|
+
DownstreamMessage.decodeDelimited = function decodeDelimited(reader) {
|
|
1869
|
+
if (!(reader instanceof $Reader))
|
|
1870
|
+
reader = new $Reader(reader);
|
|
1871
|
+
return this.decode(reader, reader.uint32());
|
|
1872
|
+
};
|
|
1873
|
+
|
|
1874
|
+
/**
|
|
1875
|
+
* Verifies a DownstreamMessage message.
|
|
1876
|
+
* @function verify
|
|
1877
|
+
* @memberof DownstreamMessage
|
|
1878
|
+
* @static
|
|
1879
|
+
* @param {Object.<string,*>} message Plain object to verify
|
|
1880
|
+
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
1881
|
+
*/
|
|
1882
|
+
DownstreamMessage.verify = function verify(message) {
|
|
1883
|
+
if (typeof message !== "object" || message === null)
|
|
1884
|
+
return "object expected";
|
|
1885
|
+
let properties = {};
|
|
1886
|
+
if (message.ackMessage != null && message.hasOwnProperty("ackMessage")) {
|
|
1887
|
+
properties.message = 1;
|
|
1888
|
+
{
|
|
1889
|
+
let error = $root.DownstreamMessage.AckMessage.verify(message.ackMessage);
|
|
1890
|
+
if (error)
|
|
1891
|
+
return "ackMessage." + error;
|
|
1892
|
+
}
|
|
1893
|
+
}
|
|
1894
|
+
if (message.dataMessage != null && message.hasOwnProperty("dataMessage")) {
|
|
1895
|
+
if (properties.message === 1)
|
|
1896
|
+
return "message: multiple values";
|
|
1897
|
+
properties.message = 1;
|
|
1898
|
+
{
|
|
1899
|
+
let error = $root.DownstreamMessage.DataMessage.verify(message.dataMessage);
|
|
1900
|
+
if (error)
|
|
1901
|
+
return "dataMessage." + error;
|
|
1902
|
+
}
|
|
1903
|
+
}
|
|
1904
|
+
if (message.systemMessage != null && message.hasOwnProperty("systemMessage")) {
|
|
1905
|
+
if (properties.message === 1)
|
|
1906
|
+
return "message: multiple values";
|
|
1907
|
+
properties.message = 1;
|
|
1908
|
+
{
|
|
1909
|
+
let error = $root.DownstreamMessage.SystemMessage.verify(message.systemMessage);
|
|
1910
|
+
if (error)
|
|
1911
|
+
return "systemMessage." + error;
|
|
1912
|
+
}
|
|
1913
|
+
}
|
|
1914
|
+
return null;
|
|
1915
|
+
};
|
|
1916
|
+
|
|
1917
|
+
/**
|
|
1918
|
+
* Creates a DownstreamMessage message from a plain object. Also converts values to their respective internal types.
|
|
1919
|
+
* @function fromObject
|
|
1920
|
+
* @memberof DownstreamMessage
|
|
1921
|
+
* @static
|
|
1922
|
+
* @param {Object.<string,*>} object Plain object
|
|
1923
|
+
* @returns {DownstreamMessage} DownstreamMessage
|
|
1924
|
+
*/
|
|
1925
|
+
DownstreamMessage.fromObject = function fromObject(object) {
|
|
1926
|
+
if (object instanceof $root.DownstreamMessage)
|
|
1927
|
+
return object;
|
|
1928
|
+
let message = new $root.DownstreamMessage();
|
|
1929
|
+
if (object.ackMessage != null) {
|
|
1930
|
+
if (typeof object.ackMessage !== "object")
|
|
1931
|
+
throw TypeError(".DownstreamMessage.ackMessage: object expected");
|
|
1932
|
+
message.ackMessage = $root.DownstreamMessage.AckMessage.fromObject(object.ackMessage);
|
|
1933
|
+
}
|
|
1934
|
+
if (object.dataMessage != null) {
|
|
1935
|
+
if (typeof object.dataMessage !== "object")
|
|
1936
|
+
throw TypeError(".DownstreamMessage.dataMessage: object expected");
|
|
1937
|
+
message.dataMessage = $root.DownstreamMessage.DataMessage.fromObject(object.dataMessage);
|
|
1938
|
+
}
|
|
1939
|
+
if (object.systemMessage != null) {
|
|
1940
|
+
if (typeof object.systemMessage !== "object")
|
|
1941
|
+
throw TypeError(".DownstreamMessage.systemMessage: object expected");
|
|
1942
|
+
message.systemMessage = $root.DownstreamMessage.SystemMessage.fromObject(object.systemMessage);
|
|
1943
|
+
}
|
|
1944
|
+
return message;
|
|
1945
|
+
};
|
|
1946
|
+
|
|
1947
|
+
/**
|
|
1948
|
+
* Creates a plain object from a DownstreamMessage message. Also converts values to other types if specified.
|
|
1949
|
+
* @function toObject
|
|
1950
|
+
* @memberof DownstreamMessage
|
|
1951
|
+
* @static
|
|
1952
|
+
* @param {DownstreamMessage} message DownstreamMessage
|
|
1953
|
+
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
1954
|
+
* @returns {Object.<string,*>} Plain object
|
|
1955
|
+
*/
|
|
1956
|
+
DownstreamMessage.toObject = function toObject(message, options) {
|
|
1957
|
+
if (!options)
|
|
1958
|
+
options = {};
|
|
1959
|
+
let object = {};
|
|
1960
|
+
if (message.ackMessage != null && message.hasOwnProperty("ackMessage")) {
|
|
1961
|
+
object.ackMessage = $root.DownstreamMessage.AckMessage.toObject(message.ackMessage, options);
|
|
1962
|
+
if (options.oneofs)
|
|
1963
|
+
object.message = "ackMessage";
|
|
1964
|
+
}
|
|
1965
|
+
if (message.dataMessage != null && message.hasOwnProperty("dataMessage")) {
|
|
1966
|
+
object.dataMessage = $root.DownstreamMessage.DataMessage.toObject(message.dataMessage, options);
|
|
1967
|
+
if (options.oneofs)
|
|
1968
|
+
object.message = "dataMessage";
|
|
1969
|
+
}
|
|
1970
|
+
if (message.systemMessage != null && message.hasOwnProperty("systemMessage")) {
|
|
1971
|
+
object.systemMessage = $root.DownstreamMessage.SystemMessage.toObject(message.systemMessage, options);
|
|
1972
|
+
if (options.oneofs)
|
|
1973
|
+
object.message = "systemMessage";
|
|
1974
|
+
}
|
|
1975
|
+
return object;
|
|
1976
|
+
};
|
|
1977
|
+
|
|
1978
|
+
/**
|
|
1979
|
+
* Converts this DownstreamMessage to JSON.
|
|
1980
|
+
* @function toJSON
|
|
1981
|
+
* @memberof DownstreamMessage
|
|
1982
|
+
* @instance
|
|
1983
|
+
* @returns {Object.<string,*>} JSON object
|
|
1984
|
+
*/
|
|
1985
|
+
DownstreamMessage.prototype.toJSON = function toJSON() {
|
|
1986
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
1987
|
+
};
|
|
1988
|
+
|
|
1989
|
+
/**
|
|
1990
|
+
* Gets the default type url for DownstreamMessage
|
|
1991
|
+
* @function getTypeUrl
|
|
1992
|
+
* @memberof DownstreamMessage
|
|
1993
|
+
* @static
|
|
1994
|
+
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
|
1995
|
+
* @returns {string} The default type url
|
|
1996
|
+
*/
|
|
1997
|
+
DownstreamMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
1998
|
+
if (typeUrlPrefix === undefined) {
|
|
1999
|
+
typeUrlPrefix = "type.googleapis.com";
|
|
2000
|
+
}
|
|
2001
|
+
return typeUrlPrefix + "/DownstreamMessage";
|
|
2002
|
+
};
|
|
2003
|
+
|
|
2004
|
+
DownstreamMessage.AckMessage = (function() {
|
|
2005
|
+
|
|
2006
|
+
/**
|
|
2007
|
+
* Properties of an AckMessage.
|
|
2008
|
+
* @memberof DownstreamMessage
|
|
2009
|
+
* @interface IAckMessage
|
|
2010
|
+
* @property {number|Long|null} [ackId] AckMessage ackId
|
|
2011
|
+
* @property {boolean|null} [success] AckMessage success
|
|
2012
|
+
* @property {DownstreamMessage.AckMessage.IErrorMessage|null} [error] AckMessage error
|
|
2013
|
+
*/
|
|
2014
|
+
|
|
2015
|
+
/**
|
|
2016
|
+
* Constructs a new AckMessage.
|
|
2017
|
+
* @memberof DownstreamMessage
|
|
2018
|
+
* @classdesc Represents an AckMessage.
|
|
2019
|
+
* @implements IAckMessage
|
|
2020
|
+
* @constructor
|
|
2021
|
+
* @param {DownstreamMessage.IAckMessage=} [properties] Properties to set
|
|
2022
|
+
*/
|
|
2023
|
+
function AckMessage(properties) {
|
|
2024
|
+
if (properties)
|
|
2025
|
+
for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
2026
|
+
if (properties[keys[i]] != null)
|
|
2027
|
+
this[keys[i]] = properties[keys[i]];
|
|
2028
|
+
}
|
|
2029
|
+
|
|
2030
|
+
/**
|
|
2031
|
+
* AckMessage ackId.
|
|
2032
|
+
* @member {number|Long} ackId
|
|
2033
|
+
* @memberof DownstreamMessage.AckMessage
|
|
2034
|
+
* @instance
|
|
2035
|
+
*/
|
|
2036
|
+
AckMessage.prototype.ackId = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
|
|
2037
|
+
|
|
2038
|
+
/**
|
|
2039
|
+
* AckMessage success.
|
|
2040
|
+
* @member {boolean} success
|
|
2041
|
+
* @memberof DownstreamMessage.AckMessage
|
|
2042
|
+
* @instance
|
|
2043
|
+
*/
|
|
2044
|
+
AckMessage.prototype.success = false;
|
|
2045
|
+
|
|
2046
|
+
/**
|
|
2047
|
+
* AckMessage error.
|
|
2048
|
+
* @member {DownstreamMessage.AckMessage.IErrorMessage|null|undefined} error
|
|
2049
|
+
* @memberof DownstreamMessage.AckMessage
|
|
2050
|
+
* @instance
|
|
2051
|
+
*/
|
|
2052
|
+
AckMessage.prototype.error = null;
|
|
2053
|
+
|
|
2054
|
+
// OneOf field names bound to virtual getters and setters
|
|
2055
|
+
let $oneOfFields;
|
|
2056
|
+
|
|
2057
|
+
/**
|
|
2058
|
+
* AckMessage _error.
|
|
2059
|
+
* @member {"error"|undefined} _error
|
|
2060
|
+
* @memberof DownstreamMessage.AckMessage
|
|
2061
|
+
* @instance
|
|
2062
|
+
*/
|
|
2063
|
+
Object.defineProperty(AckMessage.prototype, "_error", {
|
|
2064
|
+
get: $util.oneOfGetter($oneOfFields = ["error"]),
|
|
2065
|
+
set: $util.oneOfSetter($oneOfFields)
|
|
2066
|
+
});
|
|
2067
|
+
|
|
2068
|
+
/**
|
|
2069
|
+
* Creates a new AckMessage instance using the specified properties.
|
|
2070
|
+
* @function create
|
|
2071
|
+
* @memberof DownstreamMessage.AckMessage
|
|
2072
|
+
* @static
|
|
2073
|
+
* @param {DownstreamMessage.IAckMessage=} [properties] Properties to set
|
|
2074
|
+
* @returns {DownstreamMessage.AckMessage} AckMessage instance
|
|
2075
|
+
*/
|
|
2076
|
+
AckMessage.create = function create(properties) {
|
|
2077
|
+
return new AckMessage(properties);
|
|
2078
|
+
};
|
|
2079
|
+
|
|
2080
|
+
/**
|
|
2081
|
+
* Encodes the specified AckMessage message. Does not implicitly {@link DownstreamMessage.AckMessage.verify|verify} messages.
|
|
2082
|
+
* @function encode
|
|
2083
|
+
* @memberof DownstreamMessage.AckMessage
|
|
2084
|
+
* @static
|
|
2085
|
+
* @param {DownstreamMessage.IAckMessage} message AckMessage message or plain object to encode
|
|
2086
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
2087
|
+
* @returns {$protobuf.Writer} Writer
|
|
2088
|
+
*/
|
|
2089
|
+
AckMessage.encode = function encode(message, writer) {
|
|
2090
|
+
if (!writer)
|
|
2091
|
+
writer = $Writer.create();
|
|
2092
|
+
if (message.ackId != null && Object.hasOwnProperty.call(message, "ackId"))
|
|
2093
|
+
writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.ackId);
|
|
2094
|
+
if (message.success != null && Object.hasOwnProperty.call(message, "success"))
|
|
2095
|
+
writer.uint32(/* id 2, wireType 0 =*/16).bool(message.success);
|
|
2096
|
+
if (message.error != null && Object.hasOwnProperty.call(message, "error"))
|
|
2097
|
+
$root.DownstreamMessage.AckMessage.ErrorMessage.encode(message.error, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
|
|
2098
|
+
return writer;
|
|
2099
|
+
};
|
|
2100
|
+
|
|
2101
|
+
/**
|
|
2102
|
+
* Encodes the specified AckMessage message, length delimited. Does not implicitly {@link DownstreamMessage.AckMessage.verify|verify} messages.
|
|
2103
|
+
* @function encodeDelimited
|
|
2104
|
+
* @memberof DownstreamMessage.AckMessage
|
|
2105
|
+
* @static
|
|
2106
|
+
* @param {DownstreamMessage.IAckMessage} message AckMessage message or plain object to encode
|
|
2107
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
2108
|
+
* @returns {$protobuf.Writer} Writer
|
|
2109
|
+
*/
|
|
2110
|
+
AckMessage.encodeDelimited = function encodeDelimited(message, writer) {
|
|
2111
|
+
return this.encode(message, writer).ldelim();
|
|
2112
|
+
};
|
|
2113
|
+
|
|
2114
|
+
/**
|
|
2115
|
+
* Decodes an AckMessage message from the specified reader or buffer.
|
|
2116
|
+
* @function decode
|
|
2117
|
+
* @memberof DownstreamMessage.AckMessage
|
|
2118
|
+
* @static
|
|
2119
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
2120
|
+
* @param {number} [length] Message length if known beforehand
|
|
2121
|
+
* @returns {DownstreamMessage.AckMessage} AckMessage
|
|
2122
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
2123
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
2124
|
+
*/
|
|
2125
|
+
AckMessage.decode = function decode(reader, length) {
|
|
2126
|
+
if (!(reader instanceof $Reader))
|
|
2127
|
+
reader = $Reader.create(reader);
|
|
2128
|
+
let end = length === undefined ? reader.len : reader.pos + length, message = new $root.DownstreamMessage.AckMessage();
|
|
2129
|
+
while (reader.pos < end) {
|
|
2130
|
+
let tag = reader.uint32();
|
|
2131
|
+
switch (tag >>> 3) {
|
|
2132
|
+
case 1: {
|
|
2133
|
+
message.ackId = reader.uint64();
|
|
2134
|
+
break;
|
|
2135
|
+
}
|
|
2136
|
+
case 2: {
|
|
2137
|
+
message.success = reader.bool();
|
|
2138
|
+
break;
|
|
2139
|
+
}
|
|
2140
|
+
case 3: {
|
|
2141
|
+
message.error = $root.DownstreamMessage.AckMessage.ErrorMessage.decode(reader, reader.uint32());
|
|
2142
|
+
break;
|
|
2143
|
+
}
|
|
2144
|
+
default:
|
|
2145
|
+
reader.skipType(tag & 7);
|
|
2146
|
+
break;
|
|
2147
|
+
}
|
|
2148
|
+
}
|
|
2149
|
+
return message;
|
|
2150
|
+
};
|
|
2151
|
+
|
|
2152
|
+
/**
|
|
2153
|
+
* Decodes an AckMessage message from the specified reader or buffer, length delimited.
|
|
2154
|
+
* @function decodeDelimited
|
|
2155
|
+
* @memberof DownstreamMessage.AckMessage
|
|
2156
|
+
* @static
|
|
2157
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
2158
|
+
* @returns {DownstreamMessage.AckMessage} AckMessage
|
|
2159
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
2160
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
2161
|
+
*/
|
|
2162
|
+
AckMessage.decodeDelimited = function decodeDelimited(reader) {
|
|
2163
|
+
if (!(reader instanceof $Reader))
|
|
2164
|
+
reader = new $Reader(reader);
|
|
2165
|
+
return this.decode(reader, reader.uint32());
|
|
2166
|
+
};
|
|
2167
|
+
|
|
2168
|
+
/**
|
|
2169
|
+
* Verifies an AckMessage message.
|
|
2170
|
+
* @function verify
|
|
2171
|
+
* @memberof DownstreamMessage.AckMessage
|
|
2172
|
+
* @static
|
|
2173
|
+
* @param {Object.<string,*>} message Plain object to verify
|
|
2174
|
+
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
2175
|
+
*/
|
|
2176
|
+
AckMessage.verify = function verify(message) {
|
|
2177
|
+
if (typeof message !== "object" || message === null)
|
|
2178
|
+
return "object expected";
|
|
2179
|
+
let properties = {};
|
|
2180
|
+
if (message.ackId != null && message.hasOwnProperty("ackId"))
|
|
2181
|
+
if (!$util.isInteger(message.ackId) && !(message.ackId && $util.isInteger(message.ackId.low) && $util.isInteger(message.ackId.high)))
|
|
2182
|
+
return "ackId: integer|Long expected";
|
|
2183
|
+
if (message.success != null && message.hasOwnProperty("success"))
|
|
2184
|
+
if (typeof message.success !== "boolean")
|
|
2185
|
+
return "success: boolean expected";
|
|
2186
|
+
if (message.error != null && message.hasOwnProperty("error")) {
|
|
2187
|
+
properties._error = 1;
|
|
2188
|
+
{
|
|
2189
|
+
let error = $root.DownstreamMessage.AckMessage.ErrorMessage.verify(message.error);
|
|
2190
|
+
if (error)
|
|
2191
|
+
return "error." + error;
|
|
2192
|
+
}
|
|
2193
|
+
}
|
|
2194
|
+
return null;
|
|
2195
|
+
};
|
|
2196
|
+
|
|
2197
|
+
/**
|
|
2198
|
+
* Creates an AckMessage message from a plain object. Also converts values to their respective internal types.
|
|
2199
|
+
* @function fromObject
|
|
2200
|
+
* @memberof DownstreamMessage.AckMessage
|
|
2201
|
+
* @static
|
|
2202
|
+
* @param {Object.<string,*>} object Plain object
|
|
2203
|
+
* @returns {DownstreamMessage.AckMessage} AckMessage
|
|
2204
|
+
*/
|
|
2205
|
+
AckMessage.fromObject = function fromObject(object) {
|
|
2206
|
+
if (object instanceof $root.DownstreamMessage.AckMessage)
|
|
2207
|
+
return object;
|
|
2208
|
+
let message = new $root.DownstreamMessage.AckMessage();
|
|
2209
|
+
if (object.ackId != null)
|
|
2210
|
+
if ($util.Long)
|
|
2211
|
+
(message.ackId = $util.Long.fromValue(object.ackId)).unsigned = true;
|
|
2212
|
+
else if (typeof object.ackId === "string")
|
|
2213
|
+
message.ackId = parseInt(object.ackId, 10);
|
|
2214
|
+
else if (typeof object.ackId === "number")
|
|
2215
|
+
message.ackId = object.ackId;
|
|
2216
|
+
else if (typeof object.ackId === "object")
|
|
2217
|
+
message.ackId = new $util.LongBits(object.ackId.low >>> 0, object.ackId.high >>> 0).toNumber(true);
|
|
2218
|
+
if (object.success != null)
|
|
2219
|
+
message.success = Boolean(object.success);
|
|
2220
|
+
if (object.error != null) {
|
|
2221
|
+
if (typeof object.error !== "object")
|
|
2222
|
+
throw TypeError(".DownstreamMessage.AckMessage.error: object expected");
|
|
2223
|
+
message.error = $root.DownstreamMessage.AckMessage.ErrorMessage.fromObject(object.error);
|
|
2224
|
+
}
|
|
2225
|
+
return message;
|
|
2226
|
+
};
|
|
2227
|
+
|
|
2228
|
+
/**
|
|
2229
|
+
* Creates a plain object from an AckMessage message. Also converts values to other types if specified.
|
|
2230
|
+
* @function toObject
|
|
2231
|
+
* @memberof DownstreamMessage.AckMessage
|
|
2232
|
+
* @static
|
|
2233
|
+
* @param {DownstreamMessage.AckMessage} message AckMessage
|
|
2234
|
+
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
2235
|
+
* @returns {Object.<string,*>} Plain object
|
|
2236
|
+
*/
|
|
2237
|
+
AckMessage.toObject = function toObject(message, options) {
|
|
2238
|
+
if (!options)
|
|
2239
|
+
options = {};
|
|
2240
|
+
let object = {};
|
|
2241
|
+
if (options.defaults) {
|
|
2242
|
+
if ($util.Long) {
|
|
2243
|
+
let long = new $util.Long(0, 0, true);
|
|
2244
|
+
object.ackId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
|
2245
|
+
} else
|
|
2246
|
+
object.ackId = options.longs === String ? "0" : 0;
|
|
2247
|
+
object.success = false;
|
|
2248
|
+
}
|
|
2249
|
+
if (message.ackId != null && message.hasOwnProperty("ackId"))
|
|
2250
|
+
if (typeof message.ackId === "number")
|
|
2251
|
+
object.ackId = options.longs === String ? String(message.ackId) : message.ackId;
|
|
2252
|
+
else
|
|
2253
|
+
object.ackId = options.longs === String ? $util.Long.prototype.toString.call(message.ackId) : options.longs === Number ? new $util.LongBits(message.ackId.low >>> 0, message.ackId.high >>> 0).toNumber(true) : message.ackId;
|
|
2254
|
+
if (message.success != null && message.hasOwnProperty("success"))
|
|
2255
|
+
object.success = message.success;
|
|
2256
|
+
if (message.error != null && message.hasOwnProperty("error")) {
|
|
2257
|
+
object.error = $root.DownstreamMessage.AckMessage.ErrorMessage.toObject(message.error, options);
|
|
2258
|
+
if (options.oneofs)
|
|
2259
|
+
object._error = "error";
|
|
2260
|
+
}
|
|
2261
|
+
return object;
|
|
2262
|
+
};
|
|
2263
|
+
|
|
2264
|
+
/**
|
|
2265
|
+
* Converts this AckMessage to JSON.
|
|
2266
|
+
* @function toJSON
|
|
2267
|
+
* @memberof DownstreamMessage.AckMessage
|
|
2268
|
+
* @instance
|
|
2269
|
+
* @returns {Object.<string,*>} JSON object
|
|
2270
|
+
*/
|
|
2271
|
+
AckMessage.prototype.toJSON = function toJSON() {
|
|
2272
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
2273
|
+
};
|
|
2274
|
+
|
|
2275
|
+
/**
|
|
2276
|
+
* Gets the default type url for AckMessage
|
|
2277
|
+
* @function getTypeUrl
|
|
2278
|
+
* @memberof DownstreamMessage.AckMessage
|
|
2279
|
+
* @static
|
|
2280
|
+
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
|
2281
|
+
* @returns {string} The default type url
|
|
2282
|
+
*/
|
|
2283
|
+
AckMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
2284
|
+
if (typeUrlPrefix === undefined) {
|
|
2285
|
+
typeUrlPrefix = "type.googleapis.com";
|
|
2286
|
+
}
|
|
2287
|
+
return typeUrlPrefix + "/DownstreamMessage.AckMessage";
|
|
2288
|
+
};
|
|
2289
|
+
|
|
2290
|
+
AckMessage.ErrorMessage = (function() {
|
|
2291
|
+
|
|
2292
|
+
/**
|
|
2293
|
+
* Properties of an ErrorMessage.
|
|
2294
|
+
* @memberof DownstreamMessage.AckMessage
|
|
2295
|
+
* @interface IErrorMessage
|
|
2296
|
+
* @property {string|null} [name] ErrorMessage name
|
|
2297
|
+
* @property {string|null} [message] ErrorMessage message
|
|
2298
|
+
*/
|
|
2299
|
+
|
|
2300
|
+
/**
|
|
2301
|
+
* Constructs a new ErrorMessage.
|
|
2302
|
+
* @memberof DownstreamMessage.AckMessage
|
|
2303
|
+
* @classdesc Represents an ErrorMessage.
|
|
2304
|
+
* @implements IErrorMessage
|
|
2305
|
+
* @constructor
|
|
2306
|
+
* @param {DownstreamMessage.AckMessage.IErrorMessage=} [properties] Properties to set
|
|
2307
|
+
*/
|
|
2308
|
+
function ErrorMessage(properties) {
|
|
2309
|
+
if (properties)
|
|
2310
|
+
for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
2311
|
+
if (properties[keys[i]] != null)
|
|
2312
|
+
this[keys[i]] = properties[keys[i]];
|
|
2313
|
+
}
|
|
2314
|
+
|
|
2315
|
+
/**
|
|
2316
|
+
* ErrorMessage name.
|
|
2317
|
+
* @member {string} name
|
|
2318
|
+
* @memberof DownstreamMessage.AckMessage.ErrorMessage
|
|
2319
|
+
* @instance
|
|
2320
|
+
*/
|
|
2321
|
+
ErrorMessage.prototype.name = "";
|
|
2322
|
+
|
|
2323
|
+
/**
|
|
2324
|
+
* ErrorMessage message.
|
|
2325
|
+
* @member {string} message
|
|
2326
|
+
* @memberof DownstreamMessage.AckMessage.ErrorMessage
|
|
2327
|
+
* @instance
|
|
2328
|
+
*/
|
|
2329
|
+
ErrorMessage.prototype.message = "";
|
|
2330
|
+
|
|
2331
|
+
/**
|
|
2332
|
+
* Creates a new ErrorMessage instance using the specified properties.
|
|
2333
|
+
* @function create
|
|
2334
|
+
* @memberof DownstreamMessage.AckMessage.ErrorMessage
|
|
2335
|
+
* @static
|
|
2336
|
+
* @param {DownstreamMessage.AckMessage.IErrorMessage=} [properties] Properties to set
|
|
2337
|
+
* @returns {DownstreamMessage.AckMessage.ErrorMessage} ErrorMessage instance
|
|
2338
|
+
*/
|
|
2339
|
+
ErrorMessage.create = function create(properties) {
|
|
2340
|
+
return new ErrorMessage(properties);
|
|
2341
|
+
};
|
|
2342
|
+
|
|
2343
|
+
/**
|
|
2344
|
+
* Encodes the specified ErrorMessage message. Does not implicitly {@link DownstreamMessage.AckMessage.ErrorMessage.verify|verify} messages.
|
|
2345
|
+
* @function encode
|
|
2346
|
+
* @memberof DownstreamMessage.AckMessage.ErrorMessage
|
|
2347
|
+
* @static
|
|
2348
|
+
* @param {DownstreamMessage.AckMessage.IErrorMessage} message ErrorMessage message or plain object to encode
|
|
2349
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
2350
|
+
* @returns {$protobuf.Writer} Writer
|
|
2351
|
+
*/
|
|
2352
|
+
ErrorMessage.encode = function encode(message, writer) {
|
|
2353
|
+
if (!writer)
|
|
2354
|
+
writer = $Writer.create();
|
|
2355
|
+
if (message.name != null && Object.hasOwnProperty.call(message, "name"))
|
|
2356
|
+
writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
|
|
2357
|
+
if (message.message != null && Object.hasOwnProperty.call(message, "message"))
|
|
2358
|
+
writer.uint32(/* id 2, wireType 2 =*/18).string(message.message);
|
|
2359
|
+
return writer;
|
|
2360
|
+
};
|
|
2361
|
+
|
|
2362
|
+
/**
|
|
2363
|
+
* Encodes the specified ErrorMessage message, length delimited. Does not implicitly {@link DownstreamMessage.AckMessage.ErrorMessage.verify|verify} messages.
|
|
2364
|
+
* @function encodeDelimited
|
|
2365
|
+
* @memberof DownstreamMessage.AckMessage.ErrorMessage
|
|
2366
|
+
* @static
|
|
2367
|
+
* @param {DownstreamMessage.AckMessage.IErrorMessage} message ErrorMessage message or plain object to encode
|
|
2368
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
2369
|
+
* @returns {$protobuf.Writer} Writer
|
|
2370
|
+
*/
|
|
2371
|
+
ErrorMessage.encodeDelimited = function encodeDelimited(message, writer) {
|
|
2372
|
+
return this.encode(message, writer).ldelim();
|
|
2373
|
+
};
|
|
2374
|
+
|
|
2375
|
+
/**
|
|
2376
|
+
* Decodes an ErrorMessage message from the specified reader or buffer.
|
|
2377
|
+
* @function decode
|
|
2378
|
+
* @memberof DownstreamMessage.AckMessage.ErrorMessage
|
|
2379
|
+
* @static
|
|
2380
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
2381
|
+
* @param {number} [length] Message length if known beforehand
|
|
2382
|
+
* @returns {DownstreamMessage.AckMessage.ErrorMessage} ErrorMessage
|
|
2383
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
2384
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
2385
|
+
*/
|
|
2386
|
+
ErrorMessage.decode = function decode(reader, length) {
|
|
2387
|
+
if (!(reader instanceof $Reader))
|
|
2388
|
+
reader = $Reader.create(reader);
|
|
2389
|
+
let end = length === undefined ? reader.len : reader.pos + length, message = new $root.DownstreamMessage.AckMessage.ErrorMessage();
|
|
2390
|
+
while (reader.pos < end) {
|
|
2391
|
+
let tag = reader.uint32();
|
|
2392
|
+
switch (tag >>> 3) {
|
|
2393
|
+
case 1: {
|
|
2394
|
+
message.name = reader.string();
|
|
2395
|
+
break;
|
|
2396
|
+
}
|
|
2397
|
+
case 2: {
|
|
2398
|
+
message.message = reader.string();
|
|
2399
|
+
break;
|
|
2400
|
+
}
|
|
2401
|
+
default:
|
|
2402
|
+
reader.skipType(tag & 7);
|
|
2403
|
+
break;
|
|
2404
|
+
}
|
|
2405
|
+
}
|
|
2406
|
+
return message;
|
|
2407
|
+
};
|
|
2408
|
+
|
|
2409
|
+
/**
|
|
2410
|
+
* Decodes an ErrorMessage message from the specified reader or buffer, length delimited.
|
|
2411
|
+
* @function decodeDelimited
|
|
2412
|
+
* @memberof DownstreamMessage.AckMessage.ErrorMessage
|
|
2413
|
+
* @static
|
|
2414
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
2415
|
+
* @returns {DownstreamMessage.AckMessage.ErrorMessage} ErrorMessage
|
|
2416
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
2417
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
2418
|
+
*/
|
|
2419
|
+
ErrorMessage.decodeDelimited = function decodeDelimited(reader) {
|
|
2420
|
+
if (!(reader instanceof $Reader))
|
|
2421
|
+
reader = new $Reader(reader);
|
|
2422
|
+
return this.decode(reader, reader.uint32());
|
|
2423
|
+
};
|
|
2424
|
+
|
|
2425
|
+
/**
|
|
2426
|
+
* Verifies an ErrorMessage message.
|
|
2427
|
+
* @function verify
|
|
2428
|
+
* @memberof DownstreamMessage.AckMessage.ErrorMessage
|
|
2429
|
+
* @static
|
|
2430
|
+
* @param {Object.<string,*>} message Plain object to verify
|
|
2431
|
+
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
2432
|
+
*/
|
|
2433
|
+
ErrorMessage.verify = function verify(message) {
|
|
2434
|
+
if (typeof message !== "object" || message === null)
|
|
2435
|
+
return "object expected";
|
|
2436
|
+
if (message.name != null && message.hasOwnProperty("name"))
|
|
2437
|
+
if (!$util.isString(message.name))
|
|
2438
|
+
return "name: string expected";
|
|
2439
|
+
if (message.message != null && message.hasOwnProperty("message"))
|
|
2440
|
+
if (!$util.isString(message.message))
|
|
2441
|
+
return "message: string expected";
|
|
2442
|
+
return null;
|
|
2443
|
+
};
|
|
2444
|
+
|
|
2445
|
+
/**
|
|
2446
|
+
* Creates an ErrorMessage message from a plain object. Also converts values to their respective internal types.
|
|
2447
|
+
* @function fromObject
|
|
2448
|
+
* @memberof DownstreamMessage.AckMessage.ErrorMessage
|
|
2449
|
+
* @static
|
|
2450
|
+
* @param {Object.<string,*>} object Plain object
|
|
2451
|
+
* @returns {DownstreamMessage.AckMessage.ErrorMessage} ErrorMessage
|
|
2452
|
+
*/
|
|
2453
|
+
ErrorMessage.fromObject = function fromObject(object) {
|
|
2454
|
+
if (object instanceof $root.DownstreamMessage.AckMessage.ErrorMessage)
|
|
2455
|
+
return object;
|
|
2456
|
+
let message = new $root.DownstreamMessage.AckMessage.ErrorMessage();
|
|
2457
|
+
if (object.name != null)
|
|
2458
|
+
message.name = String(object.name);
|
|
2459
|
+
if (object.message != null)
|
|
2460
|
+
message.message = String(object.message);
|
|
2461
|
+
return message;
|
|
2462
|
+
};
|
|
2463
|
+
|
|
2464
|
+
/**
|
|
2465
|
+
* Creates a plain object from an ErrorMessage message. Also converts values to other types if specified.
|
|
2466
|
+
* @function toObject
|
|
2467
|
+
* @memberof DownstreamMessage.AckMessage.ErrorMessage
|
|
2468
|
+
* @static
|
|
2469
|
+
* @param {DownstreamMessage.AckMessage.ErrorMessage} message ErrorMessage
|
|
2470
|
+
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
2471
|
+
* @returns {Object.<string,*>} Plain object
|
|
2472
|
+
*/
|
|
2473
|
+
ErrorMessage.toObject = function toObject(message, options) {
|
|
2474
|
+
if (!options)
|
|
2475
|
+
options = {};
|
|
2476
|
+
let object = {};
|
|
2477
|
+
if (options.defaults) {
|
|
2478
|
+
object.name = "";
|
|
2479
|
+
object.message = "";
|
|
2480
|
+
}
|
|
2481
|
+
if (message.name != null && message.hasOwnProperty("name"))
|
|
2482
|
+
object.name = message.name;
|
|
2483
|
+
if (message.message != null && message.hasOwnProperty("message"))
|
|
2484
|
+
object.message = message.message;
|
|
2485
|
+
return object;
|
|
2486
|
+
};
|
|
2487
|
+
|
|
2488
|
+
/**
|
|
2489
|
+
* Converts this ErrorMessage to JSON.
|
|
2490
|
+
* @function toJSON
|
|
2491
|
+
* @memberof DownstreamMessage.AckMessage.ErrorMessage
|
|
2492
|
+
* @instance
|
|
2493
|
+
* @returns {Object.<string,*>} JSON object
|
|
2494
|
+
*/
|
|
2495
|
+
ErrorMessage.prototype.toJSON = function toJSON() {
|
|
2496
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
2497
|
+
};
|
|
2498
|
+
|
|
2499
|
+
/**
|
|
2500
|
+
* Gets the default type url for ErrorMessage
|
|
2501
|
+
* @function getTypeUrl
|
|
2502
|
+
* @memberof DownstreamMessage.AckMessage.ErrorMessage
|
|
2503
|
+
* @static
|
|
2504
|
+
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
|
2505
|
+
* @returns {string} The default type url
|
|
2506
|
+
*/
|
|
2507
|
+
ErrorMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
2508
|
+
if (typeUrlPrefix === undefined) {
|
|
2509
|
+
typeUrlPrefix = "type.googleapis.com";
|
|
2510
|
+
}
|
|
2511
|
+
return typeUrlPrefix + "/DownstreamMessage.AckMessage.ErrorMessage";
|
|
2512
|
+
};
|
|
2513
|
+
|
|
2514
|
+
return ErrorMessage;
|
|
2515
|
+
})();
|
|
2516
|
+
|
|
2517
|
+
return AckMessage;
|
|
2518
|
+
})();
|
|
2519
|
+
|
|
2520
|
+
DownstreamMessage.DataMessage = (function() {
|
|
2521
|
+
|
|
2522
|
+
/**
|
|
2523
|
+
* Properties of a DataMessage.
|
|
2524
|
+
* @memberof DownstreamMessage
|
|
2525
|
+
* @interface IDataMessage
|
|
2526
|
+
* @property {string|null} [from] DataMessage from
|
|
2527
|
+
* @property {string|null} [group] DataMessage group
|
|
2528
|
+
* @property {IMessageData|null} [data] DataMessage data
|
|
2529
|
+
* @property {number|Long|null} [sequenceId] DataMessage sequenceId
|
|
2530
|
+
*/
|
|
2531
|
+
|
|
2532
|
+
/**
|
|
2533
|
+
* Constructs a new DataMessage.
|
|
2534
|
+
* @memberof DownstreamMessage
|
|
2535
|
+
* @classdesc Represents a DataMessage.
|
|
2536
|
+
* @implements IDataMessage
|
|
2537
|
+
* @constructor
|
|
2538
|
+
* @param {DownstreamMessage.IDataMessage=} [properties] Properties to set
|
|
2539
|
+
*/
|
|
2540
|
+
function DataMessage(properties) {
|
|
2541
|
+
if (properties)
|
|
2542
|
+
for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
2543
|
+
if (properties[keys[i]] != null)
|
|
2544
|
+
this[keys[i]] = properties[keys[i]];
|
|
2545
|
+
}
|
|
2546
|
+
|
|
2547
|
+
/**
|
|
2548
|
+
* DataMessage from.
|
|
2549
|
+
* @member {string} from
|
|
2550
|
+
* @memberof DownstreamMessage.DataMessage
|
|
2551
|
+
* @instance
|
|
2552
|
+
*/
|
|
2553
|
+
DataMessage.prototype.from = "";
|
|
2554
|
+
|
|
2555
|
+
/**
|
|
2556
|
+
* DataMessage group.
|
|
2557
|
+
* @member {string|null|undefined} group
|
|
2558
|
+
* @memberof DownstreamMessage.DataMessage
|
|
2559
|
+
* @instance
|
|
2560
|
+
*/
|
|
2561
|
+
DataMessage.prototype.group = null;
|
|
2562
|
+
|
|
2563
|
+
/**
|
|
2564
|
+
* DataMessage data.
|
|
2565
|
+
* @member {IMessageData|null|undefined} data
|
|
2566
|
+
* @memberof DownstreamMessage.DataMessage
|
|
2567
|
+
* @instance
|
|
2568
|
+
*/
|
|
2569
|
+
DataMessage.prototype.data = null;
|
|
2570
|
+
|
|
2571
|
+
/**
|
|
2572
|
+
* DataMessage sequenceId.
|
|
2573
|
+
* @member {number|Long|null|undefined} sequenceId
|
|
2574
|
+
* @memberof DownstreamMessage.DataMessage
|
|
2575
|
+
* @instance
|
|
2576
|
+
*/
|
|
2577
|
+
DataMessage.prototype.sequenceId = null;
|
|
2578
|
+
|
|
2579
|
+
// OneOf field names bound to virtual getters and setters
|
|
2580
|
+
let $oneOfFields;
|
|
2581
|
+
|
|
2582
|
+
/**
|
|
2583
|
+
* DataMessage _group.
|
|
2584
|
+
* @member {"group"|undefined} _group
|
|
2585
|
+
* @memberof DownstreamMessage.DataMessage
|
|
2586
|
+
* @instance
|
|
2587
|
+
*/
|
|
2588
|
+
Object.defineProperty(DataMessage.prototype, "_group", {
|
|
2589
|
+
get: $util.oneOfGetter($oneOfFields = ["group"]),
|
|
2590
|
+
set: $util.oneOfSetter($oneOfFields)
|
|
2591
|
+
});
|
|
2592
|
+
|
|
2593
|
+
/**
|
|
2594
|
+
* DataMessage _sequenceId.
|
|
2595
|
+
* @member {"sequenceId"|undefined} _sequenceId
|
|
2596
|
+
* @memberof DownstreamMessage.DataMessage
|
|
2597
|
+
* @instance
|
|
2598
|
+
*/
|
|
2599
|
+
Object.defineProperty(DataMessage.prototype, "_sequenceId", {
|
|
2600
|
+
get: $util.oneOfGetter($oneOfFields = ["sequenceId"]),
|
|
2601
|
+
set: $util.oneOfSetter($oneOfFields)
|
|
2602
|
+
});
|
|
2603
|
+
|
|
2604
|
+
/**
|
|
2605
|
+
* Creates a new DataMessage instance using the specified properties.
|
|
2606
|
+
* @function create
|
|
2607
|
+
* @memberof DownstreamMessage.DataMessage
|
|
2608
|
+
* @static
|
|
2609
|
+
* @param {DownstreamMessage.IDataMessage=} [properties] Properties to set
|
|
2610
|
+
* @returns {DownstreamMessage.DataMessage} DataMessage instance
|
|
2611
|
+
*/
|
|
2612
|
+
DataMessage.create = function create(properties) {
|
|
2613
|
+
return new DataMessage(properties);
|
|
2614
|
+
};
|
|
2615
|
+
|
|
2616
|
+
/**
|
|
2617
|
+
* Encodes the specified DataMessage message. Does not implicitly {@link DownstreamMessage.DataMessage.verify|verify} messages.
|
|
2618
|
+
* @function encode
|
|
2619
|
+
* @memberof DownstreamMessage.DataMessage
|
|
2620
|
+
* @static
|
|
2621
|
+
* @param {DownstreamMessage.IDataMessage} message DataMessage message or plain object to encode
|
|
2622
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
2623
|
+
* @returns {$protobuf.Writer} Writer
|
|
2624
|
+
*/
|
|
2625
|
+
DataMessage.encode = function encode(message, writer) {
|
|
2626
|
+
if (!writer)
|
|
2627
|
+
writer = $Writer.create();
|
|
2628
|
+
if (message.from != null && Object.hasOwnProperty.call(message, "from"))
|
|
2629
|
+
writer.uint32(/* id 1, wireType 2 =*/10).string(message.from);
|
|
2630
|
+
if (message.group != null && Object.hasOwnProperty.call(message, "group"))
|
|
2631
|
+
writer.uint32(/* id 2, wireType 2 =*/18).string(message.group);
|
|
2632
|
+
if (message.data != null && Object.hasOwnProperty.call(message, "data"))
|
|
2633
|
+
$root.MessageData.encode(message.data, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
|
|
2634
|
+
if (message.sequenceId != null && Object.hasOwnProperty.call(message, "sequenceId"))
|
|
2635
|
+
writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.sequenceId);
|
|
2636
|
+
return writer;
|
|
2637
|
+
};
|
|
2638
|
+
|
|
2639
|
+
/**
|
|
2640
|
+
* Encodes the specified DataMessage message, length delimited. Does not implicitly {@link DownstreamMessage.DataMessage.verify|verify} messages.
|
|
2641
|
+
* @function encodeDelimited
|
|
2642
|
+
* @memberof DownstreamMessage.DataMessage
|
|
2643
|
+
* @static
|
|
2644
|
+
* @param {DownstreamMessage.IDataMessage} message DataMessage message or plain object to encode
|
|
2645
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
2646
|
+
* @returns {$protobuf.Writer} Writer
|
|
2647
|
+
*/
|
|
2648
|
+
DataMessage.encodeDelimited = function encodeDelimited(message, writer) {
|
|
2649
|
+
return this.encode(message, writer).ldelim();
|
|
2650
|
+
};
|
|
2651
|
+
|
|
2652
|
+
/**
|
|
2653
|
+
* Decodes a DataMessage message from the specified reader or buffer.
|
|
2654
|
+
* @function decode
|
|
2655
|
+
* @memberof DownstreamMessage.DataMessage
|
|
2656
|
+
* @static
|
|
2657
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
2658
|
+
* @param {number} [length] Message length if known beforehand
|
|
2659
|
+
* @returns {DownstreamMessage.DataMessage} DataMessage
|
|
2660
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
2661
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
2662
|
+
*/
|
|
2663
|
+
DataMessage.decode = function decode(reader, length) {
|
|
2664
|
+
if (!(reader instanceof $Reader))
|
|
2665
|
+
reader = $Reader.create(reader);
|
|
2666
|
+
let end = length === undefined ? reader.len : reader.pos + length, message = new $root.DownstreamMessage.DataMessage();
|
|
2667
|
+
while (reader.pos < end) {
|
|
2668
|
+
let tag = reader.uint32();
|
|
2669
|
+
switch (tag >>> 3) {
|
|
2670
|
+
case 1: {
|
|
2671
|
+
message.from = reader.string();
|
|
2672
|
+
break;
|
|
2673
|
+
}
|
|
2674
|
+
case 2: {
|
|
2675
|
+
message.group = reader.string();
|
|
2676
|
+
break;
|
|
2677
|
+
}
|
|
2678
|
+
case 3: {
|
|
2679
|
+
message.data = $root.MessageData.decode(reader, reader.uint32());
|
|
2680
|
+
break;
|
|
2681
|
+
}
|
|
2682
|
+
case 4: {
|
|
2683
|
+
message.sequenceId = reader.uint64();
|
|
2684
|
+
break;
|
|
2685
|
+
}
|
|
2686
|
+
default:
|
|
2687
|
+
reader.skipType(tag & 7);
|
|
2688
|
+
break;
|
|
2689
|
+
}
|
|
2690
|
+
}
|
|
2691
|
+
return message;
|
|
2692
|
+
};
|
|
2693
|
+
|
|
2694
|
+
/**
|
|
2695
|
+
* Decodes a DataMessage message from the specified reader or buffer, length delimited.
|
|
2696
|
+
* @function decodeDelimited
|
|
2697
|
+
* @memberof DownstreamMessage.DataMessage
|
|
2698
|
+
* @static
|
|
2699
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
2700
|
+
* @returns {DownstreamMessage.DataMessage} DataMessage
|
|
2701
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
2702
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
2703
|
+
*/
|
|
2704
|
+
DataMessage.decodeDelimited = function decodeDelimited(reader) {
|
|
2705
|
+
if (!(reader instanceof $Reader))
|
|
2706
|
+
reader = new $Reader(reader);
|
|
2707
|
+
return this.decode(reader, reader.uint32());
|
|
2708
|
+
};
|
|
2709
|
+
|
|
2710
|
+
/**
|
|
2711
|
+
* Verifies a DataMessage message.
|
|
2712
|
+
* @function verify
|
|
2713
|
+
* @memberof DownstreamMessage.DataMessage
|
|
2714
|
+
* @static
|
|
2715
|
+
* @param {Object.<string,*>} message Plain object to verify
|
|
2716
|
+
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
2717
|
+
*/
|
|
2718
|
+
DataMessage.verify = function verify(message) {
|
|
2719
|
+
if (typeof message !== "object" || message === null)
|
|
2720
|
+
return "object expected";
|
|
2721
|
+
let properties = {};
|
|
2722
|
+
if (message.from != null && message.hasOwnProperty("from"))
|
|
2723
|
+
if (!$util.isString(message.from))
|
|
2724
|
+
return "from: string expected";
|
|
2725
|
+
if (message.group != null && message.hasOwnProperty("group")) {
|
|
2726
|
+
properties._group = 1;
|
|
2727
|
+
if (!$util.isString(message.group))
|
|
2728
|
+
return "group: string expected";
|
|
2729
|
+
}
|
|
2730
|
+
if (message.data != null && message.hasOwnProperty("data")) {
|
|
2731
|
+
let error = $root.MessageData.verify(message.data);
|
|
2732
|
+
if (error)
|
|
2733
|
+
return "data." + error;
|
|
2734
|
+
}
|
|
2735
|
+
if (message.sequenceId != null && message.hasOwnProperty("sequenceId")) {
|
|
2736
|
+
properties._sequenceId = 1;
|
|
2737
|
+
if (!$util.isInteger(message.sequenceId) && !(message.sequenceId && $util.isInteger(message.sequenceId.low) && $util.isInteger(message.sequenceId.high)))
|
|
2738
|
+
return "sequenceId: integer|Long expected";
|
|
2739
|
+
}
|
|
2740
|
+
return null;
|
|
2741
|
+
};
|
|
2742
|
+
|
|
2743
|
+
/**
|
|
2744
|
+
* Creates a DataMessage message from a plain object. Also converts values to their respective internal types.
|
|
2745
|
+
* @function fromObject
|
|
2746
|
+
* @memberof DownstreamMessage.DataMessage
|
|
2747
|
+
* @static
|
|
2748
|
+
* @param {Object.<string,*>} object Plain object
|
|
2749
|
+
* @returns {DownstreamMessage.DataMessage} DataMessage
|
|
2750
|
+
*/
|
|
2751
|
+
DataMessage.fromObject = function fromObject(object) {
|
|
2752
|
+
if (object instanceof $root.DownstreamMessage.DataMessage)
|
|
2753
|
+
return object;
|
|
2754
|
+
let message = new $root.DownstreamMessage.DataMessage();
|
|
2755
|
+
if (object.from != null)
|
|
2756
|
+
message.from = String(object.from);
|
|
2757
|
+
if (object.group != null)
|
|
2758
|
+
message.group = String(object.group);
|
|
2759
|
+
if (object.data != null) {
|
|
2760
|
+
if (typeof object.data !== "object")
|
|
2761
|
+
throw TypeError(".DownstreamMessage.DataMessage.data: object expected");
|
|
2762
|
+
message.data = $root.MessageData.fromObject(object.data);
|
|
2763
|
+
}
|
|
2764
|
+
if (object.sequenceId != null)
|
|
2765
|
+
if ($util.Long)
|
|
2766
|
+
(message.sequenceId = $util.Long.fromValue(object.sequenceId)).unsigned = true;
|
|
2767
|
+
else if (typeof object.sequenceId === "string")
|
|
2768
|
+
message.sequenceId = parseInt(object.sequenceId, 10);
|
|
2769
|
+
else if (typeof object.sequenceId === "number")
|
|
2770
|
+
message.sequenceId = object.sequenceId;
|
|
2771
|
+
else if (typeof object.sequenceId === "object")
|
|
2772
|
+
message.sequenceId = new $util.LongBits(object.sequenceId.low >>> 0, object.sequenceId.high >>> 0).toNumber(true);
|
|
2773
|
+
return message;
|
|
2774
|
+
};
|
|
2775
|
+
|
|
2776
|
+
/**
|
|
2777
|
+
* Creates a plain object from a DataMessage message. Also converts values to other types if specified.
|
|
2778
|
+
* @function toObject
|
|
2779
|
+
* @memberof DownstreamMessage.DataMessage
|
|
2780
|
+
* @static
|
|
2781
|
+
* @param {DownstreamMessage.DataMessage} message DataMessage
|
|
2782
|
+
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
2783
|
+
* @returns {Object.<string,*>} Plain object
|
|
2784
|
+
*/
|
|
2785
|
+
DataMessage.toObject = function toObject(message, options) {
|
|
2786
|
+
if (!options)
|
|
2787
|
+
options = {};
|
|
2788
|
+
let object = {};
|
|
2789
|
+
if (options.defaults) {
|
|
2790
|
+
object.from = "";
|
|
2791
|
+
object.data = null;
|
|
2792
|
+
}
|
|
2793
|
+
if (message.from != null && message.hasOwnProperty("from"))
|
|
2794
|
+
object.from = message.from;
|
|
2795
|
+
if (message.group != null && message.hasOwnProperty("group")) {
|
|
2796
|
+
object.group = message.group;
|
|
2797
|
+
if (options.oneofs)
|
|
2798
|
+
object._group = "group";
|
|
2799
|
+
}
|
|
2800
|
+
if (message.data != null && message.hasOwnProperty("data"))
|
|
2801
|
+
object.data = $root.MessageData.toObject(message.data, options);
|
|
2802
|
+
if (message.sequenceId != null && message.hasOwnProperty("sequenceId")) {
|
|
2803
|
+
if (typeof message.sequenceId === "number")
|
|
2804
|
+
object.sequenceId = options.longs === String ? String(message.sequenceId) : message.sequenceId;
|
|
2805
|
+
else
|
|
2806
|
+
object.sequenceId = options.longs === String ? $util.Long.prototype.toString.call(message.sequenceId) : options.longs === Number ? new $util.LongBits(message.sequenceId.low >>> 0, message.sequenceId.high >>> 0).toNumber(true) : message.sequenceId;
|
|
2807
|
+
if (options.oneofs)
|
|
2808
|
+
object._sequenceId = "sequenceId";
|
|
2809
|
+
}
|
|
2810
|
+
return object;
|
|
2811
|
+
};
|
|
2812
|
+
|
|
2813
|
+
/**
|
|
2814
|
+
* Converts this DataMessage to JSON.
|
|
2815
|
+
* @function toJSON
|
|
2816
|
+
* @memberof DownstreamMessage.DataMessage
|
|
2817
|
+
* @instance
|
|
2818
|
+
* @returns {Object.<string,*>} JSON object
|
|
2819
|
+
*/
|
|
2820
|
+
DataMessage.prototype.toJSON = function toJSON() {
|
|
2821
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
2822
|
+
};
|
|
2823
|
+
|
|
2824
|
+
/**
|
|
2825
|
+
* Gets the default type url for DataMessage
|
|
2826
|
+
* @function getTypeUrl
|
|
2827
|
+
* @memberof DownstreamMessage.DataMessage
|
|
2828
|
+
* @static
|
|
2829
|
+
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
|
2830
|
+
* @returns {string} The default type url
|
|
2831
|
+
*/
|
|
2832
|
+
DataMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
2833
|
+
if (typeUrlPrefix === undefined) {
|
|
2834
|
+
typeUrlPrefix = "type.googleapis.com";
|
|
2835
|
+
}
|
|
2836
|
+
return typeUrlPrefix + "/DownstreamMessage.DataMessage";
|
|
2837
|
+
};
|
|
2838
|
+
|
|
2839
|
+
return DataMessage;
|
|
2840
|
+
})();
|
|
2841
|
+
|
|
2842
|
+
DownstreamMessage.SystemMessage = (function() {
|
|
2843
|
+
|
|
2844
|
+
/**
|
|
2845
|
+
* Properties of a SystemMessage.
|
|
2846
|
+
* @memberof DownstreamMessage
|
|
2847
|
+
* @interface ISystemMessage
|
|
2848
|
+
* @property {DownstreamMessage.SystemMessage.IConnectedMessage|null} [connectedMessage] SystemMessage connectedMessage
|
|
2849
|
+
* @property {DownstreamMessage.SystemMessage.IDisconnectedMessage|null} [disconnectedMessage] SystemMessage disconnectedMessage
|
|
2850
|
+
*/
|
|
2851
|
+
|
|
2852
|
+
/**
|
|
2853
|
+
* Constructs a new SystemMessage.
|
|
2854
|
+
* @memberof DownstreamMessage
|
|
2855
|
+
* @classdesc Represents a SystemMessage.
|
|
2856
|
+
* @implements ISystemMessage
|
|
2857
|
+
* @constructor
|
|
2858
|
+
* @param {DownstreamMessage.ISystemMessage=} [properties] Properties to set
|
|
2859
|
+
*/
|
|
2860
|
+
function SystemMessage(properties) {
|
|
2861
|
+
if (properties)
|
|
2862
|
+
for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
2863
|
+
if (properties[keys[i]] != null)
|
|
2864
|
+
this[keys[i]] = properties[keys[i]];
|
|
2865
|
+
}
|
|
2866
|
+
|
|
2867
|
+
/**
|
|
2868
|
+
* SystemMessage connectedMessage.
|
|
2869
|
+
* @member {DownstreamMessage.SystemMessage.IConnectedMessage|null|undefined} connectedMessage
|
|
2870
|
+
* @memberof DownstreamMessage.SystemMessage
|
|
2871
|
+
* @instance
|
|
2872
|
+
*/
|
|
2873
|
+
SystemMessage.prototype.connectedMessage = null;
|
|
2874
|
+
|
|
2875
|
+
/**
|
|
2876
|
+
* SystemMessage disconnectedMessage.
|
|
2877
|
+
* @member {DownstreamMessage.SystemMessage.IDisconnectedMessage|null|undefined} disconnectedMessage
|
|
2878
|
+
* @memberof DownstreamMessage.SystemMessage
|
|
2879
|
+
* @instance
|
|
2880
|
+
*/
|
|
2881
|
+
SystemMessage.prototype.disconnectedMessage = null;
|
|
2882
|
+
|
|
2883
|
+
// OneOf field names bound to virtual getters and setters
|
|
2884
|
+
let $oneOfFields;
|
|
2885
|
+
|
|
2886
|
+
/**
|
|
2887
|
+
* SystemMessage message.
|
|
2888
|
+
* @member {"connectedMessage"|"disconnectedMessage"|undefined} message
|
|
2889
|
+
* @memberof DownstreamMessage.SystemMessage
|
|
2890
|
+
* @instance
|
|
2891
|
+
*/
|
|
2892
|
+
Object.defineProperty(SystemMessage.prototype, "message", {
|
|
2893
|
+
get: $util.oneOfGetter($oneOfFields = ["connectedMessage", "disconnectedMessage"]),
|
|
2894
|
+
set: $util.oneOfSetter($oneOfFields)
|
|
2895
|
+
});
|
|
2896
|
+
|
|
2897
|
+
/**
|
|
2898
|
+
* Creates a new SystemMessage instance using the specified properties.
|
|
2899
|
+
* @function create
|
|
2900
|
+
* @memberof DownstreamMessage.SystemMessage
|
|
2901
|
+
* @static
|
|
2902
|
+
* @param {DownstreamMessage.ISystemMessage=} [properties] Properties to set
|
|
2903
|
+
* @returns {DownstreamMessage.SystemMessage} SystemMessage instance
|
|
2904
|
+
*/
|
|
2905
|
+
SystemMessage.create = function create(properties) {
|
|
2906
|
+
return new SystemMessage(properties);
|
|
2907
|
+
};
|
|
2908
|
+
|
|
2909
|
+
/**
|
|
2910
|
+
* Encodes the specified SystemMessage message. Does not implicitly {@link DownstreamMessage.SystemMessage.verify|verify} messages.
|
|
2911
|
+
* @function encode
|
|
2912
|
+
* @memberof DownstreamMessage.SystemMessage
|
|
2913
|
+
* @static
|
|
2914
|
+
* @param {DownstreamMessage.ISystemMessage} message SystemMessage message or plain object to encode
|
|
2915
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
2916
|
+
* @returns {$protobuf.Writer} Writer
|
|
2917
|
+
*/
|
|
2918
|
+
SystemMessage.encode = function encode(message, writer) {
|
|
2919
|
+
if (!writer)
|
|
2920
|
+
writer = $Writer.create();
|
|
2921
|
+
if (message.connectedMessage != null && Object.hasOwnProperty.call(message, "connectedMessage"))
|
|
2922
|
+
$root.DownstreamMessage.SystemMessage.ConnectedMessage.encode(message.connectedMessage, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
|
|
2923
|
+
if (message.disconnectedMessage != null && Object.hasOwnProperty.call(message, "disconnectedMessage"))
|
|
2924
|
+
$root.DownstreamMessage.SystemMessage.DisconnectedMessage.encode(message.disconnectedMessage, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
|
|
2925
|
+
return writer;
|
|
2926
|
+
};
|
|
2927
|
+
|
|
2928
|
+
/**
|
|
2929
|
+
* Encodes the specified SystemMessage message, length delimited. Does not implicitly {@link DownstreamMessage.SystemMessage.verify|verify} messages.
|
|
2930
|
+
* @function encodeDelimited
|
|
2931
|
+
* @memberof DownstreamMessage.SystemMessage
|
|
2932
|
+
* @static
|
|
2933
|
+
* @param {DownstreamMessage.ISystemMessage} message SystemMessage message or plain object to encode
|
|
2934
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
2935
|
+
* @returns {$protobuf.Writer} Writer
|
|
2936
|
+
*/
|
|
2937
|
+
SystemMessage.encodeDelimited = function encodeDelimited(message, writer) {
|
|
2938
|
+
return this.encode(message, writer).ldelim();
|
|
2939
|
+
};
|
|
2940
|
+
|
|
2941
|
+
/**
|
|
2942
|
+
* Decodes a SystemMessage message from the specified reader or buffer.
|
|
2943
|
+
* @function decode
|
|
2944
|
+
* @memberof DownstreamMessage.SystemMessage
|
|
2945
|
+
* @static
|
|
2946
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
2947
|
+
* @param {number} [length] Message length if known beforehand
|
|
2948
|
+
* @returns {DownstreamMessage.SystemMessage} SystemMessage
|
|
2949
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
2950
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
2951
|
+
*/
|
|
2952
|
+
SystemMessage.decode = function decode(reader, length) {
|
|
2953
|
+
if (!(reader instanceof $Reader))
|
|
2954
|
+
reader = $Reader.create(reader);
|
|
2955
|
+
let end = length === undefined ? reader.len : reader.pos + length, message = new $root.DownstreamMessage.SystemMessage();
|
|
2956
|
+
while (reader.pos < end) {
|
|
2957
|
+
let tag = reader.uint32();
|
|
2958
|
+
switch (tag >>> 3) {
|
|
2959
|
+
case 1: {
|
|
2960
|
+
message.connectedMessage = $root.DownstreamMessage.SystemMessage.ConnectedMessage.decode(reader, reader.uint32());
|
|
2961
|
+
break;
|
|
2962
|
+
}
|
|
2963
|
+
case 2: {
|
|
2964
|
+
message.disconnectedMessage = $root.DownstreamMessage.SystemMessage.DisconnectedMessage.decode(reader, reader.uint32());
|
|
2965
|
+
break;
|
|
2966
|
+
}
|
|
2967
|
+
default:
|
|
2968
|
+
reader.skipType(tag & 7);
|
|
2969
|
+
break;
|
|
2970
|
+
}
|
|
2971
|
+
}
|
|
2972
|
+
return message;
|
|
2973
|
+
};
|
|
2974
|
+
|
|
2975
|
+
/**
|
|
2976
|
+
* Decodes a SystemMessage message from the specified reader or buffer, length delimited.
|
|
2977
|
+
* @function decodeDelimited
|
|
2978
|
+
* @memberof DownstreamMessage.SystemMessage
|
|
2979
|
+
* @static
|
|
2980
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
2981
|
+
* @returns {DownstreamMessage.SystemMessage} SystemMessage
|
|
2982
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
2983
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
2984
|
+
*/
|
|
2985
|
+
SystemMessage.decodeDelimited = function decodeDelimited(reader) {
|
|
2986
|
+
if (!(reader instanceof $Reader))
|
|
2987
|
+
reader = new $Reader(reader);
|
|
2988
|
+
return this.decode(reader, reader.uint32());
|
|
2989
|
+
};
|
|
2990
|
+
|
|
2991
|
+
/**
|
|
2992
|
+
* Verifies a SystemMessage message.
|
|
2993
|
+
* @function verify
|
|
2994
|
+
* @memberof DownstreamMessage.SystemMessage
|
|
2995
|
+
* @static
|
|
2996
|
+
* @param {Object.<string,*>} message Plain object to verify
|
|
2997
|
+
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
2998
|
+
*/
|
|
2999
|
+
SystemMessage.verify = function verify(message) {
|
|
3000
|
+
if (typeof message !== "object" || message === null)
|
|
3001
|
+
return "object expected";
|
|
3002
|
+
let properties = {};
|
|
3003
|
+
if (message.connectedMessage != null && message.hasOwnProperty("connectedMessage")) {
|
|
3004
|
+
properties.message = 1;
|
|
3005
|
+
{
|
|
3006
|
+
let error = $root.DownstreamMessage.SystemMessage.ConnectedMessage.verify(message.connectedMessage);
|
|
3007
|
+
if (error)
|
|
3008
|
+
return "connectedMessage." + error;
|
|
3009
|
+
}
|
|
3010
|
+
}
|
|
3011
|
+
if (message.disconnectedMessage != null && message.hasOwnProperty("disconnectedMessage")) {
|
|
3012
|
+
if (properties.message === 1)
|
|
3013
|
+
return "message: multiple values";
|
|
3014
|
+
properties.message = 1;
|
|
3015
|
+
{
|
|
3016
|
+
let error = $root.DownstreamMessage.SystemMessage.DisconnectedMessage.verify(message.disconnectedMessage);
|
|
3017
|
+
if (error)
|
|
3018
|
+
return "disconnectedMessage." + error;
|
|
3019
|
+
}
|
|
3020
|
+
}
|
|
3021
|
+
return null;
|
|
3022
|
+
};
|
|
3023
|
+
|
|
3024
|
+
/**
|
|
3025
|
+
* Creates a SystemMessage message from a plain object. Also converts values to their respective internal types.
|
|
3026
|
+
* @function fromObject
|
|
3027
|
+
* @memberof DownstreamMessage.SystemMessage
|
|
3028
|
+
* @static
|
|
3029
|
+
* @param {Object.<string,*>} object Plain object
|
|
3030
|
+
* @returns {DownstreamMessage.SystemMessage} SystemMessage
|
|
3031
|
+
*/
|
|
3032
|
+
SystemMessage.fromObject = function fromObject(object) {
|
|
3033
|
+
if (object instanceof $root.DownstreamMessage.SystemMessage)
|
|
3034
|
+
return object;
|
|
3035
|
+
let message = new $root.DownstreamMessage.SystemMessage();
|
|
3036
|
+
if (object.connectedMessage != null) {
|
|
3037
|
+
if (typeof object.connectedMessage !== "object")
|
|
3038
|
+
throw TypeError(".DownstreamMessage.SystemMessage.connectedMessage: object expected");
|
|
3039
|
+
message.connectedMessage = $root.DownstreamMessage.SystemMessage.ConnectedMessage.fromObject(object.connectedMessage);
|
|
3040
|
+
}
|
|
3041
|
+
if (object.disconnectedMessage != null) {
|
|
3042
|
+
if (typeof object.disconnectedMessage !== "object")
|
|
3043
|
+
throw TypeError(".DownstreamMessage.SystemMessage.disconnectedMessage: object expected");
|
|
3044
|
+
message.disconnectedMessage = $root.DownstreamMessage.SystemMessage.DisconnectedMessage.fromObject(object.disconnectedMessage);
|
|
3045
|
+
}
|
|
3046
|
+
return message;
|
|
3047
|
+
};
|
|
3048
|
+
|
|
3049
|
+
/**
|
|
3050
|
+
* Creates a plain object from a SystemMessage message. Also converts values to other types if specified.
|
|
3051
|
+
* @function toObject
|
|
3052
|
+
* @memberof DownstreamMessage.SystemMessage
|
|
3053
|
+
* @static
|
|
3054
|
+
* @param {DownstreamMessage.SystemMessage} message SystemMessage
|
|
3055
|
+
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
3056
|
+
* @returns {Object.<string,*>} Plain object
|
|
3057
|
+
*/
|
|
3058
|
+
SystemMessage.toObject = function toObject(message, options) {
|
|
3059
|
+
if (!options)
|
|
3060
|
+
options = {};
|
|
3061
|
+
let object = {};
|
|
3062
|
+
if (message.connectedMessage != null && message.hasOwnProperty("connectedMessage")) {
|
|
3063
|
+
object.connectedMessage = $root.DownstreamMessage.SystemMessage.ConnectedMessage.toObject(message.connectedMessage, options);
|
|
3064
|
+
if (options.oneofs)
|
|
3065
|
+
object.message = "connectedMessage";
|
|
3066
|
+
}
|
|
3067
|
+
if (message.disconnectedMessage != null && message.hasOwnProperty("disconnectedMessage")) {
|
|
3068
|
+
object.disconnectedMessage = $root.DownstreamMessage.SystemMessage.DisconnectedMessage.toObject(message.disconnectedMessage, options);
|
|
3069
|
+
if (options.oneofs)
|
|
3070
|
+
object.message = "disconnectedMessage";
|
|
3071
|
+
}
|
|
3072
|
+
return object;
|
|
3073
|
+
};
|
|
3074
|
+
|
|
3075
|
+
/**
|
|
3076
|
+
* Converts this SystemMessage to JSON.
|
|
3077
|
+
* @function toJSON
|
|
3078
|
+
* @memberof DownstreamMessage.SystemMessage
|
|
3079
|
+
* @instance
|
|
3080
|
+
* @returns {Object.<string,*>} JSON object
|
|
3081
|
+
*/
|
|
3082
|
+
SystemMessage.prototype.toJSON = function toJSON() {
|
|
3083
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
3084
|
+
};
|
|
3085
|
+
|
|
3086
|
+
/**
|
|
3087
|
+
* Gets the default type url for SystemMessage
|
|
3088
|
+
* @function getTypeUrl
|
|
3089
|
+
* @memberof DownstreamMessage.SystemMessage
|
|
3090
|
+
* @static
|
|
3091
|
+
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
|
3092
|
+
* @returns {string} The default type url
|
|
3093
|
+
*/
|
|
3094
|
+
SystemMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
3095
|
+
if (typeUrlPrefix === undefined) {
|
|
3096
|
+
typeUrlPrefix = "type.googleapis.com";
|
|
3097
|
+
}
|
|
3098
|
+
return typeUrlPrefix + "/DownstreamMessage.SystemMessage";
|
|
3099
|
+
};
|
|
3100
|
+
|
|
3101
|
+
SystemMessage.ConnectedMessage = (function() {
|
|
3102
|
+
|
|
3103
|
+
/**
|
|
3104
|
+
* Properties of a ConnectedMessage.
|
|
3105
|
+
* @memberof DownstreamMessage.SystemMessage
|
|
3106
|
+
* @interface IConnectedMessage
|
|
3107
|
+
* @property {string|null} [connectionId] ConnectedMessage connectionId
|
|
3108
|
+
* @property {string|null} [userId] ConnectedMessage userId
|
|
3109
|
+
* @property {string|null} [reconnectionToken] ConnectedMessage reconnectionToken
|
|
3110
|
+
*/
|
|
3111
|
+
|
|
3112
|
+
/**
|
|
3113
|
+
* Constructs a new ConnectedMessage.
|
|
3114
|
+
* @memberof DownstreamMessage.SystemMessage
|
|
3115
|
+
* @classdesc Represents a ConnectedMessage.
|
|
3116
|
+
* @implements IConnectedMessage
|
|
3117
|
+
* @constructor
|
|
3118
|
+
* @param {DownstreamMessage.SystemMessage.IConnectedMessage=} [properties] Properties to set
|
|
3119
|
+
*/
|
|
3120
|
+
function ConnectedMessage(properties) {
|
|
3121
|
+
if (properties)
|
|
3122
|
+
for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
3123
|
+
if (properties[keys[i]] != null)
|
|
3124
|
+
this[keys[i]] = properties[keys[i]];
|
|
3125
|
+
}
|
|
3126
|
+
|
|
3127
|
+
/**
|
|
3128
|
+
* ConnectedMessage connectionId.
|
|
3129
|
+
* @member {string} connectionId
|
|
3130
|
+
* @memberof DownstreamMessage.SystemMessage.ConnectedMessage
|
|
3131
|
+
* @instance
|
|
3132
|
+
*/
|
|
3133
|
+
ConnectedMessage.prototype.connectionId = "";
|
|
3134
|
+
|
|
3135
|
+
/**
|
|
3136
|
+
* ConnectedMessage userId.
|
|
3137
|
+
* @member {string} userId
|
|
3138
|
+
* @memberof DownstreamMessage.SystemMessage.ConnectedMessage
|
|
3139
|
+
* @instance
|
|
3140
|
+
*/
|
|
3141
|
+
ConnectedMessage.prototype.userId = "";
|
|
3142
|
+
|
|
3143
|
+
/**
|
|
3144
|
+
* ConnectedMessage reconnectionToken.
|
|
3145
|
+
* @member {string} reconnectionToken
|
|
3146
|
+
* @memberof DownstreamMessage.SystemMessage.ConnectedMessage
|
|
3147
|
+
* @instance
|
|
3148
|
+
*/
|
|
3149
|
+
ConnectedMessage.prototype.reconnectionToken = "";
|
|
3150
|
+
|
|
3151
|
+
/**
|
|
3152
|
+
* Creates a new ConnectedMessage instance using the specified properties.
|
|
3153
|
+
* @function create
|
|
3154
|
+
* @memberof DownstreamMessage.SystemMessage.ConnectedMessage
|
|
3155
|
+
* @static
|
|
3156
|
+
* @param {DownstreamMessage.SystemMessage.IConnectedMessage=} [properties] Properties to set
|
|
3157
|
+
* @returns {DownstreamMessage.SystemMessage.ConnectedMessage} ConnectedMessage instance
|
|
3158
|
+
*/
|
|
3159
|
+
ConnectedMessage.create = function create(properties) {
|
|
3160
|
+
return new ConnectedMessage(properties);
|
|
3161
|
+
};
|
|
3162
|
+
|
|
3163
|
+
/**
|
|
3164
|
+
* Encodes the specified ConnectedMessage message. Does not implicitly {@link DownstreamMessage.SystemMessage.ConnectedMessage.verify|verify} messages.
|
|
3165
|
+
* @function encode
|
|
3166
|
+
* @memberof DownstreamMessage.SystemMessage.ConnectedMessage
|
|
3167
|
+
* @static
|
|
3168
|
+
* @param {DownstreamMessage.SystemMessage.IConnectedMessage} message ConnectedMessage message or plain object to encode
|
|
3169
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
3170
|
+
* @returns {$protobuf.Writer} Writer
|
|
3171
|
+
*/
|
|
3172
|
+
ConnectedMessage.encode = function encode(message, writer) {
|
|
3173
|
+
if (!writer)
|
|
3174
|
+
writer = $Writer.create();
|
|
3175
|
+
if (message.connectionId != null && Object.hasOwnProperty.call(message, "connectionId"))
|
|
3176
|
+
writer.uint32(/* id 1, wireType 2 =*/10).string(message.connectionId);
|
|
3177
|
+
if (message.userId != null && Object.hasOwnProperty.call(message, "userId"))
|
|
3178
|
+
writer.uint32(/* id 2, wireType 2 =*/18).string(message.userId);
|
|
3179
|
+
if (message.reconnectionToken != null && Object.hasOwnProperty.call(message, "reconnectionToken"))
|
|
3180
|
+
writer.uint32(/* id 3, wireType 2 =*/26).string(message.reconnectionToken);
|
|
3181
|
+
return writer;
|
|
3182
|
+
};
|
|
3183
|
+
|
|
3184
|
+
/**
|
|
3185
|
+
* Encodes the specified ConnectedMessage message, length delimited. Does not implicitly {@link DownstreamMessage.SystemMessage.ConnectedMessage.verify|verify} messages.
|
|
3186
|
+
* @function encodeDelimited
|
|
3187
|
+
* @memberof DownstreamMessage.SystemMessage.ConnectedMessage
|
|
3188
|
+
* @static
|
|
3189
|
+
* @param {DownstreamMessage.SystemMessage.IConnectedMessage} message ConnectedMessage message or plain object to encode
|
|
3190
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
3191
|
+
* @returns {$protobuf.Writer} Writer
|
|
3192
|
+
*/
|
|
3193
|
+
ConnectedMessage.encodeDelimited = function encodeDelimited(message, writer) {
|
|
3194
|
+
return this.encode(message, writer).ldelim();
|
|
3195
|
+
};
|
|
3196
|
+
|
|
3197
|
+
/**
|
|
3198
|
+
* Decodes a ConnectedMessage message from the specified reader or buffer.
|
|
3199
|
+
* @function decode
|
|
3200
|
+
* @memberof DownstreamMessage.SystemMessage.ConnectedMessage
|
|
3201
|
+
* @static
|
|
3202
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
3203
|
+
* @param {number} [length] Message length if known beforehand
|
|
3204
|
+
* @returns {DownstreamMessage.SystemMessage.ConnectedMessage} ConnectedMessage
|
|
3205
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
3206
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
3207
|
+
*/
|
|
3208
|
+
ConnectedMessage.decode = function decode(reader, length) {
|
|
3209
|
+
if (!(reader instanceof $Reader))
|
|
3210
|
+
reader = $Reader.create(reader);
|
|
3211
|
+
let end = length === undefined ? reader.len : reader.pos + length, message = new $root.DownstreamMessage.SystemMessage.ConnectedMessage();
|
|
3212
|
+
while (reader.pos < end) {
|
|
3213
|
+
let tag = reader.uint32();
|
|
3214
|
+
switch (tag >>> 3) {
|
|
3215
|
+
case 1: {
|
|
3216
|
+
message.connectionId = reader.string();
|
|
3217
|
+
break;
|
|
3218
|
+
}
|
|
3219
|
+
case 2: {
|
|
3220
|
+
message.userId = reader.string();
|
|
3221
|
+
break;
|
|
3222
|
+
}
|
|
3223
|
+
case 3: {
|
|
3224
|
+
message.reconnectionToken = reader.string();
|
|
3225
|
+
break;
|
|
3226
|
+
}
|
|
3227
|
+
default:
|
|
3228
|
+
reader.skipType(tag & 7);
|
|
3229
|
+
break;
|
|
3230
|
+
}
|
|
3231
|
+
}
|
|
3232
|
+
return message;
|
|
3233
|
+
};
|
|
3234
|
+
|
|
3235
|
+
/**
|
|
3236
|
+
* Decodes a ConnectedMessage message from the specified reader or buffer, length delimited.
|
|
3237
|
+
* @function decodeDelimited
|
|
3238
|
+
* @memberof DownstreamMessage.SystemMessage.ConnectedMessage
|
|
3239
|
+
* @static
|
|
3240
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
3241
|
+
* @returns {DownstreamMessage.SystemMessage.ConnectedMessage} ConnectedMessage
|
|
3242
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
3243
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
3244
|
+
*/
|
|
3245
|
+
ConnectedMessage.decodeDelimited = function decodeDelimited(reader) {
|
|
3246
|
+
if (!(reader instanceof $Reader))
|
|
3247
|
+
reader = new $Reader(reader);
|
|
3248
|
+
return this.decode(reader, reader.uint32());
|
|
3249
|
+
};
|
|
3250
|
+
|
|
3251
|
+
/**
|
|
3252
|
+
* Verifies a ConnectedMessage message.
|
|
3253
|
+
* @function verify
|
|
3254
|
+
* @memberof DownstreamMessage.SystemMessage.ConnectedMessage
|
|
3255
|
+
* @static
|
|
3256
|
+
* @param {Object.<string,*>} message Plain object to verify
|
|
3257
|
+
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
3258
|
+
*/
|
|
3259
|
+
ConnectedMessage.verify = function verify(message) {
|
|
3260
|
+
if (typeof message !== "object" || message === null)
|
|
3261
|
+
return "object expected";
|
|
3262
|
+
if (message.connectionId != null && message.hasOwnProperty("connectionId"))
|
|
3263
|
+
if (!$util.isString(message.connectionId))
|
|
3264
|
+
return "connectionId: string expected";
|
|
3265
|
+
if (message.userId != null && message.hasOwnProperty("userId"))
|
|
3266
|
+
if (!$util.isString(message.userId))
|
|
3267
|
+
return "userId: string expected";
|
|
3268
|
+
if (message.reconnectionToken != null && message.hasOwnProperty("reconnectionToken"))
|
|
3269
|
+
if (!$util.isString(message.reconnectionToken))
|
|
3270
|
+
return "reconnectionToken: string expected";
|
|
3271
|
+
return null;
|
|
3272
|
+
};
|
|
3273
|
+
|
|
3274
|
+
/**
|
|
3275
|
+
* Creates a ConnectedMessage message from a plain object. Also converts values to their respective internal types.
|
|
3276
|
+
* @function fromObject
|
|
3277
|
+
* @memberof DownstreamMessage.SystemMessage.ConnectedMessage
|
|
3278
|
+
* @static
|
|
3279
|
+
* @param {Object.<string,*>} object Plain object
|
|
3280
|
+
* @returns {DownstreamMessage.SystemMessage.ConnectedMessage} ConnectedMessage
|
|
3281
|
+
*/
|
|
3282
|
+
ConnectedMessage.fromObject = function fromObject(object) {
|
|
3283
|
+
if (object instanceof $root.DownstreamMessage.SystemMessage.ConnectedMessage)
|
|
3284
|
+
return object;
|
|
3285
|
+
let message = new $root.DownstreamMessage.SystemMessage.ConnectedMessage();
|
|
3286
|
+
if (object.connectionId != null)
|
|
3287
|
+
message.connectionId = String(object.connectionId);
|
|
3288
|
+
if (object.userId != null)
|
|
3289
|
+
message.userId = String(object.userId);
|
|
3290
|
+
if (object.reconnectionToken != null)
|
|
3291
|
+
message.reconnectionToken = String(object.reconnectionToken);
|
|
3292
|
+
return message;
|
|
3293
|
+
};
|
|
3294
|
+
|
|
3295
|
+
/**
|
|
3296
|
+
* Creates a plain object from a ConnectedMessage message. Also converts values to other types if specified.
|
|
3297
|
+
* @function toObject
|
|
3298
|
+
* @memberof DownstreamMessage.SystemMessage.ConnectedMessage
|
|
3299
|
+
* @static
|
|
3300
|
+
* @param {DownstreamMessage.SystemMessage.ConnectedMessage} message ConnectedMessage
|
|
3301
|
+
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
3302
|
+
* @returns {Object.<string,*>} Plain object
|
|
3303
|
+
*/
|
|
3304
|
+
ConnectedMessage.toObject = function toObject(message, options) {
|
|
3305
|
+
if (!options)
|
|
3306
|
+
options = {};
|
|
3307
|
+
let object = {};
|
|
3308
|
+
if (options.defaults) {
|
|
3309
|
+
object.connectionId = "";
|
|
3310
|
+
object.userId = "";
|
|
3311
|
+
object.reconnectionToken = "";
|
|
3312
|
+
}
|
|
3313
|
+
if (message.connectionId != null && message.hasOwnProperty("connectionId"))
|
|
3314
|
+
object.connectionId = message.connectionId;
|
|
3315
|
+
if (message.userId != null && message.hasOwnProperty("userId"))
|
|
3316
|
+
object.userId = message.userId;
|
|
3317
|
+
if (message.reconnectionToken != null && message.hasOwnProperty("reconnectionToken"))
|
|
3318
|
+
object.reconnectionToken = message.reconnectionToken;
|
|
3319
|
+
return object;
|
|
3320
|
+
};
|
|
3321
|
+
|
|
3322
|
+
/**
|
|
3323
|
+
* Converts this ConnectedMessage to JSON.
|
|
3324
|
+
* @function toJSON
|
|
3325
|
+
* @memberof DownstreamMessage.SystemMessage.ConnectedMessage
|
|
3326
|
+
* @instance
|
|
3327
|
+
* @returns {Object.<string,*>} JSON object
|
|
3328
|
+
*/
|
|
3329
|
+
ConnectedMessage.prototype.toJSON = function toJSON() {
|
|
3330
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
3331
|
+
};
|
|
3332
|
+
|
|
3333
|
+
/**
|
|
3334
|
+
* Gets the default type url for ConnectedMessage
|
|
3335
|
+
* @function getTypeUrl
|
|
3336
|
+
* @memberof DownstreamMessage.SystemMessage.ConnectedMessage
|
|
3337
|
+
* @static
|
|
3338
|
+
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
|
3339
|
+
* @returns {string} The default type url
|
|
3340
|
+
*/
|
|
3341
|
+
ConnectedMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
3342
|
+
if (typeUrlPrefix === undefined) {
|
|
3343
|
+
typeUrlPrefix = "type.googleapis.com";
|
|
3344
|
+
}
|
|
3345
|
+
return typeUrlPrefix + "/DownstreamMessage.SystemMessage.ConnectedMessage";
|
|
3346
|
+
};
|
|
3347
|
+
|
|
3348
|
+
return ConnectedMessage;
|
|
3349
|
+
})();
|
|
3350
|
+
|
|
3351
|
+
SystemMessage.DisconnectedMessage = (function() {
|
|
3352
|
+
|
|
3353
|
+
/**
|
|
3354
|
+
* Properties of a DisconnectedMessage.
|
|
3355
|
+
* @memberof DownstreamMessage.SystemMessage
|
|
3356
|
+
* @interface IDisconnectedMessage
|
|
3357
|
+
* @property {string|null} [reason] DisconnectedMessage reason
|
|
3358
|
+
*/
|
|
3359
|
+
|
|
3360
|
+
/**
|
|
3361
|
+
* Constructs a new DisconnectedMessage.
|
|
3362
|
+
* @memberof DownstreamMessage.SystemMessage
|
|
3363
|
+
* @classdesc Represents a DisconnectedMessage.
|
|
3364
|
+
* @implements IDisconnectedMessage
|
|
3365
|
+
* @constructor
|
|
3366
|
+
* @param {DownstreamMessage.SystemMessage.IDisconnectedMessage=} [properties] Properties to set
|
|
3367
|
+
*/
|
|
3368
|
+
function DisconnectedMessage(properties) {
|
|
3369
|
+
if (properties)
|
|
3370
|
+
for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
3371
|
+
if (properties[keys[i]] != null)
|
|
3372
|
+
this[keys[i]] = properties[keys[i]];
|
|
3373
|
+
}
|
|
3374
|
+
|
|
3375
|
+
/**
|
|
3376
|
+
* DisconnectedMessage reason.
|
|
3377
|
+
* @member {string} reason
|
|
3378
|
+
* @memberof DownstreamMessage.SystemMessage.DisconnectedMessage
|
|
3379
|
+
* @instance
|
|
3380
|
+
*/
|
|
3381
|
+
DisconnectedMessage.prototype.reason = "";
|
|
3382
|
+
|
|
3383
|
+
/**
|
|
3384
|
+
* Creates a new DisconnectedMessage instance using the specified properties.
|
|
3385
|
+
* @function create
|
|
3386
|
+
* @memberof DownstreamMessage.SystemMessage.DisconnectedMessage
|
|
3387
|
+
* @static
|
|
3388
|
+
* @param {DownstreamMessage.SystemMessage.IDisconnectedMessage=} [properties] Properties to set
|
|
3389
|
+
* @returns {DownstreamMessage.SystemMessage.DisconnectedMessage} DisconnectedMessage instance
|
|
3390
|
+
*/
|
|
3391
|
+
DisconnectedMessage.create = function create(properties) {
|
|
3392
|
+
return new DisconnectedMessage(properties);
|
|
3393
|
+
};
|
|
3394
|
+
|
|
3395
|
+
/**
|
|
3396
|
+
* Encodes the specified DisconnectedMessage message. Does not implicitly {@link DownstreamMessage.SystemMessage.DisconnectedMessage.verify|verify} messages.
|
|
3397
|
+
* @function encode
|
|
3398
|
+
* @memberof DownstreamMessage.SystemMessage.DisconnectedMessage
|
|
3399
|
+
* @static
|
|
3400
|
+
* @param {DownstreamMessage.SystemMessage.IDisconnectedMessage} message DisconnectedMessage message or plain object to encode
|
|
3401
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
3402
|
+
* @returns {$protobuf.Writer} Writer
|
|
3403
|
+
*/
|
|
3404
|
+
DisconnectedMessage.encode = function encode(message, writer) {
|
|
3405
|
+
if (!writer)
|
|
3406
|
+
writer = $Writer.create();
|
|
3407
|
+
if (message.reason != null && Object.hasOwnProperty.call(message, "reason"))
|
|
3408
|
+
writer.uint32(/* id 2, wireType 2 =*/18).string(message.reason);
|
|
3409
|
+
return writer;
|
|
3410
|
+
};
|
|
3411
|
+
|
|
3412
|
+
/**
|
|
3413
|
+
* Encodes the specified DisconnectedMessage message, length delimited. Does not implicitly {@link DownstreamMessage.SystemMessage.DisconnectedMessage.verify|verify} messages.
|
|
3414
|
+
* @function encodeDelimited
|
|
3415
|
+
* @memberof DownstreamMessage.SystemMessage.DisconnectedMessage
|
|
3416
|
+
* @static
|
|
3417
|
+
* @param {DownstreamMessage.SystemMessage.IDisconnectedMessage} message DisconnectedMessage message or plain object to encode
|
|
3418
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
3419
|
+
* @returns {$protobuf.Writer} Writer
|
|
3420
|
+
*/
|
|
3421
|
+
DisconnectedMessage.encodeDelimited = function encodeDelimited(message, writer) {
|
|
3422
|
+
return this.encode(message, writer).ldelim();
|
|
3423
|
+
};
|
|
3424
|
+
|
|
3425
|
+
/**
|
|
3426
|
+
* Decodes a DisconnectedMessage message from the specified reader or buffer.
|
|
3427
|
+
* @function decode
|
|
3428
|
+
* @memberof DownstreamMessage.SystemMessage.DisconnectedMessage
|
|
3429
|
+
* @static
|
|
3430
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
3431
|
+
* @param {number} [length] Message length if known beforehand
|
|
3432
|
+
* @returns {DownstreamMessage.SystemMessage.DisconnectedMessage} DisconnectedMessage
|
|
3433
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
3434
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
3435
|
+
*/
|
|
3436
|
+
DisconnectedMessage.decode = function decode(reader, length) {
|
|
3437
|
+
if (!(reader instanceof $Reader))
|
|
3438
|
+
reader = $Reader.create(reader);
|
|
3439
|
+
let end = length === undefined ? reader.len : reader.pos + length, message = new $root.DownstreamMessage.SystemMessage.DisconnectedMessage();
|
|
3440
|
+
while (reader.pos < end) {
|
|
3441
|
+
let tag = reader.uint32();
|
|
3442
|
+
switch (tag >>> 3) {
|
|
3443
|
+
case 2: {
|
|
3444
|
+
message.reason = reader.string();
|
|
3445
|
+
break;
|
|
3446
|
+
}
|
|
3447
|
+
default:
|
|
3448
|
+
reader.skipType(tag & 7);
|
|
3449
|
+
break;
|
|
3450
|
+
}
|
|
3451
|
+
}
|
|
3452
|
+
return message;
|
|
3453
|
+
};
|
|
3454
|
+
|
|
3455
|
+
/**
|
|
3456
|
+
* Decodes a DisconnectedMessage message from the specified reader or buffer, length delimited.
|
|
3457
|
+
* @function decodeDelimited
|
|
3458
|
+
* @memberof DownstreamMessage.SystemMessage.DisconnectedMessage
|
|
3459
|
+
* @static
|
|
3460
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
3461
|
+
* @returns {DownstreamMessage.SystemMessage.DisconnectedMessage} DisconnectedMessage
|
|
3462
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
3463
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
3464
|
+
*/
|
|
3465
|
+
DisconnectedMessage.decodeDelimited = function decodeDelimited(reader) {
|
|
3466
|
+
if (!(reader instanceof $Reader))
|
|
3467
|
+
reader = new $Reader(reader);
|
|
3468
|
+
return this.decode(reader, reader.uint32());
|
|
3469
|
+
};
|
|
3470
|
+
|
|
3471
|
+
/**
|
|
3472
|
+
* Verifies a DisconnectedMessage message.
|
|
3473
|
+
* @function verify
|
|
3474
|
+
* @memberof DownstreamMessage.SystemMessage.DisconnectedMessage
|
|
3475
|
+
* @static
|
|
3476
|
+
* @param {Object.<string,*>} message Plain object to verify
|
|
3477
|
+
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
3478
|
+
*/
|
|
3479
|
+
DisconnectedMessage.verify = function verify(message) {
|
|
3480
|
+
if (typeof message !== "object" || message === null)
|
|
3481
|
+
return "object expected";
|
|
3482
|
+
if (message.reason != null && message.hasOwnProperty("reason"))
|
|
3483
|
+
if (!$util.isString(message.reason))
|
|
3484
|
+
return "reason: string expected";
|
|
3485
|
+
return null;
|
|
3486
|
+
};
|
|
3487
|
+
|
|
3488
|
+
/**
|
|
3489
|
+
* Creates a DisconnectedMessage message from a plain object. Also converts values to their respective internal types.
|
|
3490
|
+
* @function fromObject
|
|
3491
|
+
* @memberof DownstreamMessage.SystemMessage.DisconnectedMessage
|
|
3492
|
+
* @static
|
|
3493
|
+
* @param {Object.<string,*>} object Plain object
|
|
3494
|
+
* @returns {DownstreamMessage.SystemMessage.DisconnectedMessage} DisconnectedMessage
|
|
3495
|
+
*/
|
|
3496
|
+
DisconnectedMessage.fromObject = function fromObject(object) {
|
|
3497
|
+
if (object instanceof $root.DownstreamMessage.SystemMessage.DisconnectedMessage)
|
|
3498
|
+
return object;
|
|
3499
|
+
let message = new $root.DownstreamMessage.SystemMessage.DisconnectedMessage();
|
|
3500
|
+
if (object.reason != null)
|
|
3501
|
+
message.reason = String(object.reason);
|
|
3502
|
+
return message;
|
|
3503
|
+
};
|
|
3504
|
+
|
|
3505
|
+
/**
|
|
3506
|
+
* Creates a plain object from a DisconnectedMessage message. Also converts values to other types if specified.
|
|
3507
|
+
* @function toObject
|
|
3508
|
+
* @memberof DownstreamMessage.SystemMessage.DisconnectedMessage
|
|
3509
|
+
* @static
|
|
3510
|
+
* @param {DownstreamMessage.SystemMessage.DisconnectedMessage} message DisconnectedMessage
|
|
3511
|
+
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
3512
|
+
* @returns {Object.<string,*>} Plain object
|
|
3513
|
+
*/
|
|
3514
|
+
DisconnectedMessage.toObject = function toObject(message, options) {
|
|
3515
|
+
if (!options)
|
|
3516
|
+
options = {};
|
|
3517
|
+
let object = {};
|
|
3518
|
+
if (options.defaults)
|
|
3519
|
+
object.reason = "";
|
|
3520
|
+
if (message.reason != null && message.hasOwnProperty("reason"))
|
|
3521
|
+
object.reason = message.reason;
|
|
3522
|
+
return object;
|
|
3523
|
+
};
|
|
3524
|
+
|
|
3525
|
+
/**
|
|
3526
|
+
* Converts this DisconnectedMessage to JSON.
|
|
3527
|
+
* @function toJSON
|
|
3528
|
+
* @memberof DownstreamMessage.SystemMessage.DisconnectedMessage
|
|
3529
|
+
* @instance
|
|
3530
|
+
* @returns {Object.<string,*>} JSON object
|
|
3531
|
+
*/
|
|
3532
|
+
DisconnectedMessage.prototype.toJSON = function toJSON() {
|
|
3533
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
3534
|
+
};
|
|
3535
|
+
|
|
3536
|
+
/**
|
|
3537
|
+
* Gets the default type url for DisconnectedMessage
|
|
3538
|
+
* @function getTypeUrl
|
|
3539
|
+
* @memberof DownstreamMessage.SystemMessage.DisconnectedMessage
|
|
3540
|
+
* @static
|
|
3541
|
+
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
|
3542
|
+
* @returns {string} The default type url
|
|
3543
|
+
*/
|
|
3544
|
+
DisconnectedMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
3545
|
+
if (typeUrlPrefix === undefined) {
|
|
3546
|
+
typeUrlPrefix = "type.googleapis.com";
|
|
3547
|
+
}
|
|
3548
|
+
return typeUrlPrefix + "/DownstreamMessage.SystemMessage.DisconnectedMessage";
|
|
3549
|
+
};
|
|
3550
|
+
|
|
3551
|
+
return DisconnectedMessage;
|
|
3552
|
+
})();
|
|
3553
|
+
|
|
3554
|
+
return SystemMessage;
|
|
3555
|
+
})();
|
|
3556
|
+
|
|
3557
|
+
return DownstreamMessage;
|
|
3558
|
+
})();
|
|
3559
|
+
|
|
3560
|
+
export const MessageData = $root.MessageData = (() => {
|
|
3561
|
+
|
|
3562
|
+
/**
|
|
3563
|
+
* Properties of a MessageData.
|
|
3564
|
+
* @exports IMessageData
|
|
3565
|
+
* @interface IMessageData
|
|
3566
|
+
* @property {string|null} [textData] MessageData textData
|
|
3567
|
+
* @property {Uint8Array|null} [binaryData] MessageData binaryData
|
|
3568
|
+
* @property {google.protobuf.IAny|null} [protobufData] MessageData protobufData
|
|
3569
|
+
* @property {string|null} [jsonData] MessageData jsonData
|
|
3570
|
+
*/
|
|
3571
|
+
|
|
3572
|
+
/**
|
|
3573
|
+
* Constructs a new MessageData.
|
|
3574
|
+
* @exports MessageData
|
|
3575
|
+
* @classdesc Represents a MessageData.
|
|
3576
|
+
* @implements IMessageData
|
|
3577
|
+
* @constructor
|
|
3578
|
+
* @param {IMessageData=} [properties] Properties to set
|
|
3579
|
+
*/
|
|
3580
|
+
function MessageData(properties) {
|
|
3581
|
+
if (properties)
|
|
3582
|
+
for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
3583
|
+
if (properties[keys[i]] != null)
|
|
3584
|
+
this[keys[i]] = properties[keys[i]];
|
|
3585
|
+
}
|
|
3586
|
+
|
|
3587
|
+
/**
|
|
3588
|
+
* MessageData textData.
|
|
3589
|
+
* @member {string|null|undefined} textData
|
|
3590
|
+
* @memberof MessageData
|
|
3591
|
+
* @instance
|
|
3592
|
+
*/
|
|
3593
|
+
MessageData.prototype.textData = null;
|
|
3594
|
+
|
|
3595
|
+
/**
|
|
3596
|
+
* MessageData binaryData.
|
|
3597
|
+
* @member {Uint8Array|null|undefined} binaryData
|
|
3598
|
+
* @memberof MessageData
|
|
3599
|
+
* @instance
|
|
3600
|
+
*/
|
|
3601
|
+
MessageData.prototype.binaryData = null;
|
|
3602
|
+
|
|
3603
|
+
/**
|
|
3604
|
+
* MessageData protobufData.
|
|
3605
|
+
* @member {google.protobuf.IAny|null|undefined} protobufData
|
|
3606
|
+
* @memberof MessageData
|
|
3607
|
+
* @instance
|
|
3608
|
+
*/
|
|
3609
|
+
MessageData.prototype.protobufData = null;
|
|
3610
|
+
|
|
3611
|
+
/**
|
|
3612
|
+
* MessageData jsonData.
|
|
3613
|
+
* @member {string|null|undefined} jsonData
|
|
3614
|
+
* @memberof MessageData
|
|
3615
|
+
* @instance
|
|
3616
|
+
*/
|
|
3617
|
+
MessageData.prototype.jsonData = null;
|
|
3618
|
+
|
|
3619
|
+
// OneOf field names bound to virtual getters and setters
|
|
3620
|
+
let $oneOfFields;
|
|
3621
|
+
|
|
3622
|
+
/**
|
|
3623
|
+
* MessageData data.
|
|
3624
|
+
* @member {"textData"|"binaryData"|"protobufData"|"jsonData"|undefined} data
|
|
3625
|
+
* @memberof MessageData
|
|
3626
|
+
* @instance
|
|
3627
|
+
*/
|
|
3628
|
+
Object.defineProperty(MessageData.prototype, "data", {
|
|
3629
|
+
get: $util.oneOfGetter($oneOfFields = ["textData", "binaryData", "protobufData", "jsonData"]),
|
|
3630
|
+
set: $util.oneOfSetter($oneOfFields)
|
|
3631
|
+
});
|
|
3632
|
+
|
|
3633
|
+
/**
|
|
3634
|
+
* Creates a new MessageData instance using the specified properties.
|
|
3635
|
+
* @function create
|
|
3636
|
+
* @memberof MessageData
|
|
3637
|
+
* @static
|
|
3638
|
+
* @param {IMessageData=} [properties] Properties to set
|
|
3639
|
+
* @returns {MessageData} MessageData instance
|
|
3640
|
+
*/
|
|
3641
|
+
MessageData.create = function create(properties) {
|
|
3642
|
+
return new MessageData(properties);
|
|
3643
|
+
};
|
|
3644
|
+
|
|
3645
|
+
/**
|
|
3646
|
+
* Encodes the specified MessageData message. Does not implicitly {@link MessageData.verify|verify} messages.
|
|
3647
|
+
* @function encode
|
|
3648
|
+
* @memberof MessageData
|
|
3649
|
+
* @static
|
|
3650
|
+
* @param {IMessageData} message MessageData message or plain object to encode
|
|
3651
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
3652
|
+
* @returns {$protobuf.Writer} Writer
|
|
3653
|
+
*/
|
|
3654
|
+
MessageData.encode = function encode(message, writer) {
|
|
3655
|
+
if (!writer)
|
|
3656
|
+
writer = $Writer.create();
|
|
3657
|
+
if (message.textData != null && Object.hasOwnProperty.call(message, "textData"))
|
|
3658
|
+
writer.uint32(/* id 1, wireType 2 =*/10).string(message.textData);
|
|
3659
|
+
if (message.binaryData != null && Object.hasOwnProperty.call(message, "binaryData"))
|
|
3660
|
+
writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.binaryData);
|
|
3661
|
+
if (message.protobufData != null && Object.hasOwnProperty.call(message, "protobufData"))
|
|
3662
|
+
$root.google.protobuf.Any.encode(message.protobufData, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
|
|
3663
|
+
if (message.jsonData != null && Object.hasOwnProperty.call(message, "jsonData"))
|
|
3664
|
+
writer.uint32(/* id 4, wireType 2 =*/34).string(message.jsonData);
|
|
3665
|
+
return writer;
|
|
3666
|
+
};
|
|
3667
|
+
|
|
3668
|
+
/**
|
|
3669
|
+
* Encodes the specified MessageData message, length delimited. Does not implicitly {@link MessageData.verify|verify} messages.
|
|
3670
|
+
* @function encodeDelimited
|
|
3671
|
+
* @memberof MessageData
|
|
3672
|
+
* @static
|
|
3673
|
+
* @param {IMessageData} message MessageData message or plain object to encode
|
|
3674
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
3675
|
+
* @returns {$protobuf.Writer} Writer
|
|
3676
|
+
*/
|
|
3677
|
+
MessageData.encodeDelimited = function encodeDelimited(message, writer) {
|
|
3678
|
+
return this.encode(message, writer).ldelim();
|
|
3679
|
+
};
|
|
3680
|
+
|
|
3681
|
+
/**
|
|
3682
|
+
* Decodes a MessageData message from the specified reader or buffer.
|
|
3683
|
+
* @function decode
|
|
3684
|
+
* @memberof MessageData
|
|
3685
|
+
* @static
|
|
3686
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
3687
|
+
* @param {number} [length] Message length if known beforehand
|
|
3688
|
+
* @returns {MessageData} MessageData
|
|
3689
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
3690
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
3691
|
+
*/
|
|
3692
|
+
MessageData.decode = function decode(reader, length) {
|
|
3693
|
+
if (!(reader instanceof $Reader))
|
|
3694
|
+
reader = $Reader.create(reader);
|
|
3695
|
+
let end = length === undefined ? reader.len : reader.pos + length, message = new $root.MessageData();
|
|
3696
|
+
while (reader.pos < end) {
|
|
3697
|
+
let tag = reader.uint32();
|
|
3698
|
+
switch (tag >>> 3) {
|
|
3699
|
+
case 1: {
|
|
3700
|
+
message.textData = reader.string();
|
|
3701
|
+
break;
|
|
3702
|
+
}
|
|
3703
|
+
case 2: {
|
|
3704
|
+
message.binaryData = reader.bytes();
|
|
3705
|
+
break;
|
|
3706
|
+
}
|
|
3707
|
+
case 3: {
|
|
3708
|
+
message.protobufData = $root.google.protobuf.Any.decode(reader, reader.uint32());
|
|
3709
|
+
break;
|
|
3710
|
+
}
|
|
3711
|
+
case 4: {
|
|
3712
|
+
message.jsonData = reader.string();
|
|
3713
|
+
break;
|
|
3714
|
+
}
|
|
3715
|
+
default:
|
|
3716
|
+
reader.skipType(tag & 7);
|
|
3717
|
+
break;
|
|
3718
|
+
}
|
|
3719
|
+
}
|
|
3720
|
+
return message;
|
|
3721
|
+
};
|
|
3722
|
+
|
|
3723
|
+
/**
|
|
3724
|
+
* Decodes a MessageData message from the specified reader or buffer, length delimited.
|
|
3725
|
+
* @function decodeDelimited
|
|
3726
|
+
* @memberof MessageData
|
|
3727
|
+
* @static
|
|
3728
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
3729
|
+
* @returns {MessageData} MessageData
|
|
3730
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
3731
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
3732
|
+
*/
|
|
3733
|
+
MessageData.decodeDelimited = function decodeDelimited(reader) {
|
|
3734
|
+
if (!(reader instanceof $Reader))
|
|
3735
|
+
reader = new $Reader(reader);
|
|
3736
|
+
return this.decode(reader, reader.uint32());
|
|
3737
|
+
};
|
|
3738
|
+
|
|
3739
|
+
/**
|
|
3740
|
+
* Verifies a MessageData message.
|
|
3741
|
+
* @function verify
|
|
3742
|
+
* @memberof MessageData
|
|
3743
|
+
* @static
|
|
3744
|
+
* @param {Object.<string,*>} message Plain object to verify
|
|
3745
|
+
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
3746
|
+
*/
|
|
3747
|
+
MessageData.verify = function verify(message) {
|
|
3748
|
+
if (typeof message !== "object" || message === null)
|
|
3749
|
+
return "object expected";
|
|
3750
|
+
let properties = {};
|
|
3751
|
+
if (message.textData != null && message.hasOwnProperty("textData")) {
|
|
3752
|
+
properties.data = 1;
|
|
3753
|
+
if (!$util.isString(message.textData))
|
|
3754
|
+
return "textData: string expected";
|
|
3755
|
+
}
|
|
3756
|
+
if (message.binaryData != null && message.hasOwnProperty("binaryData")) {
|
|
3757
|
+
if (properties.data === 1)
|
|
3758
|
+
return "data: multiple values";
|
|
3759
|
+
properties.data = 1;
|
|
3760
|
+
if (!(message.binaryData && typeof message.binaryData.length === "number" || $util.isString(message.binaryData)))
|
|
3761
|
+
return "binaryData: buffer expected";
|
|
3762
|
+
}
|
|
3763
|
+
if (message.protobufData != null && message.hasOwnProperty("protobufData")) {
|
|
3764
|
+
if (properties.data === 1)
|
|
3765
|
+
return "data: multiple values";
|
|
3766
|
+
properties.data = 1;
|
|
3767
|
+
{
|
|
3768
|
+
let error = $root.google.protobuf.Any.verify(message.protobufData);
|
|
3769
|
+
if (error)
|
|
3770
|
+
return "protobufData." + error;
|
|
3771
|
+
}
|
|
3772
|
+
}
|
|
3773
|
+
if (message.jsonData != null && message.hasOwnProperty("jsonData")) {
|
|
3774
|
+
if (properties.data === 1)
|
|
3775
|
+
return "data: multiple values";
|
|
3776
|
+
properties.data = 1;
|
|
3777
|
+
if (!$util.isString(message.jsonData))
|
|
3778
|
+
return "jsonData: string expected";
|
|
3779
|
+
}
|
|
3780
|
+
return null;
|
|
3781
|
+
};
|
|
3782
|
+
|
|
3783
|
+
/**
|
|
3784
|
+
* Creates a MessageData message from a plain object. Also converts values to their respective internal types.
|
|
3785
|
+
* @function fromObject
|
|
3786
|
+
* @memberof MessageData
|
|
3787
|
+
* @static
|
|
3788
|
+
* @param {Object.<string,*>} object Plain object
|
|
3789
|
+
* @returns {MessageData} MessageData
|
|
3790
|
+
*/
|
|
3791
|
+
MessageData.fromObject = function fromObject(object) {
|
|
3792
|
+
if (object instanceof $root.MessageData)
|
|
3793
|
+
return object;
|
|
3794
|
+
let message = new $root.MessageData();
|
|
3795
|
+
if (object.textData != null)
|
|
3796
|
+
message.textData = String(object.textData);
|
|
3797
|
+
if (object.binaryData != null)
|
|
3798
|
+
if (typeof object.binaryData === "string")
|
|
3799
|
+
$util.base64.decode(object.binaryData, message.binaryData = $util.newBuffer($util.base64.length(object.binaryData)), 0);
|
|
3800
|
+
else if (object.binaryData.length >= 0)
|
|
3801
|
+
message.binaryData = object.binaryData;
|
|
3802
|
+
if (object.protobufData != null) {
|
|
3803
|
+
if (typeof object.protobufData !== "object")
|
|
3804
|
+
throw TypeError(".MessageData.protobufData: object expected");
|
|
3805
|
+
message.protobufData = $root.google.protobuf.Any.fromObject(object.protobufData);
|
|
3806
|
+
}
|
|
3807
|
+
if (object.jsonData != null)
|
|
3808
|
+
message.jsonData = String(object.jsonData);
|
|
3809
|
+
return message;
|
|
3810
|
+
};
|
|
3811
|
+
|
|
3812
|
+
/**
|
|
3813
|
+
* Creates a plain object from a MessageData message. Also converts values to other types if specified.
|
|
3814
|
+
* @function toObject
|
|
3815
|
+
* @memberof MessageData
|
|
3816
|
+
* @static
|
|
3817
|
+
* @param {MessageData} message MessageData
|
|
3818
|
+
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
3819
|
+
* @returns {Object.<string,*>} Plain object
|
|
3820
|
+
*/
|
|
3821
|
+
MessageData.toObject = function toObject(message, options) {
|
|
3822
|
+
if (!options)
|
|
3823
|
+
options = {};
|
|
3824
|
+
let object = {};
|
|
3825
|
+
if (message.textData != null && message.hasOwnProperty("textData")) {
|
|
3826
|
+
object.textData = message.textData;
|
|
3827
|
+
if (options.oneofs)
|
|
3828
|
+
object.data = "textData";
|
|
3829
|
+
}
|
|
3830
|
+
if (message.binaryData != null && message.hasOwnProperty("binaryData")) {
|
|
3831
|
+
object.binaryData = options.bytes === String ? $util.base64.encode(message.binaryData, 0, message.binaryData.length) : options.bytes === Array ? Array.prototype.slice.call(message.binaryData) : message.binaryData;
|
|
3832
|
+
if (options.oneofs)
|
|
3833
|
+
object.data = "binaryData";
|
|
3834
|
+
}
|
|
3835
|
+
if (message.protobufData != null && message.hasOwnProperty("protobufData")) {
|
|
3836
|
+
object.protobufData = $root.google.protobuf.Any.toObject(message.protobufData, options);
|
|
3837
|
+
if (options.oneofs)
|
|
3838
|
+
object.data = "protobufData";
|
|
3839
|
+
}
|
|
3840
|
+
if (message.jsonData != null && message.hasOwnProperty("jsonData")) {
|
|
3841
|
+
object.jsonData = message.jsonData;
|
|
3842
|
+
if (options.oneofs)
|
|
3843
|
+
object.data = "jsonData";
|
|
3844
|
+
}
|
|
3845
|
+
return object;
|
|
3846
|
+
};
|
|
3847
|
+
|
|
3848
|
+
/**
|
|
3849
|
+
* Converts this MessageData to JSON.
|
|
3850
|
+
* @function toJSON
|
|
3851
|
+
* @memberof MessageData
|
|
3852
|
+
* @instance
|
|
3853
|
+
* @returns {Object.<string,*>} JSON object
|
|
3854
|
+
*/
|
|
3855
|
+
MessageData.prototype.toJSON = function toJSON() {
|
|
3856
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
3857
|
+
};
|
|
3858
|
+
|
|
3859
|
+
/**
|
|
3860
|
+
* Gets the default type url for MessageData
|
|
3861
|
+
* @function getTypeUrl
|
|
3862
|
+
* @memberof MessageData
|
|
3863
|
+
* @static
|
|
3864
|
+
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
|
3865
|
+
* @returns {string} The default type url
|
|
3866
|
+
*/
|
|
3867
|
+
MessageData.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
3868
|
+
if (typeUrlPrefix === undefined) {
|
|
3869
|
+
typeUrlPrefix = "type.googleapis.com";
|
|
3870
|
+
}
|
|
3871
|
+
return typeUrlPrefix + "/MessageData";
|
|
3872
|
+
};
|
|
3873
|
+
|
|
3874
|
+
return MessageData;
|
|
3875
|
+
})();
|
|
3876
|
+
|
|
3877
|
+
export const google = $root.google = (() => {
|
|
3878
|
+
|
|
3879
|
+
/**
|
|
3880
|
+
* Namespace google.
|
|
3881
|
+
* @exports google
|
|
3882
|
+
* @namespace
|
|
3883
|
+
*/
|
|
3884
|
+
const google = {};
|
|
3885
|
+
|
|
3886
|
+
google.protobuf = (function() {
|
|
3887
|
+
|
|
3888
|
+
/**
|
|
3889
|
+
* Namespace protobuf.
|
|
3890
|
+
* @memberof google
|
|
3891
|
+
* @namespace
|
|
3892
|
+
*/
|
|
3893
|
+
const protobuf = {};
|
|
3894
|
+
|
|
3895
|
+
protobuf.Any = (function() {
|
|
3896
|
+
|
|
3897
|
+
/**
|
|
3898
|
+
* Properties of an Any.
|
|
3899
|
+
* @memberof google.protobuf
|
|
3900
|
+
* @interface IAny
|
|
3901
|
+
* @property {string|null} [type_url] Any type_url
|
|
3902
|
+
* @property {Uint8Array|null} [value] Any value
|
|
3903
|
+
*/
|
|
3904
|
+
|
|
3905
|
+
/**
|
|
3906
|
+
* Constructs a new Any.
|
|
3907
|
+
* @memberof google.protobuf
|
|
3908
|
+
* @classdesc Represents an Any.
|
|
3909
|
+
* @implements IAny
|
|
3910
|
+
* @constructor
|
|
3911
|
+
* @param {google.protobuf.IAny=} [properties] Properties to set
|
|
3912
|
+
*/
|
|
3913
|
+
function Any(properties) {
|
|
3914
|
+
if (properties)
|
|
3915
|
+
for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
3916
|
+
if (properties[keys[i]] != null)
|
|
3917
|
+
this[keys[i]] = properties[keys[i]];
|
|
3918
|
+
}
|
|
3919
|
+
|
|
3920
|
+
/**
|
|
3921
|
+
* Any type_url.
|
|
3922
|
+
* @member {string} type_url
|
|
3923
|
+
* @memberof google.protobuf.Any
|
|
3924
|
+
* @instance
|
|
3925
|
+
*/
|
|
3926
|
+
Any.prototype.type_url = "";
|
|
3927
|
+
|
|
3928
|
+
/**
|
|
3929
|
+
* Any value.
|
|
3930
|
+
* @member {Uint8Array} value
|
|
3931
|
+
* @memberof google.protobuf.Any
|
|
3932
|
+
* @instance
|
|
3933
|
+
*/
|
|
3934
|
+
Any.prototype.value = $util.newBuffer([]);
|
|
3935
|
+
|
|
3936
|
+
/**
|
|
3937
|
+
* Creates a new Any instance using the specified properties.
|
|
3938
|
+
* @function create
|
|
3939
|
+
* @memberof google.protobuf.Any
|
|
3940
|
+
* @static
|
|
3941
|
+
* @param {google.protobuf.IAny=} [properties] Properties to set
|
|
3942
|
+
* @returns {google.protobuf.Any} Any instance
|
|
3943
|
+
*/
|
|
3944
|
+
Any.create = function create(properties) {
|
|
3945
|
+
return new Any(properties);
|
|
3946
|
+
};
|
|
3947
|
+
|
|
3948
|
+
/**
|
|
3949
|
+
* Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages.
|
|
3950
|
+
* @function encode
|
|
3951
|
+
* @memberof google.protobuf.Any
|
|
3952
|
+
* @static
|
|
3953
|
+
* @param {google.protobuf.IAny} message Any message or plain object to encode
|
|
3954
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
3955
|
+
* @returns {$protobuf.Writer} Writer
|
|
3956
|
+
*/
|
|
3957
|
+
Any.encode = function encode(message, writer) {
|
|
3958
|
+
if (!writer)
|
|
3959
|
+
writer = $Writer.create();
|
|
3960
|
+
if (message.type_url != null && Object.hasOwnProperty.call(message, "type_url"))
|
|
3961
|
+
writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url);
|
|
3962
|
+
if (message.value != null && Object.hasOwnProperty.call(message, "value"))
|
|
3963
|
+
writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value);
|
|
3964
|
+
return writer;
|
|
3965
|
+
};
|
|
3966
|
+
|
|
3967
|
+
/**
|
|
3968
|
+
* Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages.
|
|
3969
|
+
* @function encodeDelimited
|
|
3970
|
+
* @memberof google.protobuf.Any
|
|
3971
|
+
* @static
|
|
3972
|
+
* @param {google.protobuf.IAny} message Any message or plain object to encode
|
|
3973
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
3974
|
+
* @returns {$protobuf.Writer} Writer
|
|
3975
|
+
*/
|
|
3976
|
+
Any.encodeDelimited = function encodeDelimited(message, writer) {
|
|
3977
|
+
return this.encode(message, writer).ldelim();
|
|
3978
|
+
};
|
|
3979
|
+
|
|
3980
|
+
/**
|
|
3981
|
+
* Decodes an Any message from the specified reader or buffer.
|
|
3982
|
+
* @function decode
|
|
3983
|
+
* @memberof google.protobuf.Any
|
|
3984
|
+
* @static
|
|
3985
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
3986
|
+
* @param {number} [length] Message length if known beforehand
|
|
3987
|
+
* @returns {google.protobuf.Any} Any
|
|
3988
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
3989
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
3990
|
+
*/
|
|
3991
|
+
Any.decode = function decode(reader, length) {
|
|
3992
|
+
if (!(reader instanceof $Reader))
|
|
3993
|
+
reader = $Reader.create(reader);
|
|
3994
|
+
let end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Any();
|
|
3995
|
+
while (reader.pos < end) {
|
|
3996
|
+
let tag = reader.uint32();
|
|
3997
|
+
switch (tag >>> 3) {
|
|
3998
|
+
case 1: {
|
|
3999
|
+
message.type_url = reader.string();
|
|
4000
|
+
break;
|
|
4001
|
+
}
|
|
4002
|
+
case 2: {
|
|
4003
|
+
message.value = reader.bytes();
|
|
4004
|
+
break;
|
|
4005
|
+
}
|
|
4006
|
+
default:
|
|
4007
|
+
reader.skipType(tag & 7);
|
|
4008
|
+
break;
|
|
4009
|
+
}
|
|
4010
|
+
}
|
|
4011
|
+
return message;
|
|
4012
|
+
};
|
|
4013
|
+
|
|
4014
|
+
/**
|
|
4015
|
+
* Decodes an Any message from the specified reader or buffer, length delimited.
|
|
4016
|
+
* @function decodeDelimited
|
|
4017
|
+
* @memberof google.protobuf.Any
|
|
4018
|
+
* @static
|
|
4019
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
4020
|
+
* @returns {google.protobuf.Any} Any
|
|
4021
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
4022
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
4023
|
+
*/
|
|
4024
|
+
Any.decodeDelimited = function decodeDelimited(reader) {
|
|
4025
|
+
if (!(reader instanceof $Reader))
|
|
4026
|
+
reader = new $Reader(reader);
|
|
4027
|
+
return this.decode(reader, reader.uint32());
|
|
4028
|
+
};
|
|
4029
|
+
|
|
4030
|
+
/**
|
|
4031
|
+
* Verifies an Any message.
|
|
4032
|
+
* @function verify
|
|
4033
|
+
* @memberof google.protobuf.Any
|
|
4034
|
+
* @static
|
|
4035
|
+
* @param {Object.<string,*>} message Plain object to verify
|
|
4036
|
+
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
4037
|
+
*/
|
|
4038
|
+
Any.verify = function verify(message) {
|
|
4039
|
+
if (typeof message !== "object" || message === null)
|
|
4040
|
+
return "object expected";
|
|
4041
|
+
if (message.type_url != null && message.hasOwnProperty("type_url"))
|
|
4042
|
+
if (!$util.isString(message.type_url))
|
|
4043
|
+
return "type_url: string expected";
|
|
4044
|
+
if (message.value != null && message.hasOwnProperty("value"))
|
|
4045
|
+
if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value)))
|
|
4046
|
+
return "value: buffer expected";
|
|
4047
|
+
return null;
|
|
4048
|
+
};
|
|
4049
|
+
|
|
4050
|
+
/**
|
|
4051
|
+
* Creates an Any message from a plain object. Also converts values to their respective internal types.
|
|
4052
|
+
* @function fromObject
|
|
4053
|
+
* @memberof google.protobuf.Any
|
|
4054
|
+
* @static
|
|
4055
|
+
* @param {Object.<string,*>} object Plain object
|
|
4056
|
+
* @returns {google.protobuf.Any} Any
|
|
4057
|
+
*/
|
|
4058
|
+
Any.fromObject = function fromObject(object) {
|
|
4059
|
+
if (object instanceof $root.google.protobuf.Any)
|
|
4060
|
+
return object;
|
|
4061
|
+
let message = new $root.google.protobuf.Any();
|
|
4062
|
+
if (object.type_url != null)
|
|
4063
|
+
message.type_url = String(object.type_url);
|
|
4064
|
+
if (object.value != null)
|
|
4065
|
+
if (typeof object.value === "string")
|
|
4066
|
+
$util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0);
|
|
4067
|
+
else if (object.value.length >= 0)
|
|
4068
|
+
message.value = object.value;
|
|
4069
|
+
return message;
|
|
4070
|
+
};
|
|
4071
|
+
|
|
4072
|
+
/**
|
|
4073
|
+
* Creates a plain object from an Any message. Also converts values to other types if specified.
|
|
4074
|
+
* @function toObject
|
|
4075
|
+
* @memberof google.protobuf.Any
|
|
4076
|
+
* @static
|
|
4077
|
+
* @param {google.protobuf.Any} message Any
|
|
4078
|
+
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
4079
|
+
* @returns {Object.<string,*>} Plain object
|
|
4080
|
+
*/
|
|
4081
|
+
Any.toObject = function toObject(message, options) {
|
|
4082
|
+
if (!options)
|
|
4083
|
+
options = {};
|
|
4084
|
+
let object = {};
|
|
4085
|
+
if (options.defaults) {
|
|
4086
|
+
object.type_url = "";
|
|
4087
|
+
if (options.bytes === String)
|
|
4088
|
+
object.value = "";
|
|
4089
|
+
else {
|
|
4090
|
+
object.value = [];
|
|
4091
|
+
if (options.bytes !== Array)
|
|
4092
|
+
object.value = $util.newBuffer(object.value);
|
|
4093
|
+
}
|
|
4094
|
+
}
|
|
4095
|
+
if (message.type_url != null && message.hasOwnProperty("type_url"))
|
|
4096
|
+
object.type_url = message.type_url;
|
|
4097
|
+
if (message.value != null && message.hasOwnProperty("value"))
|
|
4098
|
+
object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value;
|
|
4099
|
+
return object;
|
|
4100
|
+
};
|
|
4101
|
+
|
|
4102
|
+
/**
|
|
4103
|
+
* Converts this Any to JSON.
|
|
4104
|
+
* @function toJSON
|
|
4105
|
+
* @memberof google.protobuf.Any
|
|
4106
|
+
* @instance
|
|
4107
|
+
* @returns {Object.<string,*>} JSON object
|
|
4108
|
+
*/
|
|
4109
|
+
Any.prototype.toJSON = function toJSON() {
|
|
4110
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
4111
|
+
};
|
|
4112
|
+
|
|
4113
|
+
/**
|
|
4114
|
+
* Gets the default type url for Any
|
|
4115
|
+
* @function getTypeUrl
|
|
4116
|
+
* @memberof google.protobuf.Any
|
|
4117
|
+
* @static
|
|
4118
|
+
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
|
4119
|
+
* @returns {string} The default type url
|
|
4120
|
+
*/
|
|
4121
|
+
Any.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
4122
|
+
if (typeUrlPrefix === undefined) {
|
|
4123
|
+
typeUrlPrefix = "type.googleapis.com";
|
|
4124
|
+
}
|
|
4125
|
+
return typeUrlPrefix + "/google.protobuf.Any";
|
|
4126
|
+
};
|
|
4127
|
+
|
|
4128
|
+
return Any;
|
|
4129
|
+
})();
|
|
4130
|
+
|
|
4131
|
+
return protobuf;
|
|
4132
|
+
})();
|
|
4133
|
+
|
|
4134
|
+
return google;
|
|
4135
|
+
})();
|
|
4136
|
+
|
|
4137
|
+
export { $root as default };
|