diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8da244413502..49d7bad79da5 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -33840,8 +33840,8 @@ importers: specifier: ^1.1.4 version: link:../../core/logger '@azure/web-pubsub-client': - specifier: 1.0.0-beta.2 - version: 1.0.0-beta.2 + specifier: workspace:^ + version: link:../web-pubsub-client long: specifier: ^5.3.1 version: 5.3.2 @@ -34462,10 +34462,6 @@ packages: resolution: {integrity: sha1-zxn7+RVmX7ilQ8du6LbmEssmz9c=} engines: {node: '>=20.0.0'} - '@azure/web-pubsub-client@1.0.0-beta.2': - resolution: {integrity: sha1-55aCrdFArY9cdOnsriB/a7lQ8ls=} - engines: {node: '>=14.0.0'} - '@babel/code-frame@7.29.0': resolution: {integrity: sha1-fNelnxWzzA3NgDA493knEqfQsVw=} engines: {node: '>=6.9.0'} @@ -40611,19 +40607,6 @@ snapshots: transitivePeerDependencies: - supports-color - '@azure/web-pubsub-client@1.0.0-beta.2': - dependencies: - '@azure/abort-controller': 1.1.0 - '@azure/core-util': 1.13.1 - '@azure/logger': 1.3.0 - buffer: 6.0.3 - tslib: 2.8.1 - ws: 7.5.10 - transitivePeerDependencies: - - bufferutil - - supports-color - - utf-8-validate - '@babel/code-frame@7.29.0': dependencies: '@babel/helper-validator-identifier': 7.28.5 diff --git a/sdk/web-pubsub/web-pubsub-client-protobuf/CHANGELOG.md b/sdk/web-pubsub/web-pubsub-client-protobuf/CHANGELOG.md index aa95bc88ee12..cc82860459b1 100644 --- a/sdk/web-pubsub/web-pubsub-client-protobuf/CHANGELOG.md +++ b/sdk/web-pubsub/web-pubsub-client-protobuf/CHANGELOG.md @@ -1,9 +1,12 @@ # Release History -## 1.0.0-beta.4 (Unreleased) +## 1.0.0-beta.5 (Unreleased) ### Features Added +- Added protobuf protocol support for group state messages (`setGroupState`, `subscribeGroupState`, `unsubscribeGroupState`, `groupStateSnapshot`, `groupStateUpdate`). +- Updated dependency `@azure/web-pubsub-client` to workspace reference for using group state types. + ### Breaking Changes ### Bugs Fixed diff --git a/sdk/web-pubsub/web-pubsub-client-protobuf/package.json b/sdk/web-pubsub/web-pubsub-client-protobuf/package.json index 66065d937f74..660677ad22d0 100644 --- a/sdk/web-pubsub/web-pubsub-client-protobuf/package.json +++ b/sdk/web-pubsub/web-pubsub-client-protobuf/package.json @@ -1,6 +1,6 @@ { "name": "@azure/web-pubsub-client-protobuf", - "version": "1.0.0-beta.4", + "version": "1.0.0-beta.5", "description": "Azure Web PubSub Client Protobuf", "sdk-type": "client", "type": "module", @@ -56,7 +56,7 @@ "sideEffects": false, "dependencies": { "@azure/logger": "^1.1.4", - "@azure/web-pubsub-client": "1.0.0-beta.2", + "@azure/web-pubsub-client": "workspace:^", "long": "^5.3.1", "protobufjs": "^7.4.0", "tslib": "^2.8.1" diff --git a/sdk/web-pubsub/web-pubsub-client-protobuf/src/generated/clientProto.cjs b/sdk/web-pubsub/web-pubsub-client-protobuf/src/generated/clientProto.cjs index 8f8b2f80b92b..425c235e004a 100644 --- a/sdk/web-pubsub/web-pubsub-client-protobuf/src/generated/clientProto.cjs +++ b/sdk/web-pubsub/web-pubsub-client-protobuf/src/generated/clientProto.cjs @@ -20,6 +20,9 @@ $root.UpstreamMessage = (function() { * @property {UpstreamMessage.IJoinGroupMessage|null} [joinGroupMessage] UpstreamMessage joinGroupMessage * @property {UpstreamMessage.ILeaveGroupMessage|null} [leaveGroupMessage] UpstreamMessage leaveGroupMessage * @property {UpstreamMessage.ISequenceAckMessage|null} [sequenceAckMessage] UpstreamMessage sequenceAckMessage + * @property {UpstreamMessage.ISetGroupStateMessage|null} [setGroupStateMessage] UpstreamMessage setGroupStateMessage + * @property {UpstreamMessage.ISubscribeGroupStateMessage|null} [subscribeGroupStateMessage] UpstreamMessage subscribeGroupStateMessage + * @property {UpstreamMessage.IUnsubscribeGroupStateMessage|null} [unsubscribeGroupStateMessage] UpstreamMessage unsubscribeGroupStateMessage */ /** @@ -77,17 +80,41 @@ $root.UpstreamMessage = (function() { */ UpstreamMessage.prototype.sequenceAckMessage = null; + /** + * UpstreamMessage setGroupStateMessage. + * @member {UpstreamMessage.ISetGroupStateMessage|null|undefined} setGroupStateMessage + * @memberof UpstreamMessage + * @instance + */ + UpstreamMessage.prototype.setGroupStateMessage = null; + + /** + * UpstreamMessage subscribeGroupStateMessage. + * @member {UpstreamMessage.ISubscribeGroupStateMessage|null|undefined} subscribeGroupStateMessage + * @memberof UpstreamMessage + * @instance + */ + UpstreamMessage.prototype.subscribeGroupStateMessage = null; + + /** + * UpstreamMessage unsubscribeGroupStateMessage. + * @member {UpstreamMessage.IUnsubscribeGroupStateMessage|null|undefined} unsubscribeGroupStateMessage + * @memberof UpstreamMessage + * @instance + */ + UpstreamMessage.prototype.unsubscribeGroupStateMessage = null; + // OneOf field names bound to virtual getters and setters var $oneOfFields; /** * UpstreamMessage message. - * @member {"sendToGroupMessage"|"eventMessage"|"joinGroupMessage"|"leaveGroupMessage"|"sequenceAckMessage"|undefined} message + * @member {"sendToGroupMessage"|"eventMessage"|"joinGroupMessage"|"leaveGroupMessage"|"sequenceAckMessage"|"setGroupStateMessage"|"subscribeGroupStateMessage"|"unsubscribeGroupStateMessage"|undefined} message * @memberof UpstreamMessage * @instance */ Object.defineProperty(UpstreamMessage.prototype, "message", { - get: $util.oneOfGetter($oneOfFields = ["sendToGroupMessage", "eventMessage", "joinGroupMessage", "leaveGroupMessage", "sequenceAckMessage"]), + get: $util.oneOfGetter($oneOfFields = ["sendToGroupMessage", "eventMessage", "joinGroupMessage", "leaveGroupMessage", "sequenceAckMessage", "setGroupStateMessage", "subscribeGroupStateMessage", "unsubscribeGroupStateMessage"]), set: $util.oneOfSetter($oneOfFields) }); @@ -125,6 +152,12 @@ $root.UpstreamMessage = (function() { $root.UpstreamMessage.LeaveGroupMessage.encode(message.leaveGroupMessage, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); if (message.sequenceAckMessage != null && Object.hasOwnProperty.call(message, "sequenceAckMessage")) $root.UpstreamMessage.SequenceAckMessage.encode(message.sequenceAckMessage, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.setGroupStateMessage != null && Object.hasOwnProperty.call(message, "setGroupStateMessage")) + $root.UpstreamMessage.SetGroupStateMessage.encode(message.setGroupStateMessage, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.subscribeGroupStateMessage != null && Object.hasOwnProperty.call(message, "subscribeGroupStateMessage")) + $root.UpstreamMessage.SubscribeGroupStateMessage.encode(message.subscribeGroupStateMessage, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); + if (message.unsubscribeGroupStateMessage != null && Object.hasOwnProperty.call(message, "unsubscribeGroupStateMessage")) + $root.UpstreamMessage.UnsubscribeGroupStateMessage.encode(message.unsubscribeGroupStateMessage, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); return writer; }; @@ -185,6 +218,18 @@ $root.UpstreamMessage = (function() { message.sequenceAckMessage = $root.UpstreamMessage.SequenceAckMessage.decode(reader, reader.uint32(), undefined, long + 1); break; } + case 15: { + message.setGroupStateMessage = $root.UpstreamMessage.SetGroupStateMessage.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 16: { + message.subscribeGroupStateMessage = $root.UpstreamMessage.SubscribeGroupStateMessage.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 17: { + message.unsubscribeGroupStateMessage = $root.UpstreamMessage.UnsubscribeGroupStateMessage.decode(reader, reader.uint32(), undefined, long + 1); + break; + } default: reader.skipType(tag & 7, long); break; @@ -273,6 +318,36 @@ $root.UpstreamMessage = (function() { return "sequenceAckMessage." + error; } } + if (message.setGroupStateMessage != null && message.hasOwnProperty("setGroupStateMessage")) { + if (properties.message === 1) + return "message: multiple values"; + properties.message = 1; + { + var error = $root.UpstreamMessage.SetGroupStateMessage.verify(message.setGroupStateMessage, long + 1); + if (error) + return "setGroupStateMessage." + error; + } + } + if (message.subscribeGroupStateMessage != null && message.hasOwnProperty("subscribeGroupStateMessage")) { + if (properties.message === 1) + return "message: multiple values"; + properties.message = 1; + { + var error = $root.UpstreamMessage.SubscribeGroupStateMessage.verify(message.subscribeGroupStateMessage, long + 1); + if (error) + return "subscribeGroupStateMessage." + error; + } + } + if (message.unsubscribeGroupStateMessage != null && message.hasOwnProperty("unsubscribeGroupStateMessage")) { + if (properties.message === 1) + return "message: multiple values"; + properties.message = 1; + { + var error = $root.UpstreamMessage.UnsubscribeGroupStateMessage.verify(message.unsubscribeGroupStateMessage, long + 1); + if (error) + return "unsubscribeGroupStateMessage." + error; + } + } return null; }; @@ -317,6 +392,21 @@ $root.UpstreamMessage = (function() { throw TypeError(".UpstreamMessage.sequenceAckMessage: object expected"); message.sequenceAckMessage = $root.UpstreamMessage.SequenceAckMessage.fromObject(object.sequenceAckMessage, long + 1); } + if (object.setGroupStateMessage != null) { + if (typeof object.setGroupStateMessage !== "object") + throw TypeError(".UpstreamMessage.setGroupStateMessage: object expected"); + message.setGroupStateMessage = $root.UpstreamMessage.SetGroupStateMessage.fromObject(object.setGroupStateMessage, long + 1); + } + if (object.subscribeGroupStateMessage != null) { + if (typeof object.subscribeGroupStateMessage !== "object") + throw TypeError(".UpstreamMessage.subscribeGroupStateMessage: object expected"); + message.subscribeGroupStateMessage = $root.UpstreamMessage.SubscribeGroupStateMessage.fromObject(object.subscribeGroupStateMessage, long + 1); + } + if (object.unsubscribeGroupStateMessage != null) { + if (typeof object.unsubscribeGroupStateMessage !== "object") + throw TypeError(".UpstreamMessage.unsubscribeGroupStateMessage: object expected"); + message.unsubscribeGroupStateMessage = $root.UpstreamMessage.UnsubscribeGroupStateMessage.fromObject(object.unsubscribeGroupStateMessage, long + 1); + } return message; }; @@ -358,6 +448,21 @@ $root.UpstreamMessage = (function() { if (options.oneofs) object.message = "sequenceAckMessage"; } + if (message.setGroupStateMessage != null && message.hasOwnProperty("setGroupStateMessage")) { + object.setGroupStateMessage = $root.UpstreamMessage.SetGroupStateMessage.toObject(message.setGroupStateMessage, options); + if (options.oneofs) + object.message = "setGroupStateMessage"; + } + if (message.subscribeGroupStateMessage != null && message.hasOwnProperty("subscribeGroupStateMessage")) { + object.subscribeGroupStateMessage = $root.UpstreamMessage.SubscribeGroupStateMessage.toObject(message.subscribeGroupStateMessage, options); + if (options.oneofs) + object.message = "subscribeGroupStateMessage"; + } + if (message.unsubscribeGroupStateMessage != null && message.hasOwnProperty("unsubscribeGroupStateMessage")) { + object.unsubscribeGroupStateMessage = $root.UpstreamMessage.UnsubscribeGroupStateMessage.toObject(message.unsubscribeGroupStateMessage, options); + if (options.oneofs) + object.message = "unsubscribeGroupStateMessage"; + } return object; }; @@ -1765,456 +1870,433 @@ $root.UpstreamMessage = (function() { return SequenceAckMessage; })(); - return UpstreamMessage; -})(); + UpstreamMessage.SetGroupStateMessage = (function() { -$root.DownstreamMessage = (function() { + /** + * Properties of a SetGroupStateMessage. + * @memberof UpstreamMessage + * @interface ISetGroupStateMessage + * @property {string|null} [group] SetGroupStateMessage group + * @property {number|Long|null} [ackId] SetGroupStateMessage ackId + * @property {GroupStateItem.IGroupState|null} [state] SetGroupStateMessage state + */ - /** - * Properties of a DownstreamMessage. - * @exports IDownstreamMessage - * @interface IDownstreamMessage - * @property {DownstreamMessage.IAckMessage|null} [ackMessage] DownstreamMessage ackMessage - * @property {DownstreamMessage.IDataMessage|null} [dataMessage] DownstreamMessage dataMessage - * @property {DownstreamMessage.ISystemMessage|null} [systemMessage] DownstreamMessage systemMessage - */ + /** + * Constructs a new SetGroupStateMessage. + * @memberof UpstreamMessage + * @classdesc Represents a SetGroupStateMessage. + * @implements ISetGroupStateMessage + * @constructor + * @param {UpstreamMessage.ISetGroupStateMessage=} [properties] Properties to set + */ + function SetGroupStateMessage(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } - /** - * Constructs a new DownstreamMessage. - * @exports DownstreamMessage - * @classdesc Represents a DownstreamMessage. - * @implements IDownstreamMessage - * @constructor - * @param {IDownstreamMessage=} [properties] Properties to set - */ - function DownstreamMessage(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } + /** + * SetGroupStateMessage group. + * @member {string} group + * @memberof UpstreamMessage.SetGroupStateMessage + * @instance + */ + SetGroupStateMessage.prototype.group = ""; - /** - * DownstreamMessage ackMessage. - * @member {DownstreamMessage.IAckMessage|null|undefined} ackMessage - * @memberof DownstreamMessage - * @instance - */ - DownstreamMessage.prototype.ackMessage = null; + /** + * SetGroupStateMessage ackId. + * @member {number|Long|null|undefined} ackId + * @memberof UpstreamMessage.SetGroupStateMessage + * @instance + */ + SetGroupStateMessage.prototype.ackId = null; - /** - * DownstreamMessage dataMessage. - * @member {DownstreamMessage.IDataMessage|null|undefined} dataMessage - * @memberof DownstreamMessage - * @instance - */ - DownstreamMessage.prototype.dataMessage = null; + /** + * SetGroupStateMessage state. + * @member {GroupStateItem.IGroupState|null|undefined} state + * @memberof UpstreamMessage.SetGroupStateMessage + * @instance + */ + SetGroupStateMessage.prototype.state = null; - /** - * DownstreamMessage systemMessage. - * @member {DownstreamMessage.ISystemMessage|null|undefined} systemMessage - * @memberof DownstreamMessage - * @instance - */ - DownstreamMessage.prototype.systemMessage = null; + // OneOf field names bound to virtual getters and setters + var $oneOfFields; - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + // Virtual OneOf for proto3 optional field + Object.defineProperty(SetGroupStateMessage.prototype, "_ackId", { + get: $util.oneOfGetter($oneOfFields = ["ackId"]), + set: $util.oneOfSetter($oneOfFields) + }); - /** - * DownstreamMessage message. - * @member {"ackMessage"|"dataMessage"|"systemMessage"|undefined} message - * @memberof DownstreamMessage - * @instance - */ - Object.defineProperty(DownstreamMessage.prototype, "message", { - get: $util.oneOfGetter($oneOfFields = ["ackMessage", "dataMessage", "systemMessage"]), - set: $util.oneOfSetter($oneOfFields) - }); + // Virtual OneOf for proto3 optional field + Object.defineProperty(SetGroupStateMessage.prototype, "_state", { + get: $util.oneOfGetter($oneOfFields = ["state"]), + set: $util.oneOfSetter($oneOfFields) + }); - /** - * Creates a new DownstreamMessage instance using the specified properties. - * @function create - * @memberof DownstreamMessage - * @static - * @param {IDownstreamMessage=} [properties] Properties to set - * @returns {DownstreamMessage} DownstreamMessage instance - */ - DownstreamMessage.create = function create(properties) { - return new DownstreamMessage(properties); - }; + /** + * Creates a new SetGroupStateMessage instance using the specified properties. + * @function create + * @memberof UpstreamMessage.SetGroupStateMessage + * @static + * @param {UpstreamMessage.ISetGroupStateMessage=} [properties] Properties to set + * @returns {UpstreamMessage.SetGroupStateMessage} SetGroupStateMessage instance + */ + SetGroupStateMessage.create = function create(properties) { + return new SetGroupStateMessage(properties); + }; - /** - * Encodes the specified DownstreamMessage message. Does not implicitly {@link DownstreamMessage.verify|verify} messages. - * @function encode - * @memberof DownstreamMessage - * @static - * @param {IDownstreamMessage} message DownstreamMessage message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DownstreamMessage.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.ackMessage != null && Object.hasOwnProperty.call(message, "ackMessage")) - $root.DownstreamMessage.AckMessage.encode(message.ackMessage, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.dataMessage != null && Object.hasOwnProperty.call(message, "dataMessage")) - $root.DownstreamMessage.DataMessage.encode(message.dataMessage, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.systemMessage != null && Object.hasOwnProperty.call(message, "systemMessage")) - $root.DownstreamMessage.SystemMessage.encode(message.systemMessage, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; + /** + * Encodes the specified SetGroupStateMessage message. Does not implicitly {@link UpstreamMessage.SetGroupStateMessage.verify|verify} messages. + * @function encode + * @memberof UpstreamMessage.SetGroupStateMessage + * @static + * @param {UpstreamMessage.ISetGroupStateMessage} message SetGroupStateMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetGroupStateMessage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.group != null && Object.hasOwnProperty.call(message, "group")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.group); + if (message.ackId != null && Object.hasOwnProperty.call(message, "ackId")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.ackId); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + $root.GroupStateItem.GroupState.encode(message.state, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; - /** - * Encodes the specified DownstreamMessage message, length delimited. Does not implicitly {@link DownstreamMessage.verify|verify} messages. - * @function encodeDelimited - * @memberof DownstreamMessage - * @static - * @param {IDownstreamMessage} message DownstreamMessage message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DownstreamMessage.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified SetGroupStateMessage message, length delimited. Does not implicitly {@link UpstreamMessage.SetGroupStateMessage.verify|verify} messages. + * @function encodeDelimited + * @memberof UpstreamMessage.SetGroupStateMessage + * @static + * @param {UpstreamMessage.ISetGroupStateMessage} message SetGroupStateMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetGroupStateMessage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes a DownstreamMessage message from the specified reader or buffer. - * @function decode - * @memberof DownstreamMessage - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {DownstreamMessage} DownstreamMessage - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DownstreamMessage.decode = function decode(reader, length, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.DownstreamMessage(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.ackMessage = $root.DownstreamMessage.AckMessage.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - case 2: { - message.dataMessage = $root.DownstreamMessage.DataMessage.decode(reader, reader.uint32(), undefined, long + 1); + /** + * Decodes a SetGroupStateMessage message from the specified reader or buffer. + * @function decode + * @memberof UpstreamMessage.SetGroupStateMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {UpstreamMessage.SetGroupStateMessage} SetGroupStateMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetGroupStateMessage.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.UpstreamMessage.SetGroupStateMessage(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) break; - } - case 3: { - message.systemMessage = $root.DownstreamMessage.SystemMessage.decode(reader, reader.uint32(), undefined, long + 1); + switch (tag >>> 3) { + case 1: { + message.group = reader.string(); + break; + } + case 2: { + message.ackId = reader.uint64(); + break; + } + case 3: { + message.state = $root.GroupStateItem.GroupState.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); break; } - default: - reader.skipType(tag & 7, long); - break; } - } - return message; - }; + return message; + }; - /** - * Decodes a DownstreamMessage message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof DownstreamMessage - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {DownstreamMessage} DownstreamMessage - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DownstreamMessage.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Decodes a SetGroupStateMessage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof UpstreamMessage.SetGroupStateMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {UpstreamMessage.SetGroupStateMessage} SetGroupStateMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetGroupStateMessage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Verifies a DownstreamMessage message. - * @function verify - * @memberof DownstreamMessage - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DownstreamMessage.verify = function verify(message, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - var properties = {}; - if (message.ackMessage != null && message.hasOwnProperty("ackMessage")) { - properties.message = 1; - { - var error = $root.DownstreamMessage.AckMessage.verify(message.ackMessage, long + 1); - if (error) - return "ackMessage." + error; - } - } - if (message.dataMessage != null && message.hasOwnProperty("dataMessage")) { - if (properties.message === 1) - return "message: multiple values"; - properties.message = 1; - { - var error = $root.DownstreamMessage.DataMessage.verify(message.dataMessage, long + 1); - if (error) - return "dataMessage." + error; + /** + * Verifies a SetGroupStateMessage message. + * @function verify + * @memberof UpstreamMessage.SetGroupStateMessage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SetGroupStateMessage.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.group != null && message.hasOwnProperty("group")) + if (!$util.isString(message.group)) + return "group: string expected"; + if (message.ackId != null && message.hasOwnProperty("ackId")) { + properties._ackId = 1; + if (!$util.isInteger(message.ackId) && !(message.ackId && $util.isInteger(message.ackId.low) && $util.isInteger(message.ackId.high))) + return "ackId: integer|Long expected"; } - } - if (message.systemMessage != null && message.hasOwnProperty("systemMessage")) { - if (properties.message === 1) - return "message: multiple values"; - properties.message = 1; - { - var error = $root.DownstreamMessage.SystemMessage.verify(message.systemMessage, long + 1); - if (error) - return "systemMessage." + error; + if (message.state != null && message.hasOwnProperty("state")) { + properties._state = 1; + { + var error = $root.GroupStateItem.GroupState.verify(message.state, long + 1); + if (error) + return "state." + error; + } } - } - return null; - }; - - /** - * Creates a DownstreamMessage message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof DownstreamMessage - * @static - * @param {Object.} object Plain object - * @returns {DownstreamMessage} DownstreamMessage - */ - DownstreamMessage.fromObject = function fromObject(object, long) { - if (object instanceof $root.DownstreamMessage) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var message = new $root.DownstreamMessage(); - if (object.ackMessage != null) { - if (typeof object.ackMessage !== "object") - throw TypeError(".DownstreamMessage.ackMessage: object expected"); - message.ackMessage = $root.DownstreamMessage.AckMessage.fromObject(object.ackMessage, long + 1); - } - if (object.dataMessage != null) { - if (typeof object.dataMessage !== "object") - throw TypeError(".DownstreamMessage.dataMessage: object expected"); - message.dataMessage = $root.DownstreamMessage.DataMessage.fromObject(object.dataMessage, long + 1); - } - if (object.systemMessage != null) { - if (typeof object.systemMessage !== "object") - throw TypeError(".DownstreamMessage.systemMessage: object expected"); - message.systemMessage = $root.DownstreamMessage.SystemMessage.fromObject(object.systemMessage, long + 1); - } - return message; - }; - - /** - * Creates a plain object from a DownstreamMessage message. Also converts values to other types if specified. - * @function toObject - * @memberof DownstreamMessage - * @static - * @param {DownstreamMessage} message DownstreamMessage - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DownstreamMessage.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.ackMessage != null && message.hasOwnProperty("ackMessage")) { - object.ackMessage = $root.DownstreamMessage.AckMessage.toObject(message.ackMessage, options); - if (options.oneofs) - object.message = "ackMessage"; - } - if (message.dataMessage != null && message.hasOwnProperty("dataMessage")) { - object.dataMessage = $root.DownstreamMessage.DataMessage.toObject(message.dataMessage, options); - if (options.oneofs) - object.message = "dataMessage"; - } - if (message.systemMessage != null && message.hasOwnProperty("systemMessage")) { - object.systemMessage = $root.DownstreamMessage.SystemMessage.toObject(message.systemMessage, options); - if (options.oneofs) - object.message = "systemMessage"; - } - return object; - }; - - /** - * Converts this DownstreamMessage to JSON. - * @function toJSON - * @memberof DownstreamMessage - * @instance - * @returns {Object.} JSON object - */ - DownstreamMessage.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DownstreamMessage - * @function getTypeUrl - * @memberof DownstreamMessage - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DownstreamMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/DownstreamMessage"; - }; - - DownstreamMessage.AckMessage = (function() { + return null; + }; /** - * Properties of an AckMessage. - * @memberof DownstreamMessage - * @interface IAckMessage - * @property {number|Long|null} [ackId] AckMessage ackId - * @property {boolean|null} [success] AckMessage success - * @property {DownstreamMessage.AckMessage.IErrorMessage|null} [error] AckMessage error + * Creates a SetGroupStateMessage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof UpstreamMessage.SetGroupStateMessage + * @static + * @param {Object.} object Plain object + * @returns {UpstreamMessage.SetGroupStateMessage} SetGroupStateMessage */ + SetGroupStateMessage.fromObject = function fromObject(object, long) { + if (object instanceof $root.UpstreamMessage.SetGroupStateMessage) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.UpstreamMessage.SetGroupStateMessage(); + if (object.group != null) + message.group = String(object.group); + if (object.ackId != null) + if ($util.Long) + (message.ackId = $util.Long.fromValue(object.ackId)).unsigned = true; + else if (typeof object.ackId === "string") + message.ackId = parseInt(object.ackId, 10); + else if (typeof object.ackId === "number") + message.ackId = object.ackId; + else if (typeof object.ackId === "object") + message.ackId = new $util.LongBits(object.ackId.low >>> 0, object.ackId.high >>> 0).toNumber(true); + if (object.state != null) { + if (typeof object.state !== "object") + throw TypeError(".UpstreamMessage.SetGroupStateMessage.state: object expected"); + message.state = $root.GroupStateItem.GroupState.fromObject(object.state, long + 1); + } + return message; + }; /** - * Constructs a new AckMessage. - * @memberof DownstreamMessage - * @classdesc Represents an AckMessage. - * @implements IAckMessage - * @constructor - * @param {DownstreamMessage.IAckMessage=} [properties] Properties to set + * Creates a plain object from a SetGroupStateMessage message. Also converts values to other types if specified. + * @function toObject + * @memberof UpstreamMessage.SetGroupStateMessage + * @static + * @param {UpstreamMessage.SetGroupStateMessage} message SetGroupStateMessage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ - function AckMessage(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } + SetGroupStateMessage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.group = ""; + if (message.group != null && message.hasOwnProperty("group")) + object.group = message.group; + if (message.ackId != null && message.hasOwnProperty("ackId")) { + if (typeof message.ackId === "number") + object.ackId = options.longs === String ? String(message.ackId) : message.ackId; + else + 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; + if (options.oneofs) + object._ackId = "ackId"; + } + if (message.state != null && message.hasOwnProperty("state")) { + object.state = $root.GroupStateItem.GroupState.toObject(message.state, options); + if (options.oneofs) + object._state = "state"; + } + return object; + }; /** - * AckMessage ackId. - * @member {number|Long} ackId - * @memberof DownstreamMessage.AckMessage + * Converts this SetGroupStateMessage to JSON. + * @function toJSON + * @memberof UpstreamMessage.SetGroupStateMessage * @instance + * @returns {Object.} JSON object */ - AckMessage.prototype.ackId = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + SetGroupStateMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; /** - * AckMessage success. - * @member {boolean} success - * @memberof DownstreamMessage.AckMessage + * Gets the default type url for SetGroupStateMessage + * @function getTypeUrl + * @memberof UpstreamMessage.SetGroupStateMessage + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SetGroupStateMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/UpstreamMessage.SetGroupStateMessage"; + }; + + return SetGroupStateMessage; + })(); + + UpstreamMessage.SubscribeGroupStateMessage = (function() { + + /** + * Properties of a SubscribeGroupStateMessage. + * @memberof UpstreamMessage + * @interface ISubscribeGroupStateMessage + * @property {string|null} [group] SubscribeGroupStateMessage group + * @property {number|Long|null} [ackId] SubscribeGroupStateMessage ackId + */ + + /** + * Constructs a new SubscribeGroupStateMessage. + * @memberof UpstreamMessage + * @classdesc Represents a SubscribeGroupStateMessage. + * @implements ISubscribeGroupStateMessage + * @constructor + * @param {UpstreamMessage.ISubscribeGroupStateMessage=} [properties] Properties to set + */ + function SubscribeGroupStateMessage(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * SubscribeGroupStateMessage group. + * @member {string} group + * @memberof UpstreamMessage.SubscribeGroupStateMessage * @instance */ - AckMessage.prototype.success = false; + SubscribeGroupStateMessage.prototype.group = ""; /** - * AckMessage error. - * @member {DownstreamMessage.AckMessage.IErrorMessage|null|undefined} error - * @memberof DownstreamMessage.AckMessage + * SubscribeGroupStateMessage ackId. + * @member {number|Long|null|undefined} ackId + * @memberof UpstreamMessage.SubscribeGroupStateMessage * @instance */ - AckMessage.prototype.error = null; + SubscribeGroupStateMessage.prototype.ackId = null; // OneOf field names bound to virtual getters and setters var $oneOfFields; // Virtual OneOf for proto3 optional field - Object.defineProperty(AckMessage.prototype, "_error", { - get: $util.oneOfGetter($oneOfFields = ["error"]), + Object.defineProperty(SubscribeGroupStateMessage.prototype, "_ackId", { + get: $util.oneOfGetter($oneOfFields = ["ackId"]), set: $util.oneOfSetter($oneOfFields) }); /** - * Creates a new AckMessage instance using the specified properties. + * Creates a new SubscribeGroupStateMessage instance using the specified properties. * @function create - * @memberof DownstreamMessage.AckMessage + * @memberof UpstreamMessage.SubscribeGroupStateMessage * @static - * @param {DownstreamMessage.IAckMessage=} [properties] Properties to set - * @returns {DownstreamMessage.AckMessage} AckMessage instance + * @param {UpstreamMessage.ISubscribeGroupStateMessage=} [properties] Properties to set + * @returns {UpstreamMessage.SubscribeGroupStateMessage} SubscribeGroupStateMessage instance */ - AckMessage.create = function create(properties) { - return new AckMessage(properties); + SubscribeGroupStateMessage.create = function create(properties) { + return new SubscribeGroupStateMessage(properties); }; /** - * Encodes the specified AckMessage message. Does not implicitly {@link DownstreamMessage.AckMessage.verify|verify} messages. + * Encodes the specified SubscribeGroupStateMessage message. Does not implicitly {@link UpstreamMessage.SubscribeGroupStateMessage.verify|verify} messages. * @function encode - * @memberof DownstreamMessage.AckMessage + * @memberof UpstreamMessage.SubscribeGroupStateMessage * @static - * @param {DownstreamMessage.IAckMessage} message AckMessage message or plain object to encode + * @param {UpstreamMessage.ISubscribeGroupStateMessage} message SubscribeGroupStateMessage message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AckMessage.encode = function encode(message, writer) { + SubscribeGroupStateMessage.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); + if (message.group != null && Object.hasOwnProperty.call(message, "group")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.group); if (message.ackId != null && Object.hasOwnProperty.call(message, "ackId")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.ackId); - if (message.success != null && Object.hasOwnProperty.call(message, "success")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.success); - if (message.error != null && Object.hasOwnProperty.call(message, "error")) - $root.DownstreamMessage.AckMessage.ErrorMessage.encode(message.error, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.ackId); return writer; }; /** - * Encodes the specified AckMessage message, length delimited. Does not implicitly {@link DownstreamMessage.AckMessage.verify|verify} messages. + * Encodes the specified SubscribeGroupStateMessage message, length delimited. Does not implicitly {@link UpstreamMessage.SubscribeGroupStateMessage.verify|verify} messages. * @function encodeDelimited - * @memberof DownstreamMessage.AckMessage + * @memberof UpstreamMessage.SubscribeGroupStateMessage * @static - * @param {DownstreamMessage.IAckMessage} message AckMessage message or plain object to encode + * @param {UpstreamMessage.ISubscribeGroupStateMessage} message SubscribeGroupStateMessage message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AckMessage.encodeDelimited = function encodeDelimited(message, writer) { + SubscribeGroupStateMessage.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an AckMessage message from the specified reader or buffer. + * Decodes a SubscribeGroupStateMessage message from the specified reader or buffer. * @function decode - * @memberof DownstreamMessage.AckMessage + * @memberof UpstreamMessage.SubscribeGroupStateMessage * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {DownstreamMessage.AckMessage} AckMessage + * @returns {UpstreamMessage.SubscribeGroupStateMessage} SubscribeGroupStateMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AckMessage.decode = function decode(reader, length, error, long) { + SubscribeGroupStateMessage.decode = function decode(reader, length, error, long) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); if (long === undefined) long = 0; if (long > $Reader.recursionLimit) throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.DownstreamMessage.AckMessage(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.UpstreamMessage.SubscribeGroupStateMessage(); while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) break; switch (tag >>> 3) { case 1: { - message.ackId = reader.uint64(); + message.group = reader.string(); break; } case 2: { - message.success = reader.bool(); - break; - } - case 3: { - message.error = $root.DownstreamMessage.AckMessage.ErrorMessage.decode(reader, reader.uint32(), undefined, long + 1); + message.ackId = reader.uint64(); break; } default: @@ -2226,30 +2308,30 @@ $root.DownstreamMessage = (function() { }; /** - * Decodes an AckMessage message from the specified reader or buffer, length delimited. + * Decodes a SubscribeGroupStateMessage message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof DownstreamMessage.AckMessage + * @memberof UpstreamMessage.SubscribeGroupStateMessage * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {DownstreamMessage.AckMessage} AckMessage + * @returns {UpstreamMessage.SubscribeGroupStateMessage} SubscribeGroupStateMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AckMessage.decodeDelimited = function decodeDelimited(reader) { + SubscribeGroupStateMessage.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an AckMessage message. + * Verifies a SubscribeGroupStateMessage message. * @function verify - * @memberof DownstreamMessage.AckMessage + * @memberof UpstreamMessage.SubscribeGroupStateMessage * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - AckMessage.verify = function verify(message, long) { + SubscribeGroupStateMessage.verify = function verify(message, long) { if (typeof message !== "object" || message === null) return "object expected"; if (long === undefined) @@ -2257,39 +2339,35 @@ $root.DownstreamMessage = (function() { if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.ackId != null && message.hasOwnProperty("ackId")) + if (message.group != null && message.hasOwnProperty("group")) + if (!$util.isString(message.group)) + return "group: string expected"; + if (message.ackId != null && message.hasOwnProperty("ackId")) { + properties._ackId = 1; if (!$util.isInteger(message.ackId) && !(message.ackId && $util.isInteger(message.ackId.low) && $util.isInteger(message.ackId.high))) return "ackId: integer|Long expected"; - if (message.success != null && message.hasOwnProperty("success")) - if (typeof message.success !== "boolean") - return "success: boolean expected"; - if (message.error != null && message.hasOwnProperty("error")) { - properties._error = 1; - { - var error = $root.DownstreamMessage.AckMessage.ErrorMessage.verify(message.error, long + 1); - if (error) - return "error." + error; - } } return null; }; /** - * Creates an AckMessage message from a plain object. Also converts values to their respective internal types. + * Creates a SubscribeGroupStateMessage message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof DownstreamMessage.AckMessage + * @memberof UpstreamMessage.SubscribeGroupStateMessage * @static * @param {Object.} object Plain object - * @returns {DownstreamMessage.AckMessage} AckMessage + * @returns {UpstreamMessage.SubscribeGroupStateMessage} SubscribeGroupStateMessage */ - AckMessage.fromObject = function fromObject(object, long) { - if (object instanceof $root.DownstreamMessage.AckMessage) + SubscribeGroupStateMessage.fromObject = function fromObject(object, long) { + if (object instanceof $root.UpstreamMessage.SubscribeGroupStateMessage) return object; if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); - var message = new $root.DownstreamMessage.AckMessage(); + var message = new $root.UpstreamMessage.SubscribeGroupStateMessage(); + if (object.group != null) + message.group = String(object.group); if (object.ackId != null) if ($util.Long) (message.ackId = $util.Long.fromValue(object.ackId)).unsigned = true; @@ -2299,482 +2377,190 @@ $root.DownstreamMessage = (function() { message.ackId = object.ackId; else if (typeof object.ackId === "object") message.ackId = new $util.LongBits(object.ackId.low >>> 0, object.ackId.high >>> 0).toNumber(true); - if (object.success != null) - message.success = Boolean(object.success); - if (object.error != null) { - if (typeof object.error !== "object") - throw TypeError(".DownstreamMessage.AckMessage.error: object expected"); - message.error = $root.DownstreamMessage.AckMessage.ErrorMessage.fromObject(object.error, long + 1); - } return message; }; /** - * Creates a plain object from an AckMessage message. Also converts values to other types if specified. + * Creates a plain object from a SubscribeGroupStateMessage message. Also converts values to other types if specified. * @function toObject - * @memberof DownstreamMessage.AckMessage + * @memberof UpstreamMessage.SubscribeGroupStateMessage * @static - * @param {DownstreamMessage.AckMessage} message AckMessage + * @param {UpstreamMessage.SubscribeGroupStateMessage} message SubscribeGroupStateMessage * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AckMessage.toObject = function toObject(message, options) { + SubscribeGroupStateMessage.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.ackId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.ackId = options.longs === String ? "0" : 0; - object.success = false; - } - if (message.ackId != null && message.hasOwnProperty("ackId")) + if (options.defaults) + object.group = ""; + if (message.group != null && message.hasOwnProperty("group")) + object.group = message.group; + if (message.ackId != null && message.hasOwnProperty("ackId")) { if (typeof message.ackId === "number") object.ackId = options.longs === String ? String(message.ackId) : message.ackId; else 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; - if (message.success != null && message.hasOwnProperty("success")) - object.success = message.success; - if (message.error != null && message.hasOwnProperty("error")) { - object.error = $root.DownstreamMessage.AckMessage.ErrorMessage.toObject(message.error, options); if (options.oneofs) - object._error = "error"; + object._ackId = "ackId"; } return object; }; /** - * Converts this AckMessage to JSON. + * Converts this SubscribeGroupStateMessage to JSON. * @function toJSON - * @memberof DownstreamMessage.AckMessage + * @memberof UpstreamMessage.SubscribeGroupStateMessage * @instance * @returns {Object.} JSON object */ - AckMessage.prototype.toJSON = function toJSON() { + SubscribeGroupStateMessage.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for AckMessage + * Gets the default type url for SubscribeGroupStateMessage * @function getTypeUrl - * @memberof DownstreamMessage.AckMessage + * @memberof UpstreamMessage.SubscribeGroupStateMessage * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - AckMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + SubscribeGroupStateMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/DownstreamMessage.AckMessage"; + return typeUrlPrefix + "/UpstreamMessage.SubscribeGroupStateMessage"; }; - AckMessage.ErrorMessage = (function() { + return SubscribeGroupStateMessage; + })(); - /** - * Properties of an ErrorMessage. - * @memberof DownstreamMessage.AckMessage - * @interface IErrorMessage - * @property {string|null} [name] ErrorMessage name - * @property {string|null} [message] ErrorMessage message - */ + UpstreamMessage.UnsubscribeGroupStateMessage = (function() { - /** - * Constructs a new ErrorMessage. - * @memberof DownstreamMessage.AckMessage - * @classdesc Represents an ErrorMessage. - * @implements IErrorMessage - * @constructor - * @param {DownstreamMessage.AckMessage.IErrorMessage=} [properties] Properties to set - */ - function ErrorMessage(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } + /** + * Properties of an UnsubscribeGroupStateMessage. + * @memberof UpstreamMessage + * @interface IUnsubscribeGroupStateMessage + * @property {string|null} [group] UnsubscribeGroupStateMessage group + * @property {number|Long|null} [ackId] UnsubscribeGroupStateMessage ackId + */ - /** - * ErrorMessage name. - * @member {string} name - * @memberof DownstreamMessage.AckMessage.ErrorMessage - * @instance - */ - ErrorMessage.prototype.name = ""; + /** + * Constructs a new UnsubscribeGroupStateMessage. + * @memberof UpstreamMessage + * @classdesc Represents an UnsubscribeGroupStateMessage. + * @implements IUnsubscribeGroupStateMessage + * @constructor + * @param {UpstreamMessage.IUnsubscribeGroupStateMessage=} [properties] Properties to set + */ + function UnsubscribeGroupStateMessage(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } - /** - * ErrorMessage message. - * @member {string} message - * @memberof DownstreamMessage.AckMessage.ErrorMessage - * @instance - */ - ErrorMessage.prototype.message = ""; + /** + * UnsubscribeGroupStateMessage group. + * @member {string} group + * @memberof UpstreamMessage.UnsubscribeGroupStateMessage + * @instance + */ + UnsubscribeGroupStateMessage.prototype.group = ""; - /** - * Creates a new ErrorMessage instance using the specified properties. - * @function create - * @memberof DownstreamMessage.AckMessage.ErrorMessage - * @static - * @param {DownstreamMessage.AckMessage.IErrorMessage=} [properties] Properties to set - * @returns {DownstreamMessage.AckMessage.ErrorMessage} ErrorMessage instance - */ - ErrorMessage.create = function create(properties) { - return new ErrorMessage(properties); - }; - - /** - * Encodes the specified ErrorMessage message. Does not implicitly {@link DownstreamMessage.AckMessage.ErrorMessage.verify|verify} messages. - * @function encode - * @memberof DownstreamMessage.AckMessage.ErrorMessage - * @static - * @param {DownstreamMessage.AckMessage.IErrorMessage} message ErrorMessage message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ErrorMessage.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.message != null && Object.hasOwnProperty.call(message, "message")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); - return writer; - }; - - /** - * Encodes the specified ErrorMessage message, length delimited. Does not implicitly {@link DownstreamMessage.AckMessage.ErrorMessage.verify|verify} messages. - * @function encodeDelimited - * @memberof DownstreamMessage.AckMessage.ErrorMessage - * @static - * @param {DownstreamMessage.AckMessage.IErrorMessage} message ErrorMessage message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ErrorMessage.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ErrorMessage message from the specified reader or buffer. - * @function decode - * @memberof DownstreamMessage.AckMessage.ErrorMessage - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {DownstreamMessage.AckMessage.ErrorMessage} ErrorMessage - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ErrorMessage.decode = function decode(reader, length, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.DownstreamMessage.AckMessage.ErrorMessage(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.message = reader.string(); - break; - } - default: - reader.skipType(tag & 7, long); - break; - } - } - return message; - }; - - /** - * Decodes an ErrorMessage message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof DownstreamMessage.AckMessage.ErrorMessage - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {DownstreamMessage.AckMessage.ErrorMessage} ErrorMessage - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ErrorMessage.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ErrorMessage message. - * @function verify - * @memberof DownstreamMessage.AckMessage.ErrorMessage - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ErrorMessage.verify = function verify(message, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.message != null && message.hasOwnProperty("message")) - if (!$util.isString(message.message)) - return "message: string expected"; - return null; - }; - - /** - * Creates an ErrorMessage message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof DownstreamMessage.AckMessage.ErrorMessage - * @static - * @param {Object.} object Plain object - * @returns {DownstreamMessage.AckMessage.ErrorMessage} ErrorMessage - */ - ErrorMessage.fromObject = function fromObject(object, long) { - if (object instanceof $root.DownstreamMessage.AckMessage.ErrorMessage) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var message = new $root.DownstreamMessage.AckMessage.ErrorMessage(); - if (object.name != null) - message.name = String(object.name); - if (object.message != null) - message.message = String(object.message); - return message; - }; - - /** - * Creates a plain object from an ErrorMessage message. Also converts values to other types if specified. - * @function toObject - * @memberof DownstreamMessage.AckMessage.ErrorMessage - * @static - * @param {DownstreamMessage.AckMessage.ErrorMessage} message ErrorMessage - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ErrorMessage.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.message = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.message != null && message.hasOwnProperty("message")) - object.message = message.message; - return object; - }; - - /** - * Converts this ErrorMessage to JSON. - * @function toJSON - * @memberof DownstreamMessage.AckMessage.ErrorMessage - * @instance - * @returns {Object.} JSON object - */ - ErrorMessage.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ErrorMessage - * @function getTypeUrl - * @memberof DownstreamMessage.AckMessage.ErrorMessage - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ErrorMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/DownstreamMessage.AckMessage.ErrorMessage"; - }; - - return ErrorMessage; - })(); - - return AckMessage; - })(); - - DownstreamMessage.DataMessage = (function() { - - /** - * Properties of a DataMessage. - * @memberof DownstreamMessage - * @interface IDataMessage - * @property {string|null} [from] DataMessage from - * @property {string|null} [group] DataMessage group - * @property {IMessageData|null} [data] DataMessage data - * @property {number|Long|null} [sequenceId] DataMessage sequenceId - */ - - /** - * Constructs a new DataMessage. - * @memberof DownstreamMessage - * @classdesc Represents a DataMessage. - * @implements IDataMessage - * @constructor - * @param {DownstreamMessage.IDataMessage=} [properties] Properties to set - */ - function DataMessage(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * DataMessage from. - * @member {string} from - * @memberof DownstreamMessage.DataMessage - * @instance - */ - DataMessage.prototype.from = ""; - - /** - * DataMessage group. - * @member {string|null|undefined} group - * @memberof DownstreamMessage.DataMessage - * @instance - */ - DataMessage.prototype.group = null; - - /** - * DataMessage data. - * @member {IMessageData|null|undefined} data - * @memberof DownstreamMessage.DataMessage - * @instance - */ - DataMessage.prototype.data = null; - - /** - * DataMessage sequenceId. - * @member {number|Long|null|undefined} sequenceId - * @memberof DownstreamMessage.DataMessage - * @instance - */ - DataMessage.prototype.sequenceId = null; + /** + * UnsubscribeGroupStateMessage ackId. + * @member {number|Long|null|undefined} ackId + * @memberof UpstreamMessage.UnsubscribeGroupStateMessage + * @instance + */ + UnsubscribeGroupStateMessage.prototype.ackId = null; // OneOf field names bound to virtual getters and setters var $oneOfFields; // Virtual OneOf for proto3 optional field - Object.defineProperty(DataMessage.prototype, "_group", { - get: $util.oneOfGetter($oneOfFields = ["group"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(DataMessage.prototype, "_sequenceId", { - get: $util.oneOfGetter($oneOfFields = ["sequenceId"]), + Object.defineProperty(UnsubscribeGroupStateMessage.prototype, "_ackId", { + get: $util.oneOfGetter($oneOfFields = ["ackId"]), set: $util.oneOfSetter($oneOfFields) }); /** - * Creates a new DataMessage instance using the specified properties. + * Creates a new UnsubscribeGroupStateMessage instance using the specified properties. * @function create - * @memberof DownstreamMessage.DataMessage + * @memberof UpstreamMessage.UnsubscribeGroupStateMessage * @static - * @param {DownstreamMessage.IDataMessage=} [properties] Properties to set - * @returns {DownstreamMessage.DataMessage} DataMessage instance + * @param {UpstreamMessage.IUnsubscribeGroupStateMessage=} [properties] Properties to set + * @returns {UpstreamMessage.UnsubscribeGroupStateMessage} UnsubscribeGroupStateMessage instance */ - DataMessage.create = function create(properties) { - return new DataMessage(properties); + UnsubscribeGroupStateMessage.create = function create(properties) { + return new UnsubscribeGroupStateMessage(properties); }; /** - * Encodes the specified DataMessage message. Does not implicitly {@link DownstreamMessage.DataMessage.verify|verify} messages. + * Encodes the specified UnsubscribeGroupStateMessage message. Does not implicitly {@link UpstreamMessage.UnsubscribeGroupStateMessage.verify|verify} messages. * @function encode - * @memberof DownstreamMessage.DataMessage + * @memberof UpstreamMessage.UnsubscribeGroupStateMessage * @static - * @param {DownstreamMessage.IDataMessage} message DataMessage message or plain object to encode + * @param {UpstreamMessage.IUnsubscribeGroupStateMessage} message UnsubscribeGroupStateMessage message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DataMessage.encode = function encode(message, writer) { + UnsubscribeGroupStateMessage.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.from != null && Object.hasOwnProperty.call(message, "from")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.from); if (message.group != null && Object.hasOwnProperty.call(message, "group")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.group); - if (message.data != null && Object.hasOwnProperty.call(message, "data")) - $root.MessageData.encode(message.data, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.sequenceId != null && Object.hasOwnProperty.call(message, "sequenceId")) - writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.sequenceId); + writer.uint32(/* id 1, wireType 2 =*/10).string(message.group); + if (message.ackId != null && Object.hasOwnProperty.call(message, "ackId")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.ackId); return writer; }; /** - * Encodes the specified DataMessage message, length delimited. Does not implicitly {@link DownstreamMessage.DataMessage.verify|verify} messages. + * Encodes the specified UnsubscribeGroupStateMessage message, length delimited. Does not implicitly {@link UpstreamMessage.UnsubscribeGroupStateMessage.verify|verify} messages. * @function encodeDelimited - * @memberof DownstreamMessage.DataMessage + * @memberof UpstreamMessage.UnsubscribeGroupStateMessage * @static - * @param {DownstreamMessage.IDataMessage} message DataMessage message or plain object to encode + * @param {UpstreamMessage.IUnsubscribeGroupStateMessage} message UnsubscribeGroupStateMessage message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DataMessage.encodeDelimited = function encodeDelimited(message, writer) { + UnsubscribeGroupStateMessage.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DataMessage message from the specified reader or buffer. + * Decodes an UnsubscribeGroupStateMessage message from the specified reader or buffer. * @function decode - * @memberof DownstreamMessage.DataMessage + * @memberof UpstreamMessage.UnsubscribeGroupStateMessage * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {DownstreamMessage.DataMessage} DataMessage + * @returns {UpstreamMessage.UnsubscribeGroupStateMessage} UnsubscribeGroupStateMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DataMessage.decode = function decode(reader, length, error, long) { + UnsubscribeGroupStateMessage.decode = function decode(reader, length, error, long) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); if (long === undefined) long = 0; if (long > $Reader.recursionLimit) throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.DownstreamMessage.DataMessage(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.UpstreamMessage.UnsubscribeGroupStateMessage(); while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) break; switch (tag >>> 3) { case 1: { - message.from = reader.string(); - break; - } - case 2: { message.group = reader.string(); break; } - case 3: { - message.data = $root.MessageData.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - case 4: { - message.sequenceId = reader.uint64(); + case 2: { + message.ackId = reader.uint64(); break; } default: @@ -2786,30 +2572,30 @@ $root.DownstreamMessage = (function() { }; /** - * Decodes a DataMessage message from the specified reader or buffer, length delimited. + * Decodes an UnsubscribeGroupStateMessage message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof DownstreamMessage.DataMessage + * @memberof UpstreamMessage.UnsubscribeGroupStateMessage * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {DownstreamMessage.DataMessage} DataMessage + * @returns {UpstreamMessage.UnsubscribeGroupStateMessage} UnsubscribeGroupStateMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DataMessage.decodeDelimited = function decodeDelimited(reader) { + UnsubscribeGroupStateMessage.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DataMessage message. + * Verifies an UnsubscribeGroupStateMessage message. * @function verify - * @memberof DownstreamMessage.DataMessage + * @memberof UpstreamMessage.UnsubscribeGroupStateMessage * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DataMessage.verify = function verify(message, long) { + UnsubscribeGroupStateMessage.verify = function verify(message, long) { if (typeof message !== "object" || message === null) return "object expected"; if (long === undefined) @@ -2817,685 +2603,799 @@ $root.DownstreamMessage = (function() { if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.from != null && message.hasOwnProperty("from")) - if (!$util.isString(message.from)) - return "from: string expected"; - if (message.group != null && message.hasOwnProperty("group")) { - properties._group = 1; + if (message.group != null && message.hasOwnProperty("group")) if (!$util.isString(message.group)) return "group: string expected"; - } - if (message.data != null && message.hasOwnProperty("data")) { - var error = $root.MessageData.verify(message.data, long + 1); - if (error) - return "data." + error; - } - if (message.sequenceId != null && message.hasOwnProperty("sequenceId")) { - properties._sequenceId = 1; - if (!$util.isInteger(message.sequenceId) && !(message.sequenceId && $util.isInteger(message.sequenceId.low) && $util.isInteger(message.sequenceId.high))) - return "sequenceId: integer|Long expected"; + if (message.ackId != null && message.hasOwnProperty("ackId")) { + properties._ackId = 1; + if (!$util.isInteger(message.ackId) && !(message.ackId && $util.isInteger(message.ackId.low) && $util.isInteger(message.ackId.high))) + return "ackId: integer|Long expected"; } return null; }; /** - * Creates a DataMessage message from a plain object. Also converts values to their respective internal types. + * Creates an UnsubscribeGroupStateMessage message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof DownstreamMessage.DataMessage + * @memberof UpstreamMessage.UnsubscribeGroupStateMessage * @static * @param {Object.} object Plain object - * @returns {DownstreamMessage.DataMessage} DataMessage + * @returns {UpstreamMessage.UnsubscribeGroupStateMessage} UnsubscribeGroupStateMessage */ - DataMessage.fromObject = function fromObject(object, long) { - if (object instanceof $root.DownstreamMessage.DataMessage) + UnsubscribeGroupStateMessage.fromObject = function fromObject(object, long) { + if (object instanceof $root.UpstreamMessage.UnsubscribeGroupStateMessage) return object; if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); - var message = new $root.DownstreamMessage.DataMessage(); - if (object.from != null) - message.from = String(object.from); + var message = new $root.UpstreamMessage.UnsubscribeGroupStateMessage(); if (object.group != null) message.group = String(object.group); - if (object.data != null) { - if (typeof object.data !== "object") - throw TypeError(".DownstreamMessage.DataMessage.data: object expected"); - message.data = $root.MessageData.fromObject(object.data, long + 1); - } - if (object.sequenceId != null) + if (object.ackId != null) if ($util.Long) - (message.sequenceId = $util.Long.fromValue(object.sequenceId)).unsigned = true; - else if (typeof object.sequenceId === "string") - message.sequenceId = parseInt(object.sequenceId, 10); - else if (typeof object.sequenceId === "number") - message.sequenceId = object.sequenceId; - else if (typeof object.sequenceId === "object") - message.sequenceId = new $util.LongBits(object.sequenceId.low >>> 0, object.sequenceId.high >>> 0).toNumber(true); + (message.ackId = $util.Long.fromValue(object.ackId)).unsigned = true; + else if (typeof object.ackId === "string") + message.ackId = parseInt(object.ackId, 10); + else if (typeof object.ackId === "number") + message.ackId = object.ackId; + else if (typeof object.ackId === "object") + message.ackId = new $util.LongBits(object.ackId.low >>> 0, object.ackId.high >>> 0).toNumber(true); return message; }; /** - * Creates a plain object from a DataMessage message. Also converts values to other types if specified. + * Creates a plain object from an UnsubscribeGroupStateMessage message. Also converts values to other types if specified. * @function toObject - * @memberof DownstreamMessage.DataMessage + * @memberof UpstreamMessage.UnsubscribeGroupStateMessage * @static - * @param {DownstreamMessage.DataMessage} message DataMessage + * @param {UpstreamMessage.UnsubscribeGroupStateMessage} message UnsubscribeGroupStateMessage * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DataMessage.toObject = function toObject(message, options) { + UnsubscribeGroupStateMessage.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.from = ""; - object.data = null; - } - if (message.from != null && message.hasOwnProperty("from")) - object.from = message.from; - if (message.group != null && message.hasOwnProperty("group")) { + if (options.defaults) + object.group = ""; + if (message.group != null && message.hasOwnProperty("group")) object.group = message.group; - if (options.oneofs) - object._group = "group"; - } - if (message.data != null && message.hasOwnProperty("data")) - object.data = $root.MessageData.toObject(message.data, options); - if (message.sequenceId != null && message.hasOwnProperty("sequenceId")) { - if (typeof message.sequenceId === "number") - object.sequenceId = options.longs === String ? String(message.sequenceId) : message.sequenceId; + if (message.ackId != null && message.hasOwnProperty("ackId")) { + if (typeof message.ackId === "number") + object.ackId = options.longs === String ? String(message.ackId) : message.ackId; else - 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; + 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; if (options.oneofs) - object._sequenceId = "sequenceId"; + object._ackId = "ackId"; } return object; }; /** - * Converts this DataMessage to JSON. + * Converts this UnsubscribeGroupStateMessage to JSON. * @function toJSON - * @memberof DownstreamMessage.DataMessage + * @memberof UpstreamMessage.UnsubscribeGroupStateMessage * @instance * @returns {Object.} JSON object */ - DataMessage.prototype.toJSON = function toJSON() { + UnsubscribeGroupStateMessage.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for DataMessage + * Gets the default type url for UnsubscribeGroupStateMessage * @function getTypeUrl - * @memberof DownstreamMessage.DataMessage + * @memberof UpstreamMessage.UnsubscribeGroupStateMessage * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - DataMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + UnsubscribeGroupStateMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/DownstreamMessage.DataMessage"; + return typeUrlPrefix + "/UpstreamMessage.UnsubscribeGroupStateMessage"; }; - return DataMessage; + return UnsubscribeGroupStateMessage; })(); - DownstreamMessage.SystemMessage = (function() { + return UpstreamMessage; +})(); - /** - * Properties of a SystemMessage. - * @memberof DownstreamMessage - * @interface ISystemMessage - * @property {DownstreamMessage.SystemMessage.IConnectedMessage|null} [connectedMessage] SystemMessage connectedMessage - * @property {DownstreamMessage.SystemMessage.IDisconnectedMessage|null} [disconnectedMessage] SystemMessage disconnectedMessage - */ +$root.DownstreamMessage = (function() { - /** - * Constructs a new SystemMessage. - * @memberof DownstreamMessage - * @classdesc Represents a SystemMessage. - * @implements ISystemMessage - * @constructor - * @param {DownstreamMessage.ISystemMessage=} [properties] Properties to set - */ - function SystemMessage(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } + /** + * Properties of a DownstreamMessage. + * @exports IDownstreamMessage + * @interface IDownstreamMessage + * @property {DownstreamMessage.IAckMessage|null} [ackMessage] DownstreamMessage ackMessage + * @property {DownstreamMessage.IDataMessage|null} [dataMessage] DownstreamMessage dataMessage + * @property {DownstreamMessage.ISystemMessage|null} [systemMessage] DownstreamMessage systemMessage + * @property {DownstreamMessage.IGroupStateUpdateMessage|null} [groupStateUpdateMessage] DownstreamMessage groupStateUpdateMessage + * @property {DownstreamMessage.IGroupStateSnapshotMessage|null} [groupStateSnapshotMessage] DownstreamMessage groupStateSnapshotMessage + */ - /** - * SystemMessage connectedMessage. - * @member {DownstreamMessage.SystemMessage.IConnectedMessage|null|undefined} connectedMessage - * @memberof DownstreamMessage.SystemMessage - * @instance - */ - SystemMessage.prototype.connectedMessage = null; + /** + * Constructs a new DownstreamMessage. + * @exports DownstreamMessage + * @classdesc Represents a DownstreamMessage. + * @implements IDownstreamMessage + * @constructor + * @param {IDownstreamMessage=} [properties] Properties to set + */ + function DownstreamMessage(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } - /** - * SystemMessage disconnectedMessage. - * @member {DownstreamMessage.SystemMessage.IDisconnectedMessage|null|undefined} disconnectedMessage - * @memberof DownstreamMessage.SystemMessage - * @instance - */ - SystemMessage.prototype.disconnectedMessage = null; + /** + * DownstreamMessage ackMessage. + * @member {DownstreamMessage.IAckMessage|null|undefined} ackMessage + * @memberof DownstreamMessage + * @instance + */ + DownstreamMessage.prototype.ackMessage = null; - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + /** + * DownstreamMessage dataMessage. + * @member {DownstreamMessage.IDataMessage|null|undefined} dataMessage + * @memberof DownstreamMessage + * @instance + */ + DownstreamMessage.prototype.dataMessage = null; - /** - * SystemMessage message. - * @member {"connectedMessage"|"disconnectedMessage"|undefined} message - * @memberof DownstreamMessage.SystemMessage - * @instance - */ - Object.defineProperty(SystemMessage.prototype, "message", { - get: $util.oneOfGetter($oneOfFields = ["connectedMessage", "disconnectedMessage"]), - set: $util.oneOfSetter($oneOfFields) - }); + /** + * DownstreamMessage systemMessage. + * @member {DownstreamMessage.ISystemMessage|null|undefined} systemMessage + * @memberof DownstreamMessage + * @instance + */ + DownstreamMessage.prototype.systemMessage = null; - /** - * Creates a new SystemMessage instance using the specified properties. - * @function create - * @memberof DownstreamMessage.SystemMessage - * @static - * @param {DownstreamMessage.ISystemMessage=} [properties] Properties to set - * @returns {DownstreamMessage.SystemMessage} SystemMessage instance - */ - SystemMessage.create = function create(properties) { - return new SystemMessage(properties); - }; + /** + * DownstreamMessage groupStateUpdateMessage. + * @member {DownstreamMessage.IGroupStateUpdateMessage|null|undefined} groupStateUpdateMessage + * @memberof DownstreamMessage + * @instance + */ + DownstreamMessage.prototype.groupStateUpdateMessage = null; - /** - * Encodes the specified SystemMessage message. Does not implicitly {@link DownstreamMessage.SystemMessage.verify|verify} messages. - * @function encode - * @memberof DownstreamMessage.SystemMessage - * @static - * @param {DownstreamMessage.ISystemMessage} message SystemMessage message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SystemMessage.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.connectedMessage != null && Object.hasOwnProperty.call(message, "connectedMessage")) - $root.DownstreamMessage.SystemMessage.ConnectedMessage.encode(message.connectedMessage, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.disconnectedMessage != null && Object.hasOwnProperty.call(message, "disconnectedMessage")) - $root.DownstreamMessage.SystemMessage.DisconnectedMessage.encode(message.disconnectedMessage, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; + /** + * DownstreamMessage groupStateSnapshotMessage. + * @member {DownstreamMessage.IGroupStateSnapshotMessage|null|undefined} groupStateSnapshotMessage + * @memberof DownstreamMessage + * @instance + */ + DownstreamMessage.prototype.groupStateSnapshotMessage = null; - /** - * Encodes the specified SystemMessage message, length delimited. Does not implicitly {@link DownstreamMessage.SystemMessage.verify|verify} messages. - * @function encodeDelimited - * @memberof DownstreamMessage.SystemMessage - * @static - * @param {DownstreamMessage.ISystemMessage} message SystemMessage message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SystemMessage.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + // OneOf field names bound to virtual getters and setters + var $oneOfFields; - /** - * Decodes a SystemMessage message from the specified reader or buffer. - * @function decode - * @memberof DownstreamMessage.SystemMessage - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {DownstreamMessage.SystemMessage} SystemMessage - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SystemMessage.decode = function decode(reader, length, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.DownstreamMessage.SystemMessage(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) + /** + * DownstreamMessage message. + * @member {"ackMessage"|"dataMessage"|"systemMessage"|"groupStateUpdateMessage"|"groupStateSnapshotMessage"|undefined} message + * @memberof DownstreamMessage + * @instance + */ + Object.defineProperty(DownstreamMessage.prototype, "message", { + get: $util.oneOfGetter($oneOfFields = ["ackMessage", "dataMessage", "systemMessage", "groupStateUpdateMessage", "groupStateSnapshotMessage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DownstreamMessage instance using the specified properties. + * @function create + * @memberof DownstreamMessage + * @static + * @param {IDownstreamMessage=} [properties] Properties to set + * @returns {DownstreamMessage} DownstreamMessage instance + */ + DownstreamMessage.create = function create(properties) { + return new DownstreamMessage(properties); + }; + + /** + * Encodes the specified DownstreamMessage message. Does not implicitly {@link DownstreamMessage.verify|verify} messages. + * @function encode + * @memberof DownstreamMessage + * @static + * @param {IDownstreamMessage} message DownstreamMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DownstreamMessage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ackMessage != null && Object.hasOwnProperty.call(message, "ackMessage")) + $root.DownstreamMessage.AckMessage.encode(message.ackMessage, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.dataMessage != null && Object.hasOwnProperty.call(message, "dataMessage")) + $root.DownstreamMessage.DataMessage.encode(message.dataMessage, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.systemMessage != null && Object.hasOwnProperty.call(message, "systemMessage")) + $root.DownstreamMessage.SystemMessage.encode(message.systemMessage, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.groupStateUpdateMessage != null && Object.hasOwnProperty.call(message, "groupStateUpdateMessage")) + $root.DownstreamMessage.GroupStateUpdateMessage.encode(message.groupStateUpdateMessage, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.groupStateSnapshotMessage != null && Object.hasOwnProperty.call(message, "groupStateSnapshotMessage")) + $root.DownstreamMessage.GroupStateSnapshotMessage.encode(message.groupStateSnapshotMessage, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DownstreamMessage message, length delimited. Does not implicitly {@link DownstreamMessage.verify|verify} messages. + * @function encodeDelimited + * @memberof DownstreamMessage + * @static + * @param {IDownstreamMessage} message DownstreamMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DownstreamMessage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DownstreamMessage message from the specified reader or buffer. + * @function decode + * @memberof DownstreamMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {DownstreamMessage} DownstreamMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DownstreamMessage.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.DownstreamMessage(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.ackMessage = $root.DownstreamMessage.AckMessage.decode(reader, reader.uint32(), undefined, long + 1); break; - switch (tag >>> 3) { - case 1: { - message.connectedMessage = $root.DownstreamMessage.SystemMessage.ConnectedMessage.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - case 2: { - message.disconnectedMessage = $root.DownstreamMessage.SystemMessage.DisconnectedMessage.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - default: - reader.skipType(tag & 7, long); + } + case 2: { + message.dataMessage = $root.DownstreamMessage.DataMessage.decode(reader, reader.uint32(), undefined, long + 1); break; } - } - return message; - }; - - /** - * Decodes a SystemMessage message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof DownstreamMessage.SystemMessage - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {DownstreamMessage.SystemMessage} SystemMessage - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SystemMessage.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SystemMessage message. - * @function verify - * @memberof DownstreamMessage.SystemMessage - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SystemMessage.verify = function verify(message, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - var properties = {}; - if (message.connectedMessage != null && message.hasOwnProperty("connectedMessage")) { - properties.message = 1; - { - var error = $root.DownstreamMessage.SystemMessage.ConnectedMessage.verify(message.connectedMessage, long + 1); - if (error) - return "connectedMessage." + error; + case 3: { + message.systemMessage = $root.DownstreamMessage.SystemMessage.decode(reader, reader.uint32(), undefined, long + 1); + break; } - } - if (message.disconnectedMessage != null && message.hasOwnProperty("disconnectedMessage")) { - if (properties.message === 1) - return "message: multiple values"; - properties.message = 1; - { - var error = $root.DownstreamMessage.SystemMessage.DisconnectedMessage.verify(message.disconnectedMessage, long + 1); - if (error) - return "disconnectedMessage." + error; + case 9: { + message.groupStateUpdateMessage = $root.DownstreamMessage.GroupStateUpdateMessage.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 10: { + message.groupStateSnapshotMessage = $root.DownstreamMessage.GroupStateSnapshotMessage.decode(reader, reader.uint32(), undefined, long + 1); + break; } + default: + reader.skipType(tag & 7, long); + break; } - return null; - }; + } + return message; + }; - /** - * Creates a SystemMessage message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof DownstreamMessage.SystemMessage - * @static - * @param {Object.} object Plain object - * @returns {DownstreamMessage.SystemMessage} SystemMessage - */ - SystemMessage.fromObject = function fromObject(object, long) { - if (object instanceof $root.DownstreamMessage.SystemMessage) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var message = new $root.DownstreamMessage.SystemMessage(); - if (object.connectedMessage != null) { - if (typeof object.connectedMessage !== "object") - throw TypeError(".DownstreamMessage.SystemMessage.connectedMessage: object expected"); - message.connectedMessage = $root.DownstreamMessage.SystemMessage.ConnectedMessage.fromObject(object.connectedMessage, long + 1); - } - if (object.disconnectedMessage != null) { - if (typeof object.disconnectedMessage !== "object") - throw TypeError(".DownstreamMessage.SystemMessage.disconnectedMessage: object expected"); - message.disconnectedMessage = $root.DownstreamMessage.SystemMessage.DisconnectedMessage.fromObject(object.disconnectedMessage, long + 1); - } - return message; - }; + /** + * Decodes a DownstreamMessage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof DownstreamMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {DownstreamMessage} DownstreamMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DownstreamMessage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Creates a plain object from a SystemMessage message. Also converts values to other types if specified. - * @function toObject - * @memberof DownstreamMessage.SystemMessage - * @static - * @param {DownstreamMessage.SystemMessage} message SystemMessage - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SystemMessage.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.connectedMessage != null && message.hasOwnProperty("connectedMessage")) { - object.connectedMessage = $root.DownstreamMessage.SystemMessage.ConnectedMessage.toObject(message.connectedMessage, options); - if (options.oneofs) - object.message = "connectedMessage"; - } - if (message.disconnectedMessage != null && message.hasOwnProperty("disconnectedMessage")) { - object.disconnectedMessage = $root.DownstreamMessage.SystemMessage.DisconnectedMessage.toObject(message.disconnectedMessage, options); - if (options.oneofs) - object.message = "disconnectedMessage"; + /** + * Verifies a DownstreamMessage message. + * @function verify + * @memberof DownstreamMessage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DownstreamMessage.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.ackMessage != null && message.hasOwnProperty("ackMessage")) { + properties.message = 1; + { + var error = $root.DownstreamMessage.AckMessage.verify(message.ackMessage, long + 1); + if (error) + return "ackMessage." + error; + } + } + if (message.dataMessage != null && message.hasOwnProperty("dataMessage")) { + if (properties.message === 1) + return "message: multiple values"; + properties.message = 1; + { + var error = $root.DownstreamMessage.DataMessage.verify(message.dataMessage, long + 1); + if (error) + return "dataMessage." + error; + } + } + if (message.systemMessage != null && message.hasOwnProperty("systemMessage")) { + if (properties.message === 1) + return "message: multiple values"; + properties.message = 1; + { + var error = $root.DownstreamMessage.SystemMessage.verify(message.systemMessage, long + 1); + if (error) + return "systemMessage." + error; + } + } + if (message.groupStateUpdateMessage != null && message.hasOwnProperty("groupStateUpdateMessage")) { + if (properties.message === 1) + return "message: multiple values"; + properties.message = 1; + { + var error = $root.DownstreamMessage.GroupStateUpdateMessage.verify(message.groupStateUpdateMessage, long + 1); + if (error) + return "groupStateUpdateMessage." + error; + } + } + if (message.groupStateSnapshotMessage != null && message.hasOwnProperty("groupStateSnapshotMessage")) { + if (properties.message === 1) + return "message: multiple values"; + properties.message = 1; + { + var error = $root.DownstreamMessage.GroupStateSnapshotMessage.verify(message.groupStateSnapshotMessage, long + 1); + if (error) + return "groupStateSnapshotMessage." + error; } + } + return null; + }; + + /** + * Creates a DownstreamMessage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof DownstreamMessage + * @static + * @param {Object.} object Plain object + * @returns {DownstreamMessage} DownstreamMessage + */ + DownstreamMessage.fromObject = function fromObject(object, long) { + if (object instanceof $root.DownstreamMessage) return object; - }; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.DownstreamMessage(); + if (object.ackMessage != null) { + if (typeof object.ackMessage !== "object") + throw TypeError(".DownstreamMessage.ackMessage: object expected"); + message.ackMessage = $root.DownstreamMessage.AckMessage.fromObject(object.ackMessage, long + 1); + } + if (object.dataMessage != null) { + if (typeof object.dataMessage !== "object") + throw TypeError(".DownstreamMessage.dataMessage: object expected"); + message.dataMessage = $root.DownstreamMessage.DataMessage.fromObject(object.dataMessage, long + 1); + } + if (object.systemMessage != null) { + if (typeof object.systemMessage !== "object") + throw TypeError(".DownstreamMessage.systemMessage: object expected"); + message.systemMessage = $root.DownstreamMessage.SystemMessage.fromObject(object.systemMessage, long + 1); + } + if (object.groupStateUpdateMessage != null) { + if (typeof object.groupStateUpdateMessage !== "object") + throw TypeError(".DownstreamMessage.groupStateUpdateMessage: object expected"); + message.groupStateUpdateMessage = $root.DownstreamMessage.GroupStateUpdateMessage.fromObject(object.groupStateUpdateMessage, long + 1); + } + if (object.groupStateSnapshotMessage != null) { + if (typeof object.groupStateSnapshotMessage !== "object") + throw TypeError(".DownstreamMessage.groupStateSnapshotMessage: object expected"); + message.groupStateSnapshotMessage = $root.DownstreamMessage.GroupStateSnapshotMessage.fromObject(object.groupStateSnapshotMessage, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a DownstreamMessage message. Also converts values to other types if specified. + * @function toObject + * @memberof DownstreamMessage + * @static + * @param {DownstreamMessage} message DownstreamMessage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DownstreamMessage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.ackMessage != null && message.hasOwnProperty("ackMessage")) { + object.ackMessage = $root.DownstreamMessage.AckMessage.toObject(message.ackMessage, options); + if (options.oneofs) + object.message = "ackMessage"; + } + if (message.dataMessage != null && message.hasOwnProperty("dataMessage")) { + object.dataMessage = $root.DownstreamMessage.DataMessage.toObject(message.dataMessage, options); + if (options.oneofs) + object.message = "dataMessage"; + } + if (message.systemMessage != null && message.hasOwnProperty("systemMessage")) { + object.systemMessage = $root.DownstreamMessage.SystemMessage.toObject(message.systemMessage, options); + if (options.oneofs) + object.message = "systemMessage"; + } + if (message.groupStateUpdateMessage != null && message.hasOwnProperty("groupStateUpdateMessage")) { + object.groupStateUpdateMessage = $root.DownstreamMessage.GroupStateUpdateMessage.toObject(message.groupStateUpdateMessage, options); + if (options.oneofs) + object.message = "groupStateUpdateMessage"; + } + if (message.groupStateSnapshotMessage != null && message.hasOwnProperty("groupStateSnapshotMessage")) { + object.groupStateSnapshotMessage = $root.DownstreamMessage.GroupStateSnapshotMessage.toObject(message.groupStateSnapshotMessage, options); + if (options.oneofs) + object.message = "groupStateSnapshotMessage"; + } + return object; + }; + + /** + * Converts this DownstreamMessage to JSON. + * @function toJSON + * @memberof DownstreamMessage + * @instance + * @returns {Object.} JSON object + */ + DownstreamMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DownstreamMessage + * @function getTypeUrl + * @memberof DownstreamMessage + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DownstreamMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/DownstreamMessage"; + }; + + DownstreamMessage.AckMessage = (function() { /** - * Converts this SystemMessage to JSON. - * @function toJSON - * @memberof DownstreamMessage.SystemMessage - * @instance - * @returns {Object.} JSON object + * Properties of an AckMessage. + * @memberof DownstreamMessage + * @interface IAckMessage + * @property {number|Long|null} [ackId] AckMessage ackId + * @property {boolean|null} [success] AckMessage success + * @property {DownstreamMessage.AckMessage.IErrorMessage|null} [error] AckMessage error */ - SystemMessage.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; /** - * Gets the default type url for SystemMessage - * @function getTypeUrl - * @memberof DownstreamMessage.SystemMessage - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url + * Constructs a new AckMessage. + * @memberof DownstreamMessage + * @classdesc Represents an AckMessage. + * @implements IAckMessage + * @constructor + * @param {DownstreamMessage.IAckMessage=} [properties] Properties to set */ - SystemMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/DownstreamMessage.SystemMessage"; - }; + function AckMessage(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } - SystemMessage.ConnectedMessage = (function() { + /** + * AckMessage ackId. + * @member {number|Long} ackId + * @memberof DownstreamMessage.AckMessage + * @instance + */ + AckMessage.prototype.ackId = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - /** - * Properties of a ConnectedMessage. - * @memberof DownstreamMessage.SystemMessage - * @interface IConnectedMessage - * @property {string|null} [connectionId] ConnectedMessage connectionId - * @property {string|null} [userId] ConnectedMessage userId - * @property {string|null} [reconnectionToken] ConnectedMessage reconnectionToken - */ + /** + * AckMessage success. + * @member {boolean} success + * @memberof DownstreamMessage.AckMessage + * @instance + */ + AckMessage.prototype.success = false; - /** - * Constructs a new ConnectedMessage. - * @memberof DownstreamMessage.SystemMessage - * @classdesc Represents a ConnectedMessage. - * @implements IConnectedMessage - * @constructor - * @param {DownstreamMessage.SystemMessage.IConnectedMessage=} [properties] Properties to set - */ - function ConnectedMessage(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } + /** + * AckMessage error. + * @member {DownstreamMessage.AckMessage.IErrorMessage|null|undefined} error + * @memberof DownstreamMessage.AckMessage + * @instance + */ + AckMessage.prototype.error = null; - /** - * ConnectedMessage connectionId. - * @member {string} connectionId - * @memberof DownstreamMessage.SystemMessage.ConnectedMessage - * @instance - */ - ConnectedMessage.prototype.connectionId = ""; + // OneOf field names bound to virtual getters and setters + var $oneOfFields; - /** - * ConnectedMessage userId. - * @member {string} userId - * @memberof DownstreamMessage.SystemMessage.ConnectedMessage - * @instance - */ - ConnectedMessage.prototype.userId = ""; - - /** - * ConnectedMessage reconnectionToken. - * @member {string} reconnectionToken - * @memberof DownstreamMessage.SystemMessage.ConnectedMessage - * @instance - */ - ConnectedMessage.prototype.reconnectionToken = ""; + // Virtual OneOf for proto3 optional field + Object.defineProperty(AckMessage.prototype, "_error", { + get: $util.oneOfGetter($oneOfFields = ["error"]), + set: $util.oneOfSetter($oneOfFields) + }); - /** - * Creates a new ConnectedMessage instance using the specified properties. - * @function create - * @memberof DownstreamMessage.SystemMessage.ConnectedMessage - * @static - * @param {DownstreamMessage.SystemMessage.IConnectedMessage=} [properties] Properties to set - * @returns {DownstreamMessage.SystemMessage.ConnectedMessage} ConnectedMessage instance - */ - ConnectedMessage.create = function create(properties) { - return new ConnectedMessage(properties); - }; + /** + * Creates a new AckMessage instance using the specified properties. + * @function create + * @memberof DownstreamMessage.AckMessage + * @static + * @param {DownstreamMessage.IAckMessage=} [properties] Properties to set + * @returns {DownstreamMessage.AckMessage} AckMessage instance + */ + AckMessage.create = function create(properties) { + return new AckMessage(properties); + }; - /** - * Encodes the specified ConnectedMessage message. Does not implicitly {@link DownstreamMessage.SystemMessage.ConnectedMessage.verify|verify} messages. - * @function encode - * @memberof DownstreamMessage.SystemMessage.ConnectedMessage - * @static - * @param {DownstreamMessage.SystemMessage.IConnectedMessage} message ConnectedMessage message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ConnectedMessage.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.connectionId != null && Object.hasOwnProperty.call(message, "connectionId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.connectionId); - if (message.userId != null && Object.hasOwnProperty.call(message, "userId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.userId); - if (message.reconnectionToken != null && Object.hasOwnProperty.call(message, "reconnectionToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.reconnectionToken); - return writer; - }; + /** + * Encodes the specified AckMessage message. Does not implicitly {@link DownstreamMessage.AckMessage.verify|verify} messages. + * @function encode + * @memberof DownstreamMessage.AckMessage + * @static + * @param {DownstreamMessage.IAckMessage} message AckMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AckMessage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ackId != null && Object.hasOwnProperty.call(message, "ackId")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.ackId); + if (message.success != null && Object.hasOwnProperty.call(message, "success")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.success); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + $root.DownstreamMessage.AckMessage.ErrorMessage.encode(message.error, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; - /** - * Encodes the specified ConnectedMessage message, length delimited. Does not implicitly {@link DownstreamMessage.SystemMessage.ConnectedMessage.verify|verify} messages. - * @function encodeDelimited - * @memberof DownstreamMessage.SystemMessage.ConnectedMessage - * @static - * @param {DownstreamMessage.SystemMessage.IConnectedMessage} message ConnectedMessage message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ConnectedMessage.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified AckMessage message, length delimited. Does not implicitly {@link DownstreamMessage.AckMessage.verify|verify} messages. + * @function encodeDelimited + * @memberof DownstreamMessage.AckMessage + * @static + * @param {DownstreamMessage.IAckMessage} message AckMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AckMessage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes a ConnectedMessage message from the specified reader or buffer. - * @function decode - * @memberof DownstreamMessage.SystemMessage.ConnectedMessage - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {DownstreamMessage.SystemMessage.ConnectedMessage} ConnectedMessage - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ConnectedMessage.decode = function decode(reader, length, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.DownstreamMessage.SystemMessage.ConnectedMessage(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) + /** + * Decodes an AckMessage message from the specified reader or buffer. + * @function decode + * @memberof DownstreamMessage.AckMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {DownstreamMessage.AckMessage} AckMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AckMessage.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.DownstreamMessage.AckMessage(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.ackId = reader.uint64(); break; - switch (tag >>> 3) { - case 1: { - message.connectionId = reader.string(); - break; - } - case 2: { - message.userId = reader.string(); - break; - } - case 3: { - message.reconnectionToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7, long); + } + case 2: { + message.success = reader.bool(); + break; + } + case 3: { + message.error = $root.DownstreamMessage.AckMessage.ErrorMessage.decode(reader, reader.uint32(), undefined, long + 1); break; } + default: + reader.skipType(tag & 7, long); + break; } - return message; - }; - - /** - * Decodes a ConnectedMessage message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof DownstreamMessage.SystemMessage.ConnectedMessage - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {DownstreamMessage.SystemMessage.ConnectedMessage} ConnectedMessage - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ConnectedMessage.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + } + return message; + }; - /** - * Verifies a ConnectedMessage message. - * @function verify - * @memberof DownstreamMessage.SystemMessage.ConnectedMessage - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ConnectedMessage.verify = function verify(message, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - if (message.connectionId != null && message.hasOwnProperty("connectionId")) - if (!$util.isString(message.connectionId)) - return "connectionId: string expected"; - if (message.userId != null && message.hasOwnProperty("userId")) - if (!$util.isString(message.userId)) - return "userId: string expected"; - if (message.reconnectionToken != null && message.hasOwnProperty("reconnectionToken")) - if (!$util.isString(message.reconnectionToken)) - return "reconnectionToken: string expected"; - return null; - }; + /** + * Decodes an AckMessage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof DownstreamMessage.AckMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {DownstreamMessage.AckMessage} AckMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AckMessage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Creates a ConnectedMessage message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof DownstreamMessage.SystemMessage.ConnectedMessage - * @static - * @param {Object.} object Plain object - * @returns {DownstreamMessage.SystemMessage.ConnectedMessage} ConnectedMessage - */ - ConnectedMessage.fromObject = function fromObject(object, long) { - if (object instanceof $root.DownstreamMessage.SystemMessage.ConnectedMessage) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var message = new $root.DownstreamMessage.SystemMessage.ConnectedMessage(); - if (object.connectionId != null) - message.connectionId = String(object.connectionId); - if (object.userId != null) - message.userId = String(object.userId); - if (object.reconnectionToken != null) - message.reconnectionToken = String(object.reconnectionToken); - return message; - }; - - /** - * Creates a plain object from a ConnectedMessage message. Also converts values to other types if specified. - * @function toObject - * @memberof DownstreamMessage.SystemMessage.ConnectedMessage - * @static - * @param {DownstreamMessage.SystemMessage.ConnectedMessage} message ConnectedMessage - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ConnectedMessage.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.connectionId = ""; - object.userId = ""; - object.reconnectionToken = ""; + /** + * Verifies an AckMessage message. + * @function verify + * @memberof DownstreamMessage.AckMessage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AckMessage.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.ackId != null && message.hasOwnProperty("ackId")) + if (!$util.isInteger(message.ackId) && !(message.ackId && $util.isInteger(message.ackId.low) && $util.isInteger(message.ackId.high))) + return "ackId: integer|Long expected"; + if (message.success != null && message.hasOwnProperty("success")) + if (typeof message.success !== "boolean") + return "success: boolean expected"; + if (message.error != null && message.hasOwnProperty("error")) { + properties._error = 1; + { + var error = $root.DownstreamMessage.AckMessage.ErrorMessage.verify(message.error, long + 1); + if (error) + return "error." + error; } - if (message.connectionId != null && message.hasOwnProperty("connectionId")) - object.connectionId = message.connectionId; - if (message.userId != null && message.hasOwnProperty("userId")) - object.userId = message.userId; - if (message.reconnectionToken != null && message.hasOwnProperty("reconnectionToken")) - object.reconnectionToken = message.reconnectionToken; + } + return null; + }; + + /** + * Creates an AckMessage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof DownstreamMessage.AckMessage + * @static + * @param {Object.} object Plain object + * @returns {DownstreamMessage.AckMessage} AckMessage + */ + AckMessage.fromObject = function fromObject(object, long) { + if (object instanceof $root.DownstreamMessage.AckMessage) return object; - }; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.DownstreamMessage.AckMessage(); + if (object.ackId != null) + if ($util.Long) + (message.ackId = $util.Long.fromValue(object.ackId)).unsigned = true; + else if (typeof object.ackId === "string") + message.ackId = parseInt(object.ackId, 10); + else if (typeof object.ackId === "number") + message.ackId = object.ackId; + else if (typeof object.ackId === "object") + message.ackId = new $util.LongBits(object.ackId.low >>> 0, object.ackId.high >>> 0).toNumber(true); + if (object.success != null) + message.success = Boolean(object.success); + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".DownstreamMessage.AckMessage.error: object expected"); + message.error = $root.DownstreamMessage.AckMessage.ErrorMessage.fromObject(object.error, long + 1); + } + return message; + }; - /** - * Converts this ConnectedMessage to JSON. - * @function toJSON - * @memberof DownstreamMessage.SystemMessage.ConnectedMessage - * @instance - * @returns {Object.} JSON object - */ - ConnectedMessage.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a plain object from an AckMessage message. Also converts values to other types if specified. + * @function toObject + * @memberof DownstreamMessage.AckMessage + * @static + * @param {DownstreamMessage.AckMessage} message AckMessage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AckMessage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.ackId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.ackId = options.longs === String ? "0" : 0; + object.success = false; + } + if (message.ackId != null && message.hasOwnProperty("ackId")) + if (typeof message.ackId === "number") + object.ackId = options.longs === String ? String(message.ackId) : message.ackId; + else + 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; + if (message.success != null && message.hasOwnProperty("success")) + object.success = message.success; + if (message.error != null && message.hasOwnProperty("error")) { + object.error = $root.DownstreamMessage.AckMessage.ErrorMessage.toObject(message.error, options); + if (options.oneofs) + object._error = "error"; + } + return object; + }; - /** - * Gets the default type url for ConnectedMessage - * @function getTypeUrl - * @memberof DownstreamMessage.SystemMessage.ConnectedMessage - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ConnectedMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/DownstreamMessage.SystemMessage.ConnectedMessage"; - }; + /** + * Converts this AckMessage to JSON. + * @function toJSON + * @memberof DownstreamMessage.AckMessage + * @instance + * @returns {Object.} JSON object + */ + AckMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return ConnectedMessage; - })(); + /** + * Gets the default type url for AckMessage + * @function getTypeUrl + * @memberof DownstreamMessage.AckMessage + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AckMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/DownstreamMessage.AckMessage"; + }; - SystemMessage.DisconnectedMessage = (function() { + AckMessage.ErrorMessage = (function() { /** - * Properties of a DisconnectedMessage. - * @memberof DownstreamMessage.SystemMessage - * @interface IDisconnectedMessage - * @property {string|null} [reason] DisconnectedMessage reason + * Properties of an ErrorMessage. + * @memberof DownstreamMessage.AckMessage + * @interface IErrorMessage + * @property {string|null} [name] ErrorMessage name + * @property {string|null} [message] ErrorMessage message */ /** - * Constructs a new DisconnectedMessage. - * @memberof DownstreamMessage.SystemMessage - * @classdesc Represents a DisconnectedMessage. - * @implements IDisconnectedMessage + * Constructs a new ErrorMessage. + * @memberof DownstreamMessage.AckMessage + * @classdesc Represents an ErrorMessage. + * @implements IErrorMessage * @constructor - * @param {DownstreamMessage.SystemMessage.IDisconnectedMessage=} [properties] Properties to set + * @param {DownstreamMessage.AckMessage.IErrorMessage=} [properties] Properties to set */ - function DisconnectedMessage(properties) { + function ErrorMessage(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null && keys[i] !== "__proto__") @@ -3503,81 +3403,95 @@ $root.DownstreamMessage = (function() { } /** - * DisconnectedMessage reason. - * @member {string} reason - * @memberof DownstreamMessage.SystemMessage.DisconnectedMessage + * ErrorMessage name. + * @member {string} name + * @memberof DownstreamMessage.AckMessage.ErrorMessage * @instance */ - DisconnectedMessage.prototype.reason = ""; + ErrorMessage.prototype.name = ""; /** - * Creates a new DisconnectedMessage instance using the specified properties. + * ErrorMessage message. + * @member {string} message + * @memberof DownstreamMessage.AckMessage.ErrorMessage + * @instance + */ + ErrorMessage.prototype.message = ""; + + /** + * Creates a new ErrorMessage instance using the specified properties. * @function create - * @memberof DownstreamMessage.SystemMessage.DisconnectedMessage + * @memberof DownstreamMessage.AckMessage.ErrorMessage * @static - * @param {DownstreamMessage.SystemMessage.IDisconnectedMessage=} [properties] Properties to set - * @returns {DownstreamMessage.SystemMessage.DisconnectedMessage} DisconnectedMessage instance + * @param {DownstreamMessage.AckMessage.IErrorMessage=} [properties] Properties to set + * @returns {DownstreamMessage.AckMessage.ErrorMessage} ErrorMessage instance */ - DisconnectedMessage.create = function create(properties) { - return new DisconnectedMessage(properties); + ErrorMessage.create = function create(properties) { + return new ErrorMessage(properties); }; /** - * Encodes the specified DisconnectedMessage message. Does not implicitly {@link DownstreamMessage.SystemMessage.DisconnectedMessage.verify|verify} messages. + * Encodes the specified ErrorMessage message. Does not implicitly {@link DownstreamMessage.AckMessage.ErrorMessage.verify|verify} messages. * @function encode - * @memberof DownstreamMessage.SystemMessage.DisconnectedMessage + * @memberof DownstreamMessage.AckMessage.ErrorMessage * @static - * @param {DownstreamMessage.SystemMessage.IDisconnectedMessage} message DisconnectedMessage message or plain object to encode + * @param {DownstreamMessage.AckMessage.IErrorMessage} message ErrorMessage message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DisconnectedMessage.encode = function encode(message, writer) { + ErrorMessage.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.reason != null && Object.hasOwnProperty.call(message, "reason")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.reason); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); return writer; }; /** - * Encodes the specified DisconnectedMessage message, length delimited. Does not implicitly {@link DownstreamMessage.SystemMessage.DisconnectedMessage.verify|verify} messages. + * Encodes the specified ErrorMessage message, length delimited. Does not implicitly {@link DownstreamMessage.AckMessage.ErrorMessage.verify|verify} messages. * @function encodeDelimited - * @memberof DownstreamMessage.SystemMessage.DisconnectedMessage + * @memberof DownstreamMessage.AckMessage.ErrorMessage * @static - * @param {DownstreamMessage.SystemMessage.IDisconnectedMessage} message DisconnectedMessage message or plain object to encode + * @param {DownstreamMessage.AckMessage.IErrorMessage} message ErrorMessage message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DisconnectedMessage.encodeDelimited = function encodeDelimited(message, writer) { + ErrorMessage.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DisconnectedMessage message from the specified reader or buffer. + * Decodes an ErrorMessage message from the specified reader or buffer. * @function decode - * @memberof DownstreamMessage.SystemMessage.DisconnectedMessage + * @memberof DownstreamMessage.AckMessage.ErrorMessage * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {DownstreamMessage.SystemMessage.DisconnectedMessage} DisconnectedMessage + * @returns {DownstreamMessage.AckMessage.ErrorMessage} ErrorMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DisconnectedMessage.decode = function decode(reader, length, error, long) { + ErrorMessage.decode = function decode(reader, length, error, long) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); if (long === undefined) long = 0; if (long > $Reader.recursionLimit) throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.DownstreamMessage.SystemMessage.DisconnectedMessage(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.DownstreamMessage.AckMessage.ErrorMessage(); while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) break; switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } case 2: { - message.reason = reader.string(); + message.message = reader.string(); break; } default: @@ -3589,139 +3503,2180 @@ $root.DownstreamMessage = (function() { }; /** - * Decodes a DisconnectedMessage message from the specified reader or buffer, length delimited. + * Decodes an ErrorMessage message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof DownstreamMessage.SystemMessage.DisconnectedMessage + * @memberof DownstreamMessage.AckMessage.ErrorMessage * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {DownstreamMessage.SystemMessage.DisconnectedMessage} DisconnectedMessage + * @returns {DownstreamMessage.AckMessage.ErrorMessage} ErrorMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DisconnectedMessage.decodeDelimited = function decodeDelimited(reader) { + ErrorMessage.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DisconnectedMessage message. + * Verifies an ErrorMessage message. * @function verify - * @memberof DownstreamMessage.SystemMessage.DisconnectedMessage + * @memberof DownstreamMessage.AckMessage.ErrorMessage * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DisconnectedMessage.verify = function verify(message, long) { + ErrorMessage.verify = function verify(message, long) { if (typeof message !== "object" || message === null) return "object expected"; if (long === undefined) long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.reason != null && message.hasOwnProperty("reason")) - if (!$util.isString(message.reason)) - return "reason: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; return null; }; /** - * Creates a DisconnectedMessage message from a plain object. Also converts values to their respective internal types. + * Creates an ErrorMessage message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof DownstreamMessage.SystemMessage.DisconnectedMessage + * @memberof DownstreamMessage.AckMessage.ErrorMessage * @static * @param {Object.} object Plain object - * @returns {DownstreamMessage.SystemMessage.DisconnectedMessage} DisconnectedMessage + * @returns {DownstreamMessage.AckMessage.ErrorMessage} ErrorMessage */ - DisconnectedMessage.fromObject = function fromObject(object, long) { - if (object instanceof $root.DownstreamMessage.SystemMessage.DisconnectedMessage) + ErrorMessage.fromObject = function fromObject(object, long) { + if (object instanceof $root.DownstreamMessage.AckMessage.ErrorMessage) return object; if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); - var message = new $root.DownstreamMessage.SystemMessage.DisconnectedMessage(); - if (object.reason != null) - message.reason = String(object.reason); + var message = new $root.DownstreamMessage.AckMessage.ErrorMessage(); + if (object.name != null) + message.name = String(object.name); + if (object.message != null) + message.message = String(object.message); return message; }; - /** - * Creates a plain object from a DisconnectedMessage message. Also converts values to other types if specified. - * @function toObject - * @memberof DownstreamMessage.SystemMessage.DisconnectedMessage - * @static - * @param {DownstreamMessage.SystemMessage.DisconnectedMessage} message DisconnectedMessage - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DisconnectedMessage.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.reason = ""; - if (message.reason != null && message.hasOwnProperty("reason")) - object.reason = message.reason; - return object; - }; + /** + * Creates a plain object from an ErrorMessage message. Also converts values to other types if specified. + * @function toObject + * @memberof DownstreamMessage.AckMessage.ErrorMessage + * @static + * @param {DownstreamMessage.AckMessage.ErrorMessage} message ErrorMessage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ErrorMessage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.message = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + return object; + }; + + /** + * Converts this ErrorMessage to JSON. + * @function toJSON + * @memberof DownstreamMessage.AckMessage.ErrorMessage + * @instance + * @returns {Object.} JSON object + */ + ErrorMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ErrorMessage + * @function getTypeUrl + * @memberof DownstreamMessage.AckMessage.ErrorMessage + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ErrorMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/DownstreamMessage.AckMessage.ErrorMessage"; + }; + + return ErrorMessage; + })(); + + return AckMessage; + })(); + + DownstreamMessage.DataMessage = (function() { + + /** + * Properties of a DataMessage. + * @memberof DownstreamMessage + * @interface IDataMessage + * @property {string|null} [from] DataMessage from + * @property {string|null} [group] DataMessage group + * @property {IMessageData|null} [data] DataMessage data + * @property {number|Long|null} [sequenceId] DataMessage sequenceId + */ + + /** + * Constructs a new DataMessage. + * @memberof DownstreamMessage + * @classdesc Represents a DataMessage. + * @implements IDataMessage + * @constructor + * @param {DownstreamMessage.IDataMessage=} [properties] Properties to set + */ + function DataMessage(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DataMessage from. + * @member {string} from + * @memberof DownstreamMessage.DataMessage + * @instance + */ + DataMessage.prototype.from = ""; + + /** + * DataMessage group. + * @member {string|null|undefined} group + * @memberof DownstreamMessage.DataMessage + * @instance + */ + DataMessage.prototype.group = null; + + /** + * DataMessage data. + * @member {IMessageData|null|undefined} data + * @memberof DownstreamMessage.DataMessage + * @instance + */ + DataMessage.prototype.data = null; + + /** + * DataMessage sequenceId. + * @member {number|Long|null|undefined} sequenceId + * @memberof DownstreamMessage.DataMessage + * @instance + */ + DataMessage.prototype.sequenceId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DataMessage.prototype, "_group", { + get: $util.oneOfGetter($oneOfFields = ["group"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DataMessage.prototype, "_sequenceId", { + get: $util.oneOfGetter($oneOfFields = ["sequenceId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DataMessage instance using the specified properties. + * @function create + * @memberof DownstreamMessage.DataMessage + * @static + * @param {DownstreamMessage.IDataMessage=} [properties] Properties to set + * @returns {DownstreamMessage.DataMessage} DataMessage instance + */ + DataMessage.create = function create(properties) { + return new DataMessage(properties); + }; + + /** + * Encodes the specified DataMessage message. Does not implicitly {@link DownstreamMessage.DataMessage.verify|verify} messages. + * @function encode + * @memberof DownstreamMessage.DataMessage + * @static + * @param {DownstreamMessage.IDataMessage} message DataMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataMessage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.from != null && Object.hasOwnProperty.call(message, "from")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.from); + if (message.group != null && Object.hasOwnProperty.call(message, "group")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.group); + if (message.data != null && Object.hasOwnProperty.call(message, "data")) + $root.MessageData.encode(message.data, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.sequenceId != null && Object.hasOwnProperty.call(message, "sequenceId")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.sequenceId); + return writer; + }; + + /** + * Encodes the specified DataMessage message, length delimited. Does not implicitly {@link DownstreamMessage.DataMessage.verify|verify} messages. + * @function encodeDelimited + * @memberof DownstreamMessage.DataMessage + * @static + * @param {DownstreamMessage.IDataMessage} message DataMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataMessage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DataMessage message from the specified reader or buffer. + * @function decode + * @memberof DownstreamMessage.DataMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {DownstreamMessage.DataMessage} DataMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataMessage.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.DownstreamMessage.DataMessage(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.from = reader.string(); + break; + } + case 2: { + message.group = reader.string(); + break; + } + case 3: { + message.data = $root.MessageData.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.sequenceId = reader.uint64(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DataMessage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof DownstreamMessage.DataMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {DownstreamMessage.DataMessage} DataMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataMessage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DataMessage message. + * @function verify + * @memberof DownstreamMessage.DataMessage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DataMessage.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.from != null && message.hasOwnProperty("from")) + if (!$util.isString(message.from)) + return "from: string expected"; + if (message.group != null && message.hasOwnProperty("group")) { + properties._group = 1; + if (!$util.isString(message.group)) + return "group: string expected"; + } + if (message.data != null && message.hasOwnProperty("data")) { + var error = $root.MessageData.verify(message.data, long + 1); + if (error) + return "data." + error; + } + if (message.sequenceId != null && message.hasOwnProperty("sequenceId")) { + properties._sequenceId = 1; + if (!$util.isInteger(message.sequenceId) && !(message.sequenceId && $util.isInteger(message.sequenceId.low) && $util.isInteger(message.sequenceId.high))) + return "sequenceId: integer|Long expected"; + } + return null; + }; + + /** + * Creates a DataMessage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof DownstreamMessage.DataMessage + * @static + * @param {Object.} object Plain object + * @returns {DownstreamMessage.DataMessage} DataMessage + */ + DataMessage.fromObject = function fromObject(object, long) { + if (object instanceof $root.DownstreamMessage.DataMessage) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.DownstreamMessage.DataMessage(); + if (object.from != null) + message.from = String(object.from); + if (object.group != null) + message.group = String(object.group); + if (object.data != null) { + if (typeof object.data !== "object") + throw TypeError(".DownstreamMessage.DataMessage.data: object expected"); + message.data = $root.MessageData.fromObject(object.data, long + 1); + } + if (object.sequenceId != null) + if ($util.Long) + (message.sequenceId = $util.Long.fromValue(object.sequenceId)).unsigned = true; + else if (typeof object.sequenceId === "string") + message.sequenceId = parseInt(object.sequenceId, 10); + else if (typeof object.sequenceId === "number") + message.sequenceId = object.sequenceId; + else if (typeof object.sequenceId === "object") + message.sequenceId = new $util.LongBits(object.sequenceId.low >>> 0, object.sequenceId.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a DataMessage message. Also converts values to other types if specified. + * @function toObject + * @memberof DownstreamMessage.DataMessage + * @static + * @param {DownstreamMessage.DataMessage} message DataMessage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DataMessage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.from = ""; + object.data = null; + } + if (message.from != null && message.hasOwnProperty("from")) + object.from = message.from; + if (message.group != null && message.hasOwnProperty("group")) { + object.group = message.group; + if (options.oneofs) + object._group = "group"; + } + if (message.data != null && message.hasOwnProperty("data")) + object.data = $root.MessageData.toObject(message.data, options); + if (message.sequenceId != null && message.hasOwnProperty("sequenceId")) { + if (typeof message.sequenceId === "number") + object.sequenceId = options.longs === String ? String(message.sequenceId) : message.sequenceId; + else + 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; + if (options.oneofs) + object._sequenceId = "sequenceId"; + } + return object; + }; + + /** + * Converts this DataMessage to JSON. + * @function toJSON + * @memberof DownstreamMessage.DataMessage + * @instance + * @returns {Object.} JSON object + */ + DataMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DataMessage + * @function getTypeUrl + * @memberof DownstreamMessage.DataMessage + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DataMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/DownstreamMessage.DataMessage"; + }; + + return DataMessage; + })(); + + DownstreamMessage.SystemMessage = (function() { + + /** + * Properties of a SystemMessage. + * @memberof DownstreamMessage + * @interface ISystemMessage + * @property {DownstreamMessage.SystemMessage.IConnectedMessage|null} [connectedMessage] SystemMessage connectedMessage + * @property {DownstreamMessage.SystemMessage.IDisconnectedMessage|null} [disconnectedMessage] SystemMessage disconnectedMessage + */ + + /** + * Constructs a new SystemMessage. + * @memberof DownstreamMessage + * @classdesc Represents a SystemMessage. + * @implements ISystemMessage + * @constructor + * @param {DownstreamMessage.ISystemMessage=} [properties] Properties to set + */ + function SystemMessage(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * SystemMessage connectedMessage. + * @member {DownstreamMessage.SystemMessage.IConnectedMessage|null|undefined} connectedMessage + * @memberof DownstreamMessage.SystemMessage + * @instance + */ + SystemMessage.prototype.connectedMessage = null; + + /** + * SystemMessage disconnectedMessage. + * @member {DownstreamMessage.SystemMessage.IDisconnectedMessage|null|undefined} disconnectedMessage + * @memberof DownstreamMessage.SystemMessage + * @instance + */ + SystemMessage.prototype.disconnectedMessage = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SystemMessage message. + * @member {"connectedMessage"|"disconnectedMessage"|undefined} message + * @memberof DownstreamMessage.SystemMessage + * @instance + */ + Object.defineProperty(SystemMessage.prototype, "message", { + get: $util.oneOfGetter($oneOfFields = ["connectedMessage", "disconnectedMessage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SystemMessage instance using the specified properties. + * @function create + * @memberof DownstreamMessage.SystemMessage + * @static + * @param {DownstreamMessage.ISystemMessage=} [properties] Properties to set + * @returns {DownstreamMessage.SystemMessage} SystemMessage instance + */ + SystemMessage.create = function create(properties) { + return new SystemMessage(properties); + }; + + /** + * Encodes the specified SystemMessage message. Does not implicitly {@link DownstreamMessage.SystemMessage.verify|verify} messages. + * @function encode + * @memberof DownstreamMessage.SystemMessage + * @static + * @param {DownstreamMessage.ISystemMessage} message SystemMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SystemMessage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.connectedMessage != null && Object.hasOwnProperty.call(message, "connectedMessage")) + $root.DownstreamMessage.SystemMessage.ConnectedMessage.encode(message.connectedMessage, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.disconnectedMessage != null && Object.hasOwnProperty.call(message, "disconnectedMessage")) + $root.DownstreamMessage.SystemMessage.DisconnectedMessage.encode(message.disconnectedMessage, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SystemMessage message, length delimited. Does not implicitly {@link DownstreamMessage.SystemMessage.verify|verify} messages. + * @function encodeDelimited + * @memberof DownstreamMessage.SystemMessage + * @static + * @param {DownstreamMessage.ISystemMessage} message SystemMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SystemMessage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SystemMessage message from the specified reader or buffer. + * @function decode + * @memberof DownstreamMessage.SystemMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {DownstreamMessage.SystemMessage} SystemMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SystemMessage.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.DownstreamMessage.SystemMessage(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.connectedMessage = $root.DownstreamMessage.SystemMessage.ConnectedMessage.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.disconnectedMessage = $root.DownstreamMessage.SystemMessage.DisconnectedMessage.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a SystemMessage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof DownstreamMessage.SystemMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {DownstreamMessage.SystemMessage} SystemMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SystemMessage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SystemMessage message. + * @function verify + * @memberof DownstreamMessage.SystemMessage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SystemMessage.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.connectedMessage != null && message.hasOwnProperty("connectedMessage")) { + properties.message = 1; + { + var error = $root.DownstreamMessage.SystemMessage.ConnectedMessage.verify(message.connectedMessage, long + 1); + if (error) + return "connectedMessage." + error; + } + } + if (message.disconnectedMessage != null && message.hasOwnProperty("disconnectedMessage")) { + if (properties.message === 1) + return "message: multiple values"; + properties.message = 1; + { + var error = $root.DownstreamMessage.SystemMessage.DisconnectedMessage.verify(message.disconnectedMessage, long + 1); + if (error) + return "disconnectedMessage." + error; + } + } + return null; + }; + + /** + * Creates a SystemMessage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof DownstreamMessage.SystemMessage + * @static + * @param {Object.} object Plain object + * @returns {DownstreamMessage.SystemMessage} SystemMessage + */ + SystemMessage.fromObject = function fromObject(object, long) { + if (object instanceof $root.DownstreamMessage.SystemMessage) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.DownstreamMessage.SystemMessage(); + if (object.connectedMessage != null) { + if (typeof object.connectedMessage !== "object") + throw TypeError(".DownstreamMessage.SystemMessage.connectedMessage: object expected"); + message.connectedMessage = $root.DownstreamMessage.SystemMessage.ConnectedMessage.fromObject(object.connectedMessage, long + 1); + } + if (object.disconnectedMessage != null) { + if (typeof object.disconnectedMessage !== "object") + throw TypeError(".DownstreamMessage.SystemMessage.disconnectedMessage: object expected"); + message.disconnectedMessage = $root.DownstreamMessage.SystemMessage.DisconnectedMessage.fromObject(object.disconnectedMessage, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a SystemMessage message. Also converts values to other types if specified. + * @function toObject + * @memberof DownstreamMessage.SystemMessage + * @static + * @param {DownstreamMessage.SystemMessage} message SystemMessage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SystemMessage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.connectedMessage != null && message.hasOwnProperty("connectedMessage")) { + object.connectedMessage = $root.DownstreamMessage.SystemMessage.ConnectedMessage.toObject(message.connectedMessage, options); + if (options.oneofs) + object.message = "connectedMessage"; + } + if (message.disconnectedMessage != null && message.hasOwnProperty("disconnectedMessage")) { + object.disconnectedMessage = $root.DownstreamMessage.SystemMessage.DisconnectedMessage.toObject(message.disconnectedMessage, options); + if (options.oneofs) + object.message = "disconnectedMessage"; + } + return object; + }; + + /** + * Converts this SystemMessage to JSON. + * @function toJSON + * @memberof DownstreamMessage.SystemMessage + * @instance + * @returns {Object.} JSON object + */ + SystemMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SystemMessage + * @function getTypeUrl + * @memberof DownstreamMessage.SystemMessage + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SystemMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/DownstreamMessage.SystemMessage"; + }; + + SystemMessage.ConnectedMessage = (function() { + + /** + * Properties of a ConnectedMessage. + * @memberof DownstreamMessage.SystemMessage + * @interface IConnectedMessage + * @property {string|null} [connectionId] ConnectedMessage connectionId + * @property {string|null} [userId] ConnectedMessage userId + * @property {string|null} [reconnectionToken] ConnectedMessage reconnectionToken + */ + + /** + * Constructs a new ConnectedMessage. + * @memberof DownstreamMessage.SystemMessage + * @classdesc Represents a ConnectedMessage. + * @implements IConnectedMessage + * @constructor + * @param {DownstreamMessage.SystemMessage.IConnectedMessage=} [properties] Properties to set + */ + function ConnectedMessage(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConnectedMessage connectionId. + * @member {string} connectionId + * @memberof DownstreamMessage.SystemMessage.ConnectedMessage + * @instance + */ + ConnectedMessage.prototype.connectionId = ""; + + /** + * ConnectedMessage userId. + * @member {string} userId + * @memberof DownstreamMessage.SystemMessage.ConnectedMessage + * @instance + */ + ConnectedMessage.prototype.userId = ""; + + /** + * ConnectedMessage reconnectionToken. + * @member {string} reconnectionToken + * @memberof DownstreamMessage.SystemMessage.ConnectedMessage + * @instance + */ + ConnectedMessage.prototype.reconnectionToken = ""; + + /** + * Creates a new ConnectedMessage instance using the specified properties. + * @function create + * @memberof DownstreamMessage.SystemMessage.ConnectedMessage + * @static + * @param {DownstreamMessage.SystemMessage.IConnectedMessage=} [properties] Properties to set + * @returns {DownstreamMessage.SystemMessage.ConnectedMessage} ConnectedMessage instance + */ + ConnectedMessage.create = function create(properties) { + return new ConnectedMessage(properties); + }; + + /** + * Encodes the specified ConnectedMessage message. Does not implicitly {@link DownstreamMessage.SystemMessage.ConnectedMessage.verify|verify} messages. + * @function encode + * @memberof DownstreamMessage.SystemMessage.ConnectedMessage + * @static + * @param {DownstreamMessage.SystemMessage.IConnectedMessage} message ConnectedMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConnectedMessage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.connectionId != null && Object.hasOwnProperty.call(message, "connectionId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.connectionId); + if (message.userId != null && Object.hasOwnProperty.call(message, "userId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.userId); + if (message.reconnectionToken != null && Object.hasOwnProperty.call(message, "reconnectionToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.reconnectionToken); + return writer; + }; + + /** + * Encodes the specified ConnectedMessage message, length delimited. Does not implicitly {@link DownstreamMessage.SystemMessage.ConnectedMessage.verify|verify} messages. + * @function encodeDelimited + * @memberof DownstreamMessage.SystemMessage.ConnectedMessage + * @static + * @param {DownstreamMessage.SystemMessage.IConnectedMessage} message ConnectedMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConnectedMessage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConnectedMessage message from the specified reader or buffer. + * @function decode + * @memberof DownstreamMessage.SystemMessage.ConnectedMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {DownstreamMessage.SystemMessage.ConnectedMessage} ConnectedMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConnectedMessage.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.DownstreamMessage.SystemMessage.ConnectedMessage(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.connectionId = reader.string(); + break; + } + case 2: { + message.userId = reader.string(); + break; + } + case 3: { + message.reconnectionToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ConnectedMessage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof DownstreamMessage.SystemMessage.ConnectedMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {DownstreamMessage.SystemMessage.ConnectedMessage} ConnectedMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConnectedMessage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConnectedMessage message. + * @function verify + * @memberof DownstreamMessage.SystemMessage.ConnectedMessage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConnectedMessage.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.connectionId != null && message.hasOwnProperty("connectionId")) + if (!$util.isString(message.connectionId)) + return "connectionId: string expected"; + if (message.userId != null && message.hasOwnProperty("userId")) + if (!$util.isString(message.userId)) + return "userId: string expected"; + if (message.reconnectionToken != null && message.hasOwnProperty("reconnectionToken")) + if (!$util.isString(message.reconnectionToken)) + return "reconnectionToken: string expected"; + return null; + }; + + /** + * Creates a ConnectedMessage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof DownstreamMessage.SystemMessage.ConnectedMessage + * @static + * @param {Object.} object Plain object + * @returns {DownstreamMessage.SystemMessage.ConnectedMessage} ConnectedMessage + */ + ConnectedMessage.fromObject = function fromObject(object, long) { + if (object instanceof $root.DownstreamMessage.SystemMessage.ConnectedMessage) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.DownstreamMessage.SystemMessage.ConnectedMessage(); + if (object.connectionId != null) + message.connectionId = String(object.connectionId); + if (object.userId != null) + message.userId = String(object.userId); + if (object.reconnectionToken != null) + message.reconnectionToken = String(object.reconnectionToken); + return message; + }; + + /** + * Creates a plain object from a ConnectedMessage message. Also converts values to other types if specified. + * @function toObject + * @memberof DownstreamMessage.SystemMessage.ConnectedMessage + * @static + * @param {DownstreamMessage.SystemMessage.ConnectedMessage} message ConnectedMessage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConnectedMessage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.connectionId = ""; + object.userId = ""; + object.reconnectionToken = ""; + } + if (message.connectionId != null && message.hasOwnProperty("connectionId")) + object.connectionId = message.connectionId; + if (message.userId != null && message.hasOwnProperty("userId")) + object.userId = message.userId; + if (message.reconnectionToken != null && message.hasOwnProperty("reconnectionToken")) + object.reconnectionToken = message.reconnectionToken; + return object; + }; + + /** + * Converts this ConnectedMessage to JSON. + * @function toJSON + * @memberof DownstreamMessage.SystemMessage.ConnectedMessage + * @instance + * @returns {Object.} JSON object + */ + ConnectedMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ConnectedMessage + * @function getTypeUrl + * @memberof DownstreamMessage.SystemMessage.ConnectedMessage + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConnectedMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/DownstreamMessage.SystemMessage.ConnectedMessage"; + }; + + return ConnectedMessage; + })(); + + SystemMessage.DisconnectedMessage = (function() { + + /** + * Properties of a DisconnectedMessage. + * @memberof DownstreamMessage.SystemMessage + * @interface IDisconnectedMessage + * @property {string|null} [reason] DisconnectedMessage reason + */ + + /** + * Constructs a new DisconnectedMessage. + * @memberof DownstreamMessage.SystemMessage + * @classdesc Represents a DisconnectedMessage. + * @implements IDisconnectedMessage + * @constructor + * @param {DownstreamMessage.SystemMessage.IDisconnectedMessage=} [properties] Properties to set + */ + function DisconnectedMessage(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DisconnectedMessage reason. + * @member {string} reason + * @memberof DownstreamMessage.SystemMessage.DisconnectedMessage + * @instance + */ + DisconnectedMessage.prototype.reason = ""; + + /** + * Creates a new DisconnectedMessage instance using the specified properties. + * @function create + * @memberof DownstreamMessage.SystemMessage.DisconnectedMessage + * @static + * @param {DownstreamMessage.SystemMessage.IDisconnectedMessage=} [properties] Properties to set + * @returns {DownstreamMessage.SystemMessage.DisconnectedMessage} DisconnectedMessage instance + */ + DisconnectedMessage.create = function create(properties) { + return new DisconnectedMessage(properties); + }; + + /** + * Encodes the specified DisconnectedMessage message. Does not implicitly {@link DownstreamMessage.SystemMessage.DisconnectedMessage.verify|verify} messages. + * @function encode + * @memberof DownstreamMessage.SystemMessage.DisconnectedMessage + * @static + * @param {DownstreamMessage.SystemMessage.IDisconnectedMessage} message DisconnectedMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DisconnectedMessage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.reason != null && Object.hasOwnProperty.call(message, "reason")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.reason); + return writer; + }; + + /** + * Encodes the specified DisconnectedMessage message, length delimited. Does not implicitly {@link DownstreamMessage.SystemMessage.DisconnectedMessage.verify|verify} messages. + * @function encodeDelimited + * @memberof DownstreamMessage.SystemMessage.DisconnectedMessage + * @static + * @param {DownstreamMessage.SystemMessage.IDisconnectedMessage} message DisconnectedMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DisconnectedMessage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DisconnectedMessage message from the specified reader or buffer. + * @function decode + * @memberof DownstreamMessage.SystemMessage.DisconnectedMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {DownstreamMessage.SystemMessage.DisconnectedMessage} DisconnectedMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DisconnectedMessage.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.DownstreamMessage.SystemMessage.DisconnectedMessage(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.reason = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DisconnectedMessage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof DownstreamMessage.SystemMessage.DisconnectedMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {DownstreamMessage.SystemMessage.DisconnectedMessage} DisconnectedMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DisconnectedMessage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DisconnectedMessage message. + * @function verify + * @memberof DownstreamMessage.SystemMessage.DisconnectedMessage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DisconnectedMessage.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.reason != null && message.hasOwnProperty("reason")) + if (!$util.isString(message.reason)) + return "reason: string expected"; + return null; + }; + + /** + * Creates a DisconnectedMessage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof DownstreamMessage.SystemMessage.DisconnectedMessage + * @static + * @param {Object.} object Plain object + * @returns {DownstreamMessage.SystemMessage.DisconnectedMessage} DisconnectedMessage + */ + DisconnectedMessage.fromObject = function fromObject(object, long) { + if (object instanceof $root.DownstreamMessage.SystemMessage.DisconnectedMessage) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.DownstreamMessage.SystemMessage.DisconnectedMessage(); + if (object.reason != null) + message.reason = String(object.reason); + return message; + }; + + /** + * Creates a plain object from a DisconnectedMessage message. Also converts values to other types if specified. + * @function toObject + * @memberof DownstreamMessage.SystemMessage.DisconnectedMessage + * @static + * @param {DownstreamMessage.SystemMessage.DisconnectedMessage} message DisconnectedMessage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DisconnectedMessage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.reason = ""; + if (message.reason != null && message.hasOwnProperty("reason")) + object.reason = message.reason; + return object; + }; + + /** + * Converts this DisconnectedMessage to JSON. + * @function toJSON + * @memberof DownstreamMessage.SystemMessage.DisconnectedMessage + * @instance + * @returns {Object.} JSON object + */ + DisconnectedMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DisconnectedMessage + * @function getTypeUrl + * @memberof DownstreamMessage.SystemMessage.DisconnectedMessage + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DisconnectedMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/DownstreamMessage.SystemMessage.DisconnectedMessage"; + }; + + return DisconnectedMessage; + })(); + + return SystemMessage; + })(); + + DownstreamMessage.GroupStateSnapshotMessage = (function() { + + /** + * Properties of a GroupStateSnapshotMessage. + * @memberof DownstreamMessage + * @interface IGroupStateSnapshotMessage + * @property {string|null} [group] GroupStateSnapshotMessage group + * @property {Array.|null} [items] GroupStateSnapshotMessage items + * @property {number|Long|null} [sequenceId] GroupStateSnapshotMessage sequenceId + */ + + /** + * Constructs a new GroupStateSnapshotMessage. + * @memberof DownstreamMessage + * @classdesc Represents a GroupStateSnapshotMessage. + * @implements IGroupStateSnapshotMessage + * @constructor + * @param {DownstreamMessage.IGroupStateSnapshotMessage=} [properties] Properties to set + */ + function GroupStateSnapshotMessage(properties) { + this.items = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GroupStateSnapshotMessage group. + * @member {string} group + * @memberof DownstreamMessage.GroupStateSnapshotMessage + * @instance + */ + GroupStateSnapshotMessage.prototype.group = ""; + + /** + * GroupStateSnapshotMessage items. + * @member {Array.} items + * @memberof DownstreamMessage.GroupStateSnapshotMessage + * @instance + */ + GroupStateSnapshotMessage.prototype.items = $util.emptyArray; + + /** + * GroupStateSnapshotMessage sequenceId. + * @member {number|Long|null|undefined} sequenceId + * @memberof DownstreamMessage.GroupStateSnapshotMessage + * @instance + */ + GroupStateSnapshotMessage.prototype.sequenceId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(GroupStateSnapshotMessage.prototype, "_sequenceId", { + get: $util.oneOfGetter($oneOfFields = ["sequenceId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GroupStateSnapshotMessage instance using the specified properties. + * @function create + * @memberof DownstreamMessage.GroupStateSnapshotMessage + * @static + * @param {DownstreamMessage.IGroupStateSnapshotMessage=} [properties] Properties to set + * @returns {DownstreamMessage.GroupStateSnapshotMessage} GroupStateSnapshotMessage instance + */ + GroupStateSnapshotMessage.create = function create(properties) { + return new GroupStateSnapshotMessage(properties); + }; + + /** + * Encodes the specified GroupStateSnapshotMessage message. Does not implicitly {@link DownstreamMessage.GroupStateSnapshotMessage.verify|verify} messages. + * @function encode + * @memberof DownstreamMessage.GroupStateSnapshotMessage + * @static + * @param {DownstreamMessage.IGroupStateSnapshotMessage} message GroupStateSnapshotMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupStateSnapshotMessage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.group != null && Object.hasOwnProperty.call(message, "group")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.group); + if (message.items != null && message.items.length) + for (var i = 0; i < message.items.length; ++i) + $root.GroupStateItem.encode(message.items[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.sequenceId != null && Object.hasOwnProperty.call(message, "sequenceId")) + writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.sequenceId); + return writer; + }; + + /** + * Encodes the specified GroupStateSnapshotMessage message, length delimited. Does not implicitly {@link DownstreamMessage.GroupStateSnapshotMessage.verify|verify} messages. + * @function encodeDelimited + * @memberof DownstreamMessage.GroupStateSnapshotMessage + * @static + * @param {DownstreamMessage.IGroupStateSnapshotMessage} message GroupStateSnapshotMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupStateSnapshotMessage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GroupStateSnapshotMessage message from the specified reader or buffer. + * @function decode + * @memberof DownstreamMessage.GroupStateSnapshotMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {DownstreamMessage.GroupStateSnapshotMessage} GroupStateSnapshotMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupStateSnapshotMessage.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.DownstreamMessage.GroupStateSnapshotMessage(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.group = reader.string(); + break; + } + case 2: { + if (!(message.items && message.items.length)) + message.items = []; + message.items.push($root.GroupStateItem.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 3: { + message.sequenceId = reader.uint64(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GroupStateSnapshotMessage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof DownstreamMessage.GroupStateSnapshotMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {DownstreamMessage.GroupStateSnapshotMessage} GroupStateSnapshotMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupStateSnapshotMessage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GroupStateSnapshotMessage message. + * @function verify + * @memberof DownstreamMessage.GroupStateSnapshotMessage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GroupStateSnapshotMessage.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.group != null && message.hasOwnProperty("group")) + if (!$util.isString(message.group)) + return "group: string expected"; + if (message.items != null && message.hasOwnProperty("items")) { + if (!Array.isArray(message.items)) + return "items: array expected"; + for (var i = 0; i < message.items.length; ++i) { + var error = $root.GroupStateItem.verify(message.items[i], long + 1); + if (error) + return "items." + error; + } + } + if (message.sequenceId != null && message.hasOwnProperty("sequenceId")) { + properties._sequenceId = 1; + if (!$util.isInteger(message.sequenceId) && !(message.sequenceId && $util.isInteger(message.sequenceId.low) && $util.isInteger(message.sequenceId.high))) + return "sequenceId: integer|Long expected"; + } + return null; + }; + + /** + * Creates a GroupStateSnapshotMessage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof DownstreamMessage.GroupStateSnapshotMessage + * @static + * @param {Object.} object Plain object + * @returns {DownstreamMessage.GroupStateSnapshotMessage} GroupStateSnapshotMessage + */ + GroupStateSnapshotMessage.fromObject = function fromObject(object, long) { + if (object instanceof $root.DownstreamMessage.GroupStateSnapshotMessage) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.DownstreamMessage.GroupStateSnapshotMessage(); + if (object.group != null) + message.group = String(object.group); + if (object.items) { + if (!Array.isArray(object.items)) + throw TypeError(".DownstreamMessage.GroupStateSnapshotMessage.items: array expected"); + message.items = []; + for (var i = 0; i < object.items.length; ++i) { + if (typeof object.items[i] !== "object") + throw TypeError(".DownstreamMessage.GroupStateSnapshotMessage.items: object expected"); + message.items[i] = $root.GroupStateItem.fromObject(object.items[i], long + 1); + } + } + if (object.sequenceId != null) + if ($util.Long) + (message.sequenceId = $util.Long.fromValue(object.sequenceId)).unsigned = true; + else if (typeof object.sequenceId === "string") + message.sequenceId = parseInt(object.sequenceId, 10); + else if (typeof object.sequenceId === "number") + message.sequenceId = object.sequenceId; + else if (typeof object.sequenceId === "object") + message.sequenceId = new $util.LongBits(object.sequenceId.low >>> 0, object.sequenceId.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a GroupStateSnapshotMessage message. Also converts values to other types if specified. + * @function toObject + * @memberof DownstreamMessage.GroupStateSnapshotMessage + * @static + * @param {DownstreamMessage.GroupStateSnapshotMessage} message GroupStateSnapshotMessage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GroupStateSnapshotMessage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.items = []; + if (options.defaults) + object.group = ""; + if (message.group != null && message.hasOwnProperty("group")) + object.group = message.group; + if (message.items && message.items.length) { + object.items = []; + for (var j = 0; j < message.items.length; ++j) + object.items[j] = $root.GroupStateItem.toObject(message.items[j], options); + } + if (message.sequenceId != null && message.hasOwnProperty("sequenceId")) { + if (typeof message.sequenceId === "number") + object.sequenceId = options.longs === String ? String(message.sequenceId) : message.sequenceId; + else + 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; + if (options.oneofs) + object._sequenceId = "sequenceId"; + } + return object; + }; + + /** + * Converts this GroupStateSnapshotMessage to JSON. + * @function toJSON + * @memberof DownstreamMessage.GroupStateSnapshotMessage + * @instance + * @returns {Object.} JSON object + */ + GroupStateSnapshotMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GroupStateSnapshotMessage + * @function getTypeUrl + * @memberof DownstreamMessage.GroupStateSnapshotMessage + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GroupStateSnapshotMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/DownstreamMessage.GroupStateSnapshotMessage"; + }; + + return GroupStateSnapshotMessage; + })(); + + DownstreamMessage.GroupStateUpdateMessage = (function() { + + /** + * Properties of a GroupStateUpdateMessage. + * @memberof DownstreamMessage + * @interface IGroupStateUpdateMessage + * @property {string|null} [group] GroupStateUpdateMessage group + * @property {Array.|null} [items] GroupStateUpdateMessage items + * @property {number|Long|null} [sequenceId] GroupStateUpdateMessage sequenceId + */ + + /** + * Constructs a new GroupStateUpdateMessage. + * @memberof DownstreamMessage + * @classdesc Represents a GroupStateUpdateMessage. + * @implements IGroupStateUpdateMessage + * @constructor + * @param {DownstreamMessage.IGroupStateUpdateMessage=} [properties] Properties to set + */ + function GroupStateUpdateMessage(properties) { + this.items = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GroupStateUpdateMessage group. + * @member {string} group + * @memberof DownstreamMessage.GroupStateUpdateMessage + * @instance + */ + GroupStateUpdateMessage.prototype.group = ""; + + /** + * GroupStateUpdateMessage items. + * @member {Array.} items + * @memberof DownstreamMessage.GroupStateUpdateMessage + * @instance + */ + GroupStateUpdateMessage.prototype.items = $util.emptyArray; + + /** + * GroupStateUpdateMessage sequenceId. + * @member {number|Long|null|undefined} sequenceId + * @memberof DownstreamMessage.GroupStateUpdateMessage + * @instance + */ + GroupStateUpdateMessage.prototype.sequenceId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(GroupStateUpdateMessage.prototype, "_sequenceId", { + get: $util.oneOfGetter($oneOfFields = ["sequenceId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GroupStateUpdateMessage instance using the specified properties. + * @function create + * @memberof DownstreamMessage.GroupStateUpdateMessage + * @static + * @param {DownstreamMessage.IGroupStateUpdateMessage=} [properties] Properties to set + * @returns {DownstreamMessage.GroupStateUpdateMessage} GroupStateUpdateMessage instance + */ + GroupStateUpdateMessage.create = function create(properties) { + return new GroupStateUpdateMessage(properties); + }; + + /** + * Encodes the specified GroupStateUpdateMessage message. Does not implicitly {@link DownstreamMessage.GroupStateUpdateMessage.verify|verify} messages. + * @function encode + * @memberof DownstreamMessage.GroupStateUpdateMessage + * @static + * @param {DownstreamMessage.IGroupStateUpdateMessage} message GroupStateUpdateMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupStateUpdateMessage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.group != null && Object.hasOwnProperty.call(message, "group")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.group); + if (message.items != null && message.items.length) + for (var i = 0; i < message.items.length; ++i) + $root.GroupStateItem.encode(message.items[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.sequenceId != null && Object.hasOwnProperty.call(message, "sequenceId")) + writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.sequenceId); + return writer; + }; + + /** + * Encodes the specified GroupStateUpdateMessage message, length delimited. Does not implicitly {@link DownstreamMessage.GroupStateUpdateMessage.verify|verify} messages. + * @function encodeDelimited + * @memberof DownstreamMessage.GroupStateUpdateMessage + * @static + * @param {DownstreamMessage.IGroupStateUpdateMessage} message GroupStateUpdateMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupStateUpdateMessage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GroupStateUpdateMessage message from the specified reader or buffer. + * @function decode + * @memberof DownstreamMessage.GroupStateUpdateMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {DownstreamMessage.GroupStateUpdateMessage} GroupStateUpdateMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupStateUpdateMessage.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.DownstreamMessage.GroupStateUpdateMessage(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.group = reader.string(); + break; + } + case 2: { + if (!(message.items && message.items.length)) + message.items = []; + message.items.push($root.GroupStateItem.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 3: { + message.sequenceId = reader.uint64(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GroupStateUpdateMessage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof DownstreamMessage.GroupStateUpdateMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {DownstreamMessage.GroupStateUpdateMessage} GroupStateUpdateMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupStateUpdateMessage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GroupStateUpdateMessage message. + * @function verify + * @memberof DownstreamMessage.GroupStateUpdateMessage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GroupStateUpdateMessage.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.group != null && message.hasOwnProperty("group")) + if (!$util.isString(message.group)) + return "group: string expected"; + if (message.items != null && message.hasOwnProperty("items")) { + if (!Array.isArray(message.items)) + return "items: array expected"; + for (var i = 0; i < message.items.length; ++i) { + var error = $root.GroupStateItem.verify(message.items[i], long + 1); + if (error) + return "items." + error; + } + } + if (message.sequenceId != null && message.hasOwnProperty("sequenceId")) { + properties._sequenceId = 1; + if (!$util.isInteger(message.sequenceId) && !(message.sequenceId && $util.isInteger(message.sequenceId.low) && $util.isInteger(message.sequenceId.high))) + return "sequenceId: integer|Long expected"; + } + return null; + }; + + /** + * Creates a GroupStateUpdateMessage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof DownstreamMessage.GroupStateUpdateMessage + * @static + * @param {Object.} object Plain object + * @returns {DownstreamMessage.GroupStateUpdateMessage} GroupStateUpdateMessage + */ + GroupStateUpdateMessage.fromObject = function fromObject(object, long) { + if (object instanceof $root.DownstreamMessage.GroupStateUpdateMessage) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.DownstreamMessage.GroupStateUpdateMessage(); + if (object.group != null) + message.group = String(object.group); + if (object.items) { + if (!Array.isArray(object.items)) + throw TypeError(".DownstreamMessage.GroupStateUpdateMessage.items: array expected"); + message.items = []; + for (var i = 0; i < object.items.length; ++i) { + if (typeof object.items[i] !== "object") + throw TypeError(".DownstreamMessage.GroupStateUpdateMessage.items: object expected"); + message.items[i] = $root.GroupStateItem.fromObject(object.items[i], long + 1); + } + } + if (object.sequenceId != null) + if ($util.Long) + (message.sequenceId = $util.Long.fromValue(object.sequenceId)).unsigned = true; + else if (typeof object.sequenceId === "string") + message.sequenceId = parseInt(object.sequenceId, 10); + else if (typeof object.sequenceId === "number") + message.sequenceId = object.sequenceId; + else if (typeof object.sequenceId === "object") + message.sequenceId = new $util.LongBits(object.sequenceId.low >>> 0, object.sequenceId.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a GroupStateUpdateMessage message. Also converts values to other types if specified. + * @function toObject + * @memberof DownstreamMessage.GroupStateUpdateMessage + * @static + * @param {DownstreamMessage.GroupStateUpdateMessage} message GroupStateUpdateMessage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GroupStateUpdateMessage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.items = []; + if (options.defaults) + object.group = ""; + if (message.group != null && message.hasOwnProperty("group")) + object.group = message.group; + if (message.items && message.items.length) { + object.items = []; + for (var j = 0; j < message.items.length; ++j) + object.items[j] = $root.GroupStateItem.toObject(message.items[j], options); + } + if (message.sequenceId != null && message.hasOwnProperty("sequenceId")) { + if (typeof message.sequenceId === "number") + object.sequenceId = options.longs === String ? String(message.sequenceId) : message.sequenceId; + else + 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; + if (options.oneofs) + object._sequenceId = "sequenceId"; + } + return object; + }; + + /** + * Converts this GroupStateUpdateMessage to JSON. + * @function toJSON + * @memberof DownstreamMessage.GroupStateUpdateMessage + * @instance + * @returns {Object.} JSON object + */ + GroupStateUpdateMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GroupStateUpdateMessage + * @function getTypeUrl + * @memberof DownstreamMessage.GroupStateUpdateMessage + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GroupStateUpdateMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/DownstreamMessage.GroupStateUpdateMessage"; + }; + + return GroupStateUpdateMessage; + })(); + + return DownstreamMessage; +})(); + +$root.MessageData = (function() { + + /** + * Properties of a MessageData. + * @exports IMessageData + * @interface IMessageData + * @property {string|null} [textData] MessageData textData + * @property {Uint8Array|null} [binaryData] MessageData binaryData + * @property {google.protobuf.IAny|null} [protobufData] MessageData protobufData + * @property {string|null} [jsonData] MessageData jsonData + */ + + /** + * Constructs a new MessageData. + * @exports MessageData + * @classdesc Represents a MessageData. + * @implements IMessageData + * @constructor + * @param {IMessageData=} [properties] Properties to set + */ + function MessageData(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * MessageData textData. + * @member {string|null|undefined} textData + * @memberof MessageData + * @instance + */ + MessageData.prototype.textData = null; + + /** + * MessageData binaryData. + * @member {Uint8Array|null|undefined} binaryData + * @memberof MessageData + * @instance + */ + MessageData.prototype.binaryData = null; + + /** + * MessageData protobufData. + * @member {google.protobuf.IAny|null|undefined} protobufData + * @memberof MessageData + * @instance + */ + MessageData.prototype.protobufData = null; + + /** + * MessageData jsonData. + * @member {string|null|undefined} jsonData + * @memberof MessageData + * @instance + */ + MessageData.prototype.jsonData = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * MessageData data. + * @member {"textData"|"binaryData"|"protobufData"|"jsonData"|undefined} data + * @memberof MessageData + * @instance + */ + Object.defineProperty(MessageData.prototype, "data", { + get: $util.oneOfGetter($oneOfFields = ["textData", "binaryData", "protobufData", "jsonData"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new MessageData instance using the specified properties. + * @function create + * @memberof MessageData + * @static + * @param {IMessageData=} [properties] Properties to set + * @returns {MessageData} MessageData instance + */ + MessageData.create = function create(properties) { + return new MessageData(properties); + }; + + /** + * Encodes the specified MessageData message. Does not implicitly {@link MessageData.verify|verify} messages. + * @function encode + * @memberof MessageData + * @static + * @param {IMessageData} message MessageData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageData.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.textData != null && Object.hasOwnProperty.call(message, "textData")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.textData); + if (message.binaryData != null && Object.hasOwnProperty.call(message, "binaryData")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.binaryData); + if (message.protobufData != null && Object.hasOwnProperty.call(message, "protobufData")) + $root.google.protobuf.Any.encode(message.protobufData, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.jsonData != null && Object.hasOwnProperty.call(message, "jsonData")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.jsonData); + return writer; + }; + + /** + * Encodes the specified MessageData message, length delimited. Does not implicitly {@link MessageData.verify|verify} messages. + * @function encodeDelimited + * @memberof MessageData + * @static + * @param {IMessageData} message MessageData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageData.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MessageData message from the specified reader or buffer. + * @function decode + * @memberof MessageData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {MessageData} MessageData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageData.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.MessageData(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.textData = reader.string(); + break; + } + case 2: { + message.binaryData = reader.bytes(); + break; + } + case 3: { + message.protobufData = $root.google.protobuf.Any.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.jsonData = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a MessageData message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof MessageData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {MessageData} MessageData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageData.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Converts this DisconnectedMessage to JSON. - * @function toJSON - * @memberof DownstreamMessage.SystemMessage.DisconnectedMessage - * @instance - * @returns {Object.} JSON object - */ - DisconnectedMessage.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Verifies a MessageData message. + * @function verify + * @memberof MessageData + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MessageData.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.textData != null && message.hasOwnProperty("textData")) { + properties.data = 1; + if (!$util.isString(message.textData)) + return "textData: string expected"; + } + if (message.binaryData != null && message.hasOwnProperty("binaryData")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + if (!(message.binaryData && typeof message.binaryData.length === "number" || $util.isString(message.binaryData))) + return "binaryData: buffer expected"; + } + if (message.protobufData != null && message.hasOwnProperty("protobufData")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.protobuf.Any.verify(message.protobufData, long + 1); + if (error) + return "protobufData." + error; + } + } + if (message.jsonData != null && message.hasOwnProperty("jsonData")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + if (!$util.isString(message.jsonData)) + return "jsonData: string expected"; + } + return null; + }; - /** - * Gets the default type url for DisconnectedMessage - * @function getTypeUrl - * @memberof DownstreamMessage.SystemMessage.DisconnectedMessage - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DisconnectedMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/DownstreamMessage.SystemMessage.DisconnectedMessage"; - }; + /** + * Creates a MessageData message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof MessageData + * @static + * @param {Object.} object Plain object + * @returns {MessageData} MessageData + */ + MessageData.fromObject = function fromObject(object, long) { + if (object instanceof $root.MessageData) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.MessageData(); + if (object.textData != null) + message.textData = String(object.textData); + if (object.binaryData != null) + if (typeof object.binaryData === "string") + $util.base64.decode(object.binaryData, message.binaryData = $util.newBuffer($util.base64.length(object.binaryData)), 0); + else if (object.binaryData.length >= 0) + message.binaryData = object.binaryData; + if (object.protobufData != null) { + if (typeof object.protobufData !== "object") + throw TypeError(".MessageData.protobufData: object expected"); + message.protobufData = $root.google.protobuf.Any.fromObject(object.protobufData, long + 1); + } + if (object.jsonData != null) + message.jsonData = String(object.jsonData); + return message; + }; - return DisconnectedMessage; - })(); + /** + * Creates a plain object from a MessageData message. Also converts values to other types if specified. + * @function toObject + * @memberof MessageData + * @static + * @param {MessageData} message MessageData + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MessageData.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.textData != null && message.hasOwnProperty("textData")) { + object.textData = message.textData; + if (options.oneofs) + object.data = "textData"; + } + if (message.binaryData != null && message.hasOwnProperty("binaryData")) { + 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; + if (options.oneofs) + object.data = "binaryData"; + } + if (message.protobufData != null && message.hasOwnProperty("protobufData")) { + object.protobufData = $root.google.protobuf.Any.toObject(message.protobufData, options); + if (options.oneofs) + object.data = "protobufData"; + } + if (message.jsonData != null && message.hasOwnProperty("jsonData")) { + object.jsonData = message.jsonData; + if (options.oneofs) + object.data = "jsonData"; + } + return object; + }; - return SystemMessage; - })(); + /** + * Converts this MessageData to JSON. + * @function toJSON + * @memberof MessageData + * @instance + * @returns {Object.} JSON object + */ + MessageData.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return DownstreamMessage; + /** + * Gets the default type url for MessageData + * @function getTypeUrl + * @memberof MessageData + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MessageData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/MessageData"; + }; + + return MessageData; })(); -$root.MessageData = (function() { +$root.GroupStateItem = (function() { /** - * Properties of a MessageData. - * @exports IMessageData - * @interface IMessageData - * @property {string|null} [textData] MessageData textData - * @property {Uint8Array|null} [binaryData] MessageData binaryData - * @property {google.protobuf.IAny|null} [protobufData] MessageData protobufData - * @property {string|null} [jsonData] MessageData jsonData + * Properties of a GroupStateItem. + * @exports IGroupStateItem + * @interface IGroupStateItem + * @property {string|null} [connectionId] GroupStateItem connectionId + * @property {string|null} [userId] GroupStateItem userId + * @property {GroupStateItem.IGroupState|null} [state] GroupStateItem state + * @property {number|Long|null} [updatedAt] GroupStateItem updatedAt */ /** - * Constructs a new MessageData. - * @exports MessageData - * @classdesc Represents a MessageData. - * @implements IMessageData + * Constructs a new GroupStateItem. + * @exports GroupStateItem + * @classdesc Represents a GroupStateItem. + * @implements IGroupStateItem * @constructor - * @param {IMessageData=} [properties] Properties to set + * @param {IGroupStateItem=} [properties] Properties to set */ - function MessageData(properties) { + function GroupStateItem(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null && keys[i] !== "__proto__") @@ -3729,137 +5684,138 @@ $root.MessageData = (function() { } /** - * MessageData textData. - * @member {string|null|undefined} textData - * @memberof MessageData + * GroupStateItem connectionId. + * @member {string} connectionId + * @memberof GroupStateItem * @instance */ - MessageData.prototype.textData = null; + GroupStateItem.prototype.connectionId = ""; /** - * MessageData binaryData. - * @member {Uint8Array|null|undefined} binaryData - * @memberof MessageData + * GroupStateItem userId. + * @member {string|null|undefined} userId + * @memberof GroupStateItem * @instance */ - MessageData.prototype.binaryData = null; + GroupStateItem.prototype.userId = null; /** - * MessageData protobufData. - * @member {google.protobuf.IAny|null|undefined} protobufData - * @memberof MessageData + * GroupStateItem state. + * @member {GroupStateItem.IGroupState|null|undefined} state + * @memberof GroupStateItem * @instance */ - MessageData.prototype.protobufData = null; + GroupStateItem.prototype.state = null; /** - * MessageData jsonData. - * @member {string|null|undefined} jsonData - * @memberof MessageData + * GroupStateItem updatedAt. + * @member {number|Long} updatedAt + * @memberof GroupStateItem * @instance */ - MessageData.prototype.jsonData = null; + GroupStateItem.prototype.updatedAt = $util.Long ? $util.Long.fromBits(0,0,false) : 0; // OneOf field names bound to virtual getters and setters var $oneOfFields; - /** - * MessageData data. - * @member {"textData"|"binaryData"|"protobufData"|"jsonData"|undefined} data - * @memberof MessageData - * @instance - */ - Object.defineProperty(MessageData.prototype, "data", { - get: $util.oneOfGetter($oneOfFields = ["textData", "binaryData", "protobufData", "jsonData"]), + // Virtual OneOf for proto3 optional field + Object.defineProperty(GroupStateItem.prototype, "_userId", { + get: $util.oneOfGetter($oneOfFields = ["userId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(GroupStateItem.prototype, "_state", { + get: $util.oneOfGetter($oneOfFields = ["state"]), set: $util.oneOfSetter($oneOfFields) }); /** - * Creates a new MessageData instance using the specified properties. + * Creates a new GroupStateItem instance using the specified properties. * @function create - * @memberof MessageData + * @memberof GroupStateItem * @static - * @param {IMessageData=} [properties] Properties to set - * @returns {MessageData} MessageData instance + * @param {IGroupStateItem=} [properties] Properties to set + * @returns {GroupStateItem} GroupStateItem instance */ - MessageData.create = function create(properties) { - return new MessageData(properties); + GroupStateItem.create = function create(properties) { + return new GroupStateItem(properties); }; /** - * Encodes the specified MessageData message. Does not implicitly {@link MessageData.verify|verify} messages. + * Encodes the specified GroupStateItem message. Does not implicitly {@link GroupStateItem.verify|verify} messages. * @function encode - * @memberof MessageData + * @memberof GroupStateItem * @static - * @param {IMessageData} message MessageData message or plain object to encode + * @param {IGroupStateItem} message GroupStateItem message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MessageData.encode = function encode(message, writer) { + GroupStateItem.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.textData != null && Object.hasOwnProperty.call(message, "textData")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.textData); - if (message.binaryData != null && Object.hasOwnProperty.call(message, "binaryData")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.binaryData); - if (message.protobufData != null && Object.hasOwnProperty.call(message, "protobufData")) - $root.google.protobuf.Any.encode(message.protobufData, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.jsonData != null && Object.hasOwnProperty.call(message, "jsonData")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.jsonData); + if (message.connectionId != null && Object.hasOwnProperty.call(message, "connectionId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.connectionId); + if (message.userId != null && Object.hasOwnProperty.call(message, "userId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.userId); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + $root.GroupStateItem.GroupState.encode(message.state, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.updatedAt != null && Object.hasOwnProperty.call(message, "updatedAt")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.updatedAt); return writer; }; /** - * Encodes the specified MessageData message, length delimited. Does not implicitly {@link MessageData.verify|verify} messages. + * Encodes the specified GroupStateItem message, length delimited. Does not implicitly {@link GroupStateItem.verify|verify} messages. * @function encodeDelimited - * @memberof MessageData + * @memberof GroupStateItem * @static - * @param {IMessageData} message MessageData message or plain object to encode + * @param {IGroupStateItem} message GroupStateItem message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MessageData.encodeDelimited = function encodeDelimited(message, writer) { + GroupStateItem.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a MessageData message from the specified reader or buffer. + * Decodes a GroupStateItem message from the specified reader or buffer. * @function decode - * @memberof MessageData + * @memberof GroupStateItem * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {MessageData} MessageData + * @returns {GroupStateItem} GroupStateItem * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MessageData.decode = function decode(reader, length, error, long) { + GroupStateItem.decode = function decode(reader, length, error, long) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); if (long === undefined) long = 0; if (long > $Reader.recursionLimit) throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.MessageData(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.GroupStateItem(); while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) break; switch (tag >>> 3) { case 1: { - message.textData = reader.string(); + message.connectionId = reader.string(); break; } case 2: { - message.binaryData = reader.bytes(); + message.userId = reader.string(); break; } case 3: { - message.protobufData = $root.google.protobuf.Any.decode(reader, reader.uint32(), undefined, long + 1); + message.state = $root.GroupStateItem.GroupState.decode(reader, reader.uint32(), undefined, long + 1); break; } case 4: { - message.jsonData = reader.string(); + message.updatedAt = reader.int64(); break; } default: @@ -3871,30 +5827,30 @@ $root.MessageData = (function() { }; /** - * Decodes a MessageData message from the specified reader or buffer, length delimited. + * Decodes a GroupStateItem message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof MessageData + * @memberof GroupStateItem * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {MessageData} MessageData + * @returns {GroupStateItem} GroupStateItem * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MessageData.decodeDelimited = function decodeDelimited(reader) { + GroupStateItem.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a MessageData message. + * Verifies a GroupStateItem message. * @function verify - * @memberof MessageData + * @memberof GroupStateItem * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - MessageData.verify = function verify(message, long) { + GroupStateItem.verify = function verify(message, long) { if (typeof message !== "object" || message === null) return "object expected"; if (long === undefined) @@ -3902,134 +5858,393 @@ $root.MessageData = (function() { if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.textData != null && message.hasOwnProperty("textData")) { - properties.data = 1; - if (!$util.isString(message.textData)) - return "textData: string expected"; - } - if (message.binaryData != null && message.hasOwnProperty("binaryData")) { - if (properties.data === 1) - return "data: multiple values"; - properties.data = 1; - if (!(message.binaryData && typeof message.binaryData.length === "number" || $util.isString(message.binaryData))) - return "binaryData: buffer expected"; + if (message.connectionId != null && message.hasOwnProperty("connectionId")) + if (!$util.isString(message.connectionId)) + return "connectionId: string expected"; + if (message.userId != null && message.hasOwnProperty("userId")) { + properties._userId = 1; + if (!$util.isString(message.userId)) + return "userId: string expected"; } - if (message.protobufData != null && message.hasOwnProperty("protobufData")) { - if (properties.data === 1) - return "data: multiple values"; - properties.data = 1; + if (message.state != null && message.hasOwnProperty("state")) { + properties._state = 1; { - var error = $root.google.protobuf.Any.verify(message.protobufData, long + 1); + var error = $root.GroupStateItem.GroupState.verify(message.state, long + 1); if (error) - return "protobufData." + error; + return "state." + error; } } - if (message.jsonData != null && message.hasOwnProperty("jsonData")) { - if (properties.data === 1) - return "data: multiple values"; - properties.data = 1; - if (!$util.isString(message.jsonData)) - return "jsonData: string expected"; - } + if (message.updatedAt != null && message.hasOwnProperty("updatedAt")) + if (!$util.isInteger(message.updatedAt) && !(message.updatedAt && $util.isInteger(message.updatedAt.low) && $util.isInteger(message.updatedAt.high))) + return "updatedAt: integer|Long expected"; return null; }; /** - * Creates a MessageData message from a plain object. Also converts values to their respective internal types. + * Creates a GroupStateItem message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof MessageData + * @memberof GroupStateItem * @static * @param {Object.} object Plain object - * @returns {MessageData} MessageData + * @returns {GroupStateItem} GroupStateItem */ - MessageData.fromObject = function fromObject(object, long) { - if (object instanceof $root.MessageData) + GroupStateItem.fromObject = function fromObject(object, long) { + if (object instanceof $root.GroupStateItem) return object; if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); - var message = new $root.MessageData(); - if (object.textData != null) - message.textData = String(object.textData); - if (object.binaryData != null) - if (typeof object.binaryData === "string") - $util.base64.decode(object.binaryData, message.binaryData = $util.newBuffer($util.base64.length(object.binaryData)), 0); - else if (object.binaryData.length >= 0) - message.binaryData = object.binaryData; - if (object.protobufData != null) { - if (typeof object.protobufData !== "object") - throw TypeError(".MessageData.protobufData: object expected"); - message.protobufData = $root.google.protobuf.Any.fromObject(object.protobufData, long + 1); + var message = new $root.GroupStateItem(); + if (object.connectionId != null) + message.connectionId = String(object.connectionId); + if (object.userId != null) + message.userId = String(object.userId); + if (object.state != null) { + if (typeof object.state !== "object") + throw TypeError(".GroupStateItem.state: object expected"); + message.state = $root.GroupStateItem.GroupState.fromObject(object.state, long + 1); } - if (object.jsonData != null) - message.jsonData = String(object.jsonData); + if (object.updatedAt != null) + if ($util.Long) + (message.updatedAt = $util.Long.fromValue(object.updatedAt)).unsigned = false; + else if (typeof object.updatedAt === "string") + message.updatedAt = parseInt(object.updatedAt, 10); + else if (typeof object.updatedAt === "number") + message.updatedAt = object.updatedAt; + else if (typeof object.updatedAt === "object") + message.updatedAt = new $util.LongBits(object.updatedAt.low >>> 0, object.updatedAt.high >>> 0).toNumber(); return message; }; /** - * Creates a plain object from a MessageData message. Also converts values to other types if specified. + * Creates a plain object from a GroupStateItem message. Also converts values to other types if specified. * @function toObject - * @memberof MessageData + * @memberof GroupStateItem * @static - * @param {MessageData} message MessageData + * @param {GroupStateItem} message GroupStateItem * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - MessageData.toObject = function toObject(message, options) { + GroupStateItem.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (message.textData != null && message.hasOwnProperty("textData")) { - object.textData = message.textData; - if (options.oneofs) - object.data = "textData"; - } - if (message.binaryData != null && message.hasOwnProperty("binaryData")) { - 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; - if (options.oneofs) - object.data = "binaryData"; + if (options.defaults) { + object.connectionId = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.updatedAt = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.updatedAt = options.longs === String ? "0" : 0; } - if (message.protobufData != null && message.hasOwnProperty("protobufData")) { - object.protobufData = $root.google.protobuf.Any.toObject(message.protobufData, options); + if (message.connectionId != null && message.hasOwnProperty("connectionId")) + object.connectionId = message.connectionId; + if (message.userId != null && message.hasOwnProperty("userId")) { + object.userId = message.userId; if (options.oneofs) - object.data = "protobufData"; + object._userId = "userId"; } - if (message.jsonData != null && message.hasOwnProperty("jsonData")) { - object.jsonData = message.jsonData; + if (message.state != null && message.hasOwnProperty("state")) { + object.state = $root.GroupStateItem.GroupState.toObject(message.state, options); if (options.oneofs) - object.data = "jsonData"; + object._state = "state"; } + if (message.updatedAt != null && message.hasOwnProperty("updatedAt")) + if (typeof message.updatedAt === "number") + object.updatedAt = options.longs === String ? String(message.updatedAt) : message.updatedAt; + else + object.updatedAt = options.longs === String ? $util.Long.prototype.toString.call(message.updatedAt) : options.longs === Number ? new $util.LongBits(message.updatedAt.low >>> 0, message.updatedAt.high >>> 0).toNumber() : message.updatedAt; return object; }; /** - * Converts this MessageData to JSON. + * Converts this GroupStateItem to JSON. * @function toJSON - * @memberof MessageData + * @memberof GroupStateItem * @instance * @returns {Object.} JSON object */ - MessageData.prototype.toJSON = function toJSON() { + GroupStateItem.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for MessageData + * Gets the default type url for GroupStateItem * @function getTypeUrl - * @memberof MessageData + * @memberof GroupStateItem * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - MessageData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + GroupStateItem.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/MessageData"; + return typeUrlPrefix + "/GroupStateItem"; }; - return MessageData; + GroupStateItem.GroupState = (function() { + + /** + * Properties of a GroupState. + * @memberof GroupStateItem + * @interface IGroupState + * @property {Object.|null} [entries] GroupState entries + */ + + /** + * Constructs a new GroupState. + * @memberof GroupStateItem + * @classdesc Represents a GroupState. + * @implements IGroupState + * @constructor + * @param {GroupStateItem.IGroupState=} [properties] Properties to set + */ + function GroupState(properties) { + this.entries = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GroupState entries. + * @member {Object.} entries + * @memberof GroupStateItem.GroupState + * @instance + */ + GroupState.prototype.entries = $util.emptyObject; + + /** + * Creates a new GroupState instance using the specified properties. + * @function create + * @memberof GroupStateItem.GroupState + * @static + * @param {GroupStateItem.IGroupState=} [properties] Properties to set + * @returns {GroupStateItem.GroupState} GroupState instance + */ + GroupState.create = function create(properties) { + return new GroupState(properties); + }; + + /** + * Encodes the specified GroupState message. Does not implicitly {@link GroupStateItem.GroupState.verify|verify} messages. + * @function encode + * @memberof GroupStateItem.GroupState + * @static + * @param {GroupStateItem.IGroupState} message GroupState message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupState.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.entries != null && Object.hasOwnProperty.call(message, "entries")) + for (var keys = Object.keys(message.entries), i = 0; i < keys.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.entries[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified GroupState message, length delimited. Does not implicitly {@link GroupStateItem.GroupState.verify|verify} messages. + * @function encodeDelimited + * @memberof GroupStateItem.GroupState + * @static + * @param {GroupStateItem.IGroupState} message GroupState message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupState.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GroupState message from the specified reader or buffer. + * @function decode + * @memberof GroupStateItem.GroupState + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {GroupStateItem.GroupState} GroupState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupState.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.GroupStateItem.GroupState(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (message.entries === $util.emptyObject) + message.entries = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7, long); + break; + } + } + if (key === "__proto__") + $util.makeProp(message.entries, key); + message.entries[key] = value; + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GroupState message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof GroupStateItem.GroupState + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {GroupStateItem.GroupState} GroupState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupState.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GroupState message. + * @function verify + * @memberof GroupStateItem.GroupState + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GroupState.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.entries != null && message.hasOwnProperty("entries")) { + if (!$util.isObject(message.entries)) + return "entries: object expected"; + var key = Object.keys(message.entries); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.entries[key[i]])) + return "entries: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a GroupState message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof GroupStateItem.GroupState + * @static + * @param {Object.} object Plain object + * @returns {GroupStateItem.GroupState} GroupState + */ + GroupState.fromObject = function fromObject(object, long) { + if (object instanceof $root.GroupStateItem.GroupState) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.GroupStateItem.GroupState(); + if (object.entries) { + if (typeof object.entries !== "object") + throw TypeError(".GroupStateItem.GroupState.entries: object expected"); + message.entries = {}; + for (var keys = Object.keys(object.entries), i = 0; i < keys.length; ++i) { + if (keys[i] === "__proto__") + $util.makeProp(message.entries, keys[i]); + message.entries[keys[i]] = String(object.entries[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from a GroupState message. Also converts values to other types if specified. + * @function toObject + * @memberof GroupStateItem.GroupState + * @static + * @param {GroupStateItem.GroupState} message GroupState + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GroupState.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.entries = {}; + var keys2; + if (message.entries && (keys2 = Object.keys(message.entries)).length) { + object.entries = {}; + for (var j = 0; j < keys2.length; ++j) { + if (keys2[j] === "__proto__") + $util.makeProp(object.entries, keys2[j]); + object.entries[keys2[j]] = message.entries[keys2[j]]; + } + } + return object; + }; + + /** + * Converts this GroupState to JSON. + * @function toJSON + * @memberof GroupStateItem.GroupState + * @instance + * @returns {Object.} JSON object + */ + GroupState.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GroupState + * @function getTypeUrl + * @memberof GroupStateItem.GroupState + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GroupState.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/GroupStateItem.GroupState"; + }; + + return GroupState; + })(); + + return GroupStateItem; })(); $root.google = (function() { diff --git a/sdk/web-pubsub/web-pubsub-client-protobuf/src/generated/clientProto.d.ts b/sdk/web-pubsub/web-pubsub-client-protobuf/src/generated/clientProto.d.ts index 09cd01c3d726..57003fd253ed 100644 --- a/sdk/web-pubsub/web-pubsub-client-protobuf/src/generated/clientProto.d.ts +++ b/sdk/web-pubsub/web-pubsub-client-protobuf/src/generated/clientProto.d.ts @@ -17,6 +17,15 @@ export interface IUpstreamMessage { /** UpstreamMessage sequenceAckMessage */ sequenceAckMessage?: (UpstreamMessage.ISequenceAckMessage|null); + + /** UpstreamMessage setGroupStateMessage */ + setGroupStateMessage?: (UpstreamMessage.ISetGroupStateMessage|null); + + /** UpstreamMessage subscribeGroupStateMessage */ + subscribeGroupStateMessage?: (UpstreamMessage.ISubscribeGroupStateMessage|null); + + /** UpstreamMessage unsubscribeGroupStateMessage */ + unsubscribeGroupStateMessage?: (UpstreamMessage.IUnsubscribeGroupStateMessage|null); } /** Represents an UpstreamMessage. */ @@ -43,8 +52,17 @@ export class UpstreamMessage implements IUpstreamMessage { /** UpstreamMessage sequenceAckMessage. */ public sequenceAckMessage?: (UpstreamMessage.ISequenceAckMessage|null); + /** UpstreamMessage setGroupStateMessage. */ + public setGroupStateMessage?: (UpstreamMessage.ISetGroupStateMessage|null); + + /** UpstreamMessage subscribeGroupStateMessage. */ + public subscribeGroupStateMessage?: (UpstreamMessage.ISubscribeGroupStateMessage|null); + + /** UpstreamMessage unsubscribeGroupStateMessage. */ + public unsubscribeGroupStateMessage?: (UpstreamMessage.IUnsubscribeGroupStateMessage|null); + /** UpstreamMessage message. */ - public message?: ("sendToGroupMessage"|"eventMessage"|"joinGroupMessage"|"leaveGroupMessage"|"sequenceAckMessage"); + public message?: ("sendToGroupMessage"|"eventMessage"|"joinGroupMessage"|"leaveGroupMessage"|"sequenceAckMessage"|"setGroupStateMessage"|"subscribeGroupStateMessage"|"unsubscribeGroupStateMessage"); /** * Creates a new UpstreamMessage instance using the specified properties. @@ -652,6 +670,321 @@ export namespace UpstreamMessage { */ public static getTypeUrl(typeUrlPrefix?: string): string; } + + /** Properties of a SetGroupStateMessage. */ + interface ISetGroupStateMessage { + + /** SetGroupStateMessage group */ + group?: (string|null); + + /** SetGroupStateMessage ackId */ + ackId?: (number|Long|null); + + /** SetGroupStateMessage state */ + state?: (GroupStateItem.IGroupState|null); + } + + /** Represents a SetGroupStateMessage. */ + class SetGroupStateMessage implements ISetGroupStateMessage { + + /** + * Constructs a new SetGroupStateMessage. + * @param [properties] Properties to set + */ + constructor(properties?: UpstreamMessage.ISetGroupStateMessage); + + /** SetGroupStateMessage group. */ + public group: string; + + /** SetGroupStateMessage ackId. */ + public ackId?: (number|Long|null); + + /** SetGroupStateMessage state. */ + public state?: (GroupStateItem.IGroupState|null); + + /** + * Creates a new SetGroupStateMessage instance using the specified properties. + * @param [properties] Properties to set + * @returns SetGroupStateMessage instance + */ + public static create(properties?: UpstreamMessage.ISetGroupStateMessage): UpstreamMessage.SetGroupStateMessage; + + /** + * Encodes the specified SetGroupStateMessage message. Does not implicitly {@link UpstreamMessage.SetGroupStateMessage.verify|verify} messages. + * @param message SetGroupStateMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: UpstreamMessage.ISetGroupStateMessage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SetGroupStateMessage message, length delimited. Does not implicitly {@link UpstreamMessage.SetGroupStateMessage.verify|verify} messages. + * @param message SetGroupStateMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: UpstreamMessage.ISetGroupStateMessage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SetGroupStateMessage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SetGroupStateMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): UpstreamMessage.SetGroupStateMessage; + + /** + * Decodes a SetGroupStateMessage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SetGroupStateMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): UpstreamMessage.SetGroupStateMessage; + + /** + * Verifies a SetGroupStateMessage message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SetGroupStateMessage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SetGroupStateMessage + */ + public static fromObject(object: { [k: string]: any }): UpstreamMessage.SetGroupStateMessage; + + /** + * Creates a plain object from a SetGroupStateMessage message. Also converts values to other types if specified. + * @param message SetGroupStateMessage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: UpstreamMessage.SetGroupStateMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SetGroupStateMessage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SetGroupStateMessage + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SubscribeGroupStateMessage. */ + interface ISubscribeGroupStateMessage { + + /** SubscribeGroupStateMessage group */ + group?: (string|null); + + /** SubscribeGroupStateMessage ackId */ + ackId?: (number|Long|null); + } + + /** Represents a SubscribeGroupStateMessage. */ + class SubscribeGroupStateMessage implements ISubscribeGroupStateMessage { + + /** + * Constructs a new SubscribeGroupStateMessage. + * @param [properties] Properties to set + */ + constructor(properties?: UpstreamMessage.ISubscribeGroupStateMessage); + + /** SubscribeGroupStateMessage group. */ + public group: string; + + /** SubscribeGroupStateMessage ackId. */ + public ackId?: (number|Long|null); + + /** + * Creates a new SubscribeGroupStateMessage instance using the specified properties. + * @param [properties] Properties to set + * @returns SubscribeGroupStateMessage instance + */ + public static create(properties?: UpstreamMessage.ISubscribeGroupStateMessage): UpstreamMessage.SubscribeGroupStateMessage; + + /** + * Encodes the specified SubscribeGroupStateMessage message. Does not implicitly {@link UpstreamMessage.SubscribeGroupStateMessage.verify|verify} messages. + * @param message SubscribeGroupStateMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: UpstreamMessage.ISubscribeGroupStateMessage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SubscribeGroupStateMessage message, length delimited. Does not implicitly {@link UpstreamMessage.SubscribeGroupStateMessage.verify|verify} messages. + * @param message SubscribeGroupStateMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: UpstreamMessage.ISubscribeGroupStateMessage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SubscribeGroupStateMessage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SubscribeGroupStateMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): UpstreamMessage.SubscribeGroupStateMessage; + + /** + * Decodes a SubscribeGroupStateMessage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SubscribeGroupStateMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): UpstreamMessage.SubscribeGroupStateMessage; + + /** + * Verifies a SubscribeGroupStateMessage message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SubscribeGroupStateMessage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SubscribeGroupStateMessage + */ + public static fromObject(object: { [k: string]: any }): UpstreamMessage.SubscribeGroupStateMessage; + + /** + * Creates a plain object from a SubscribeGroupStateMessage message. Also converts values to other types if specified. + * @param message SubscribeGroupStateMessage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: UpstreamMessage.SubscribeGroupStateMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SubscribeGroupStateMessage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SubscribeGroupStateMessage + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UnsubscribeGroupStateMessage. */ + interface IUnsubscribeGroupStateMessage { + + /** UnsubscribeGroupStateMessage group */ + group?: (string|null); + + /** UnsubscribeGroupStateMessage ackId */ + ackId?: (number|Long|null); + } + + /** Represents an UnsubscribeGroupStateMessage. */ + class UnsubscribeGroupStateMessage implements IUnsubscribeGroupStateMessage { + + /** + * Constructs a new UnsubscribeGroupStateMessage. + * @param [properties] Properties to set + */ + constructor(properties?: UpstreamMessage.IUnsubscribeGroupStateMessage); + + /** UnsubscribeGroupStateMessage group. */ + public group: string; + + /** UnsubscribeGroupStateMessage ackId. */ + public ackId?: (number|Long|null); + + /** + * Creates a new UnsubscribeGroupStateMessage instance using the specified properties. + * @param [properties] Properties to set + * @returns UnsubscribeGroupStateMessage instance + */ + public static create(properties?: UpstreamMessage.IUnsubscribeGroupStateMessage): UpstreamMessage.UnsubscribeGroupStateMessage; + + /** + * Encodes the specified UnsubscribeGroupStateMessage message. Does not implicitly {@link UpstreamMessage.UnsubscribeGroupStateMessage.verify|verify} messages. + * @param message UnsubscribeGroupStateMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: UpstreamMessage.IUnsubscribeGroupStateMessage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UnsubscribeGroupStateMessage message, length delimited. Does not implicitly {@link UpstreamMessage.UnsubscribeGroupStateMessage.verify|verify} messages. + * @param message UnsubscribeGroupStateMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: UpstreamMessage.IUnsubscribeGroupStateMessage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UnsubscribeGroupStateMessage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UnsubscribeGroupStateMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): UpstreamMessage.UnsubscribeGroupStateMessage; + + /** + * Decodes an UnsubscribeGroupStateMessage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UnsubscribeGroupStateMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): UpstreamMessage.UnsubscribeGroupStateMessage; + + /** + * Verifies an UnsubscribeGroupStateMessage message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UnsubscribeGroupStateMessage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UnsubscribeGroupStateMessage + */ + public static fromObject(object: { [k: string]: any }): UpstreamMessage.UnsubscribeGroupStateMessage; + + /** + * Creates a plain object from an UnsubscribeGroupStateMessage message. Also converts values to other types if specified. + * @param message UnsubscribeGroupStateMessage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: UpstreamMessage.UnsubscribeGroupStateMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UnsubscribeGroupStateMessage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UnsubscribeGroupStateMessage + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } } /** Properties of a DownstreamMessage. */ @@ -665,6 +998,12 @@ export interface IDownstreamMessage { /** DownstreamMessage systemMessage */ systemMessage?: (DownstreamMessage.ISystemMessage|null); + + /** DownstreamMessage groupStateUpdateMessage */ + groupStateUpdateMessage?: (DownstreamMessage.IGroupStateUpdateMessage|null); + + /** DownstreamMessage groupStateSnapshotMessage */ + groupStateSnapshotMessage?: (DownstreamMessage.IGroupStateSnapshotMessage|null); } /** Represents a DownstreamMessage. */ @@ -685,8 +1024,14 @@ export class DownstreamMessage implements IDownstreamMessage { /** DownstreamMessage systemMessage. */ public systemMessage?: (DownstreamMessage.ISystemMessage|null); + /** DownstreamMessage groupStateUpdateMessage. */ + public groupStateUpdateMessage?: (DownstreamMessage.IGroupStateUpdateMessage|null); + + /** DownstreamMessage groupStateSnapshotMessage. */ + public groupStateSnapshotMessage?: (DownstreamMessage.IGroupStateSnapshotMessage|null); + /** DownstreamMessage message. */ - public message?: ("ackMessage"|"dataMessage"|"systemMessage"); + public message?: ("ackMessage"|"dataMessage"|"systemMessage"|"groupStateUpdateMessage"|"groupStateSnapshotMessage"); /** * Creates a new DownstreamMessage instance using the specified properties. @@ -1412,6 +1757,224 @@ export namespace DownstreamMessage { public static getTypeUrl(typeUrlPrefix?: string): string; } } + + /** Properties of a GroupStateSnapshotMessage. */ + interface IGroupStateSnapshotMessage { + + /** GroupStateSnapshotMessage group */ + group?: (string|null); + + /** GroupStateSnapshotMessage items */ + items?: (IGroupStateItem[]|null); + + /** GroupStateSnapshotMessage sequenceId */ + sequenceId?: (number|Long|null); + } + + /** Represents a GroupStateSnapshotMessage. */ + class GroupStateSnapshotMessage implements IGroupStateSnapshotMessage { + + /** + * Constructs a new GroupStateSnapshotMessage. + * @param [properties] Properties to set + */ + constructor(properties?: DownstreamMessage.IGroupStateSnapshotMessage); + + /** GroupStateSnapshotMessage group. */ + public group: string; + + /** GroupStateSnapshotMessage items. */ + public items: IGroupStateItem[]; + + /** GroupStateSnapshotMessage sequenceId. */ + public sequenceId?: (number|Long|null); + + /** + * Creates a new GroupStateSnapshotMessage instance using the specified properties. + * @param [properties] Properties to set + * @returns GroupStateSnapshotMessage instance + */ + public static create(properties?: DownstreamMessage.IGroupStateSnapshotMessage): DownstreamMessage.GroupStateSnapshotMessage; + + /** + * Encodes the specified GroupStateSnapshotMessage message. Does not implicitly {@link DownstreamMessage.GroupStateSnapshotMessage.verify|verify} messages. + * @param message GroupStateSnapshotMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: DownstreamMessage.IGroupStateSnapshotMessage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GroupStateSnapshotMessage message, length delimited. Does not implicitly {@link DownstreamMessage.GroupStateSnapshotMessage.verify|verify} messages. + * @param message GroupStateSnapshotMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: DownstreamMessage.IGroupStateSnapshotMessage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GroupStateSnapshotMessage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GroupStateSnapshotMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): DownstreamMessage.GroupStateSnapshotMessage; + + /** + * Decodes a GroupStateSnapshotMessage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GroupStateSnapshotMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): DownstreamMessage.GroupStateSnapshotMessage; + + /** + * Verifies a GroupStateSnapshotMessage message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GroupStateSnapshotMessage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GroupStateSnapshotMessage + */ + public static fromObject(object: { [k: string]: any }): DownstreamMessage.GroupStateSnapshotMessage; + + /** + * Creates a plain object from a GroupStateSnapshotMessage message. Also converts values to other types if specified. + * @param message GroupStateSnapshotMessage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: DownstreamMessage.GroupStateSnapshotMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GroupStateSnapshotMessage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GroupStateSnapshotMessage + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GroupStateUpdateMessage. */ + interface IGroupStateUpdateMessage { + + /** GroupStateUpdateMessage group */ + group?: (string|null); + + /** GroupStateUpdateMessage items */ + items?: (IGroupStateItem[]|null); + + /** GroupStateUpdateMessage sequenceId */ + sequenceId?: (number|Long|null); + } + + /** Represents a GroupStateUpdateMessage. */ + class GroupStateUpdateMessage implements IGroupStateUpdateMessage { + + /** + * Constructs a new GroupStateUpdateMessage. + * @param [properties] Properties to set + */ + constructor(properties?: DownstreamMessage.IGroupStateUpdateMessage); + + /** GroupStateUpdateMessage group. */ + public group: string; + + /** GroupStateUpdateMessage items. */ + public items: IGroupStateItem[]; + + /** GroupStateUpdateMessage sequenceId. */ + public sequenceId?: (number|Long|null); + + /** + * Creates a new GroupStateUpdateMessage instance using the specified properties. + * @param [properties] Properties to set + * @returns GroupStateUpdateMessage instance + */ + public static create(properties?: DownstreamMessage.IGroupStateUpdateMessage): DownstreamMessage.GroupStateUpdateMessage; + + /** + * Encodes the specified GroupStateUpdateMessage message. Does not implicitly {@link DownstreamMessage.GroupStateUpdateMessage.verify|verify} messages. + * @param message GroupStateUpdateMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: DownstreamMessage.IGroupStateUpdateMessage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GroupStateUpdateMessage message, length delimited. Does not implicitly {@link DownstreamMessage.GroupStateUpdateMessage.verify|verify} messages. + * @param message GroupStateUpdateMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: DownstreamMessage.IGroupStateUpdateMessage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GroupStateUpdateMessage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GroupStateUpdateMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): DownstreamMessage.GroupStateUpdateMessage; + + /** + * Decodes a GroupStateUpdateMessage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GroupStateUpdateMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): DownstreamMessage.GroupStateUpdateMessage; + + /** + * Verifies a GroupStateUpdateMessage message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GroupStateUpdateMessage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GroupStateUpdateMessage + */ + public static fromObject(object: { [k: string]: any }): DownstreamMessage.GroupStateUpdateMessage; + + /** + * Creates a plain object from a GroupStateUpdateMessage message. Also converts values to other types if specified. + * @param message GroupStateUpdateMessage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: DownstreamMessage.GroupStateUpdateMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GroupStateUpdateMessage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GroupStateUpdateMessage + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } } /** Properties of a MessageData. */ @@ -1532,6 +2095,221 @@ export class MessageData implements IMessageData { public static getTypeUrl(typeUrlPrefix?: string): string; } +/** Properties of a GroupStateItem. */ +export interface IGroupStateItem { + + /** GroupStateItem connectionId */ + connectionId?: (string|null); + + /** GroupStateItem userId */ + userId?: (string|null); + + /** GroupStateItem state */ + state?: (GroupStateItem.IGroupState|null); + + /** GroupStateItem updatedAt */ + updatedAt?: (number|Long|null); +} + +/** Represents a GroupStateItem. */ +export class GroupStateItem implements IGroupStateItem { + + /** + * Constructs a new GroupStateItem. + * @param [properties] Properties to set + */ + constructor(properties?: IGroupStateItem); + + /** GroupStateItem connectionId. */ + public connectionId: string; + + /** GroupStateItem userId. */ + public userId?: (string|null); + + /** GroupStateItem state. */ + public state?: (GroupStateItem.IGroupState|null); + + /** GroupStateItem updatedAt. */ + public updatedAt: (number|Long); + + /** + * Creates a new GroupStateItem instance using the specified properties. + * @param [properties] Properties to set + * @returns GroupStateItem instance + */ + public static create(properties?: IGroupStateItem): GroupStateItem; + + /** + * Encodes the specified GroupStateItem message. Does not implicitly {@link GroupStateItem.verify|verify} messages. + * @param message GroupStateItem message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: IGroupStateItem, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GroupStateItem message, length delimited. Does not implicitly {@link GroupStateItem.verify|verify} messages. + * @param message GroupStateItem message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: IGroupStateItem, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GroupStateItem message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GroupStateItem + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): GroupStateItem; + + /** + * Decodes a GroupStateItem message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GroupStateItem + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): GroupStateItem; + + /** + * Verifies a GroupStateItem message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GroupStateItem message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GroupStateItem + */ + public static fromObject(object: { [k: string]: any }): GroupStateItem; + + /** + * Creates a plain object from a GroupStateItem message. Also converts values to other types if specified. + * @param message GroupStateItem + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: GroupStateItem, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GroupStateItem to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GroupStateItem + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; +} + +export namespace GroupStateItem { + + /** Properties of a GroupState. */ + interface IGroupState { + + /** GroupState entries */ + entries?: ({ [k: string]: string }|null); + } + + /** Represents a GroupState. */ + class GroupState implements IGroupState { + + /** + * Constructs a new GroupState. + * @param [properties] Properties to set + */ + constructor(properties?: GroupStateItem.IGroupState); + + /** GroupState entries. */ + public entries: { [k: string]: string }; + + /** + * Creates a new GroupState instance using the specified properties. + * @param [properties] Properties to set + * @returns GroupState instance + */ + public static create(properties?: GroupStateItem.IGroupState): GroupStateItem.GroupState; + + /** + * Encodes the specified GroupState message. Does not implicitly {@link GroupStateItem.GroupState.verify|verify} messages. + * @param message GroupState message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: GroupStateItem.IGroupState, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GroupState message, length delimited. Does not implicitly {@link GroupStateItem.GroupState.verify|verify} messages. + * @param message GroupState message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: GroupStateItem.IGroupState, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GroupState message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GroupState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): GroupStateItem.GroupState; + + /** + * Decodes a GroupState message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GroupState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): GroupStateItem.GroupState; + + /** + * Verifies a GroupState message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GroupState message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GroupState + */ + public static fromObject(object: { [k: string]: any }): GroupStateItem.GroupState; + + /** + * Creates a plain object from a GroupState message. Also converts values to other types if specified. + * @param message GroupState + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: GroupStateItem.GroupState, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GroupState to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GroupState + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } +} + /** Namespace google. */ export namespace google { diff --git a/sdk/web-pubsub/web-pubsub-client-protobuf/src/generated/clientProto.js b/sdk/web-pubsub/web-pubsub-client-protobuf/src/generated/clientProto.js index 62be2e5eabd2..84575f5abdb9 100644 --- a/sdk/web-pubsub/web-pubsub-client-protobuf/src/generated/clientProto.js +++ b/sdk/web-pubsub/web-pubsub-client-protobuf/src/generated/clientProto.js @@ -18,6 +18,9 @@ export const UpstreamMessage = $root.UpstreamMessage = (() => { * @property {UpstreamMessage.IJoinGroupMessage|null} [joinGroupMessage] UpstreamMessage joinGroupMessage * @property {UpstreamMessage.ILeaveGroupMessage|null} [leaveGroupMessage] UpstreamMessage leaveGroupMessage * @property {UpstreamMessage.ISequenceAckMessage|null} [sequenceAckMessage] UpstreamMessage sequenceAckMessage + * @property {UpstreamMessage.ISetGroupStateMessage|null} [setGroupStateMessage] UpstreamMessage setGroupStateMessage + * @property {UpstreamMessage.ISubscribeGroupStateMessage|null} [subscribeGroupStateMessage] UpstreamMessage subscribeGroupStateMessage + * @property {UpstreamMessage.IUnsubscribeGroupStateMessage|null} [unsubscribeGroupStateMessage] UpstreamMessage unsubscribeGroupStateMessage */ /** @@ -75,17 +78,41 @@ export const UpstreamMessage = $root.UpstreamMessage = (() => { */ UpstreamMessage.prototype.sequenceAckMessage = null; + /** + * UpstreamMessage setGroupStateMessage. + * @member {UpstreamMessage.ISetGroupStateMessage|null|undefined} setGroupStateMessage + * @memberof UpstreamMessage + * @instance + */ + UpstreamMessage.prototype.setGroupStateMessage = null; + + /** + * UpstreamMessage subscribeGroupStateMessage. + * @member {UpstreamMessage.ISubscribeGroupStateMessage|null|undefined} subscribeGroupStateMessage + * @memberof UpstreamMessage + * @instance + */ + UpstreamMessage.prototype.subscribeGroupStateMessage = null; + + /** + * UpstreamMessage unsubscribeGroupStateMessage. + * @member {UpstreamMessage.IUnsubscribeGroupStateMessage|null|undefined} unsubscribeGroupStateMessage + * @memberof UpstreamMessage + * @instance + */ + UpstreamMessage.prototype.unsubscribeGroupStateMessage = null; + // OneOf field names bound to virtual getters and setters let $oneOfFields; /** * UpstreamMessage message. - * @member {"sendToGroupMessage"|"eventMessage"|"joinGroupMessage"|"leaveGroupMessage"|"sequenceAckMessage"|undefined} message + * @member {"sendToGroupMessage"|"eventMessage"|"joinGroupMessage"|"leaveGroupMessage"|"sequenceAckMessage"|"setGroupStateMessage"|"subscribeGroupStateMessage"|"unsubscribeGroupStateMessage"|undefined} message * @memberof UpstreamMessage * @instance */ Object.defineProperty(UpstreamMessage.prototype, "message", { - get: $util.oneOfGetter($oneOfFields = ["sendToGroupMessage", "eventMessage", "joinGroupMessage", "leaveGroupMessage", "sequenceAckMessage"]), + get: $util.oneOfGetter($oneOfFields = ["sendToGroupMessage", "eventMessage", "joinGroupMessage", "leaveGroupMessage", "sequenceAckMessage", "setGroupStateMessage", "subscribeGroupStateMessage", "unsubscribeGroupStateMessage"]), set: $util.oneOfSetter($oneOfFields) }); @@ -123,6 +150,12 @@ export const UpstreamMessage = $root.UpstreamMessage = (() => { $root.UpstreamMessage.LeaveGroupMessage.encode(message.leaveGroupMessage, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); if (message.sequenceAckMessage != null && Object.hasOwnProperty.call(message, "sequenceAckMessage")) $root.UpstreamMessage.SequenceAckMessage.encode(message.sequenceAckMessage, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.setGroupStateMessage != null && Object.hasOwnProperty.call(message, "setGroupStateMessage")) + $root.UpstreamMessage.SetGroupStateMessage.encode(message.setGroupStateMessage, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.subscribeGroupStateMessage != null && Object.hasOwnProperty.call(message, "subscribeGroupStateMessage")) + $root.UpstreamMessage.SubscribeGroupStateMessage.encode(message.subscribeGroupStateMessage, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); + if (message.unsubscribeGroupStateMessage != null && Object.hasOwnProperty.call(message, "unsubscribeGroupStateMessage")) + $root.UpstreamMessage.UnsubscribeGroupStateMessage.encode(message.unsubscribeGroupStateMessage, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); return writer; }; @@ -183,6 +216,18 @@ export const UpstreamMessage = $root.UpstreamMessage = (() => { message.sequenceAckMessage = $root.UpstreamMessage.SequenceAckMessage.decode(reader, reader.uint32(), undefined, long + 1); break; } + case 15: { + message.setGroupStateMessage = $root.UpstreamMessage.SetGroupStateMessage.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 16: { + message.subscribeGroupStateMessage = $root.UpstreamMessage.SubscribeGroupStateMessage.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 17: { + message.unsubscribeGroupStateMessage = $root.UpstreamMessage.UnsubscribeGroupStateMessage.decode(reader, reader.uint32(), undefined, long + 1); + break; + } default: reader.skipType(tag & 7, long); break; @@ -271,6 +316,36 @@ export const UpstreamMessage = $root.UpstreamMessage = (() => { return "sequenceAckMessage." + error; } } + if (message.setGroupStateMessage != null && message.hasOwnProperty("setGroupStateMessage")) { + if (properties.message === 1) + return "message: multiple values"; + properties.message = 1; + { + let error = $root.UpstreamMessage.SetGroupStateMessage.verify(message.setGroupStateMessage, long + 1); + if (error) + return "setGroupStateMessage." + error; + } + } + if (message.subscribeGroupStateMessage != null && message.hasOwnProperty("subscribeGroupStateMessage")) { + if (properties.message === 1) + return "message: multiple values"; + properties.message = 1; + { + let error = $root.UpstreamMessage.SubscribeGroupStateMessage.verify(message.subscribeGroupStateMessage, long + 1); + if (error) + return "subscribeGroupStateMessage." + error; + } + } + if (message.unsubscribeGroupStateMessage != null && message.hasOwnProperty("unsubscribeGroupStateMessage")) { + if (properties.message === 1) + return "message: multiple values"; + properties.message = 1; + { + let error = $root.UpstreamMessage.UnsubscribeGroupStateMessage.verify(message.unsubscribeGroupStateMessage, long + 1); + if (error) + return "unsubscribeGroupStateMessage." + error; + } + } return null; }; @@ -315,6 +390,21 @@ export const UpstreamMessage = $root.UpstreamMessage = (() => { throw TypeError(".UpstreamMessage.sequenceAckMessage: object expected"); message.sequenceAckMessage = $root.UpstreamMessage.SequenceAckMessage.fromObject(object.sequenceAckMessage, long + 1); } + if (object.setGroupStateMessage != null) { + if (typeof object.setGroupStateMessage !== "object") + throw TypeError(".UpstreamMessage.setGroupStateMessage: object expected"); + message.setGroupStateMessage = $root.UpstreamMessage.SetGroupStateMessage.fromObject(object.setGroupStateMessage, long + 1); + } + if (object.subscribeGroupStateMessage != null) { + if (typeof object.subscribeGroupStateMessage !== "object") + throw TypeError(".UpstreamMessage.subscribeGroupStateMessage: object expected"); + message.subscribeGroupStateMessage = $root.UpstreamMessage.SubscribeGroupStateMessage.fromObject(object.subscribeGroupStateMessage, long + 1); + } + if (object.unsubscribeGroupStateMessage != null) { + if (typeof object.unsubscribeGroupStateMessage !== "object") + throw TypeError(".UpstreamMessage.unsubscribeGroupStateMessage: object expected"); + message.unsubscribeGroupStateMessage = $root.UpstreamMessage.UnsubscribeGroupStateMessage.fromObject(object.unsubscribeGroupStateMessage, long + 1); + } return message; }; @@ -356,6 +446,21 @@ export const UpstreamMessage = $root.UpstreamMessage = (() => { if (options.oneofs) object.message = "sequenceAckMessage"; } + if (message.setGroupStateMessage != null && message.hasOwnProperty("setGroupStateMessage")) { + object.setGroupStateMessage = $root.UpstreamMessage.SetGroupStateMessage.toObject(message.setGroupStateMessage, options); + if (options.oneofs) + object.message = "setGroupStateMessage"; + } + if (message.subscribeGroupStateMessage != null && message.hasOwnProperty("subscribeGroupStateMessage")) { + object.subscribeGroupStateMessage = $root.UpstreamMessage.SubscribeGroupStateMessage.toObject(message.subscribeGroupStateMessage, options); + if (options.oneofs) + object.message = "subscribeGroupStateMessage"; + } + if (message.unsubscribeGroupStateMessage != null && message.hasOwnProperty("unsubscribeGroupStateMessage")) { + object.unsubscribeGroupStateMessage = $root.UpstreamMessage.UnsubscribeGroupStateMessage.toObject(message.unsubscribeGroupStateMessage, options); + if (options.oneofs) + object.message = "unsubscribeGroupStateMessage"; + } return object; }; @@ -1763,456 +1868,433 @@ export const UpstreamMessage = $root.UpstreamMessage = (() => { return SequenceAckMessage; })(); - return UpstreamMessage; -})(); + UpstreamMessage.SetGroupStateMessage = (function() { -export const DownstreamMessage = $root.DownstreamMessage = (() => { + /** + * Properties of a SetGroupStateMessage. + * @memberof UpstreamMessage + * @interface ISetGroupStateMessage + * @property {string|null} [group] SetGroupStateMessage group + * @property {number|Long|null} [ackId] SetGroupStateMessage ackId + * @property {GroupStateItem.IGroupState|null} [state] SetGroupStateMessage state + */ - /** - * Properties of a DownstreamMessage. - * @exports IDownstreamMessage - * @interface IDownstreamMessage - * @property {DownstreamMessage.IAckMessage|null} [ackMessage] DownstreamMessage ackMessage - * @property {DownstreamMessage.IDataMessage|null} [dataMessage] DownstreamMessage dataMessage - * @property {DownstreamMessage.ISystemMessage|null} [systemMessage] DownstreamMessage systemMessage - */ + /** + * Constructs a new SetGroupStateMessage. + * @memberof UpstreamMessage + * @classdesc Represents a SetGroupStateMessage. + * @implements ISetGroupStateMessage + * @constructor + * @param {UpstreamMessage.ISetGroupStateMessage=} [properties] Properties to set + */ + function SetGroupStateMessage(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } - /** - * Constructs a new DownstreamMessage. - * @exports DownstreamMessage - * @classdesc Represents a DownstreamMessage. - * @implements IDownstreamMessage - * @constructor - * @param {IDownstreamMessage=} [properties] Properties to set - */ - function DownstreamMessage(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } + /** + * SetGroupStateMessage group. + * @member {string} group + * @memberof UpstreamMessage.SetGroupStateMessage + * @instance + */ + SetGroupStateMessage.prototype.group = ""; - /** - * DownstreamMessage ackMessage. - * @member {DownstreamMessage.IAckMessage|null|undefined} ackMessage - * @memberof DownstreamMessage - * @instance - */ - DownstreamMessage.prototype.ackMessage = null; + /** + * SetGroupStateMessage ackId. + * @member {number|Long|null|undefined} ackId + * @memberof UpstreamMessage.SetGroupStateMessage + * @instance + */ + SetGroupStateMessage.prototype.ackId = null; - /** - * DownstreamMessage dataMessage. - * @member {DownstreamMessage.IDataMessage|null|undefined} dataMessage - * @memberof DownstreamMessage - * @instance - */ - DownstreamMessage.prototype.dataMessage = null; + /** + * SetGroupStateMessage state. + * @member {GroupStateItem.IGroupState|null|undefined} state + * @memberof UpstreamMessage.SetGroupStateMessage + * @instance + */ + SetGroupStateMessage.prototype.state = null; - /** - * DownstreamMessage systemMessage. - * @member {DownstreamMessage.ISystemMessage|null|undefined} systemMessage - * @memberof DownstreamMessage - * @instance - */ - DownstreamMessage.prototype.systemMessage = null; + // OneOf field names bound to virtual getters and setters + let $oneOfFields; - // OneOf field names bound to virtual getters and setters - let $oneOfFields; + // Virtual OneOf for proto3 optional field + Object.defineProperty(SetGroupStateMessage.prototype, "_ackId", { + get: $util.oneOfGetter($oneOfFields = ["ackId"]), + set: $util.oneOfSetter($oneOfFields) + }); - /** - * DownstreamMessage message. - * @member {"ackMessage"|"dataMessage"|"systemMessage"|undefined} message - * @memberof DownstreamMessage - * @instance - */ - Object.defineProperty(DownstreamMessage.prototype, "message", { - get: $util.oneOfGetter($oneOfFields = ["ackMessage", "dataMessage", "systemMessage"]), - set: $util.oneOfSetter($oneOfFields) - }); + // Virtual OneOf for proto3 optional field + Object.defineProperty(SetGroupStateMessage.prototype, "_state", { + get: $util.oneOfGetter($oneOfFields = ["state"]), + set: $util.oneOfSetter($oneOfFields) + }); - /** - * Creates a new DownstreamMessage instance using the specified properties. - * @function create - * @memberof DownstreamMessage - * @static - * @param {IDownstreamMessage=} [properties] Properties to set - * @returns {DownstreamMessage} DownstreamMessage instance - */ - DownstreamMessage.create = function create(properties) { - return new DownstreamMessage(properties); - }; + /** + * Creates a new SetGroupStateMessage instance using the specified properties. + * @function create + * @memberof UpstreamMessage.SetGroupStateMessage + * @static + * @param {UpstreamMessage.ISetGroupStateMessage=} [properties] Properties to set + * @returns {UpstreamMessage.SetGroupStateMessage} SetGroupStateMessage instance + */ + SetGroupStateMessage.create = function create(properties) { + return new SetGroupStateMessage(properties); + }; - /** - * Encodes the specified DownstreamMessage message. Does not implicitly {@link DownstreamMessage.verify|verify} messages. - * @function encode - * @memberof DownstreamMessage - * @static - * @param {IDownstreamMessage} message DownstreamMessage message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DownstreamMessage.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.ackMessage != null && Object.hasOwnProperty.call(message, "ackMessage")) - $root.DownstreamMessage.AckMessage.encode(message.ackMessage, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.dataMessage != null && Object.hasOwnProperty.call(message, "dataMessage")) - $root.DownstreamMessage.DataMessage.encode(message.dataMessage, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.systemMessage != null && Object.hasOwnProperty.call(message, "systemMessage")) - $root.DownstreamMessage.SystemMessage.encode(message.systemMessage, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; + /** + * Encodes the specified SetGroupStateMessage message. Does not implicitly {@link UpstreamMessage.SetGroupStateMessage.verify|verify} messages. + * @function encode + * @memberof UpstreamMessage.SetGroupStateMessage + * @static + * @param {UpstreamMessage.ISetGroupStateMessage} message SetGroupStateMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetGroupStateMessage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.group != null && Object.hasOwnProperty.call(message, "group")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.group); + if (message.ackId != null && Object.hasOwnProperty.call(message, "ackId")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.ackId); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + $root.GroupStateItem.GroupState.encode(message.state, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; - /** - * Encodes the specified DownstreamMessage message, length delimited. Does not implicitly {@link DownstreamMessage.verify|verify} messages. - * @function encodeDelimited - * @memberof DownstreamMessage - * @static - * @param {IDownstreamMessage} message DownstreamMessage message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DownstreamMessage.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified SetGroupStateMessage message, length delimited. Does not implicitly {@link UpstreamMessage.SetGroupStateMessage.verify|verify} messages. + * @function encodeDelimited + * @memberof UpstreamMessage.SetGroupStateMessage + * @static + * @param {UpstreamMessage.ISetGroupStateMessage} message SetGroupStateMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetGroupStateMessage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes a DownstreamMessage message from the specified reader or buffer. - * @function decode - * @memberof DownstreamMessage - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {DownstreamMessage} DownstreamMessage - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DownstreamMessage.decode = function decode(reader, length, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.DownstreamMessage(); - while (reader.pos < end) { - let tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.ackMessage = $root.DownstreamMessage.AckMessage.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - case 2: { - message.dataMessage = $root.DownstreamMessage.DataMessage.decode(reader, reader.uint32(), undefined, long + 1); + /** + * Decodes a SetGroupStateMessage message from the specified reader or buffer. + * @function decode + * @memberof UpstreamMessage.SetGroupStateMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {UpstreamMessage.SetGroupStateMessage} SetGroupStateMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetGroupStateMessage.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.UpstreamMessage.SetGroupStateMessage(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) break; - } - case 3: { - message.systemMessage = $root.DownstreamMessage.SystemMessage.decode(reader, reader.uint32(), undefined, long + 1); + switch (tag >>> 3) { + case 1: { + message.group = reader.string(); + break; + } + case 2: { + message.ackId = reader.uint64(); + break; + } + case 3: { + message.state = $root.GroupStateItem.GroupState.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); break; } - default: - reader.skipType(tag & 7, long); - break; } - } - return message; - }; + return message; + }; - /** - * Decodes a DownstreamMessage message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof DownstreamMessage - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {DownstreamMessage} DownstreamMessage - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DownstreamMessage.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Decodes a SetGroupStateMessage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof UpstreamMessage.SetGroupStateMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {UpstreamMessage.SetGroupStateMessage} SetGroupStateMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetGroupStateMessage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Verifies a DownstreamMessage message. - * @function verify - * @memberof DownstreamMessage - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DownstreamMessage.verify = function verify(message, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - let properties = {}; - if (message.ackMessage != null && message.hasOwnProperty("ackMessage")) { - properties.message = 1; - { - let error = $root.DownstreamMessage.AckMessage.verify(message.ackMessage, long + 1); - if (error) - return "ackMessage." + error; - } - } - if (message.dataMessage != null && message.hasOwnProperty("dataMessage")) { - if (properties.message === 1) - return "message: multiple values"; - properties.message = 1; - { - let error = $root.DownstreamMessage.DataMessage.verify(message.dataMessage, long + 1); - if (error) - return "dataMessage." + error; + /** + * Verifies a SetGroupStateMessage message. + * @function verify + * @memberof UpstreamMessage.SetGroupStateMessage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SetGroupStateMessage.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + let properties = {}; + if (message.group != null && message.hasOwnProperty("group")) + if (!$util.isString(message.group)) + return "group: string expected"; + if (message.ackId != null && message.hasOwnProperty("ackId")) { + properties._ackId = 1; + if (!$util.isInteger(message.ackId) && !(message.ackId && $util.isInteger(message.ackId.low) && $util.isInteger(message.ackId.high))) + return "ackId: integer|Long expected"; } - } - if (message.systemMessage != null && message.hasOwnProperty("systemMessage")) { - if (properties.message === 1) - return "message: multiple values"; - properties.message = 1; - { - let error = $root.DownstreamMessage.SystemMessage.verify(message.systemMessage, long + 1); - if (error) - return "systemMessage." + error; + if (message.state != null && message.hasOwnProperty("state")) { + properties._state = 1; + { + let error = $root.GroupStateItem.GroupState.verify(message.state, long + 1); + if (error) + return "state." + error; + } } - } - return null; - }; - - /** - * Creates a DownstreamMessage message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof DownstreamMessage - * @static - * @param {Object.} object Plain object - * @returns {DownstreamMessage} DownstreamMessage - */ - DownstreamMessage.fromObject = function fromObject(object, long) { - if (object instanceof $root.DownstreamMessage) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - let message = new $root.DownstreamMessage(); - if (object.ackMessage != null) { - if (typeof object.ackMessage !== "object") - throw TypeError(".DownstreamMessage.ackMessage: object expected"); - message.ackMessage = $root.DownstreamMessage.AckMessage.fromObject(object.ackMessage, long + 1); - } - if (object.dataMessage != null) { - if (typeof object.dataMessage !== "object") - throw TypeError(".DownstreamMessage.dataMessage: object expected"); - message.dataMessage = $root.DownstreamMessage.DataMessage.fromObject(object.dataMessage, long + 1); - } - if (object.systemMessage != null) { - if (typeof object.systemMessage !== "object") - throw TypeError(".DownstreamMessage.systemMessage: object expected"); - message.systemMessage = $root.DownstreamMessage.SystemMessage.fromObject(object.systemMessage, long + 1); - } - return message; - }; - - /** - * Creates a plain object from a DownstreamMessage message. Also converts values to other types if specified. - * @function toObject - * @memberof DownstreamMessage - * @static - * @param {DownstreamMessage} message DownstreamMessage - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DownstreamMessage.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (message.ackMessage != null && message.hasOwnProperty("ackMessage")) { - object.ackMessage = $root.DownstreamMessage.AckMessage.toObject(message.ackMessage, options); - if (options.oneofs) - object.message = "ackMessage"; - } - if (message.dataMessage != null && message.hasOwnProperty("dataMessage")) { - object.dataMessage = $root.DownstreamMessage.DataMessage.toObject(message.dataMessage, options); - if (options.oneofs) - object.message = "dataMessage"; - } - if (message.systemMessage != null && message.hasOwnProperty("systemMessage")) { - object.systemMessage = $root.DownstreamMessage.SystemMessage.toObject(message.systemMessage, options); - if (options.oneofs) - object.message = "systemMessage"; - } - return object; - }; - - /** - * Converts this DownstreamMessage to JSON. - * @function toJSON - * @memberof DownstreamMessage - * @instance - * @returns {Object.} JSON object - */ - DownstreamMessage.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DownstreamMessage - * @function getTypeUrl - * @memberof DownstreamMessage - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DownstreamMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/DownstreamMessage"; - }; - - DownstreamMessage.AckMessage = (function() { + return null; + }; /** - * Properties of an AckMessage. - * @memberof DownstreamMessage - * @interface IAckMessage - * @property {number|Long|null} [ackId] AckMessage ackId - * @property {boolean|null} [success] AckMessage success - * @property {DownstreamMessage.AckMessage.IErrorMessage|null} [error] AckMessage error + * Creates a SetGroupStateMessage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof UpstreamMessage.SetGroupStateMessage + * @static + * @param {Object.} object Plain object + * @returns {UpstreamMessage.SetGroupStateMessage} SetGroupStateMessage */ + SetGroupStateMessage.fromObject = function fromObject(object, long) { + if (object instanceof $root.UpstreamMessage.SetGroupStateMessage) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.UpstreamMessage.SetGroupStateMessage(); + if (object.group != null) + message.group = String(object.group); + if (object.ackId != null) + if ($util.Long) + (message.ackId = $util.Long.fromValue(object.ackId)).unsigned = true; + else if (typeof object.ackId === "string") + message.ackId = parseInt(object.ackId, 10); + else if (typeof object.ackId === "number") + message.ackId = object.ackId; + else if (typeof object.ackId === "object") + message.ackId = new $util.LongBits(object.ackId.low >>> 0, object.ackId.high >>> 0).toNumber(true); + if (object.state != null) { + if (typeof object.state !== "object") + throw TypeError(".UpstreamMessage.SetGroupStateMessage.state: object expected"); + message.state = $root.GroupStateItem.GroupState.fromObject(object.state, long + 1); + } + return message; + }; /** - * Constructs a new AckMessage. - * @memberof DownstreamMessage - * @classdesc Represents an AckMessage. - * @implements IAckMessage - * @constructor - * @param {DownstreamMessage.IAckMessage=} [properties] Properties to set + * Creates a plain object from a SetGroupStateMessage message. Also converts values to other types if specified. + * @function toObject + * @memberof UpstreamMessage.SetGroupStateMessage + * @static + * @param {UpstreamMessage.SetGroupStateMessage} message SetGroupStateMessage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ - function AckMessage(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } + SetGroupStateMessage.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.group = ""; + if (message.group != null && message.hasOwnProperty("group")) + object.group = message.group; + if (message.ackId != null && message.hasOwnProperty("ackId")) { + if (typeof message.ackId === "number") + object.ackId = options.longs === String ? String(message.ackId) : message.ackId; + else + 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; + if (options.oneofs) + object._ackId = "ackId"; + } + if (message.state != null && message.hasOwnProperty("state")) { + object.state = $root.GroupStateItem.GroupState.toObject(message.state, options); + if (options.oneofs) + object._state = "state"; + } + return object; + }; /** - * AckMessage ackId. - * @member {number|Long} ackId - * @memberof DownstreamMessage.AckMessage + * Converts this SetGroupStateMessage to JSON. + * @function toJSON + * @memberof UpstreamMessage.SetGroupStateMessage * @instance + * @returns {Object.} JSON object */ - AckMessage.prototype.ackId = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + SetGroupStateMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; /** - * AckMessage success. - * @member {boolean} success - * @memberof DownstreamMessage.AckMessage + * Gets the default type url for SetGroupStateMessage + * @function getTypeUrl + * @memberof UpstreamMessage.SetGroupStateMessage + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SetGroupStateMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/UpstreamMessage.SetGroupStateMessage"; + }; + + return SetGroupStateMessage; + })(); + + UpstreamMessage.SubscribeGroupStateMessage = (function() { + + /** + * Properties of a SubscribeGroupStateMessage. + * @memberof UpstreamMessage + * @interface ISubscribeGroupStateMessage + * @property {string|null} [group] SubscribeGroupStateMessage group + * @property {number|Long|null} [ackId] SubscribeGroupStateMessage ackId + */ + + /** + * Constructs a new SubscribeGroupStateMessage. + * @memberof UpstreamMessage + * @classdesc Represents a SubscribeGroupStateMessage. + * @implements ISubscribeGroupStateMessage + * @constructor + * @param {UpstreamMessage.ISubscribeGroupStateMessage=} [properties] Properties to set + */ + function SubscribeGroupStateMessage(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * SubscribeGroupStateMessage group. + * @member {string} group + * @memberof UpstreamMessage.SubscribeGroupStateMessage * @instance */ - AckMessage.prototype.success = false; + SubscribeGroupStateMessage.prototype.group = ""; /** - * AckMessage error. - * @member {DownstreamMessage.AckMessage.IErrorMessage|null|undefined} error - * @memberof DownstreamMessage.AckMessage + * SubscribeGroupStateMessage ackId. + * @member {number|Long|null|undefined} ackId + * @memberof UpstreamMessage.SubscribeGroupStateMessage * @instance */ - AckMessage.prototype.error = null; + SubscribeGroupStateMessage.prototype.ackId = null; // OneOf field names bound to virtual getters and setters let $oneOfFields; // Virtual OneOf for proto3 optional field - Object.defineProperty(AckMessage.prototype, "_error", { - get: $util.oneOfGetter($oneOfFields = ["error"]), + Object.defineProperty(SubscribeGroupStateMessage.prototype, "_ackId", { + get: $util.oneOfGetter($oneOfFields = ["ackId"]), set: $util.oneOfSetter($oneOfFields) }); /** - * Creates a new AckMessage instance using the specified properties. + * Creates a new SubscribeGroupStateMessage instance using the specified properties. * @function create - * @memberof DownstreamMessage.AckMessage + * @memberof UpstreamMessage.SubscribeGroupStateMessage * @static - * @param {DownstreamMessage.IAckMessage=} [properties] Properties to set - * @returns {DownstreamMessage.AckMessage} AckMessage instance + * @param {UpstreamMessage.ISubscribeGroupStateMessage=} [properties] Properties to set + * @returns {UpstreamMessage.SubscribeGroupStateMessage} SubscribeGroupStateMessage instance */ - AckMessage.create = function create(properties) { - return new AckMessage(properties); + SubscribeGroupStateMessage.create = function create(properties) { + return new SubscribeGroupStateMessage(properties); }; /** - * Encodes the specified AckMessage message. Does not implicitly {@link DownstreamMessage.AckMessage.verify|verify} messages. + * Encodes the specified SubscribeGroupStateMessage message. Does not implicitly {@link UpstreamMessage.SubscribeGroupStateMessage.verify|verify} messages. * @function encode - * @memberof DownstreamMessage.AckMessage + * @memberof UpstreamMessage.SubscribeGroupStateMessage * @static - * @param {DownstreamMessage.IAckMessage} message AckMessage message or plain object to encode + * @param {UpstreamMessage.ISubscribeGroupStateMessage} message SubscribeGroupStateMessage message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AckMessage.encode = function encode(message, writer) { + SubscribeGroupStateMessage.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); + if (message.group != null && Object.hasOwnProperty.call(message, "group")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.group); if (message.ackId != null && Object.hasOwnProperty.call(message, "ackId")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.ackId); - if (message.success != null && Object.hasOwnProperty.call(message, "success")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.success); - if (message.error != null && Object.hasOwnProperty.call(message, "error")) - $root.DownstreamMessage.AckMessage.ErrorMessage.encode(message.error, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.ackId); return writer; }; /** - * Encodes the specified AckMessage message, length delimited. Does not implicitly {@link DownstreamMessage.AckMessage.verify|verify} messages. + * Encodes the specified SubscribeGroupStateMessage message, length delimited. Does not implicitly {@link UpstreamMessage.SubscribeGroupStateMessage.verify|verify} messages. * @function encodeDelimited - * @memberof DownstreamMessage.AckMessage + * @memberof UpstreamMessage.SubscribeGroupStateMessage * @static - * @param {DownstreamMessage.IAckMessage} message AckMessage message or plain object to encode + * @param {UpstreamMessage.ISubscribeGroupStateMessage} message SubscribeGroupStateMessage message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AckMessage.encodeDelimited = function encodeDelimited(message, writer) { + SubscribeGroupStateMessage.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an AckMessage message from the specified reader or buffer. + * Decodes a SubscribeGroupStateMessage message from the specified reader or buffer. * @function decode - * @memberof DownstreamMessage.AckMessage + * @memberof UpstreamMessage.SubscribeGroupStateMessage * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {DownstreamMessage.AckMessage} AckMessage + * @returns {UpstreamMessage.SubscribeGroupStateMessage} SubscribeGroupStateMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AckMessage.decode = function decode(reader, length, error, long) { + SubscribeGroupStateMessage.decode = function decode(reader, length, error, long) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); if (long === undefined) long = 0; if (long > $Reader.recursionLimit) throw Error("maximum nesting depth exceeded"); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.DownstreamMessage.AckMessage(); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.UpstreamMessage.SubscribeGroupStateMessage(); while (reader.pos < end) { let tag = reader.uint32(); if (tag === error) break; switch (tag >>> 3) { case 1: { - message.ackId = reader.uint64(); + message.group = reader.string(); break; } case 2: { - message.success = reader.bool(); - break; - } - case 3: { - message.error = $root.DownstreamMessage.AckMessage.ErrorMessage.decode(reader, reader.uint32(), undefined, long + 1); + message.ackId = reader.uint64(); break; } default: @@ -2224,30 +2306,30 @@ export const DownstreamMessage = $root.DownstreamMessage = (() => { }; /** - * Decodes an AckMessage message from the specified reader or buffer, length delimited. + * Decodes a SubscribeGroupStateMessage message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof DownstreamMessage.AckMessage + * @memberof UpstreamMessage.SubscribeGroupStateMessage * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {DownstreamMessage.AckMessage} AckMessage + * @returns {UpstreamMessage.SubscribeGroupStateMessage} SubscribeGroupStateMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AckMessage.decodeDelimited = function decodeDelimited(reader) { + SubscribeGroupStateMessage.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an AckMessage message. + * Verifies a SubscribeGroupStateMessage message. * @function verify - * @memberof DownstreamMessage.AckMessage + * @memberof UpstreamMessage.SubscribeGroupStateMessage * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - AckMessage.verify = function verify(message, long) { + SubscribeGroupStateMessage.verify = function verify(message, long) { if (typeof message !== "object" || message === null) return "object expected"; if (long === undefined) @@ -2255,39 +2337,35 @@ export const DownstreamMessage = $root.DownstreamMessage = (() => { if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; let properties = {}; - if (message.ackId != null && message.hasOwnProperty("ackId")) + if (message.group != null && message.hasOwnProperty("group")) + if (!$util.isString(message.group)) + return "group: string expected"; + if (message.ackId != null && message.hasOwnProperty("ackId")) { + properties._ackId = 1; if (!$util.isInteger(message.ackId) && !(message.ackId && $util.isInteger(message.ackId.low) && $util.isInteger(message.ackId.high))) return "ackId: integer|Long expected"; - if (message.success != null && message.hasOwnProperty("success")) - if (typeof message.success !== "boolean") - return "success: boolean expected"; - if (message.error != null && message.hasOwnProperty("error")) { - properties._error = 1; - { - let error = $root.DownstreamMessage.AckMessage.ErrorMessage.verify(message.error, long + 1); - if (error) - return "error." + error; - } } return null; }; /** - * Creates an AckMessage message from a plain object. Also converts values to their respective internal types. + * Creates a SubscribeGroupStateMessage message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof DownstreamMessage.AckMessage + * @memberof UpstreamMessage.SubscribeGroupStateMessage * @static * @param {Object.} object Plain object - * @returns {DownstreamMessage.AckMessage} AckMessage + * @returns {UpstreamMessage.SubscribeGroupStateMessage} SubscribeGroupStateMessage */ - AckMessage.fromObject = function fromObject(object, long) { - if (object instanceof $root.DownstreamMessage.AckMessage) + SubscribeGroupStateMessage.fromObject = function fromObject(object, long) { + if (object instanceof $root.UpstreamMessage.SubscribeGroupStateMessage) return object; if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); - let message = new $root.DownstreamMessage.AckMessage(); + let message = new $root.UpstreamMessage.SubscribeGroupStateMessage(); + if (object.group != null) + message.group = String(object.group); if (object.ackId != null) if ($util.Long) (message.ackId = $util.Long.fromValue(object.ackId)).unsigned = true; @@ -2297,482 +2375,190 @@ export const DownstreamMessage = $root.DownstreamMessage = (() => { message.ackId = object.ackId; else if (typeof object.ackId === "object") message.ackId = new $util.LongBits(object.ackId.low >>> 0, object.ackId.high >>> 0).toNumber(true); - if (object.success != null) - message.success = Boolean(object.success); - if (object.error != null) { - if (typeof object.error !== "object") - throw TypeError(".DownstreamMessage.AckMessage.error: object expected"); - message.error = $root.DownstreamMessage.AckMessage.ErrorMessage.fromObject(object.error, long + 1); - } return message; }; /** - * Creates a plain object from an AckMessage message. Also converts values to other types if specified. + * Creates a plain object from a SubscribeGroupStateMessage message. Also converts values to other types if specified. * @function toObject - * @memberof DownstreamMessage.AckMessage + * @memberof UpstreamMessage.SubscribeGroupStateMessage * @static - * @param {DownstreamMessage.AckMessage} message AckMessage + * @param {UpstreamMessage.SubscribeGroupStateMessage} message SubscribeGroupStateMessage * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AckMessage.toObject = function toObject(message, options) { + SubscribeGroupStateMessage.toObject = function toObject(message, options) { if (!options) options = {}; let object = {}; - if (options.defaults) { - if ($util.Long) { - let long = new $util.Long(0, 0, true); - object.ackId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.ackId = options.longs === String ? "0" : 0; - object.success = false; - } - if (message.ackId != null && message.hasOwnProperty("ackId")) + if (options.defaults) + object.group = ""; + if (message.group != null && message.hasOwnProperty("group")) + object.group = message.group; + if (message.ackId != null && message.hasOwnProperty("ackId")) { if (typeof message.ackId === "number") object.ackId = options.longs === String ? String(message.ackId) : message.ackId; else 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; - if (message.success != null && message.hasOwnProperty("success")) - object.success = message.success; - if (message.error != null && message.hasOwnProperty("error")) { - object.error = $root.DownstreamMessage.AckMessage.ErrorMessage.toObject(message.error, options); if (options.oneofs) - object._error = "error"; + object._ackId = "ackId"; } return object; }; /** - * Converts this AckMessage to JSON. + * Converts this SubscribeGroupStateMessage to JSON. * @function toJSON - * @memberof DownstreamMessage.AckMessage + * @memberof UpstreamMessage.SubscribeGroupStateMessage * @instance * @returns {Object.} JSON object */ - AckMessage.prototype.toJSON = function toJSON() { + SubscribeGroupStateMessage.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for AckMessage + * Gets the default type url for SubscribeGroupStateMessage * @function getTypeUrl - * @memberof DownstreamMessage.AckMessage + * @memberof UpstreamMessage.SubscribeGroupStateMessage * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - AckMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + SubscribeGroupStateMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/DownstreamMessage.AckMessage"; + return typeUrlPrefix + "/UpstreamMessage.SubscribeGroupStateMessage"; }; - AckMessage.ErrorMessage = (function() { + return SubscribeGroupStateMessage; + })(); - /** - * Properties of an ErrorMessage. - * @memberof DownstreamMessage.AckMessage - * @interface IErrorMessage - * @property {string|null} [name] ErrorMessage name - * @property {string|null} [message] ErrorMessage message - */ + UpstreamMessage.UnsubscribeGroupStateMessage = (function() { - /** - * Constructs a new ErrorMessage. - * @memberof DownstreamMessage.AckMessage - * @classdesc Represents an ErrorMessage. - * @implements IErrorMessage - * @constructor - * @param {DownstreamMessage.AckMessage.IErrorMessage=} [properties] Properties to set - */ - function ErrorMessage(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } + /** + * Properties of an UnsubscribeGroupStateMessage. + * @memberof UpstreamMessage + * @interface IUnsubscribeGroupStateMessage + * @property {string|null} [group] UnsubscribeGroupStateMessage group + * @property {number|Long|null} [ackId] UnsubscribeGroupStateMessage ackId + */ - /** - * ErrorMessage name. - * @member {string} name - * @memberof DownstreamMessage.AckMessage.ErrorMessage - * @instance - */ - ErrorMessage.prototype.name = ""; + /** + * Constructs a new UnsubscribeGroupStateMessage. + * @memberof UpstreamMessage + * @classdesc Represents an UnsubscribeGroupStateMessage. + * @implements IUnsubscribeGroupStateMessage + * @constructor + * @param {UpstreamMessage.IUnsubscribeGroupStateMessage=} [properties] Properties to set + */ + function UnsubscribeGroupStateMessage(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } - /** - * ErrorMessage message. - * @member {string} message - * @memberof DownstreamMessage.AckMessage.ErrorMessage - * @instance - */ - ErrorMessage.prototype.message = ""; + /** + * UnsubscribeGroupStateMessage group. + * @member {string} group + * @memberof UpstreamMessage.UnsubscribeGroupStateMessage + * @instance + */ + UnsubscribeGroupStateMessage.prototype.group = ""; - /** - * Creates a new ErrorMessage instance using the specified properties. - * @function create - * @memberof DownstreamMessage.AckMessage.ErrorMessage - * @static - * @param {DownstreamMessage.AckMessage.IErrorMessage=} [properties] Properties to set - * @returns {DownstreamMessage.AckMessage.ErrorMessage} ErrorMessage instance - */ - ErrorMessage.create = function create(properties) { - return new ErrorMessage(properties); - }; - - /** - * Encodes the specified ErrorMessage message. Does not implicitly {@link DownstreamMessage.AckMessage.ErrorMessage.verify|verify} messages. - * @function encode - * @memberof DownstreamMessage.AckMessage.ErrorMessage - * @static - * @param {DownstreamMessage.AckMessage.IErrorMessage} message ErrorMessage message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ErrorMessage.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.message != null && Object.hasOwnProperty.call(message, "message")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); - return writer; - }; - - /** - * Encodes the specified ErrorMessage message, length delimited. Does not implicitly {@link DownstreamMessage.AckMessage.ErrorMessage.verify|verify} messages. - * @function encodeDelimited - * @memberof DownstreamMessage.AckMessage.ErrorMessage - * @static - * @param {DownstreamMessage.AckMessage.IErrorMessage} message ErrorMessage message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ErrorMessage.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ErrorMessage message from the specified reader or buffer. - * @function decode - * @memberof DownstreamMessage.AckMessage.ErrorMessage - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {DownstreamMessage.AckMessage.ErrorMessage} ErrorMessage - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ErrorMessage.decode = function decode(reader, length, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.DownstreamMessage.AckMessage.ErrorMessage(); - while (reader.pos < end) { - let tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.message = reader.string(); - break; - } - default: - reader.skipType(tag & 7, long); - break; - } - } - return message; - }; - - /** - * Decodes an ErrorMessage message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof DownstreamMessage.AckMessage.ErrorMessage - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {DownstreamMessage.AckMessage.ErrorMessage} ErrorMessage - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ErrorMessage.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ErrorMessage message. - * @function verify - * @memberof DownstreamMessage.AckMessage.ErrorMessage - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ErrorMessage.verify = function verify(message, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.message != null && message.hasOwnProperty("message")) - if (!$util.isString(message.message)) - return "message: string expected"; - return null; - }; - - /** - * Creates an ErrorMessage message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof DownstreamMessage.AckMessage.ErrorMessage - * @static - * @param {Object.} object Plain object - * @returns {DownstreamMessage.AckMessage.ErrorMessage} ErrorMessage - */ - ErrorMessage.fromObject = function fromObject(object, long) { - if (object instanceof $root.DownstreamMessage.AckMessage.ErrorMessage) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - let message = new $root.DownstreamMessage.AckMessage.ErrorMessage(); - if (object.name != null) - message.name = String(object.name); - if (object.message != null) - message.message = String(object.message); - return message; - }; - - /** - * Creates a plain object from an ErrorMessage message. Also converts values to other types if specified. - * @function toObject - * @memberof DownstreamMessage.AckMessage.ErrorMessage - * @static - * @param {DownstreamMessage.AckMessage.ErrorMessage} message ErrorMessage - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ErrorMessage.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.name = ""; - object.message = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.message != null && message.hasOwnProperty("message")) - object.message = message.message; - return object; - }; - - /** - * Converts this ErrorMessage to JSON. - * @function toJSON - * @memberof DownstreamMessage.AckMessage.ErrorMessage - * @instance - * @returns {Object.} JSON object - */ - ErrorMessage.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ErrorMessage - * @function getTypeUrl - * @memberof DownstreamMessage.AckMessage.ErrorMessage - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ErrorMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/DownstreamMessage.AckMessage.ErrorMessage"; - }; - - return ErrorMessage; - })(); - - return AckMessage; - })(); - - DownstreamMessage.DataMessage = (function() { - - /** - * Properties of a DataMessage. - * @memberof DownstreamMessage - * @interface IDataMessage - * @property {string|null} [from] DataMessage from - * @property {string|null} [group] DataMessage group - * @property {IMessageData|null} [data] DataMessage data - * @property {number|Long|null} [sequenceId] DataMessage sequenceId - */ - - /** - * Constructs a new DataMessage. - * @memberof DownstreamMessage - * @classdesc Represents a DataMessage. - * @implements IDataMessage - * @constructor - * @param {DownstreamMessage.IDataMessage=} [properties] Properties to set - */ - function DataMessage(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * DataMessage from. - * @member {string} from - * @memberof DownstreamMessage.DataMessage - * @instance - */ - DataMessage.prototype.from = ""; - - /** - * DataMessage group. - * @member {string|null|undefined} group - * @memberof DownstreamMessage.DataMessage - * @instance - */ - DataMessage.prototype.group = null; - - /** - * DataMessage data. - * @member {IMessageData|null|undefined} data - * @memberof DownstreamMessage.DataMessage - * @instance - */ - DataMessage.prototype.data = null; - - /** - * DataMessage sequenceId. - * @member {number|Long|null|undefined} sequenceId - * @memberof DownstreamMessage.DataMessage - * @instance - */ - DataMessage.prototype.sequenceId = null; + /** + * UnsubscribeGroupStateMessage ackId. + * @member {number|Long|null|undefined} ackId + * @memberof UpstreamMessage.UnsubscribeGroupStateMessage + * @instance + */ + UnsubscribeGroupStateMessage.prototype.ackId = null; // OneOf field names bound to virtual getters and setters let $oneOfFields; // Virtual OneOf for proto3 optional field - Object.defineProperty(DataMessage.prototype, "_group", { - get: $util.oneOfGetter($oneOfFields = ["group"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(DataMessage.prototype, "_sequenceId", { - get: $util.oneOfGetter($oneOfFields = ["sequenceId"]), + Object.defineProperty(UnsubscribeGroupStateMessage.prototype, "_ackId", { + get: $util.oneOfGetter($oneOfFields = ["ackId"]), set: $util.oneOfSetter($oneOfFields) }); /** - * Creates a new DataMessage instance using the specified properties. + * Creates a new UnsubscribeGroupStateMessage instance using the specified properties. * @function create - * @memberof DownstreamMessage.DataMessage + * @memberof UpstreamMessage.UnsubscribeGroupStateMessage * @static - * @param {DownstreamMessage.IDataMessage=} [properties] Properties to set - * @returns {DownstreamMessage.DataMessage} DataMessage instance + * @param {UpstreamMessage.IUnsubscribeGroupStateMessage=} [properties] Properties to set + * @returns {UpstreamMessage.UnsubscribeGroupStateMessage} UnsubscribeGroupStateMessage instance */ - DataMessage.create = function create(properties) { - return new DataMessage(properties); + UnsubscribeGroupStateMessage.create = function create(properties) { + return new UnsubscribeGroupStateMessage(properties); }; /** - * Encodes the specified DataMessage message. Does not implicitly {@link DownstreamMessage.DataMessage.verify|verify} messages. + * Encodes the specified UnsubscribeGroupStateMessage message. Does not implicitly {@link UpstreamMessage.UnsubscribeGroupStateMessage.verify|verify} messages. * @function encode - * @memberof DownstreamMessage.DataMessage + * @memberof UpstreamMessage.UnsubscribeGroupStateMessage * @static - * @param {DownstreamMessage.IDataMessage} message DataMessage message or plain object to encode + * @param {UpstreamMessage.IUnsubscribeGroupStateMessage} message UnsubscribeGroupStateMessage message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DataMessage.encode = function encode(message, writer) { + UnsubscribeGroupStateMessage.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.from != null && Object.hasOwnProperty.call(message, "from")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.from); if (message.group != null && Object.hasOwnProperty.call(message, "group")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.group); - if (message.data != null && Object.hasOwnProperty.call(message, "data")) - $root.MessageData.encode(message.data, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.sequenceId != null && Object.hasOwnProperty.call(message, "sequenceId")) - writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.sequenceId); + writer.uint32(/* id 1, wireType 2 =*/10).string(message.group); + if (message.ackId != null && Object.hasOwnProperty.call(message, "ackId")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.ackId); return writer; }; /** - * Encodes the specified DataMessage message, length delimited. Does not implicitly {@link DownstreamMessage.DataMessage.verify|verify} messages. + * Encodes the specified UnsubscribeGroupStateMessage message, length delimited. Does not implicitly {@link UpstreamMessage.UnsubscribeGroupStateMessage.verify|verify} messages. * @function encodeDelimited - * @memberof DownstreamMessage.DataMessage + * @memberof UpstreamMessage.UnsubscribeGroupStateMessage * @static - * @param {DownstreamMessage.IDataMessage} message DataMessage message or plain object to encode + * @param {UpstreamMessage.IUnsubscribeGroupStateMessage} message UnsubscribeGroupStateMessage message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DataMessage.encodeDelimited = function encodeDelimited(message, writer) { + UnsubscribeGroupStateMessage.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DataMessage message from the specified reader or buffer. + * Decodes an UnsubscribeGroupStateMessage message from the specified reader or buffer. * @function decode - * @memberof DownstreamMessage.DataMessage + * @memberof UpstreamMessage.UnsubscribeGroupStateMessage * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {DownstreamMessage.DataMessage} DataMessage + * @returns {UpstreamMessage.UnsubscribeGroupStateMessage} UnsubscribeGroupStateMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DataMessage.decode = function decode(reader, length, error, long) { + UnsubscribeGroupStateMessage.decode = function decode(reader, length, error, long) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); if (long === undefined) long = 0; if (long > $Reader.recursionLimit) throw Error("maximum nesting depth exceeded"); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.DownstreamMessage.DataMessage(); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.UpstreamMessage.UnsubscribeGroupStateMessage(); while (reader.pos < end) { let tag = reader.uint32(); if (tag === error) break; switch (tag >>> 3) { case 1: { - message.from = reader.string(); - break; - } - case 2: { message.group = reader.string(); break; } - case 3: { - message.data = $root.MessageData.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - case 4: { - message.sequenceId = reader.uint64(); + case 2: { + message.ackId = reader.uint64(); break; } default: @@ -2784,30 +2570,30 @@ export const DownstreamMessage = $root.DownstreamMessage = (() => { }; /** - * Decodes a DataMessage message from the specified reader or buffer, length delimited. + * Decodes an UnsubscribeGroupStateMessage message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof DownstreamMessage.DataMessage + * @memberof UpstreamMessage.UnsubscribeGroupStateMessage * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {DownstreamMessage.DataMessage} DataMessage + * @returns {UpstreamMessage.UnsubscribeGroupStateMessage} UnsubscribeGroupStateMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DataMessage.decodeDelimited = function decodeDelimited(reader) { + UnsubscribeGroupStateMessage.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DataMessage message. + * Verifies an UnsubscribeGroupStateMessage message. * @function verify - * @memberof DownstreamMessage.DataMessage + * @memberof UpstreamMessage.UnsubscribeGroupStateMessage * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DataMessage.verify = function verify(message, long) { + UnsubscribeGroupStateMessage.verify = function verify(message, long) { if (typeof message !== "object" || message === null) return "object expected"; if (long === undefined) @@ -2815,685 +2601,799 @@ export const DownstreamMessage = $root.DownstreamMessage = (() => { if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; let properties = {}; - if (message.from != null && message.hasOwnProperty("from")) - if (!$util.isString(message.from)) - return "from: string expected"; - if (message.group != null && message.hasOwnProperty("group")) { - properties._group = 1; + if (message.group != null && message.hasOwnProperty("group")) if (!$util.isString(message.group)) return "group: string expected"; - } - if (message.data != null && message.hasOwnProperty("data")) { - let error = $root.MessageData.verify(message.data, long + 1); - if (error) - return "data." + error; - } - if (message.sequenceId != null && message.hasOwnProperty("sequenceId")) { - properties._sequenceId = 1; - if (!$util.isInteger(message.sequenceId) && !(message.sequenceId && $util.isInteger(message.sequenceId.low) && $util.isInteger(message.sequenceId.high))) - return "sequenceId: integer|Long expected"; + if (message.ackId != null && message.hasOwnProperty("ackId")) { + properties._ackId = 1; + if (!$util.isInteger(message.ackId) && !(message.ackId && $util.isInteger(message.ackId.low) && $util.isInteger(message.ackId.high))) + return "ackId: integer|Long expected"; } return null; }; /** - * Creates a DataMessage message from a plain object. Also converts values to their respective internal types. + * Creates an UnsubscribeGroupStateMessage message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof DownstreamMessage.DataMessage + * @memberof UpstreamMessage.UnsubscribeGroupStateMessage * @static * @param {Object.} object Plain object - * @returns {DownstreamMessage.DataMessage} DataMessage + * @returns {UpstreamMessage.UnsubscribeGroupStateMessage} UnsubscribeGroupStateMessage */ - DataMessage.fromObject = function fromObject(object, long) { - if (object instanceof $root.DownstreamMessage.DataMessage) + UnsubscribeGroupStateMessage.fromObject = function fromObject(object, long) { + if (object instanceof $root.UpstreamMessage.UnsubscribeGroupStateMessage) return object; if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); - let message = new $root.DownstreamMessage.DataMessage(); - if (object.from != null) - message.from = String(object.from); + let message = new $root.UpstreamMessage.UnsubscribeGroupStateMessage(); if (object.group != null) message.group = String(object.group); - if (object.data != null) { - if (typeof object.data !== "object") - throw TypeError(".DownstreamMessage.DataMessage.data: object expected"); - message.data = $root.MessageData.fromObject(object.data, long + 1); - } - if (object.sequenceId != null) + if (object.ackId != null) if ($util.Long) - (message.sequenceId = $util.Long.fromValue(object.sequenceId)).unsigned = true; - else if (typeof object.sequenceId === "string") - message.sequenceId = parseInt(object.sequenceId, 10); - else if (typeof object.sequenceId === "number") - message.sequenceId = object.sequenceId; - else if (typeof object.sequenceId === "object") - message.sequenceId = new $util.LongBits(object.sequenceId.low >>> 0, object.sequenceId.high >>> 0).toNumber(true); + (message.ackId = $util.Long.fromValue(object.ackId)).unsigned = true; + else if (typeof object.ackId === "string") + message.ackId = parseInt(object.ackId, 10); + else if (typeof object.ackId === "number") + message.ackId = object.ackId; + else if (typeof object.ackId === "object") + message.ackId = new $util.LongBits(object.ackId.low >>> 0, object.ackId.high >>> 0).toNumber(true); return message; }; /** - * Creates a plain object from a DataMessage message. Also converts values to other types if specified. + * Creates a plain object from an UnsubscribeGroupStateMessage message. Also converts values to other types if specified. * @function toObject - * @memberof DownstreamMessage.DataMessage + * @memberof UpstreamMessage.UnsubscribeGroupStateMessage * @static - * @param {DownstreamMessage.DataMessage} message DataMessage + * @param {UpstreamMessage.UnsubscribeGroupStateMessage} message UnsubscribeGroupStateMessage * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DataMessage.toObject = function toObject(message, options) { + UnsubscribeGroupStateMessage.toObject = function toObject(message, options) { if (!options) options = {}; let object = {}; - if (options.defaults) { - object.from = ""; - object.data = null; - } - if (message.from != null && message.hasOwnProperty("from")) - object.from = message.from; - if (message.group != null && message.hasOwnProperty("group")) { + if (options.defaults) + object.group = ""; + if (message.group != null && message.hasOwnProperty("group")) object.group = message.group; - if (options.oneofs) - object._group = "group"; - } - if (message.data != null && message.hasOwnProperty("data")) - object.data = $root.MessageData.toObject(message.data, options); - if (message.sequenceId != null && message.hasOwnProperty("sequenceId")) { - if (typeof message.sequenceId === "number") - object.sequenceId = options.longs === String ? String(message.sequenceId) : message.sequenceId; + if (message.ackId != null && message.hasOwnProperty("ackId")) { + if (typeof message.ackId === "number") + object.ackId = options.longs === String ? String(message.ackId) : message.ackId; else - 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; + 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; if (options.oneofs) - object._sequenceId = "sequenceId"; + object._ackId = "ackId"; } return object; }; /** - * Converts this DataMessage to JSON. + * Converts this UnsubscribeGroupStateMessage to JSON. * @function toJSON - * @memberof DownstreamMessage.DataMessage + * @memberof UpstreamMessage.UnsubscribeGroupStateMessage * @instance * @returns {Object.} JSON object */ - DataMessage.prototype.toJSON = function toJSON() { + UnsubscribeGroupStateMessage.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for DataMessage + * Gets the default type url for UnsubscribeGroupStateMessage * @function getTypeUrl - * @memberof DownstreamMessage.DataMessage + * @memberof UpstreamMessage.UnsubscribeGroupStateMessage * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - DataMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + UnsubscribeGroupStateMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/DownstreamMessage.DataMessage"; + return typeUrlPrefix + "/UpstreamMessage.UnsubscribeGroupStateMessage"; }; - return DataMessage; + return UnsubscribeGroupStateMessage; })(); - DownstreamMessage.SystemMessage = (function() { + return UpstreamMessage; +})(); - /** - * Properties of a SystemMessage. - * @memberof DownstreamMessage - * @interface ISystemMessage - * @property {DownstreamMessage.SystemMessage.IConnectedMessage|null} [connectedMessage] SystemMessage connectedMessage - * @property {DownstreamMessage.SystemMessage.IDisconnectedMessage|null} [disconnectedMessage] SystemMessage disconnectedMessage - */ +export const DownstreamMessage = $root.DownstreamMessage = (() => { - /** - * Constructs a new SystemMessage. - * @memberof DownstreamMessage - * @classdesc Represents a SystemMessage. - * @implements ISystemMessage - * @constructor - * @param {DownstreamMessage.ISystemMessage=} [properties] Properties to set - */ - function SystemMessage(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } + /** + * Properties of a DownstreamMessage. + * @exports IDownstreamMessage + * @interface IDownstreamMessage + * @property {DownstreamMessage.IAckMessage|null} [ackMessage] DownstreamMessage ackMessage + * @property {DownstreamMessage.IDataMessage|null} [dataMessage] DownstreamMessage dataMessage + * @property {DownstreamMessage.ISystemMessage|null} [systemMessage] DownstreamMessage systemMessage + * @property {DownstreamMessage.IGroupStateUpdateMessage|null} [groupStateUpdateMessage] DownstreamMessage groupStateUpdateMessage + * @property {DownstreamMessage.IGroupStateSnapshotMessage|null} [groupStateSnapshotMessage] DownstreamMessage groupStateSnapshotMessage + */ - /** - * SystemMessage connectedMessage. - * @member {DownstreamMessage.SystemMessage.IConnectedMessage|null|undefined} connectedMessage - * @memberof DownstreamMessage.SystemMessage - * @instance - */ - SystemMessage.prototype.connectedMessage = null; + /** + * Constructs a new DownstreamMessage. + * @exports DownstreamMessage + * @classdesc Represents a DownstreamMessage. + * @implements IDownstreamMessage + * @constructor + * @param {IDownstreamMessage=} [properties] Properties to set + */ + function DownstreamMessage(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } - /** - * SystemMessage disconnectedMessage. - * @member {DownstreamMessage.SystemMessage.IDisconnectedMessage|null|undefined} disconnectedMessage - * @memberof DownstreamMessage.SystemMessage - * @instance - */ - SystemMessage.prototype.disconnectedMessage = null; + /** + * DownstreamMessage ackMessage. + * @member {DownstreamMessage.IAckMessage|null|undefined} ackMessage + * @memberof DownstreamMessage + * @instance + */ + DownstreamMessage.prototype.ackMessage = null; - // OneOf field names bound to virtual getters and setters - let $oneOfFields; + /** + * DownstreamMessage dataMessage. + * @member {DownstreamMessage.IDataMessage|null|undefined} dataMessage + * @memberof DownstreamMessage + * @instance + */ + DownstreamMessage.prototype.dataMessage = null; - /** - * SystemMessage message. - * @member {"connectedMessage"|"disconnectedMessage"|undefined} message - * @memberof DownstreamMessage.SystemMessage - * @instance - */ - Object.defineProperty(SystemMessage.prototype, "message", { - get: $util.oneOfGetter($oneOfFields = ["connectedMessage", "disconnectedMessage"]), - set: $util.oneOfSetter($oneOfFields) - }); + /** + * DownstreamMessage systemMessage. + * @member {DownstreamMessage.ISystemMessage|null|undefined} systemMessage + * @memberof DownstreamMessage + * @instance + */ + DownstreamMessage.prototype.systemMessage = null; - /** - * Creates a new SystemMessage instance using the specified properties. - * @function create - * @memberof DownstreamMessage.SystemMessage - * @static - * @param {DownstreamMessage.ISystemMessage=} [properties] Properties to set - * @returns {DownstreamMessage.SystemMessage} SystemMessage instance - */ - SystemMessage.create = function create(properties) { - return new SystemMessage(properties); - }; + /** + * DownstreamMessage groupStateUpdateMessage. + * @member {DownstreamMessage.IGroupStateUpdateMessage|null|undefined} groupStateUpdateMessage + * @memberof DownstreamMessage + * @instance + */ + DownstreamMessage.prototype.groupStateUpdateMessage = null; - /** - * Encodes the specified SystemMessage message. Does not implicitly {@link DownstreamMessage.SystemMessage.verify|verify} messages. - * @function encode - * @memberof DownstreamMessage.SystemMessage - * @static - * @param {DownstreamMessage.ISystemMessage} message SystemMessage message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SystemMessage.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.connectedMessage != null && Object.hasOwnProperty.call(message, "connectedMessage")) - $root.DownstreamMessage.SystemMessage.ConnectedMessage.encode(message.connectedMessage, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.disconnectedMessage != null && Object.hasOwnProperty.call(message, "disconnectedMessage")) - $root.DownstreamMessage.SystemMessage.DisconnectedMessage.encode(message.disconnectedMessage, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; + /** + * DownstreamMessage groupStateSnapshotMessage. + * @member {DownstreamMessage.IGroupStateSnapshotMessage|null|undefined} groupStateSnapshotMessage + * @memberof DownstreamMessage + * @instance + */ + DownstreamMessage.prototype.groupStateSnapshotMessage = null; - /** - * Encodes the specified SystemMessage message, length delimited. Does not implicitly {@link DownstreamMessage.SystemMessage.verify|verify} messages. - * @function encodeDelimited - * @memberof DownstreamMessage.SystemMessage - * @static - * @param {DownstreamMessage.ISystemMessage} message SystemMessage message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SystemMessage.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + // OneOf field names bound to virtual getters and setters + let $oneOfFields; - /** - * Decodes a SystemMessage message from the specified reader or buffer. - * @function decode - * @memberof DownstreamMessage.SystemMessage - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {DownstreamMessage.SystemMessage} SystemMessage - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SystemMessage.decode = function decode(reader, length, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.DownstreamMessage.SystemMessage(); - while (reader.pos < end) { - let tag = reader.uint32(); - if (tag === error) + /** + * DownstreamMessage message. + * @member {"ackMessage"|"dataMessage"|"systemMessage"|"groupStateUpdateMessage"|"groupStateSnapshotMessage"|undefined} message + * @memberof DownstreamMessage + * @instance + */ + Object.defineProperty(DownstreamMessage.prototype, "message", { + get: $util.oneOfGetter($oneOfFields = ["ackMessage", "dataMessage", "systemMessage", "groupStateUpdateMessage", "groupStateSnapshotMessage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DownstreamMessage instance using the specified properties. + * @function create + * @memberof DownstreamMessage + * @static + * @param {IDownstreamMessage=} [properties] Properties to set + * @returns {DownstreamMessage} DownstreamMessage instance + */ + DownstreamMessage.create = function create(properties) { + return new DownstreamMessage(properties); + }; + + /** + * Encodes the specified DownstreamMessage message. Does not implicitly {@link DownstreamMessage.verify|verify} messages. + * @function encode + * @memberof DownstreamMessage + * @static + * @param {IDownstreamMessage} message DownstreamMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DownstreamMessage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ackMessage != null && Object.hasOwnProperty.call(message, "ackMessage")) + $root.DownstreamMessage.AckMessage.encode(message.ackMessage, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.dataMessage != null && Object.hasOwnProperty.call(message, "dataMessage")) + $root.DownstreamMessage.DataMessage.encode(message.dataMessage, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.systemMessage != null && Object.hasOwnProperty.call(message, "systemMessage")) + $root.DownstreamMessage.SystemMessage.encode(message.systemMessage, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.groupStateUpdateMessage != null && Object.hasOwnProperty.call(message, "groupStateUpdateMessage")) + $root.DownstreamMessage.GroupStateUpdateMessage.encode(message.groupStateUpdateMessage, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.groupStateSnapshotMessage != null && Object.hasOwnProperty.call(message, "groupStateSnapshotMessage")) + $root.DownstreamMessage.GroupStateSnapshotMessage.encode(message.groupStateSnapshotMessage, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DownstreamMessage message, length delimited. Does not implicitly {@link DownstreamMessage.verify|verify} messages. + * @function encodeDelimited + * @memberof DownstreamMessage + * @static + * @param {IDownstreamMessage} message DownstreamMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DownstreamMessage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DownstreamMessage message from the specified reader or buffer. + * @function decode + * @memberof DownstreamMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {DownstreamMessage} DownstreamMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DownstreamMessage.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.DownstreamMessage(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.ackMessage = $root.DownstreamMessage.AckMessage.decode(reader, reader.uint32(), undefined, long + 1); break; - switch (tag >>> 3) { - case 1: { - message.connectedMessage = $root.DownstreamMessage.SystemMessage.ConnectedMessage.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - case 2: { - message.disconnectedMessage = $root.DownstreamMessage.SystemMessage.DisconnectedMessage.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - default: - reader.skipType(tag & 7, long); + } + case 2: { + message.dataMessage = $root.DownstreamMessage.DataMessage.decode(reader, reader.uint32(), undefined, long + 1); break; } - } - return message; - }; - - /** - * Decodes a SystemMessage message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof DownstreamMessage.SystemMessage - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {DownstreamMessage.SystemMessage} SystemMessage - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SystemMessage.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SystemMessage message. - * @function verify - * @memberof DownstreamMessage.SystemMessage - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SystemMessage.verify = function verify(message, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - let properties = {}; - if (message.connectedMessage != null && message.hasOwnProperty("connectedMessage")) { - properties.message = 1; - { - let error = $root.DownstreamMessage.SystemMessage.ConnectedMessage.verify(message.connectedMessage, long + 1); - if (error) - return "connectedMessage." + error; + case 3: { + message.systemMessage = $root.DownstreamMessage.SystemMessage.decode(reader, reader.uint32(), undefined, long + 1); + break; } - } - if (message.disconnectedMessage != null && message.hasOwnProperty("disconnectedMessage")) { - if (properties.message === 1) - return "message: multiple values"; - properties.message = 1; - { - let error = $root.DownstreamMessage.SystemMessage.DisconnectedMessage.verify(message.disconnectedMessage, long + 1); - if (error) - return "disconnectedMessage." + error; + case 9: { + message.groupStateUpdateMessage = $root.DownstreamMessage.GroupStateUpdateMessage.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 10: { + message.groupStateSnapshotMessage = $root.DownstreamMessage.GroupStateSnapshotMessage.decode(reader, reader.uint32(), undefined, long + 1); + break; } + default: + reader.skipType(tag & 7, long); + break; } - return null; - }; + } + return message; + }; - /** - * Creates a SystemMessage message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof DownstreamMessage.SystemMessage - * @static - * @param {Object.} object Plain object - * @returns {DownstreamMessage.SystemMessage} SystemMessage - */ - SystemMessage.fromObject = function fromObject(object, long) { - if (object instanceof $root.DownstreamMessage.SystemMessage) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - let message = new $root.DownstreamMessage.SystemMessage(); - if (object.connectedMessage != null) { - if (typeof object.connectedMessage !== "object") - throw TypeError(".DownstreamMessage.SystemMessage.connectedMessage: object expected"); - message.connectedMessage = $root.DownstreamMessage.SystemMessage.ConnectedMessage.fromObject(object.connectedMessage, long + 1); - } - if (object.disconnectedMessage != null) { - if (typeof object.disconnectedMessage !== "object") - throw TypeError(".DownstreamMessage.SystemMessage.disconnectedMessage: object expected"); - message.disconnectedMessage = $root.DownstreamMessage.SystemMessage.DisconnectedMessage.fromObject(object.disconnectedMessage, long + 1); - } - return message; - }; + /** + * Decodes a DownstreamMessage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof DownstreamMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {DownstreamMessage} DownstreamMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DownstreamMessage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Creates a plain object from a SystemMessage message. Also converts values to other types if specified. - * @function toObject - * @memberof DownstreamMessage.SystemMessage - * @static - * @param {DownstreamMessage.SystemMessage} message SystemMessage - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SystemMessage.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (message.connectedMessage != null && message.hasOwnProperty("connectedMessage")) { - object.connectedMessage = $root.DownstreamMessage.SystemMessage.ConnectedMessage.toObject(message.connectedMessage, options); - if (options.oneofs) - object.message = "connectedMessage"; - } - if (message.disconnectedMessage != null && message.hasOwnProperty("disconnectedMessage")) { - object.disconnectedMessage = $root.DownstreamMessage.SystemMessage.DisconnectedMessage.toObject(message.disconnectedMessage, options); - if (options.oneofs) - object.message = "disconnectedMessage"; + /** + * Verifies a DownstreamMessage message. + * @function verify + * @memberof DownstreamMessage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DownstreamMessage.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + let properties = {}; + if (message.ackMessage != null && message.hasOwnProperty("ackMessage")) { + properties.message = 1; + { + let error = $root.DownstreamMessage.AckMessage.verify(message.ackMessage, long + 1); + if (error) + return "ackMessage." + error; + } + } + if (message.dataMessage != null && message.hasOwnProperty("dataMessage")) { + if (properties.message === 1) + return "message: multiple values"; + properties.message = 1; + { + let error = $root.DownstreamMessage.DataMessage.verify(message.dataMessage, long + 1); + if (error) + return "dataMessage." + error; + } + } + if (message.systemMessage != null && message.hasOwnProperty("systemMessage")) { + if (properties.message === 1) + return "message: multiple values"; + properties.message = 1; + { + let error = $root.DownstreamMessage.SystemMessage.verify(message.systemMessage, long + 1); + if (error) + return "systemMessage." + error; + } + } + if (message.groupStateUpdateMessage != null && message.hasOwnProperty("groupStateUpdateMessage")) { + if (properties.message === 1) + return "message: multiple values"; + properties.message = 1; + { + let error = $root.DownstreamMessage.GroupStateUpdateMessage.verify(message.groupStateUpdateMessage, long + 1); + if (error) + return "groupStateUpdateMessage." + error; + } + } + if (message.groupStateSnapshotMessage != null && message.hasOwnProperty("groupStateSnapshotMessage")) { + if (properties.message === 1) + return "message: multiple values"; + properties.message = 1; + { + let error = $root.DownstreamMessage.GroupStateSnapshotMessage.verify(message.groupStateSnapshotMessage, long + 1); + if (error) + return "groupStateSnapshotMessage." + error; } + } + return null; + }; + + /** + * Creates a DownstreamMessage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof DownstreamMessage + * @static + * @param {Object.} object Plain object + * @returns {DownstreamMessage} DownstreamMessage + */ + DownstreamMessage.fromObject = function fromObject(object, long) { + if (object instanceof $root.DownstreamMessage) return object; - }; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.DownstreamMessage(); + if (object.ackMessage != null) { + if (typeof object.ackMessage !== "object") + throw TypeError(".DownstreamMessage.ackMessage: object expected"); + message.ackMessage = $root.DownstreamMessage.AckMessage.fromObject(object.ackMessage, long + 1); + } + if (object.dataMessage != null) { + if (typeof object.dataMessage !== "object") + throw TypeError(".DownstreamMessage.dataMessage: object expected"); + message.dataMessage = $root.DownstreamMessage.DataMessage.fromObject(object.dataMessage, long + 1); + } + if (object.systemMessage != null) { + if (typeof object.systemMessage !== "object") + throw TypeError(".DownstreamMessage.systemMessage: object expected"); + message.systemMessage = $root.DownstreamMessage.SystemMessage.fromObject(object.systemMessage, long + 1); + } + if (object.groupStateUpdateMessage != null) { + if (typeof object.groupStateUpdateMessage !== "object") + throw TypeError(".DownstreamMessage.groupStateUpdateMessage: object expected"); + message.groupStateUpdateMessage = $root.DownstreamMessage.GroupStateUpdateMessage.fromObject(object.groupStateUpdateMessage, long + 1); + } + if (object.groupStateSnapshotMessage != null) { + if (typeof object.groupStateSnapshotMessage !== "object") + throw TypeError(".DownstreamMessage.groupStateSnapshotMessage: object expected"); + message.groupStateSnapshotMessage = $root.DownstreamMessage.GroupStateSnapshotMessage.fromObject(object.groupStateSnapshotMessage, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a DownstreamMessage message. Also converts values to other types if specified. + * @function toObject + * @memberof DownstreamMessage + * @static + * @param {DownstreamMessage} message DownstreamMessage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DownstreamMessage.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (message.ackMessage != null && message.hasOwnProperty("ackMessage")) { + object.ackMessage = $root.DownstreamMessage.AckMessage.toObject(message.ackMessage, options); + if (options.oneofs) + object.message = "ackMessage"; + } + if (message.dataMessage != null && message.hasOwnProperty("dataMessage")) { + object.dataMessage = $root.DownstreamMessage.DataMessage.toObject(message.dataMessage, options); + if (options.oneofs) + object.message = "dataMessage"; + } + if (message.systemMessage != null && message.hasOwnProperty("systemMessage")) { + object.systemMessage = $root.DownstreamMessage.SystemMessage.toObject(message.systemMessage, options); + if (options.oneofs) + object.message = "systemMessage"; + } + if (message.groupStateUpdateMessage != null && message.hasOwnProperty("groupStateUpdateMessage")) { + object.groupStateUpdateMessage = $root.DownstreamMessage.GroupStateUpdateMessage.toObject(message.groupStateUpdateMessage, options); + if (options.oneofs) + object.message = "groupStateUpdateMessage"; + } + if (message.groupStateSnapshotMessage != null && message.hasOwnProperty("groupStateSnapshotMessage")) { + object.groupStateSnapshotMessage = $root.DownstreamMessage.GroupStateSnapshotMessage.toObject(message.groupStateSnapshotMessage, options); + if (options.oneofs) + object.message = "groupStateSnapshotMessage"; + } + return object; + }; + + /** + * Converts this DownstreamMessage to JSON. + * @function toJSON + * @memberof DownstreamMessage + * @instance + * @returns {Object.} JSON object + */ + DownstreamMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DownstreamMessage + * @function getTypeUrl + * @memberof DownstreamMessage + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DownstreamMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/DownstreamMessage"; + }; + + DownstreamMessage.AckMessage = (function() { /** - * Converts this SystemMessage to JSON. - * @function toJSON - * @memberof DownstreamMessage.SystemMessage - * @instance - * @returns {Object.} JSON object + * Properties of an AckMessage. + * @memberof DownstreamMessage + * @interface IAckMessage + * @property {number|Long|null} [ackId] AckMessage ackId + * @property {boolean|null} [success] AckMessage success + * @property {DownstreamMessage.AckMessage.IErrorMessage|null} [error] AckMessage error */ - SystemMessage.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; /** - * Gets the default type url for SystemMessage - * @function getTypeUrl - * @memberof DownstreamMessage.SystemMessage - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url + * Constructs a new AckMessage. + * @memberof DownstreamMessage + * @classdesc Represents an AckMessage. + * @implements IAckMessage + * @constructor + * @param {DownstreamMessage.IAckMessage=} [properties] Properties to set */ - SystemMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/DownstreamMessage.SystemMessage"; - }; + function AckMessage(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } - SystemMessage.ConnectedMessage = (function() { + /** + * AckMessage ackId. + * @member {number|Long} ackId + * @memberof DownstreamMessage.AckMessage + * @instance + */ + AckMessage.prototype.ackId = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - /** - * Properties of a ConnectedMessage. - * @memberof DownstreamMessage.SystemMessage - * @interface IConnectedMessage - * @property {string|null} [connectionId] ConnectedMessage connectionId - * @property {string|null} [userId] ConnectedMessage userId - * @property {string|null} [reconnectionToken] ConnectedMessage reconnectionToken - */ + /** + * AckMessage success. + * @member {boolean} success + * @memberof DownstreamMessage.AckMessage + * @instance + */ + AckMessage.prototype.success = false; - /** - * Constructs a new ConnectedMessage. - * @memberof DownstreamMessage.SystemMessage - * @classdesc Represents a ConnectedMessage. - * @implements IConnectedMessage - * @constructor - * @param {DownstreamMessage.SystemMessage.IConnectedMessage=} [properties] Properties to set - */ - function ConnectedMessage(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } + /** + * AckMessage error. + * @member {DownstreamMessage.AckMessage.IErrorMessage|null|undefined} error + * @memberof DownstreamMessage.AckMessage + * @instance + */ + AckMessage.prototype.error = null; - /** - * ConnectedMessage connectionId. - * @member {string} connectionId - * @memberof DownstreamMessage.SystemMessage.ConnectedMessage - * @instance - */ - ConnectedMessage.prototype.connectionId = ""; + // OneOf field names bound to virtual getters and setters + let $oneOfFields; - /** - * ConnectedMessage userId. - * @member {string} userId - * @memberof DownstreamMessage.SystemMessage.ConnectedMessage - * @instance - */ - ConnectedMessage.prototype.userId = ""; - - /** - * ConnectedMessage reconnectionToken. - * @member {string} reconnectionToken - * @memberof DownstreamMessage.SystemMessage.ConnectedMessage - * @instance - */ - ConnectedMessage.prototype.reconnectionToken = ""; + // Virtual OneOf for proto3 optional field + Object.defineProperty(AckMessage.prototype, "_error", { + get: $util.oneOfGetter($oneOfFields = ["error"]), + set: $util.oneOfSetter($oneOfFields) + }); - /** - * Creates a new ConnectedMessage instance using the specified properties. - * @function create - * @memberof DownstreamMessage.SystemMessage.ConnectedMessage - * @static - * @param {DownstreamMessage.SystemMessage.IConnectedMessage=} [properties] Properties to set - * @returns {DownstreamMessage.SystemMessage.ConnectedMessage} ConnectedMessage instance - */ - ConnectedMessage.create = function create(properties) { - return new ConnectedMessage(properties); - }; + /** + * Creates a new AckMessage instance using the specified properties. + * @function create + * @memberof DownstreamMessage.AckMessage + * @static + * @param {DownstreamMessage.IAckMessage=} [properties] Properties to set + * @returns {DownstreamMessage.AckMessage} AckMessage instance + */ + AckMessage.create = function create(properties) { + return new AckMessage(properties); + }; - /** - * Encodes the specified ConnectedMessage message. Does not implicitly {@link DownstreamMessage.SystemMessage.ConnectedMessage.verify|verify} messages. - * @function encode - * @memberof DownstreamMessage.SystemMessage.ConnectedMessage - * @static - * @param {DownstreamMessage.SystemMessage.IConnectedMessage} message ConnectedMessage message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ConnectedMessage.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.connectionId != null && Object.hasOwnProperty.call(message, "connectionId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.connectionId); - if (message.userId != null && Object.hasOwnProperty.call(message, "userId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.userId); - if (message.reconnectionToken != null && Object.hasOwnProperty.call(message, "reconnectionToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.reconnectionToken); - return writer; - }; + /** + * Encodes the specified AckMessage message. Does not implicitly {@link DownstreamMessage.AckMessage.verify|verify} messages. + * @function encode + * @memberof DownstreamMessage.AckMessage + * @static + * @param {DownstreamMessage.IAckMessage} message AckMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AckMessage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ackId != null && Object.hasOwnProperty.call(message, "ackId")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.ackId); + if (message.success != null && Object.hasOwnProperty.call(message, "success")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.success); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + $root.DownstreamMessage.AckMessage.ErrorMessage.encode(message.error, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; - /** - * Encodes the specified ConnectedMessage message, length delimited. Does not implicitly {@link DownstreamMessage.SystemMessage.ConnectedMessage.verify|verify} messages. - * @function encodeDelimited - * @memberof DownstreamMessage.SystemMessage.ConnectedMessage - * @static - * @param {DownstreamMessage.SystemMessage.IConnectedMessage} message ConnectedMessage message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ConnectedMessage.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified AckMessage message, length delimited. Does not implicitly {@link DownstreamMessage.AckMessage.verify|verify} messages. + * @function encodeDelimited + * @memberof DownstreamMessage.AckMessage + * @static + * @param {DownstreamMessage.IAckMessage} message AckMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AckMessage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes a ConnectedMessage message from the specified reader or buffer. - * @function decode - * @memberof DownstreamMessage.SystemMessage.ConnectedMessage - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {DownstreamMessage.SystemMessage.ConnectedMessage} ConnectedMessage - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ConnectedMessage.decode = function decode(reader, length, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.DownstreamMessage.SystemMessage.ConnectedMessage(); - while (reader.pos < end) { - let tag = reader.uint32(); - if (tag === error) + /** + * Decodes an AckMessage message from the specified reader or buffer. + * @function decode + * @memberof DownstreamMessage.AckMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {DownstreamMessage.AckMessage} AckMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AckMessage.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.DownstreamMessage.AckMessage(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.ackId = reader.uint64(); break; - switch (tag >>> 3) { - case 1: { - message.connectionId = reader.string(); - break; - } - case 2: { - message.userId = reader.string(); - break; - } - case 3: { - message.reconnectionToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7, long); + } + case 2: { + message.success = reader.bool(); + break; + } + case 3: { + message.error = $root.DownstreamMessage.AckMessage.ErrorMessage.decode(reader, reader.uint32(), undefined, long + 1); break; } + default: + reader.skipType(tag & 7, long); + break; } - return message; - }; - - /** - * Decodes a ConnectedMessage message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof DownstreamMessage.SystemMessage.ConnectedMessage - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {DownstreamMessage.SystemMessage.ConnectedMessage} ConnectedMessage - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ConnectedMessage.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + } + return message; + }; - /** - * Verifies a ConnectedMessage message. - * @function verify - * @memberof DownstreamMessage.SystemMessage.ConnectedMessage - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ConnectedMessage.verify = function verify(message, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - if (message.connectionId != null && message.hasOwnProperty("connectionId")) - if (!$util.isString(message.connectionId)) - return "connectionId: string expected"; - if (message.userId != null && message.hasOwnProperty("userId")) - if (!$util.isString(message.userId)) - return "userId: string expected"; - if (message.reconnectionToken != null && message.hasOwnProperty("reconnectionToken")) - if (!$util.isString(message.reconnectionToken)) - return "reconnectionToken: string expected"; - return null; - }; + /** + * Decodes an AckMessage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof DownstreamMessage.AckMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {DownstreamMessage.AckMessage} AckMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AckMessage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Creates a ConnectedMessage message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof DownstreamMessage.SystemMessage.ConnectedMessage - * @static - * @param {Object.} object Plain object - * @returns {DownstreamMessage.SystemMessage.ConnectedMessage} ConnectedMessage - */ - ConnectedMessage.fromObject = function fromObject(object, long) { - if (object instanceof $root.DownstreamMessage.SystemMessage.ConnectedMessage) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - let message = new $root.DownstreamMessage.SystemMessage.ConnectedMessage(); - if (object.connectionId != null) - message.connectionId = String(object.connectionId); - if (object.userId != null) - message.userId = String(object.userId); - if (object.reconnectionToken != null) - message.reconnectionToken = String(object.reconnectionToken); - return message; - }; - - /** - * Creates a plain object from a ConnectedMessage message. Also converts values to other types if specified. - * @function toObject - * @memberof DownstreamMessage.SystemMessage.ConnectedMessage - * @static - * @param {DownstreamMessage.SystemMessage.ConnectedMessage} message ConnectedMessage - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ConnectedMessage.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.connectionId = ""; - object.userId = ""; - object.reconnectionToken = ""; + /** + * Verifies an AckMessage message. + * @function verify + * @memberof DownstreamMessage.AckMessage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AckMessage.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + let properties = {}; + if (message.ackId != null && message.hasOwnProperty("ackId")) + if (!$util.isInteger(message.ackId) && !(message.ackId && $util.isInteger(message.ackId.low) && $util.isInteger(message.ackId.high))) + return "ackId: integer|Long expected"; + if (message.success != null && message.hasOwnProperty("success")) + if (typeof message.success !== "boolean") + return "success: boolean expected"; + if (message.error != null && message.hasOwnProperty("error")) { + properties._error = 1; + { + let error = $root.DownstreamMessage.AckMessage.ErrorMessage.verify(message.error, long + 1); + if (error) + return "error." + error; } - if (message.connectionId != null && message.hasOwnProperty("connectionId")) - object.connectionId = message.connectionId; - if (message.userId != null && message.hasOwnProperty("userId")) - object.userId = message.userId; - if (message.reconnectionToken != null && message.hasOwnProperty("reconnectionToken")) - object.reconnectionToken = message.reconnectionToken; + } + return null; + }; + + /** + * Creates an AckMessage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof DownstreamMessage.AckMessage + * @static + * @param {Object.} object Plain object + * @returns {DownstreamMessage.AckMessage} AckMessage + */ + AckMessage.fromObject = function fromObject(object, long) { + if (object instanceof $root.DownstreamMessage.AckMessage) return object; - }; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.DownstreamMessage.AckMessage(); + if (object.ackId != null) + if ($util.Long) + (message.ackId = $util.Long.fromValue(object.ackId)).unsigned = true; + else if (typeof object.ackId === "string") + message.ackId = parseInt(object.ackId, 10); + else if (typeof object.ackId === "number") + message.ackId = object.ackId; + else if (typeof object.ackId === "object") + message.ackId = new $util.LongBits(object.ackId.low >>> 0, object.ackId.high >>> 0).toNumber(true); + if (object.success != null) + message.success = Boolean(object.success); + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".DownstreamMessage.AckMessage.error: object expected"); + message.error = $root.DownstreamMessage.AckMessage.ErrorMessage.fromObject(object.error, long + 1); + } + return message; + }; - /** - * Converts this ConnectedMessage to JSON. - * @function toJSON - * @memberof DownstreamMessage.SystemMessage.ConnectedMessage - * @instance - * @returns {Object.} JSON object - */ - ConnectedMessage.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a plain object from an AckMessage message. Also converts values to other types if specified. + * @function toObject + * @memberof DownstreamMessage.AckMessage + * @static + * @param {DownstreamMessage.AckMessage} message AckMessage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AckMessage.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.ackId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.ackId = options.longs === String ? "0" : 0; + object.success = false; + } + if (message.ackId != null && message.hasOwnProperty("ackId")) + if (typeof message.ackId === "number") + object.ackId = options.longs === String ? String(message.ackId) : message.ackId; + else + 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; + if (message.success != null && message.hasOwnProperty("success")) + object.success = message.success; + if (message.error != null && message.hasOwnProperty("error")) { + object.error = $root.DownstreamMessage.AckMessage.ErrorMessage.toObject(message.error, options); + if (options.oneofs) + object._error = "error"; + } + return object; + }; - /** - * Gets the default type url for ConnectedMessage - * @function getTypeUrl - * @memberof DownstreamMessage.SystemMessage.ConnectedMessage - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ConnectedMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/DownstreamMessage.SystemMessage.ConnectedMessage"; - }; + /** + * Converts this AckMessage to JSON. + * @function toJSON + * @memberof DownstreamMessage.AckMessage + * @instance + * @returns {Object.} JSON object + */ + AckMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return ConnectedMessage; - })(); + /** + * Gets the default type url for AckMessage + * @function getTypeUrl + * @memberof DownstreamMessage.AckMessage + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AckMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/DownstreamMessage.AckMessage"; + }; - SystemMessage.DisconnectedMessage = (function() { + AckMessage.ErrorMessage = (function() { /** - * Properties of a DisconnectedMessage. - * @memberof DownstreamMessage.SystemMessage - * @interface IDisconnectedMessage - * @property {string|null} [reason] DisconnectedMessage reason + * Properties of an ErrorMessage. + * @memberof DownstreamMessage.AckMessage + * @interface IErrorMessage + * @property {string|null} [name] ErrorMessage name + * @property {string|null} [message] ErrorMessage message */ /** - * Constructs a new DisconnectedMessage. - * @memberof DownstreamMessage.SystemMessage - * @classdesc Represents a DisconnectedMessage. - * @implements IDisconnectedMessage + * Constructs a new ErrorMessage. + * @memberof DownstreamMessage.AckMessage + * @classdesc Represents an ErrorMessage. + * @implements IErrorMessage * @constructor - * @param {DownstreamMessage.SystemMessage.IDisconnectedMessage=} [properties] Properties to set + * @param {DownstreamMessage.AckMessage.IErrorMessage=} [properties] Properties to set */ - function DisconnectedMessage(properties) { + function ErrorMessage(properties) { if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null && keys[i] !== "__proto__") @@ -3501,81 +3401,95 @@ export const DownstreamMessage = $root.DownstreamMessage = (() => { } /** - * DisconnectedMessage reason. - * @member {string} reason - * @memberof DownstreamMessage.SystemMessage.DisconnectedMessage + * ErrorMessage name. + * @member {string} name + * @memberof DownstreamMessage.AckMessage.ErrorMessage * @instance */ - DisconnectedMessage.prototype.reason = ""; + ErrorMessage.prototype.name = ""; /** - * Creates a new DisconnectedMessage instance using the specified properties. + * ErrorMessage message. + * @member {string} message + * @memberof DownstreamMessage.AckMessage.ErrorMessage + * @instance + */ + ErrorMessage.prototype.message = ""; + + /** + * Creates a new ErrorMessage instance using the specified properties. * @function create - * @memberof DownstreamMessage.SystemMessage.DisconnectedMessage + * @memberof DownstreamMessage.AckMessage.ErrorMessage * @static - * @param {DownstreamMessage.SystemMessage.IDisconnectedMessage=} [properties] Properties to set - * @returns {DownstreamMessage.SystemMessage.DisconnectedMessage} DisconnectedMessage instance + * @param {DownstreamMessage.AckMessage.IErrorMessage=} [properties] Properties to set + * @returns {DownstreamMessage.AckMessage.ErrorMessage} ErrorMessage instance */ - DisconnectedMessage.create = function create(properties) { - return new DisconnectedMessage(properties); + ErrorMessage.create = function create(properties) { + return new ErrorMessage(properties); }; /** - * Encodes the specified DisconnectedMessage message. Does not implicitly {@link DownstreamMessage.SystemMessage.DisconnectedMessage.verify|verify} messages. + * Encodes the specified ErrorMessage message. Does not implicitly {@link DownstreamMessage.AckMessage.ErrorMessage.verify|verify} messages. * @function encode - * @memberof DownstreamMessage.SystemMessage.DisconnectedMessage + * @memberof DownstreamMessage.AckMessage.ErrorMessage * @static - * @param {DownstreamMessage.SystemMessage.IDisconnectedMessage} message DisconnectedMessage message or plain object to encode + * @param {DownstreamMessage.AckMessage.IErrorMessage} message ErrorMessage message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DisconnectedMessage.encode = function encode(message, writer) { + ErrorMessage.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.reason != null && Object.hasOwnProperty.call(message, "reason")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.reason); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); return writer; }; /** - * Encodes the specified DisconnectedMessage message, length delimited. Does not implicitly {@link DownstreamMessage.SystemMessage.DisconnectedMessage.verify|verify} messages. + * Encodes the specified ErrorMessage message, length delimited. Does not implicitly {@link DownstreamMessage.AckMessage.ErrorMessage.verify|verify} messages. * @function encodeDelimited - * @memberof DownstreamMessage.SystemMessage.DisconnectedMessage + * @memberof DownstreamMessage.AckMessage.ErrorMessage * @static - * @param {DownstreamMessage.SystemMessage.IDisconnectedMessage} message DisconnectedMessage message or plain object to encode + * @param {DownstreamMessage.AckMessage.IErrorMessage} message ErrorMessage message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DisconnectedMessage.encodeDelimited = function encodeDelimited(message, writer) { + ErrorMessage.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DisconnectedMessage message from the specified reader or buffer. + * Decodes an ErrorMessage message from the specified reader or buffer. * @function decode - * @memberof DownstreamMessage.SystemMessage.DisconnectedMessage + * @memberof DownstreamMessage.AckMessage.ErrorMessage * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {DownstreamMessage.SystemMessage.DisconnectedMessage} DisconnectedMessage + * @returns {DownstreamMessage.AckMessage.ErrorMessage} ErrorMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DisconnectedMessage.decode = function decode(reader, length, error, long) { + ErrorMessage.decode = function decode(reader, length, error, long) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); if (long === undefined) long = 0; if (long > $Reader.recursionLimit) throw Error("maximum nesting depth exceeded"); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.DownstreamMessage.SystemMessage.DisconnectedMessage(); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.DownstreamMessage.AckMessage.ErrorMessage(); while (reader.pos < end) { let tag = reader.uint32(); if (tag === error) break; switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } case 2: { - message.reason = reader.string(); + message.message = reader.string(); break; } default: @@ -3587,139 +3501,2180 @@ export const DownstreamMessage = $root.DownstreamMessage = (() => { }; /** - * Decodes a DisconnectedMessage message from the specified reader or buffer, length delimited. + * Decodes an ErrorMessage message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof DownstreamMessage.SystemMessage.DisconnectedMessage + * @memberof DownstreamMessage.AckMessage.ErrorMessage * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {DownstreamMessage.SystemMessage.DisconnectedMessage} DisconnectedMessage + * @returns {DownstreamMessage.AckMessage.ErrorMessage} ErrorMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DisconnectedMessage.decodeDelimited = function decodeDelimited(reader) { + ErrorMessage.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DisconnectedMessage message. + * Verifies an ErrorMessage message. * @function verify - * @memberof DownstreamMessage.SystemMessage.DisconnectedMessage + * @memberof DownstreamMessage.AckMessage.ErrorMessage * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DisconnectedMessage.verify = function verify(message, long) { + ErrorMessage.verify = function verify(message, long) { if (typeof message !== "object" || message === null) return "object expected"; if (long === undefined) long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.reason != null && message.hasOwnProperty("reason")) - if (!$util.isString(message.reason)) - return "reason: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; return null; }; /** - * Creates a DisconnectedMessage message from a plain object. Also converts values to their respective internal types. + * Creates an ErrorMessage message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof DownstreamMessage.SystemMessage.DisconnectedMessage + * @memberof DownstreamMessage.AckMessage.ErrorMessage * @static * @param {Object.} object Plain object - * @returns {DownstreamMessage.SystemMessage.DisconnectedMessage} DisconnectedMessage + * @returns {DownstreamMessage.AckMessage.ErrorMessage} ErrorMessage */ - DisconnectedMessage.fromObject = function fromObject(object, long) { - if (object instanceof $root.DownstreamMessage.SystemMessage.DisconnectedMessage) + ErrorMessage.fromObject = function fromObject(object, long) { + if (object instanceof $root.DownstreamMessage.AckMessage.ErrorMessage) return object; if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); - let message = new $root.DownstreamMessage.SystemMessage.DisconnectedMessage(); - if (object.reason != null) - message.reason = String(object.reason); + let message = new $root.DownstreamMessage.AckMessage.ErrorMessage(); + if (object.name != null) + message.name = String(object.name); + if (object.message != null) + message.message = String(object.message); return message; }; - /** - * Creates a plain object from a DisconnectedMessage message. Also converts values to other types if specified. - * @function toObject - * @memberof DownstreamMessage.SystemMessage.DisconnectedMessage - * @static - * @param {DownstreamMessage.SystemMessage.DisconnectedMessage} message DisconnectedMessage - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DisconnectedMessage.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) - object.reason = ""; - if (message.reason != null && message.hasOwnProperty("reason")) - object.reason = message.reason; - return object; - }; + /** + * Creates a plain object from an ErrorMessage message. Also converts values to other types if specified. + * @function toObject + * @memberof DownstreamMessage.AckMessage.ErrorMessage + * @static + * @param {DownstreamMessage.AckMessage.ErrorMessage} message ErrorMessage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ErrorMessage.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.name = ""; + object.message = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + return object; + }; + + /** + * Converts this ErrorMessage to JSON. + * @function toJSON + * @memberof DownstreamMessage.AckMessage.ErrorMessage + * @instance + * @returns {Object.} JSON object + */ + ErrorMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ErrorMessage + * @function getTypeUrl + * @memberof DownstreamMessage.AckMessage.ErrorMessage + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ErrorMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/DownstreamMessage.AckMessage.ErrorMessage"; + }; + + return ErrorMessage; + })(); + + return AckMessage; + })(); + + DownstreamMessage.DataMessage = (function() { + + /** + * Properties of a DataMessage. + * @memberof DownstreamMessage + * @interface IDataMessage + * @property {string|null} [from] DataMessage from + * @property {string|null} [group] DataMessage group + * @property {IMessageData|null} [data] DataMessage data + * @property {number|Long|null} [sequenceId] DataMessage sequenceId + */ + + /** + * Constructs a new DataMessage. + * @memberof DownstreamMessage + * @classdesc Represents a DataMessage. + * @implements IDataMessage + * @constructor + * @param {DownstreamMessage.IDataMessage=} [properties] Properties to set + */ + function DataMessage(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DataMessage from. + * @member {string} from + * @memberof DownstreamMessage.DataMessage + * @instance + */ + DataMessage.prototype.from = ""; + + /** + * DataMessage group. + * @member {string|null|undefined} group + * @memberof DownstreamMessage.DataMessage + * @instance + */ + DataMessage.prototype.group = null; + + /** + * DataMessage data. + * @member {IMessageData|null|undefined} data + * @memberof DownstreamMessage.DataMessage + * @instance + */ + DataMessage.prototype.data = null; + + /** + * DataMessage sequenceId. + * @member {number|Long|null|undefined} sequenceId + * @memberof DownstreamMessage.DataMessage + * @instance + */ + DataMessage.prototype.sequenceId = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DataMessage.prototype, "_group", { + get: $util.oneOfGetter($oneOfFields = ["group"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DataMessage.prototype, "_sequenceId", { + get: $util.oneOfGetter($oneOfFields = ["sequenceId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DataMessage instance using the specified properties. + * @function create + * @memberof DownstreamMessage.DataMessage + * @static + * @param {DownstreamMessage.IDataMessage=} [properties] Properties to set + * @returns {DownstreamMessage.DataMessage} DataMessage instance + */ + DataMessage.create = function create(properties) { + return new DataMessage(properties); + }; + + /** + * Encodes the specified DataMessage message. Does not implicitly {@link DownstreamMessage.DataMessage.verify|verify} messages. + * @function encode + * @memberof DownstreamMessage.DataMessage + * @static + * @param {DownstreamMessage.IDataMessage} message DataMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataMessage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.from != null && Object.hasOwnProperty.call(message, "from")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.from); + if (message.group != null && Object.hasOwnProperty.call(message, "group")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.group); + if (message.data != null && Object.hasOwnProperty.call(message, "data")) + $root.MessageData.encode(message.data, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.sequenceId != null && Object.hasOwnProperty.call(message, "sequenceId")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.sequenceId); + return writer; + }; + + /** + * Encodes the specified DataMessage message, length delimited. Does not implicitly {@link DownstreamMessage.DataMessage.verify|verify} messages. + * @function encodeDelimited + * @memberof DownstreamMessage.DataMessage + * @static + * @param {DownstreamMessage.IDataMessage} message DataMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataMessage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DataMessage message from the specified reader or buffer. + * @function decode + * @memberof DownstreamMessage.DataMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {DownstreamMessage.DataMessage} DataMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataMessage.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.DownstreamMessage.DataMessage(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.from = reader.string(); + break; + } + case 2: { + message.group = reader.string(); + break; + } + case 3: { + message.data = $root.MessageData.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.sequenceId = reader.uint64(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DataMessage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof DownstreamMessage.DataMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {DownstreamMessage.DataMessage} DataMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataMessage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DataMessage message. + * @function verify + * @memberof DownstreamMessage.DataMessage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DataMessage.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + let properties = {}; + if (message.from != null && message.hasOwnProperty("from")) + if (!$util.isString(message.from)) + return "from: string expected"; + if (message.group != null && message.hasOwnProperty("group")) { + properties._group = 1; + if (!$util.isString(message.group)) + return "group: string expected"; + } + if (message.data != null && message.hasOwnProperty("data")) { + let error = $root.MessageData.verify(message.data, long + 1); + if (error) + return "data." + error; + } + if (message.sequenceId != null && message.hasOwnProperty("sequenceId")) { + properties._sequenceId = 1; + if (!$util.isInteger(message.sequenceId) && !(message.sequenceId && $util.isInteger(message.sequenceId.low) && $util.isInteger(message.sequenceId.high))) + return "sequenceId: integer|Long expected"; + } + return null; + }; + + /** + * Creates a DataMessage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof DownstreamMessage.DataMessage + * @static + * @param {Object.} object Plain object + * @returns {DownstreamMessage.DataMessage} DataMessage + */ + DataMessage.fromObject = function fromObject(object, long) { + if (object instanceof $root.DownstreamMessage.DataMessage) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.DownstreamMessage.DataMessage(); + if (object.from != null) + message.from = String(object.from); + if (object.group != null) + message.group = String(object.group); + if (object.data != null) { + if (typeof object.data !== "object") + throw TypeError(".DownstreamMessage.DataMessage.data: object expected"); + message.data = $root.MessageData.fromObject(object.data, long + 1); + } + if (object.sequenceId != null) + if ($util.Long) + (message.sequenceId = $util.Long.fromValue(object.sequenceId)).unsigned = true; + else if (typeof object.sequenceId === "string") + message.sequenceId = parseInt(object.sequenceId, 10); + else if (typeof object.sequenceId === "number") + message.sequenceId = object.sequenceId; + else if (typeof object.sequenceId === "object") + message.sequenceId = new $util.LongBits(object.sequenceId.low >>> 0, object.sequenceId.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a DataMessage message. Also converts values to other types if specified. + * @function toObject + * @memberof DownstreamMessage.DataMessage + * @static + * @param {DownstreamMessage.DataMessage} message DataMessage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DataMessage.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.from = ""; + object.data = null; + } + if (message.from != null && message.hasOwnProperty("from")) + object.from = message.from; + if (message.group != null && message.hasOwnProperty("group")) { + object.group = message.group; + if (options.oneofs) + object._group = "group"; + } + if (message.data != null && message.hasOwnProperty("data")) + object.data = $root.MessageData.toObject(message.data, options); + if (message.sequenceId != null && message.hasOwnProperty("sequenceId")) { + if (typeof message.sequenceId === "number") + object.sequenceId = options.longs === String ? String(message.sequenceId) : message.sequenceId; + else + 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; + if (options.oneofs) + object._sequenceId = "sequenceId"; + } + return object; + }; + + /** + * Converts this DataMessage to JSON. + * @function toJSON + * @memberof DownstreamMessage.DataMessage + * @instance + * @returns {Object.} JSON object + */ + DataMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DataMessage + * @function getTypeUrl + * @memberof DownstreamMessage.DataMessage + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DataMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/DownstreamMessage.DataMessage"; + }; + + return DataMessage; + })(); + + DownstreamMessage.SystemMessage = (function() { + + /** + * Properties of a SystemMessage. + * @memberof DownstreamMessage + * @interface ISystemMessage + * @property {DownstreamMessage.SystemMessage.IConnectedMessage|null} [connectedMessage] SystemMessage connectedMessage + * @property {DownstreamMessage.SystemMessage.IDisconnectedMessage|null} [disconnectedMessage] SystemMessage disconnectedMessage + */ + + /** + * Constructs a new SystemMessage. + * @memberof DownstreamMessage + * @classdesc Represents a SystemMessage. + * @implements ISystemMessage + * @constructor + * @param {DownstreamMessage.ISystemMessage=} [properties] Properties to set + */ + function SystemMessage(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * SystemMessage connectedMessage. + * @member {DownstreamMessage.SystemMessage.IConnectedMessage|null|undefined} connectedMessage + * @memberof DownstreamMessage.SystemMessage + * @instance + */ + SystemMessage.prototype.connectedMessage = null; + + /** + * SystemMessage disconnectedMessage. + * @member {DownstreamMessage.SystemMessage.IDisconnectedMessage|null|undefined} disconnectedMessage + * @memberof DownstreamMessage.SystemMessage + * @instance + */ + SystemMessage.prototype.disconnectedMessage = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * SystemMessage message. + * @member {"connectedMessage"|"disconnectedMessage"|undefined} message + * @memberof DownstreamMessage.SystemMessage + * @instance + */ + Object.defineProperty(SystemMessage.prototype, "message", { + get: $util.oneOfGetter($oneOfFields = ["connectedMessage", "disconnectedMessage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SystemMessage instance using the specified properties. + * @function create + * @memberof DownstreamMessage.SystemMessage + * @static + * @param {DownstreamMessage.ISystemMessage=} [properties] Properties to set + * @returns {DownstreamMessage.SystemMessage} SystemMessage instance + */ + SystemMessage.create = function create(properties) { + return new SystemMessage(properties); + }; + + /** + * Encodes the specified SystemMessage message. Does not implicitly {@link DownstreamMessage.SystemMessage.verify|verify} messages. + * @function encode + * @memberof DownstreamMessage.SystemMessage + * @static + * @param {DownstreamMessage.ISystemMessage} message SystemMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SystemMessage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.connectedMessage != null && Object.hasOwnProperty.call(message, "connectedMessage")) + $root.DownstreamMessage.SystemMessage.ConnectedMessage.encode(message.connectedMessage, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.disconnectedMessage != null && Object.hasOwnProperty.call(message, "disconnectedMessage")) + $root.DownstreamMessage.SystemMessage.DisconnectedMessage.encode(message.disconnectedMessage, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SystemMessage message, length delimited. Does not implicitly {@link DownstreamMessage.SystemMessage.verify|verify} messages. + * @function encodeDelimited + * @memberof DownstreamMessage.SystemMessage + * @static + * @param {DownstreamMessage.ISystemMessage} message SystemMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SystemMessage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SystemMessage message from the specified reader or buffer. + * @function decode + * @memberof DownstreamMessage.SystemMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {DownstreamMessage.SystemMessage} SystemMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SystemMessage.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.DownstreamMessage.SystemMessage(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.connectedMessage = $root.DownstreamMessage.SystemMessage.ConnectedMessage.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.disconnectedMessage = $root.DownstreamMessage.SystemMessage.DisconnectedMessage.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a SystemMessage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof DownstreamMessage.SystemMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {DownstreamMessage.SystemMessage} SystemMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SystemMessage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SystemMessage message. + * @function verify + * @memberof DownstreamMessage.SystemMessage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SystemMessage.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + let properties = {}; + if (message.connectedMessage != null && message.hasOwnProperty("connectedMessage")) { + properties.message = 1; + { + let error = $root.DownstreamMessage.SystemMessage.ConnectedMessage.verify(message.connectedMessage, long + 1); + if (error) + return "connectedMessage." + error; + } + } + if (message.disconnectedMessage != null && message.hasOwnProperty("disconnectedMessage")) { + if (properties.message === 1) + return "message: multiple values"; + properties.message = 1; + { + let error = $root.DownstreamMessage.SystemMessage.DisconnectedMessage.verify(message.disconnectedMessage, long + 1); + if (error) + return "disconnectedMessage." + error; + } + } + return null; + }; + + /** + * Creates a SystemMessage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof DownstreamMessage.SystemMessage + * @static + * @param {Object.} object Plain object + * @returns {DownstreamMessage.SystemMessage} SystemMessage + */ + SystemMessage.fromObject = function fromObject(object, long) { + if (object instanceof $root.DownstreamMessage.SystemMessage) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.DownstreamMessage.SystemMessage(); + if (object.connectedMessage != null) { + if (typeof object.connectedMessage !== "object") + throw TypeError(".DownstreamMessage.SystemMessage.connectedMessage: object expected"); + message.connectedMessage = $root.DownstreamMessage.SystemMessage.ConnectedMessage.fromObject(object.connectedMessage, long + 1); + } + if (object.disconnectedMessage != null) { + if (typeof object.disconnectedMessage !== "object") + throw TypeError(".DownstreamMessage.SystemMessage.disconnectedMessage: object expected"); + message.disconnectedMessage = $root.DownstreamMessage.SystemMessage.DisconnectedMessage.fromObject(object.disconnectedMessage, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a SystemMessage message. Also converts values to other types if specified. + * @function toObject + * @memberof DownstreamMessage.SystemMessage + * @static + * @param {DownstreamMessage.SystemMessage} message SystemMessage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SystemMessage.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (message.connectedMessage != null && message.hasOwnProperty("connectedMessage")) { + object.connectedMessage = $root.DownstreamMessage.SystemMessage.ConnectedMessage.toObject(message.connectedMessage, options); + if (options.oneofs) + object.message = "connectedMessage"; + } + if (message.disconnectedMessage != null && message.hasOwnProperty("disconnectedMessage")) { + object.disconnectedMessage = $root.DownstreamMessage.SystemMessage.DisconnectedMessage.toObject(message.disconnectedMessage, options); + if (options.oneofs) + object.message = "disconnectedMessage"; + } + return object; + }; + + /** + * Converts this SystemMessage to JSON. + * @function toJSON + * @memberof DownstreamMessage.SystemMessage + * @instance + * @returns {Object.} JSON object + */ + SystemMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SystemMessage + * @function getTypeUrl + * @memberof DownstreamMessage.SystemMessage + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SystemMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/DownstreamMessage.SystemMessage"; + }; + + SystemMessage.ConnectedMessage = (function() { + + /** + * Properties of a ConnectedMessage. + * @memberof DownstreamMessage.SystemMessage + * @interface IConnectedMessage + * @property {string|null} [connectionId] ConnectedMessage connectionId + * @property {string|null} [userId] ConnectedMessage userId + * @property {string|null} [reconnectionToken] ConnectedMessage reconnectionToken + */ + + /** + * Constructs a new ConnectedMessage. + * @memberof DownstreamMessage.SystemMessage + * @classdesc Represents a ConnectedMessage. + * @implements IConnectedMessage + * @constructor + * @param {DownstreamMessage.SystemMessage.IConnectedMessage=} [properties] Properties to set + */ + function ConnectedMessage(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConnectedMessage connectionId. + * @member {string} connectionId + * @memberof DownstreamMessage.SystemMessage.ConnectedMessage + * @instance + */ + ConnectedMessage.prototype.connectionId = ""; + + /** + * ConnectedMessage userId. + * @member {string} userId + * @memberof DownstreamMessage.SystemMessage.ConnectedMessage + * @instance + */ + ConnectedMessage.prototype.userId = ""; + + /** + * ConnectedMessage reconnectionToken. + * @member {string} reconnectionToken + * @memberof DownstreamMessage.SystemMessage.ConnectedMessage + * @instance + */ + ConnectedMessage.prototype.reconnectionToken = ""; + + /** + * Creates a new ConnectedMessage instance using the specified properties. + * @function create + * @memberof DownstreamMessage.SystemMessage.ConnectedMessage + * @static + * @param {DownstreamMessage.SystemMessage.IConnectedMessage=} [properties] Properties to set + * @returns {DownstreamMessage.SystemMessage.ConnectedMessage} ConnectedMessage instance + */ + ConnectedMessage.create = function create(properties) { + return new ConnectedMessage(properties); + }; + + /** + * Encodes the specified ConnectedMessage message. Does not implicitly {@link DownstreamMessage.SystemMessage.ConnectedMessage.verify|verify} messages. + * @function encode + * @memberof DownstreamMessage.SystemMessage.ConnectedMessage + * @static + * @param {DownstreamMessage.SystemMessage.IConnectedMessage} message ConnectedMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConnectedMessage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.connectionId != null && Object.hasOwnProperty.call(message, "connectionId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.connectionId); + if (message.userId != null && Object.hasOwnProperty.call(message, "userId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.userId); + if (message.reconnectionToken != null && Object.hasOwnProperty.call(message, "reconnectionToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.reconnectionToken); + return writer; + }; + + /** + * Encodes the specified ConnectedMessage message, length delimited. Does not implicitly {@link DownstreamMessage.SystemMessage.ConnectedMessage.verify|verify} messages. + * @function encodeDelimited + * @memberof DownstreamMessage.SystemMessage.ConnectedMessage + * @static + * @param {DownstreamMessage.SystemMessage.IConnectedMessage} message ConnectedMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConnectedMessage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConnectedMessage message from the specified reader or buffer. + * @function decode + * @memberof DownstreamMessage.SystemMessage.ConnectedMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {DownstreamMessage.SystemMessage.ConnectedMessage} ConnectedMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConnectedMessage.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.DownstreamMessage.SystemMessage.ConnectedMessage(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.connectionId = reader.string(); + break; + } + case 2: { + message.userId = reader.string(); + break; + } + case 3: { + message.reconnectionToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ConnectedMessage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof DownstreamMessage.SystemMessage.ConnectedMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {DownstreamMessage.SystemMessage.ConnectedMessage} ConnectedMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConnectedMessage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConnectedMessage message. + * @function verify + * @memberof DownstreamMessage.SystemMessage.ConnectedMessage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConnectedMessage.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.connectionId != null && message.hasOwnProperty("connectionId")) + if (!$util.isString(message.connectionId)) + return "connectionId: string expected"; + if (message.userId != null && message.hasOwnProperty("userId")) + if (!$util.isString(message.userId)) + return "userId: string expected"; + if (message.reconnectionToken != null && message.hasOwnProperty("reconnectionToken")) + if (!$util.isString(message.reconnectionToken)) + return "reconnectionToken: string expected"; + return null; + }; + + /** + * Creates a ConnectedMessage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof DownstreamMessage.SystemMessage.ConnectedMessage + * @static + * @param {Object.} object Plain object + * @returns {DownstreamMessage.SystemMessage.ConnectedMessage} ConnectedMessage + */ + ConnectedMessage.fromObject = function fromObject(object, long) { + if (object instanceof $root.DownstreamMessage.SystemMessage.ConnectedMessage) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.DownstreamMessage.SystemMessage.ConnectedMessage(); + if (object.connectionId != null) + message.connectionId = String(object.connectionId); + if (object.userId != null) + message.userId = String(object.userId); + if (object.reconnectionToken != null) + message.reconnectionToken = String(object.reconnectionToken); + return message; + }; + + /** + * Creates a plain object from a ConnectedMessage message. Also converts values to other types if specified. + * @function toObject + * @memberof DownstreamMessage.SystemMessage.ConnectedMessage + * @static + * @param {DownstreamMessage.SystemMessage.ConnectedMessage} message ConnectedMessage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConnectedMessage.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.connectionId = ""; + object.userId = ""; + object.reconnectionToken = ""; + } + if (message.connectionId != null && message.hasOwnProperty("connectionId")) + object.connectionId = message.connectionId; + if (message.userId != null && message.hasOwnProperty("userId")) + object.userId = message.userId; + if (message.reconnectionToken != null && message.hasOwnProperty("reconnectionToken")) + object.reconnectionToken = message.reconnectionToken; + return object; + }; + + /** + * Converts this ConnectedMessage to JSON. + * @function toJSON + * @memberof DownstreamMessage.SystemMessage.ConnectedMessage + * @instance + * @returns {Object.} JSON object + */ + ConnectedMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ConnectedMessage + * @function getTypeUrl + * @memberof DownstreamMessage.SystemMessage.ConnectedMessage + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConnectedMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/DownstreamMessage.SystemMessage.ConnectedMessage"; + }; + + return ConnectedMessage; + })(); + + SystemMessage.DisconnectedMessage = (function() { + + /** + * Properties of a DisconnectedMessage. + * @memberof DownstreamMessage.SystemMessage + * @interface IDisconnectedMessage + * @property {string|null} [reason] DisconnectedMessage reason + */ + + /** + * Constructs a new DisconnectedMessage. + * @memberof DownstreamMessage.SystemMessage + * @classdesc Represents a DisconnectedMessage. + * @implements IDisconnectedMessage + * @constructor + * @param {DownstreamMessage.SystemMessage.IDisconnectedMessage=} [properties] Properties to set + */ + function DisconnectedMessage(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DisconnectedMessage reason. + * @member {string} reason + * @memberof DownstreamMessage.SystemMessage.DisconnectedMessage + * @instance + */ + DisconnectedMessage.prototype.reason = ""; + + /** + * Creates a new DisconnectedMessage instance using the specified properties. + * @function create + * @memberof DownstreamMessage.SystemMessage.DisconnectedMessage + * @static + * @param {DownstreamMessage.SystemMessage.IDisconnectedMessage=} [properties] Properties to set + * @returns {DownstreamMessage.SystemMessage.DisconnectedMessage} DisconnectedMessage instance + */ + DisconnectedMessage.create = function create(properties) { + return new DisconnectedMessage(properties); + }; + + /** + * Encodes the specified DisconnectedMessage message. Does not implicitly {@link DownstreamMessage.SystemMessage.DisconnectedMessage.verify|verify} messages. + * @function encode + * @memberof DownstreamMessage.SystemMessage.DisconnectedMessage + * @static + * @param {DownstreamMessage.SystemMessage.IDisconnectedMessage} message DisconnectedMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DisconnectedMessage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.reason != null && Object.hasOwnProperty.call(message, "reason")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.reason); + return writer; + }; + + /** + * Encodes the specified DisconnectedMessage message, length delimited. Does not implicitly {@link DownstreamMessage.SystemMessage.DisconnectedMessage.verify|verify} messages. + * @function encodeDelimited + * @memberof DownstreamMessage.SystemMessage.DisconnectedMessage + * @static + * @param {DownstreamMessage.SystemMessage.IDisconnectedMessage} message DisconnectedMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DisconnectedMessage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DisconnectedMessage message from the specified reader or buffer. + * @function decode + * @memberof DownstreamMessage.SystemMessage.DisconnectedMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {DownstreamMessage.SystemMessage.DisconnectedMessage} DisconnectedMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DisconnectedMessage.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.DownstreamMessage.SystemMessage.DisconnectedMessage(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.reason = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DisconnectedMessage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof DownstreamMessage.SystemMessage.DisconnectedMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {DownstreamMessage.SystemMessage.DisconnectedMessage} DisconnectedMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DisconnectedMessage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DisconnectedMessage message. + * @function verify + * @memberof DownstreamMessage.SystemMessage.DisconnectedMessage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DisconnectedMessage.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.reason != null && message.hasOwnProperty("reason")) + if (!$util.isString(message.reason)) + return "reason: string expected"; + return null; + }; + + /** + * Creates a DisconnectedMessage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof DownstreamMessage.SystemMessage.DisconnectedMessage + * @static + * @param {Object.} object Plain object + * @returns {DownstreamMessage.SystemMessage.DisconnectedMessage} DisconnectedMessage + */ + DisconnectedMessage.fromObject = function fromObject(object, long) { + if (object instanceof $root.DownstreamMessage.SystemMessage.DisconnectedMessage) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.DownstreamMessage.SystemMessage.DisconnectedMessage(); + if (object.reason != null) + message.reason = String(object.reason); + return message; + }; + + /** + * Creates a plain object from a DisconnectedMessage message. Also converts values to other types if specified. + * @function toObject + * @memberof DownstreamMessage.SystemMessage.DisconnectedMessage + * @static + * @param {DownstreamMessage.SystemMessage.DisconnectedMessage} message DisconnectedMessage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DisconnectedMessage.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.reason = ""; + if (message.reason != null && message.hasOwnProperty("reason")) + object.reason = message.reason; + return object; + }; + + /** + * Converts this DisconnectedMessage to JSON. + * @function toJSON + * @memberof DownstreamMessage.SystemMessage.DisconnectedMessage + * @instance + * @returns {Object.} JSON object + */ + DisconnectedMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DisconnectedMessage + * @function getTypeUrl + * @memberof DownstreamMessage.SystemMessage.DisconnectedMessage + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DisconnectedMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/DownstreamMessage.SystemMessage.DisconnectedMessage"; + }; + + return DisconnectedMessage; + })(); + + return SystemMessage; + })(); + + DownstreamMessage.GroupStateSnapshotMessage = (function() { + + /** + * Properties of a GroupStateSnapshotMessage. + * @memberof DownstreamMessage + * @interface IGroupStateSnapshotMessage + * @property {string|null} [group] GroupStateSnapshotMessage group + * @property {Array.|null} [items] GroupStateSnapshotMessage items + * @property {number|Long|null} [sequenceId] GroupStateSnapshotMessage sequenceId + */ + + /** + * Constructs a new GroupStateSnapshotMessage. + * @memberof DownstreamMessage + * @classdesc Represents a GroupStateSnapshotMessage. + * @implements IGroupStateSnapshotMessage + * @constructor + * @param {DownstreamMessage.IGroupStateSnapshotMessage=} [properties] Properties to set + */ + function GroupStateSnapshotMessage(properties) { + this.items = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GroupStateSnapshotMessage group. + * @member {string} group + * @memberof DownstreamMessage.GroupStateSnapshotMessage + * @instance + */ + GroupStateSnapshotMessage.prototype.group = ""; + + /** + * GroupStateSnapshotMessage items. + * @member {Array.} items + * @memberof DownstreamMessage.GroupStateSnapshotMessage + * @instance + */ + GroupStateSnapshotMessage.prototype.items = $util.emptyArray; + + /** + * GroupStateSnapshotMessage sequenceId. + * @member {number|Long|null|undefined} sequenceId + * @memberof DownstreamMessage.GroupStateSnapshotMessage + * @instance + */ + GroupStateSnapshotMessage.prototype.sequenceId = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(GroupStateSnapshotMessage.prototype, "_sequenceId", { + get: $util.oneOfGetter($oneOfFields = ["sequenceId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GroupStateSnapshotMessage instance using the specified properties. + * @function create + * @memberof DownstreamMessage.GroupStateSnapshotMessage + * @static + * @param {DownstreamMessage.IGroupStateSnapshotMessage=} [properties] Properties to set + * @returns {DownstreamMessage.GroupStateSnapshotMessage} GroupStateSnapshotMessage instance + */ + GroupStateSnapshotMessage.create = function create(properties) { + return new GroupStateSnapshotMessage(properties); + }; + + /** + * Encodes the specified GroupStateSnapshotMessage message. Does not implicitly {@link DownstreamMessage.GroupStateSnapshotMessage.verify|verify} messages. + * @function encode + * @memberof DownstreamMessage.GroupStateSnapshotMessage + * @static + * @param {DownstreamMessage.IGroupStateSnapshotMessage} message GroupStateSnapshotMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupStateSnapshotMessage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.group != null && Object.hasOwnProperty.call(message, "group")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.group); + if (message.items != null && message.items.length) + for (let i = 0; i < message.items.length; ++i) + $root.GroupStateItem.encode(message.items[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.sequenceId != null && Object.hasOwnProperty.call(message, "sequenceId")) + writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.sequenceId); + return writer; + }; + + /** + * Encodes the specified GroupStateSnapshotMessage message, length delimited. Does not implicitly {@link DownstreamMessage.GroupStateSnapshotMessage.verify|verify} messages. + * @function encodeDelimited + * @memberof DownstreamMessage.GroupStateSnapshotMessage + * @static + * @param {DownstreamMessage.IGroupStateSnapshotMessage} message GroupStateSnapshotMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupStateSnapshotMessage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GroupStateSnapshotMessage message from the specified reader or buffer. + * @function decode + * @memberof DownstreamMessage.GroupStateSnapshotMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {DownstreamMessage.GroupStateSnapshotMessage} GroupStateSnapshotMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupStateSnapshotMessage.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.DownstreamMessage.GroupStateSnapshotMessage(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.group = reader.string(); + break; + } + case 2: { + if (!(message.items && message.items.length)) + message.items = []; + message.items.push($root.GroupStateItem.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 3: { + message.sequenceId = reader.uint64(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GroupStateSnapshotMessage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof DownstreamMessage.GroupStateSnapshotMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {DownstreamMessage.GroupStateSnapshotMessage} GroupStateSnapshotMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupStateSnapshotMessage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GroupStateSnapshotMessage message. + * @function verify + * @memberof DownstreamMessage.GroupStateSnapshotMessage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GroupStateSnapshotMessage.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + let properties = {}; + if (message.group != null && message.hasOwnProperty("group")) + if (!$util.isString(message.group)) + return "group: string expected"; + if (message.items != null && message.hasOwnProperty("items")) { + if (!Array.isArray(message.items)) + return "items: array expected"; + for (let i = 0; i < message.items.length; ++i) { + let error = $root.GroupStateItem.verify(message.items[i], long + 1); + if (error) + return "items." + error; + } + } + if (message.sequenceId != null && message.hasOwnProperty("sequenceId")) { + properties._sequenceId = 1; + if (!$util.isInteger(message.sequenceId) && !(message.sequenceId && $util.isInteger(message.sequenceId.low) && $util.isInteger(message.sequenceId.high))) + return "sequenceId: integer|Long expected"; + } + return null; + }; + + /** + * Creates a GroupStateSnapshotMessage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof DownstreamMessage.GroupStateSnapshotMessage + * @static + * @param {Object.} object Plain object + * @returns {DownstreamMessage.GroupStateSnapshotMessage} GroupStateSnapshotMessage + */ + GroupStateSnapshotMessage.fromObject = function fromObject(object, long) { + if (object instanceof $root.DownstreamMessage.GroupStateSnapshotMessage) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.DownstreamMessage.GroupStateSnapshotMessage(); + if (object.group != null) + message.group = String(object.group); + if (object.items) { + if (!Array.isArray(object.items)) + throw TypeError(".DownstreamMessage.GroupStateSnapshotMessage.items: array expected"); + message.items = []; + for (let i = 0; i < object.items.length; ++i) { + if (typeof object.items[i] !== "object") + throw TypeError(".DownstreamMessage.GroupStateSnapshotMessage.items: object expected"); + message.items[i] = $root.GroupStateItem.fromObject(object.items[i], long + 1); + } + } + if (object.sequenceId != null) + if ($util.Long) + (message.sequenceId = $util.Long.fromValue(object.sequenceId)).unsigned = true; + else if (typeof object.sequenceId === "string") + message.sequenceId = parseInt(object.sequenceId, 10); + else if (typeof object.sequenceId === "number") + message.sequenceId = object.sequenceId; + else if (typeof object.sequenceId === "object") + message.sequenceId = new $util.LongBits(object.sequenceId.low >>> 0, object.sequenceId.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a GroupStateSnapshotMessage message. Also converts values to other types if specified. + * @function toObject + * @memberof DownstreamMessage.GroupStateSnapshotMessage + * @static + * @param {DownstreamMessage.GroupStateSnapshotMessage} message GroupStateSnapshotMessage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GroupStateSnapshotMessage.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.items = []; + if (options.defaults) + object.group = ""; + if (message.group != null && message.hasOwnProperty("group")) + object.group = message.group; + if (message.items && message.items.length) { + object.items = []; + for (let j = 0; j < message.items.length; ++j) + object.items[j] = $root.GroupStateItem.toObject(message.items[j], options); + } + if (message.sequenceId != null && message.hasOwnProperty("sequenceId")) { + if (typeof message.sequenceId === "number") + object.sequenceId = options.longs === String ? String(message.sequenceId) : message.sequenceId; + else + 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; + if (options.oneofs) + object._sequenceId = "sequenceId"; + } + return object; + }; + + /** + * Converts this GroupStateSnapshotMessage to JSON. + * @function toJSON + * @memberof DownstreamMessage.GroupStateSnapshotMessage + * @instance + * @returns {Object.} JSON object + */ + GroupStateSnapshotMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GroupStateSnapshotMessage + * @function getTypeUrl + * @memberof DownstreamMessage.GroupStateSnapshotMessage + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GroupStateSnapshotMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/DownstreamMessage.GroupStateSnapshotMessage"; + }; + + return GroupStateSnapshotMessage; + })(); + + DownstreamMessage.GroupStateUpdateMessage = (function() { + + /** + * Properties of a GroupStateUpdateMessage. + * @memberof DownstreamMessage + * @interface IGroupStateUpdateMessage + * @property {string|null} [group] GroupStateUpdateMessage group + * @property {Array.|null} [items] GroupStateUpdateMessage items + * @property {number|Long|null} [sequenceId] GroupStateUpdateMessage sequenceId + */ + + /** + * Constructs a new GroupStateUpdateMessage. + * @memberof DownstreamMessage + * @classdesc Represents a GroupStateUpdateMessage. + * @implements IGroupStateUpdateMessage + * @constructor + * @param {DownstreamMessage.IGroupStateUpdateMessage=} [properties] Properties to set + */ + function GroupStateUpdateMessage(properties) { + this.items = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GroupStateUpdateMessage group. + * @member {string} group + * @memberof DownstreamMessage.GroupStateUpdateMessage + * @instance + */ + GroupStateUpdateMessage.prototype.group = ""; + + /** + * GroupStateUpdateMessage items. + * @member {Array.} items + * @memberof DownstreamMessage.GroupStateUpdateMessage + * @instance + */ + GroupStateUpdateMessage.prototype.items = $util.emptyArray; + + /** + * GroupStateUpdateMessage sequenceId. + * @member {number|Long|null|undefined} sequenceId + * @memberof DownstreamMessage.GroupStateUpdateMessage + * @instance + */ + GroupStateUpdateMessage.prototype.sequenceId = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(GroupStateUpdateMessage.prototype, "_sequenceId", { + get: $util.oneOfGetter($oneOfFields = ["sequenceId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GroupStateUpdateMessage instance using the specified properties. + * @function create + * @memberof DownstreamMessage.GroupStateUpdateMessage + * @static + * @param {DownstreamMessage.IGroupStateUpdateMessage=} [properties] Properties to set + * @returns {DownstreamMessage.GroupStateUpdateMessage} GroupStateUpdateMessage instance + */ + GroupStateUpdateMessage.create = function create(properties) { + return new GroupStateUpdateMessage(properties); + }; + + /** + * Encodes the specified GroupStateUpdateMessage message. Does not implicitly {@link DownstreamMessage.GroupStateUpdateMessage.verify|verify} messages. + * @function encode + * @memberof DownstreamMessage.GroupStateUpdateMessage + * @static + * @param {DownstreamMessage.IGroupStateUpdateMessage} message GroupStateUpdateMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupStateUpdateMessage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.group != null && Object.hasOwnProperty.call(message, "group")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.group); + if (message.items != null && message.items.length) + for (let i = 0; i < message.items.length; ++i) + $root.GroupStateItem.encode(message.items[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.sequenceId != null && Object.hasOwnProperty.call(message, "sequenceId")) + writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.sequenceId); + return writer; + }; + + /** + * Encodes the specified GroupStateUpdateMessage message, length delimited. Does not implicitly {@link DownstreamMessage.GroupStateUpdateMessage.verify|verify} messages. + * @function encodeDelimited + * @memberof DownstreamMessage.GroupStateUpdateMessage + * @static + * @param {DownstreamMessage.IGroupStateUpdateMessage} message GroupStateUpdateMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupStateUpdateMessage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GroupStateUpdateMessage message from the specified reader or buffer. + * @function decode + * @memberof DownstreamMessage.GroupStateUpdateMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {DownstreamMessage.GroupStateUpdateMessage} GroupStateUpdateMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupStateUpdateMessage.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.DownstreamMessage.GroupStateUpdateMessage(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.group = reader.string(); + break; + } + case 2: { + if (!(message.items && message.items.length)) + message.items = []; + message.items.push($root.GroupStateItem.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 3: { + message.sequenceId = reader.uint64(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GroupStateUpdateMessage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof DownstreamMessage.GroupStateUpdateMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {DownstreamMessage.GroupStateUpdateMessage} GroupStateUpdateMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupStateUpdateMessage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GroupStateUpdateMessage message. + * @function verify + * @memberof DownstreamMessage.GroupStateUpdateMessage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GroupStateUpdateMessage.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + let properties = {}; + if (message.group != null && message.hasOwnProperty("group")) + if (!$util.isString(message.group)) + return "group: string expected"; + if (message.items != null && message.hasOwnProperty("items")) { + if (!Array.isArray(message.items)) + return "items: array expected"; + for (let i = 0; i < message.items.length; ++i) { + let error = $root.GroupStateItem.verify(message.items[i], long + 1); + if (error) + return "items." + error; + } + } + if (message.sequenceId != null && message.hasOwnProperty("sequenceId")) { + properties._sequenceId = 1; + if (!$util.isInteger(message.sequenceId) && !(message.sequenceId && $util.isInteger(message.sequenceId.low) && $util.isInteger(message.sequenceId.high))) + return "sequenceId: integer|Long expected"; + } + return null; + }; + + /** + * Creates a GroupStateUpdateMessage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof DownstreamMessage.GroupStateUpdateMessage + * @static + * @param {Object.} object Plain object + * @returns {DownstreamMessage.GroupStateUpdateMessage} GroupStateUpdateMessage + */ + GroupStateUpdateMessage.fromObject = function fromObject(object, long) { + if (object instanceof $root.DownstreamMessage.GroupStateUpdateMessage) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.DownstreamMessage.GroupStateUpdateMessage(); + if (object.group != null) + message.group = String(object.group); + if (object.items) { + if (!Array.isArray(object.items)) + throw TypeError(".DownstreamMessage.GroupStateUpdateMessage.items: array expected"); + message.items = []; + for (let i = 0; i < object.items.length; ++i) { + if (typeof object.items[i] !== "object") + throw TypeError(".DownstreamMessage.GroupStateUpdateMessage.items: object expected"); + message.items[i] = $root.GroupStateItem.fromObject(object.items[i], long + 1); + } + } + if (object.sequenceId != null) + if ($util.Long) + (message.sequenceId = $util.Long.fromValue(object.sequenceId)).unsigned = true; + else if (typeof object.sequenceId === "string") + message.sequenceId = parseInt(object.sequenceId, 10); + else if (typeof object.sequenceId === "number") + message.sequenceId = object.sequenceId; + else if (typeof object.sequenceId === "object") + message.sequenceId = new $util.LongBits(object.sequenceId.low >>> 0, object.sequenceId.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a GroupStateUpdateMessage message. Also converts values to other types if specified. + * @function toObject + * @memberof DownstreamMessage.GroupStateUpdateMessage + * @static + * @param {DownstreamMessage.GroupStateUpdateMessage} message GroupStateUpdateMessage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GroupStateUpdateMessage.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.items = []; + if (options.defaults) + object.group = ""; + if (message.group != null && message.hasOwnProperty("group")) + object.group = message.group; + if (message.items && message.items.length) { + object.items = []; + for (let j = 0; j < message.items.length; ++j) + object.items[j] = $root.GroupStateItem.toObject(message.items[j], options); + } + if (message.sequenceId != null && message.hasOwnProperty("sequenceId")) { + if (typeof message.sequenceId === "number") + object.sequenceId = options.longs === String ? String(message.sequenceId) : message.sequenceId; + else + 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; + if (options.oneofs) + object._sequenceId = "sequenceId"; + } + return object; + }; + + /** + * Converts this GroupStateUpdateMessage to JSON. + * @function toJSON + * @memberof DownstreamMessage.GroupStateUpdateMessage + * @instance + * @returns {Object.} JSON object + */ + GroupStateUpdateMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GroupStateUpdateMessage + * @function getTypeUrl + * @memberof DownstreamMessage.GroupStateUpdateMessage + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GroupStateUpdateMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/DownstreamMessage.GroupStateUpdateMessage"; + }; + + return GroupStateUpdateMessage; + })(); + + return DownstreamMessage; +})(); + +export const MessageData = $root.MessageData = (() => { + + /** + * Properties of a MessageData. + * @exports IMessageData + * @interface IMessageData + * @property {string|null} [textData] MessageData textData + * @property {Uint8Array|null} [binaryData] MessageData binaryData + * @property {google.protobuf.IAny|null} [protobufData] MessageData protobufData + * @property {string|null} [jsonData] MessageData jsonData + */ + + /** + * Constructs a new MessageData. + * @exports MessageData + * @classdesc Represents a MessageData. + * @implements IMessageData + * @constructor + * @param {IMessageData=} [properties] Properties to set + */ + function MessageData(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * MessageData textData. + * @member {string|null|undefined} textData + * @memberof MessageData + * @instance + */ + MessageData.prototype.textData = null; + + /** + * MessageData binaryData. + * @member {Uint8Array|null|undefined} binaryData + * @memberof MessageData + * @instance + */ + MessageData.prototype.binaryData = null; + + /** + * MessageData protobufData. + * @member {google.protobuf.IAny|null|undefined} protobufData + * @memberof MessageData + * @instance + */ + MessageData.prototype.protobufData = null; + + /** + * MessageData jsonData. + * @member {string|null|undefined} jsonData + * @memberof MessageData + * @instance + */ + MessageData.prototype.jsonData = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * MessageData data. + * @member {"textData"|"binaryData"|"protobufData"|"jsonData"|undefined} data + * @memberof MessageData + * @instance + */ + Object.defineProperty(MessageData.prototype, "data", { + get: $util.oneOfGetter($oneOfFields = ["textData", "binaryData", "protobufData", "jsonData"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new MessageData instance using the specified properties. + * @function create + * @memberof MessageData + * @static + * @param {IMessageData=} [properties] Properties to set + * @returns {MessageData} MessageData instance + */ + MessageData.create = function create(properties) { + return new MessageData(properties); + }; + + /** + * Encodes the specified MessageData message. Does not implicitly {@link MessageData.verify|verify} messages. + * @function encode + * @memberof MessageData + * @static + * @param {IMessageData} message MessageData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageData.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.textData != null && Object.hasOwnProperty.call(message, "textData")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.textData); + if (message.binaryData != null && Object.hasOwnProperty.call(message, "binaryData")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.binaryData); + if (message.protobufData != null && Object.hasOwnProperty.call(message, "protobufData")) + $root.google.protobuf.Any.encode(message.protobufData, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.jsonData != null && Object.hasOwnProperty.call(message, "jsonData")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.jsonData); + return writer; + }; + + /** + * Encodes the specified MessageData message, length delimited. Does not implicitly {@link MessageData.verify|verify} messages. + * @function encodeDelimited + * @memberof MessageData + * @static + * @param {IMessageData} message MessageData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageData.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MessageData message from the specified reader or buffer. + * @function decode + * @memberof MessageData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {MessageData} MessageData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageData.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.MessageData(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.textData = reader.string(); + break; + } + case 2: { + message.binaryData = reader.bytes(); + break; + } + case 3: { + message.protobufData = $root.google.protobuf.Any.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.jsonData = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a MessageData message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof MessageData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {MessageData} MessageData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageData.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Converts this DisconnectedMessage to JSON. - * @function toJSON - * @memberof DownstreamMessage.SystemMessage.DisconnectedMessage - * @instance - * @returns {Object.} JSON object - */ - DisconnectedMessage.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Verifies a MessageData message. + * @function verify + * @memberof MessageData + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MessageData.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + let properties = {}; + if (message.textData != null && message.hasOwnProperty("textData")) { + properties.data = 1; + if (!$util.isString(message.textData)) + return "textData: string expected"; + } + if (message.binaryData != null && message.hasOwnProperty("binaryData")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + if (!(message.binaryData && typeof message.binaryData.length === "number" || $util.isString(message.binaryData))) + return "binaryData: buffer expected"; + } + if (message.protobufData != null && message.hasOwnProperty("protobufData")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + let error = $root.google.protobuf.Any.verify(message.protobufData, long + 1); + if (error) + return "protobufData." + error; + } + } + if (message.jsonData != null && message.hasOwnProperty("jsonData")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + if (!$util.isString(message.jsonData)) + return "jsonData: string expected"; + } + return null; + }; - /** - * Gets the default type url for DisconnectedMessage - * @function getTypeUrl - * @memberof DownstreamMessage.SystemMessage.DisconnectedMessage - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DisconnectedMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/DownstreamMessage.SystemMessage.DisconnectedMessage"; - }; + /** + * Creates a MessageData message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof MessageData + * @static + * @param {Object.} object Plain object + * @returns {MessageData} MessageData + */ + MessageData.fromObject = function fromObject(object, long) { + if (object instanceof $root.MessageData) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.MessageData(); + if (object.textData != null) + message.textData = String(object.textData); + if (object.binaryData != null) + if (typeof object.binaryData === "string") + $util.base64.decode(object.binaryData, message.binaryData = $util.newBuffer($util.base64.length(object.binaryData)), 0); + else if (object.binaryData.length >= 0) + message.binaryData = object.binaryData; + if (object.protobufData != null) { + if (typeof object.protobufData !== "object") + throw TypeError(".MessageData.protobufData: object expected"); + message.protobufData = $root.google.protobuf.Any.fromObject(object.protobufData, long + 1); + } + if (object.jsonData != null) + message.jsonData = String(object.jsonData); + return message; + }; - return DisconnectedMessage; - })(); + /** + * Creates a plain object from a MessageData message. Also converts values to other types if specified. + * @function toObject + * @memberof MessageData + * @static + * @param {MessageData} message MessageData + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MessageData.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (message.textData != null && message.hasOwnProperty("textData")) { + object.textData = message.textData; + if (options.oneofs) + object.data = "textData"; + } + if (message.binaryData != null && message.hasOwnProperty("binaryData")) { + 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; + if (options.oneofs) + object.data = "binaryData"; + } + if (message.protobufData != null && message.hasOwnProperty("protobufData")) { + object.protobufData = $root.google.protobuf.Any.toObject(message.protobufData, options); + if (options.oneofs) + object.data = "protobufData"; + } + if (message.jsonData != null && message.hasOwnProperty("jsonData")) { + object.jsonData = message.jsonData; + if (options.oneofs) + object.data = "jsonData"; + } + return object; + }; - return SystemMessage; - })(); + /** + * Converts this MessageData to JSON. + * @function toJSON + * @memberof MessageData + * @instance + * @returns {Object.} JSON object + */ + MessageData.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return DownstreamMessage; + /** + * Gets the default type url for MessageData + * @function getTypeUrl + * @memberof MessageData + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MessageData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/MessageData"; + }; + + return MessageData; })(); -export const MessageData = $root.MessageData = (() => { +export const GroupStateItem = $root.GroupStateItem = (() => { /** - * Properties of a MessageData. - * @exports IMessageData - * @interface IMessageData - * @property {string|null} [textData] MessageData textData - * @property {Uint8Array|null} [binaryData] MessageData binaryData - * @property {google.protobuf.IAny|null} [protobufData] MessageData protobufData - * @property {string|null} [jsonData] MessageData jsonData + * Properties of a GroupStateItem. + * @exports IGroupStateItem + * @interface IGroupStateItem + * @property {string|null} [connectionId] GroupStateItem connectionId + * @property {string|null} [userId] GroupStateItem userId + * @property {GroupStateItem.IGroupState|null} [state] GroupStateItem state + * @property {number|Long|null} [updatedAt] GroupStateItem updatedAt */ /** - * Constructs a new MessageData. - * @exports MessageData - * @classdesc Represents a MessageData. - * @implements IMessageData + * Constructs a new GroupStateItem. + * @exports GroupStateItem + * @classdesc Represents a GroupStateItem. + * @implements IGroupStateItem * @constructor - * @param {IMessageData=} [properties] Properties to set + * @param {IGroupStateItem=} [properties] Properties to set */ - function MessageData(properties) { + function GroupStateItem(properties) { if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null && keys[i] !== "__proto__") @@ -3727,137 +5682,138 @@ export const MessageData = $root.MessageData = (() => { } /** - * MessageData textData. - * @member {string|null|undefined} textData - * @memberof MessageData + * GroupStateItem connectionId. + * @member {string} connectionId + * @memberof GroupStateItem * @instance */ - MessageData.prototype.textData = null; + GroupStateItem.prototype.connectionId = ""; /** - * MessageData binaryData. - * @member {Uint8Array|null|undefined} binaryData - * @memberof MessageData + * GroupStateItem userId. + * @member {string|null|undefined} userId + * @memberof GroupStateItem * @instance */ - MessageData.prototype.binaryData = null; + GroupStateItem.prototype.userId = null; /** - * MessageData protobufData. - * @member {google.protobuf.IAny|null|undefined} protobufData - * @memberof MessageData + * GroupStateItem state. + * @member {GroupStateItem.IGroupState|null|undefined} state + * @memberof GroupStateItem * @instance */ - MessageData.prototype.protobufData = null; + GroupStateItem.prototype.state = null; /** - * MessageData jsonData. - * @member {string|null|undefined} jsonData - * @memberof MessageData + * GroupStateItem updatedAt. + * @member {number|Long} updatedAt + * @memberof GroupStateItem * @instance */ - MessageData.prototype.jsonData = null; + GroupStateItem.prototype.updatedAt = $util.Long ? $util.Long.fromBits(0,0,false) : 0; // OneOf field names bound to virtual getters and setters let $oneOfFields; - /** - * MessageData data. - * @member {"textData"|"binaryData"|"protobufData"|"jsonData"|undefined} data - * @memberof MessageData - * @instance - */ - Object.defineProperty(MessageData.prototype, "data", { - get: $util.oneOfGetter($oneOfFields = ["textData", "binaryData", "protobufData", "jsonData"]), + // Virtual OneOf for proto3 optional field + Object.defineProperty(GroupStateItem.prototype, "_userId", { + get: $util.oneOfGetter($oneOfFields = ["userId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(GroupStateItem.prototype, "_state", { + get: $util.oneOfGetter($oneOfFields = ["state"]), set: $util.oneOfSetter($oneOfFields) }); /** - * Creates a new MessageData instance using the specified properties. + * Creates a new GroupStateItem instance using the specified properties. * @function create - * @memberof MessageData + * @memberof GroupStateItem * @static - * @param {IMessageData=} [properties] Properties to set - * @returns {MessageData} MessageData instance + * @param {IGroupStateItem=} [properties] Properties to set + * @returns {GroupStateItem} GroupStateItem instance */ - MessageData.create = function create(properties) { - return new MessageData(properties); + GroupStateItem.create = function create(properties) { + return new GroupStateItem(properties); }; /** - * Encodes the specified MessageData message. Does not implicitly {@link MessageData.verify|verify} messages. + * Encodes the specified GroupStateItem message. Does not implicitly {@link GroupStateItem.verify|verify} messages. * @function encode - * @memberof MessageData + * @memberof GroupStateItem * @static - * @param {IMessageData} message MessageData message or plain object to encode + * @param {IGroupStateItem} message GroupStateItem message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MessageData.encode = function encode(message, writer) { + GroupStateItem.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.textData != null && Object.hasOwnProperty.call(message, "textData")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.textData); - if (message.binaryData != null && Object.hasOwnProperty.call(message, "binaryData")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.binaryData); - if (message.protobufData != null && Object.hasOwnProperty.call(message, "protobufData")) - $root.google.protobuf.Any.encode(message.protobufData, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.jsonData != null && Object.hasOwnProperty.call(message, "jsonData")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.jsonData); + if (message.connectionId != null && Object.hasOwnProperty.call(message, "connectionId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.connectionId); + if (message.userId != null && Object.hasOwnProperty.call(message, "userId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.userId); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + $root.GroupStateItem.GroupState.encode(message.state, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.updatedAt != null && Object.hasOwnProperty.call(message, "updatedAt")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.updatedAt); return writer; }; /** - * Encodes the specified MessageData message, length delimited. Does not implicitly {@link MessageData.verify|verify} messages. + * Encodes the specified GroupStateItem message, length delimited. Does not implicitly {@link GroupStateItem.verify|verify} messages. * @function encodeDelimited - * @memberof MessageData + * @memberof GroupStateItem * @static - * @param {IMessageData} message MessageData message or plain object to encode + * @param {IGroupStateItem} message GroupStateItem message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MessageData.encodeDelimited = function encodeDelimited(message, writer) { + GroupStateItem.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a MessageData message from the specified reader or buffer. + * Decodes a GroupStateItem message from the specified reader or buffer. * @function decode - * @memberof MessageData + * @memberof GroupStateItem * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {MessageData} MessageData + * @returns {GroupStateItem} GroupStateItem * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MessageData.decode = function decode(reader, length, error, long) { + GroupStateItem.decode = function decode(reader, length, error, long) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); if (long === undefined) long = 0; if (long > $Reader.recursionLimit) throw Error("maximum nesting depth exceeded"); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.MessageData(); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.GroupStateItem(); while (reader.pos < end) { let tag = reader.uint32(); if (tag === error) break; switch (tag >>> 3) { case 1: { - message.textData = reader.string(); + message.connectionId = reader.string(); break; } case 2: { - message.binaryData = reader.bytes(); + message.userId = reader.string(); break; } case 3: { - message.protobufData = $root.google.protobuf.Any.decode(reader, reader.uint32(), undefined, long + 1); + message.state = $root.GroupStateItem.GroupState.decode(reader, reader.uint32(), undefined, long + 1); break; } case 4: { - message.jsonData = reader.string(); + message.updatedAt = reader.int64(); break; } default: @@ -3869,30 +5825,30 @@ export const MessageData = $root.MessageData = (() => { }; /** - * Decodes a MessageData message from the specified reader or buffer, length delimited. + * Decodes a GroupStateItem message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof MessageData + * @memberof GroupStateItem * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {MessageData} MessageData + * @returns {GroupStateItem} GroupStateItem * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MessageData.decodeDelimited = function decodeDelimited(reader) { + GroupStateItem.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a MessageData message. + * Verifies a GroupStateItem message. * @function verify - * @memberof MessageData + * @memberof GroupStateItem * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - MessageData.verify = function verify(message, long) { + GroupStateItem.verify = function verify(message, long) { if (typeof message !== "object" || message === null) return "object expected"; if (long === undefined) @@ -3900,134 +5856,393 @@ export const MessageData = $root.MessageData = (() => { if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; let properties = {}; - if (message.textData != null && message.hasOwnProperty("textData")) { - properties.data = 1; - if (!$util.isString(message.textData)) - return "textData: string expected"; - } - if (message.binaryData != null && message.hasOwnProperty("binaryData")) { - if (properties.data === 1) - return "data: multiple values"; - properties.data = 1; - if (!(message.binaryData && typeof message.binaryData.length === "number" || $util.isString(message.binaryData))) - return "binaryData: buffer expected"; + if (message.connectionId != null && message.hasOwnProperty("connectionId")) + if (!$util.isString(message.connectionId)) + return "connectionId: string expected"; + if (message.userId != null && message.hasOwnProperty("userId")) { + properties._userId = 1; + if (!$util.isString(message.userId)) + return "userId: string expected"; } - if (message.protobufData != null && message.hasOwnProperty("protobufData")) { - if (properties.data === 1) - return "data: multiple values"; - properties.data = 1; + if (message.state != null && message.hasOwnProperty("state")) { + properties._state = 1; { - let error = $root.google.protobuf.Any.verify(message.protobufData, long + 1); + let error = $root.GroupStateItem.GroupState.verify(message.state, long + 1); if (error) - return "protobufData." + error; + return "state." + error; } } - if (message.jsonData != null && message.hasOwnProperty("jsonData")) { - if (properties.data === 1) - return "data: multiple values"; - properties.data = 1; - if (!$util.isString(message.jsonData)) - return "jsonData: string expected"; - } + if (message.updatedAt != null && message.hasOwnProperty("updatedAt")) + if (!$util.isInteger(message.updatedAt) && !(message.updatedAt && $util.isInteger(message.updatedAt.low) && $util.isInteger(message.updatedAt.high))) + return "updatedAt: integer|Long expected"; return null; }; /** - * Creates a MessageData message from a plain object. Also converts values to their respective internal types. + * Creates a GroupStateItem message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof MessageData + * @memberof GroupStateItem * @static * @param {Object.} object Plain object - * @returns {MessageData} MessageData + * @returns {GroupStateItem} GroupStateItem */ - MessageData.fromObject = function fromObject(object, long) { - if (object instanceof $root.MessageData) + GroupStateItem.fromObject = function fromObject(object, long) { + if (object instanceof $root.GroupStateItem) return object; if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); - let message = new $root.MessageData(); - if (object.textData != null) - message.textData = String(object.textData); - if (object.binaryData != null) - if (typeof object.binaryData === "string") - $util.base64.decode(object.binaryData, message.binaryData = $util.newBuffer($util.base64.length(object.binaryData)), 0); - else if (object.binaryData.length >= 0) - message.binaryData = object.binaryData; - if (object.protobufData != null) { - if (typeof object.protobufData !== "object") - throw TypeError(".MessageData.protobufData: object expected"); - message.protobufData = $root.google.protobuf.Any.fromObject(object.protobufData, long + 1); + let message = new $root.GroupStateItem(); + if (object.connectionId != null) + message.connectionId = String(object.connectionId); + if (object.userId != null) + message.userId = String(object.userId); + if (object.state != null) { + if (typeof object.state !== "object") + throw TypeError(".GroupStateItem.state: object expected"); + message.state = $root.GroupStateItem.GroupState.fromObject(object.state, long + 1); } - if (object.jsonData != null) - message.jsonData = String(object.jsonData); + if (object.updatedAt != null) + if ($util.Long) + (message.updatedAt = $util.Long.fromValue(object.updatedAt)).unsigned = false; + else if (typeof object.updatedAt === "string") + message.updatedAt = parseInt(object.updatedAt, 10); + else if (typeof object.updatedAt === "number") + message.updatedAt = object.updatedAt; + else if (typeof object.updatedAt === "object") + message.updatedAt = new $util.LongBits(object.updatedAt.low >>> 0, object.updatedAt.high >>> 0).toNumber(); return message; }; /** - * Creates a plain object from a MessageData message. Also converts values to other types if specified. + * Creates a plain object from a GroupStateItem message. Also converts values to other types if specified. * @function toObject - * @memberof MessageData + * @memberof GroupStateItem * @static - * @param {MessageData} message MessageData + * @param {GroupStateItem} message GroupStateItem * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - MessageData.toObject = function toObject(message, options) { + GroupStateItem.toObject = function toObject(message, options) { if (!options) options = {}; let object = {}; - if (message.textData != null && message.hasOwnProperty("textData")) { - object.textData = message.textData; - if (options.oneofs) - object.data = "textData"; - } - if (message.binaryData != null && message.hasOwnProperty("binaryData")) { - 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; - if (options.oneofs) - object.data = "binaryData"; + if (options.defaults) { + object.connectionId = ""; + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.updatedAt = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.updatedAt = options.longs === String ? "0" : 0; } - if (message.protobufData != null && message.hasOwnProperty("protobufData")) { - object.protobufData = $root.google.protobuf.Any.toObject(message.protobufData, options); + if (message.connectionId != null && message.hasOwnProperty("connectionId")) + object.connectionId = message.connectionId; + if (message.userId != null && message.hasOwnProperty("userId")) { + object.userId = message.userId; if (options.oneofs) - object.data = "protobufData"; + object._userId = "userId"; } - if (message.jsonData != null && message.hasOwnProperty("jsonData")) { - object.jsonData = message.jsonData; + if (message.state != null && message.hasOwnProperty("state")) { + object.state = $root.GroupStateItem.GroupState.toObject(message.state, options); if (options.oneofs) - object.data = "jsonData"; + object._state = "state"; } + if (message.updatedAt != null && message.hasOwnProperty("updatedAt")) + if (typeof message.updatedAt === "number") + object.updatedAt = options.longs === String ? String(message.updatedAt) : message.updatedAt; + else + object.updatedAt = options.longs === String ? $util.Long.prototype.toString.call(message.updatedAt) : options.longs === Number ? new $util.LongBits(message.updatedAt.low >>> 0, message.updatedAt.high >>> 0).toNumber() : message.updatedAt; return object; }; /** - * Converts this MessageData to JSON. + * Converts this GroupStateItem to JSON. * @function toJSON - * @memberof MessageData + * @memberof GroupStateItem * @instance * @returns {Object.} JSON object */ - MessageData.prototype.toJSON = function toJSON() { + GroupStateItem.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for MessageData + * Gets the default type url for GroupStateItem * @function getTypeUrl - * @memberof MessageData + * @memberof GroupStateItem * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - MessageData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + GroupStateItem.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/MessageData"; + return typeUrlPrefix + "/GroupStateItem"; }; - return MessageData; + GroupStateItem.GroupState = (function() { + + /** + * Properties of a GroupState. + * @memberof GroupStateItem + * @interface IGroupState + * @property {Object.|null} [entries] GroupState entries + */ + + /** + * Constructs a new GroupState. + * @memberof GroupStateItem + * @classdesc Represents a GroupState. + * @implements IGroupState + * @constructor + * @param {GroupStateItem.IGroupState=} [properties] Properties to set + */ + function GroupState(properties) { + this.entries = {}; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GroupState entries. + * @member {Object.} entries + * @memberof GroupStateItem.GroupState + * @instance + */ + GroupState.prototype.entries = $util.emptyObject; + + /** + * Creates a new GroupState instance using the specified properties. + * @function create + * @memberof GroupStateItem.GroupState + * @static + * @param {GroupStateItem.IGroupState=} [properties] Properties to set + * @returns {GroupStateItem.GroupState} GroupState instance + */ + GroupState.create = function create(properties) { + return new GroupState(properties); + }; + + /** + * Encodes the specified GroupState message. Does not implicitly {@link GroupStateItem.GroupState.verify|verify} messages. + * @function encode + * @memberof GroupStateItem.GroupState + * @static + * @param {GroupStateItem.IGroupState} message GroupState message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupState.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.entries != null && Object.hasOwnProperty.call(message, "entries")) + for (let keys = Object.keys(message.entries), i = 0; i < keys.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.entries[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified GroupState message, length delimited. Does not implicitly {@link GroupStateItem.GroupState.verify|verify} messages. + * @function encodeDelimited + * @memberof GroupStateItem.GroupState + * @static + * @param {GroupStateItem.IGroupState} message GroupState message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupState.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GroupState message from the specified reader or buffer. + * @function decode + * @memberof GroupStateItem.GroupState + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {GroupStateItem.GroupState} GroupState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupState.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.GroupStateItem.GroupState(), key, value; + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (message.entries === $util.emptyObject) + message.entries = {}; + let end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + let tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7, long); + break; + } + } + if (key === "__proto__") + $util.makeProp(message.entries, key); + message.entries[key] = value; + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GroupState message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof GroupStateItem.GroupState + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {GroupStateItem.GroupState} GroupState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupState.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GroupState message. + * @function verify + * @memberof GroupStateItem.GroupState + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GroupState.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.entries != null && message.hasOwnProperty("entries")) { + if (!$util.isObject(message.entries)) + return "entries: object expected"; + let key = Object.keys(message.entries); + for (let i = 0; i < key.length; ++i) + if (!$util.isString(message.entries[key[i]])) + return "entries: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a GroupState message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof GroupStateItem.GroupState + * @static + * @param {Object.} object Plain object + * @returns {GroupStateItem.GroupState} GroupState + */ + GroupState.fromObject = function fromObject(object, long) { + if (object instanceof $root.GroupStateItem.GroupState) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.GroupStateItem.GroupState(); + if (object.entries) { + if (typeof object.entries !== "object") + throw TypeError(".GroupStateItem.GroupState.entries: object expected"); + message.entries = {}; + for (let keys = Object.keys(object.entries), i = 0; i < keys.length; ++i) { + if (keys[i] === "__proto__") + $util.makeProp(message.entries, keys[i]); + message.entries[keys[i]] = String(object.entries[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from a GroupState message. Also converts values to other types if specified. + * @function toObject + * @memberof GroupStateItem.GroupState + * @static + * @param {GroupStateItem.GroupState} message GroupState + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GroupState.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.objects || options.defaults) + object.entries = {}; + let keys2; + if (message.entries && (keys2 = Object.keys(message.entries)).length) { + object.entries = {}; + for (let j = 0; j < keys2.length; ++j) { + if (keys2[j] === "__proto__") + $util.makeProp(object.entries, keys2[j]); + object.entries[keys2[j]] = message.entries[keys2[j]]; + } + } + return object; + }; + + /** + * Converts this GroupState to JSON. + * @function toJSON + * @memberof GroupStateItem.GroupState + * @instance + * @returns {Object.} JSON object + */ + GroupState.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GroupState + * @function getTypeUrl + * @memberof GroupStateItem.GroupState + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GroupState.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/GroupStateItem.GroupState"; + }; + + return GroupState; + })(); + + return GroupStateItem; })(); export const google = $root.google = (() => { diff --git a/sdk/web-pubsub/web-pubsub-client-protobuf/src/protos/client.proto b/sdk/web-pubsub/web-pubsub-client-protobuf/src/protos/client.proto index 5a258a9cb542..968243aa69ad 100644 --- a/sdk/web-pubsub/web-pubsub-client-protobuf/src/protos/client.proto +++ b/sdk/web-pubsub/web-pubsub-client-protobuf/src/protos/client.proto @@ -9,6 +9,9 @@ message UpstreamMessage { JoinGroupMessage join_group_message = 6; LeaveGroupMessage leave_group_message = 7; SequenceAckMessage sequence_ack_message = 8; + SetGroupStateMessage set_group_state_message = 15; + SubscribeGroupStateMessage subscribe_group_state_message = 16; + UnsubscribeGroupStateMessage unsubscribe_group_state_message = 17; } message SendToGroupMessage { @@ -23,7 +26,7 @@ message UpstreamMessage { MessageData data = 2; optional uint64 ack_id = 3; } - + message JoinGroupMessage { string group = 1; optional uint64 ack_id = 2; @@ -37,6 +40,22 @@ message UpstreamMessage { message SequenceAckMessage { uint64 sequence_id = 1; } + + message SetGroupStateMessage { + string group = 1; + optional uint64 ack_id = 2; + optional GroupStateItem.GroupState state = 3; + } + + message SubscribeGroupStateMessage { + string group = 1; + optional uint64 ack_id = 2; + } + + message UnsubscribeGroupStateMessage { + string group = 1; + optional uint64 ack_id = 2; + } } message DownstreamMessage { @@ -44,13 +63,15 @@ message DownstreamMessage { AckMessage ack_message = 1; DataMessage data_message = 2; SystemMessage system_message = 3; + GroupStateUpdateMessage group_state_update_message = 9; + GroupStateSnapshotMessage group_state_snapshot_message = 10; } - + message AckMessage { uint64 ack_id = 1; bool success = 2; optional ErrorMessage error = 3; - + message ErrorMessage { string name = 1; string message = 2; @@ -69,7 +90,7 @@ message DownstreamMessage { ConnectedMessage connected_message = 1; DisconnectedMessage disconnected_message = 2; } - + message ConnectedMessage { string connection_id = 1; string user_id = 2; @@ -80,6 +101,18 @@ message DownstreamMessage { string reason = 2; } } + + message GroupStateSnapshotMessage { + string group = 1; + repeated GroupStateItem items = 2; + optional uint64 sequence_id = 3; + } + + message GroupStateUpdateMessage { + string group = 1; + repeated GroupStateItem items = 2; + optional uint64 sequence_id = 3; + } } message MessageData { @@ -89,4 +122,15 @@ message MessageData { google.protobuf.Any protobuf_data = 3; string json_data = 4; } -} \ No newline at end of file +} + +message GroupStateItem { + string connection_id = 1; + optional string user_id = 2; + optional GroupState state = 3; + int64 updated_at = 4; + + message GroupState { + map entries = 1; + } +} diff --git a/sdk/web-pubsub/web-pubsub-client-protobuf/src/webPubSubProtobufProtocolBase.ts b/sdk/web-pubsub/web-pubsub-client-protobuf/src/webPubSubProtobufProtocolBase.ts index 7953571b6ff5..77a80e0b8f8e 100644 --- a/sdk/web-pubsub/web-pubsub-client-protobuf/src/webPubSubProtobufProtocolBase.ts +++ b/sdk/web-pubsub/web-pubsub-client-protobuf/src/webPubSubProtobufProtocolBase.ts @@ -7,6 +7,9 @@ import type { ConnectedMessage, DisconnectedMessage, GroupDataMessage, + GroupStateItem, + GroupStateSnapshotMessage, + GroupStateUpdateMessage, ServerDataMessage, WebPubSubDataType, WebPubSubMessage, @@ -101,6 +104,42 @@ export class WebPubSubProtobufProtocolBase { } else { return null; } + } else if (downstream.groupStateSnapshotMessage) { + const msg = downstream.groupStateSnapshotMessage; + const items: GroupStateItem[] = (msg.items || []).map((item: any) => { + const result: GroupStateItem = { + connectionId: item.connectionId, + userId: item.userId, + updatedAt: this._getNumber(item.updatedAt) as number, + }; + if (item.state != null) { + result.state = item.state.entries; + } + return result; + }); + return { + kind: "groupStateSnapshot", + group: msg.group, + items, + } as GroupStateSnapshotMessage; + } else if (downstream.groupStateUpdateMessage) { + const msg = downstream.groupStateUpdateMessage; + const items: GroupStateItem[] = (msg.items || []).map((item: any) => { + const result: GroupStateItem = { + connectionId: item.connectionId, + userId: item.userId, + updatedAt: this._getNumber(item.updatedAt) as number, + }; + if (item.state != null) { + result.state = item.state.entries; + } + return result; + }); + return { + kind: "groupStateUpdate", + group: msg.group, + items, + } as GroupStateUpdateMessage; } else { return null; } @@ -133,7 +172,10 @@ export class WebPubSubProtobufProtocolBase { const sendToGroup = UpstreamMessage.SendToGroupMessage.create({ group: message.group, ackId: message.ackId, - data: this._getIMessageData(message.data, message.dataType), + data: + message.data !== undefined + ? this._getIMessageData(message.data, message.dataType!) + : undefined, noEcho: message.noEcho, } as UpstreamMessage.ISendToGroupMessage); upstream = UpstreamMessage.create({ sendToGroupMessage: sendToGroup } as IUpstreamMessage); @@ -155,6 +197,37 @@ export class WebPubSubProtobufProtocolBase { upstream = UpstreamMessage.create({ sequenceAckMessage: sequenceAck } as IUpstreamMessage); break; } + case "setGroupState": { + const setGroupState = UpstreamMessage.SetGroupStateMessage.create({ + group: message.group, + ackId: message.ackId, + state: message.state !== undefined ? { entries: message.state } : null, + } as UpstreamMessage.ISetGroupStateMessage); + upstream = UpstreamMessage.create({ + setGroupStateMessage: setGroupState, + } as IUpstreamMessage); + break; + } + case "subscribeGroupState": { + const subscribeGroupState = UpstreamMessage.SubscribeGroupStateMessage.create({ + group: message.group, + ackId: message.ackId, + } as UpstreamMessage.ISubscribeGroupStateMessage); + upstream = UpstreamMessage.create({ + subscribeGroupStateMessage: subscribeGroupState, + } as IUpstreamMessage); + break; + } + case "unsubscribeGroupState": { + const unsubscribeGroupState = UpstreamMessage.UnsubscribeGroupStateMessage.create({ + group: message.group, + ackId: message.ackId, + } as UpstreamMessage.IUnsubscribeGroupStateMessage); + upstream = UpstreamMessage.create({ + unsubscribeGroupStateMessage: unsubscribeGroupState, + } as IUpstreamMessage); + break; + } default: throw new TypeError(`kind is not supported: ${message.kind}`); } diff --git a/sdk/web-pubsub/web-pubsub-client-protobuf/test/client.spec.ts b/sdk/web-pubsub/web-pubsub-client-protobuf/test/client.spec.ts index 62d5c2d13031..20671fa3a22b 100644 --- a/sdk/web-pubsub/web-pubsub-client-protobuf/test/client.spec.ts +++ b/sdk/web-pubsub/web-pubsub-client-protobuf/test/client.spec.ts @@ -6,12 +6,17 @@ import type { ConnectedMessage, DisconnectedMessage, GroupDataMessage, + GroupStateSnapshotMessage, + GroupStateUpdateMessage, JoinGroupMessage, LeaveGroupMessage, SendEventMessage, SendToGroupMessage, SequenceAckMessage, ServerDataMessage, + SetGroupStateMessage, + SubscribeGroupStateMessage, + UnsubscribeGroupStateMessage, WebPubSubMessage, } from "@azure/web-pubsub-client"; import { WebPubSubProtobufProtocol } from "../src/index.js"; @@ -305,7 +310,124 @@ describe("WebPubSubClient", function () { tests.forEach(({ testName, message, assertFunc }) => { it(`parse message test ${testName}`, () => { const buffer = Buffer.from(message, "base64"); - const parsedMsg = protocol.parseMessages(buffer); + const parsedMsg = protocol.parseMessages(buffer) as WebPubSubMessage | null; + assertFunc(parsedMsg!); + }); + }); + }); + + describe("WriteMessage group state upstream messages", () => { + const tests = [ + { + testName: "setGroupState with state", + message: { + kind: "setGroupState", + group: "chat-room", + state: { activity: "typing" }, + ackId: 1, + } as SetGroupStateMessage, + payload: "eiMKCWNoYXQtcm9vbRABGhQKEgoIYWN0aXZpdHkSBnR5cGluZw==", + }, + { + testName: "setGroupState clear (no state)", + message: { + kind: "setGroupState", + group: "chat-room", + ackId: 2, + } as SetGroupStateMessage, + payload: "eg0KCWNoYXQtcm9vbRAC", + }, + { + testName: "subscribeGroupState", + message: { + kind: "subscribeGroupState", + group: "chat-room", + ackId: 3, + } as SubscribeGroupStateMessage, + payload: "ggENCgljaGF0LXJvb20QAw==", + }, + { + testName: "unsubscribeGroupState", + message: { + kind: "unsubscribeGroupState", + group: "chat-room", + ackId: 4, + } as UnsubscribeGroupStateMessage, + payload: "igENCgljaGF0LXJvb20QBA==", + }, + ]; + + tests.forEach(({ testName, message, payload }) => { + it(`write message test ${testName}`, () => { + const writeMessage = protocol.writeMessage(message) as ArrayBuffer; + assert.equal(arrayBufferToBase64(writeMessage), payload); + }); + }); + + function arrayBufferToBase64(buffer: ArrayBuffer): string { + return Buffer.from(buffer).toString("base64"); + } + }); + + describe("Parse group state downstream messages", () => { + const tests = [ + { + testName: "groupStateSnapshot", + message: + "UmMKCWNoYXQtcm9vbRItCgdjb25uLWExEgVhbGljZRoUChIKCGFjdGl2aXR5EgZ0eXBpbmcggK/KlNgyEicKB2Nvbm4tYjESA2JvYhoQCg4KBGhhbmQSBnJhaXNlZCDgksmU2DI=", + assertFunc: (msg: WebPubSubMessage) => { + const m = msg as GroupStateSnapshotMessage; + assert.equal(m.kind, "groupStateSnapshot"); + assert.equal(m.group, "chat-room"); + assert.equal(m.items.length, 2); + assert.equal(m.items[0].connectionId, "conn-a1"); + assert.equal(m.items[0].userId, "alice"); + assert.deepEqual(m.items[0].state, { activity: "typing" }); + assert.equal(m.items[0].updatedAt, 1741652400000); + assert.equal(m.items[1].connectionId, "conn-b1"); + assert.equal(m.items[1].userId, "bob"); + assert.deepEqual(m.items[1].state, { hand: "raised" }); + }, + }, + { + testName: "groupStateSnapshot with empty items", + message: "UgwKCmVtcHR5LXJvb20=", + assertFunc: (msg: WebPubSubMessage) => { + const m = msg as GroupStateSnapshotMessage; + assert.equal(m.kind, "groupStateSnapshot"); + assert.equal(m.group, "empty-room"); + assert.equal(m.items.length, 0); + }, + }, + { + testName: "groupStateUpdate with state set", + message: "SjoKCWNoYXQtcm9vbRItCgdjb25uLWExEgVhbGljZRoUChIKCGFjdGl2aXR5EgZ0eXBpbmcggK/KlNgy", + assertFunc: (msg: WebPubSubMessage) => { + const m = msg as GroupStateUpdateMessage; + assert.equal(m.kind, "groupStateUpdate"); + assert.equal(m.group, "chat-room"); + assert.equal(m.items.length, 1); + assert.equal(m.items[0].connectionId, "conn-a1"); + assert.deepEqual(m.items[0].state, { activity: "typing" }); + }, + }, + { + testName: "groupStateUpdate with state cleared", + message: "SiQKCWNoYXQtcm9vbRIXCgdjb25uLWExEgVhbGljZSCI1sqU2DI=", + assertFunc: (msg: WebPubSubMessage) => { + const m = msg as GroupStateUpdateMessage; + assert.equal(m.kind, "groupStateUpdate"); + assert.equal(m.items[0].connectionId, "conn-a1"); + assert.isUndefined(m.items[0].state); + assert.equal(m.items[0].updatedAt, 1741652405000); + }, + }, + ]; + + tests.forEach(({ testName, message, assertFunc }) => { + it(`parse message test ${testName}`, () => { + const buffer = Buffer.from(message, "base64"); + const parsedMsg = protocol.parseMessages(buffer) as WebPubSubMessage | null; assertFunc(parsedMsg!); }); });