UNPKG

@vreden/meta

Version:

Baileys is a lightweight JavaScript library for interacting with the WhatsApp Web API using WebSocket.

1,103 lines (1,030 loc) 5.06 MB
/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ "use strict"; var $protobuf = require("protobufjs/minimal"); // Common aliases var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; // Exported root namespace var $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {}); $root.E2E = (function() { /** * Namespace E2E. * @exports E2E * @namespace */ var E2E = {}; E2E.AIQueryFanout = (function() { /** * Properties of a AIQueryFanout. * @memberof E2E * @interface IAIQueryFanout * @property {Protocol.IMessageKey|null} [messageKey] AIQueryFanout messageKey * @property {E2E.IMessage|null} [message] AIQueryFanout message * @property {number|Long|null} [timestamp] AIQueryFanout timestamp */ /** * Constructs a new AIQueryFanout. * @memberof E2E * @classdesc Represents a AIQueryFanout. * @implements IAIQueryFanout * @constructor * @param {E2E.IAIQueryFanout=} [properties] Properties to set */ function AIQueryFanout(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * AIQueryFanout messageKey. * @member {Protocol.IMessageKey|null|undefined} messageKey * @memberof E2E.AIQueryFanout * @instance */ AIQueryFanout.prototype.messageKey = null; /** * AIQueryFanout message. * @member {E2E.IMessage|null|undefined} message * @memberof E2E.AIQueryFanout * @instance */ AIQueryFanout.prototype.message = null; /** * AIQueryFanout timestamp. * @member {number|Long} timestamp * @memberof E2E.AIQueryFanout * @instance */ AIQueryFanout.prototype.timestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** * Creates a new AIQueryFanout instance using the specified properties. * @function create * @memberof E2E.AIQueryFanout * @static * @param {E2E.IAIQueryFanout=} [properties] Properties to set * @returns {E2E.AIQueryFanout} AIQueryFanout instance */ AIQueryFanout.create = function create(properties) { return new AIQueryFanout(properties); }; /** * Encodes the specified AIQueryFanout message. Does not implicitly {@link E2E.AIQueryFanout.verify|verify} messages. * @function encode * @memberof E2E.AIQueryFanout * @static * @param {E2E.IAIQueryFanout} message AIQueryFanout message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ AIQueryFanout.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.messageKey != null && Object.hasOwnProperty.call(message, "messageKey")) $root.Protocol.MessageKey.encode(message.messageKey, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); if (message.message != null && Object.hasOwnProperty.call(message, "message")) $root.E2E.Message.encode(message.message, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp")) writer.uint32(/* id 3, wireType 0 =*/24).int64(message.timestamp); return writer; }; /** * Encodes the specified AIQueryFanout message, length delimited. Does not implicitly {@link E2E.AIQueryFanout.verify|verify} messages. * @function encodeDelimited * @memberof E2E.AIQueryFanout * @static * @param {E2E.IAIQueryFanout} message AIQueryFanout message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ AIQueryFanout.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a AIQueryFanout message from the specified reader or buffer. * @function decode * @memberof E2E.AIQueryFanout * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {E2E.AIQueryFanout} AIQueryFanout * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ AIQueryFanout.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.E2E.AIQueryFanout(); while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) break; switch (tag >>> 3) { case 1: { message.messageKey = $root.Protocol.MessageKey.decode(reader, reader.uint32()); break; } case 2: { message.message = $root.E2E.Message.decode(reader, reader.uint32()); break; } case 3: { message.timestamp = reader.int64(); break; } default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a AIQueryFanout message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof E2E.AIQueryFanout * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {E2E.AIQueryFanout} AIQueryFanout * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ AIQueryFanout.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a AIQueryFanout message. * @function verify * @memberof E2E.AIQueryFanout * @static * @param {Object.<string,*>} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ AIQueryFanout.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.messageKey != null && message.hasOwnProperty("messageKey")) { var error = $root.Protocol.MessageKey.verify(message.messageKey); if (error) return "messageKey." + error; } if (message.message != null && message.hasOwnProperty("message")) { var error = $root.E2E.Message.verify(message.message); if (error) return "message." + error; } if (message.timestamp != null && message.hasOwnProperty("timestamp")) if (!$util.isInteger(message.timestamp) && !(message.timestamp && $util.isInteger(message.timestamp.low) && $util.isInteger(message.timestamp.high))) return "timestamp: integer|Long expected"; return null; }; /** * Creates a AIQueryFanout message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof E2E.AIQueryFanout * @static * @param {Object.<string,*>} object Plain object * @returns {E2E.AIQueryFanout} AIQueryFanout */ AIQueryFanout.fromObject = function fromObject(object) { if (object instanceof $root.E2E.AIQueryFanout) return object; var message = new $root.E2E.AIQueryFanout(); if (object.messageKey != null) { if (typeof object.messageKey !== "object") throw TypeError(".E2E.AIQueryFanout.messageKey: object expected"); message.messageKey = $root.Protocol.MessageKey.fromObject(object.messageKey); } if (object.message != null) { if (typeof object.message !== "object") throw TypeError(".E2E.AIQueryFanout.message: object expected"); message.message = $root.E2E.Message.fromObject(object.message); } if (object.timestamp != null) if ($util.Long) (message.timestamp = $util.Long.fromValue(object.timestamp)).unsigned = false; else if (typeof object.timestamp === "string") message.timestamp = parseInt(object.timestamp, 10); else if (typeof object.timestamp === "number") message.timestamp = object.timestamp; else if (typeof object.timestamp === "object") message.timestamp = new $util.LongBits(object.timestamp.low >>> 0, object.timestamp.high >>> 0).toNumber(); return message; }; /** * Creates a plain object from a AIQueryFanout message. Also converts values to other types if specified. * @function toObject * @memberof E2E.AIQueryFanout * @static * @param {E2E.AIQueryFanout} message AIQueryFanout * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.<string,*>} Plain object */ AIQueryFanout.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.messageKey = null; object.message = null; if ($util.Long) { var long = new $util.Long(0, 0, false); object.timestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; } else object.timestamp = options.longs === String ? "0" : 0; } if (message.messageKey != null && message.hasOwnProperty("messageKey")) object.messageKey = $root.Protocol.MessageKey.toObject(message.messageKey, options); if (message.message != null && message.hasOwnProperty("message")) object.message = $root.E2E.Message.toObject(message.message, options); if (message.timestamp != null && message.hasOwnProperty("timestamp")) if (typeof message.timestamp === "number") object.timestamp = options.longs === String ? String(message.timestamp) : message.timestamp; else object.timestamp = options.longs === String ? $util.Long.prototype.toString.call(message.timestamp) : options.longs === Number ? new $util.LongBits(message.timestamp.low >>> 0, message.timestamp.high >>> 0).toNumber() : message.timestamp; return object; }; /** * Converts this AIQueryFanout to JSON. * @function toJSON * @memberof E2E.AIQueryFanout * @instance * @returns {Object.<string,*>} JSON object */ AIQueryFanout.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** * Gets the default type url for AIQueryFanout * @function getTypeUrl * @memberof E2E.AIQueryFanout * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ AIQueryFanout.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } return typeUrlPrefix + "/E2E.AIQueryFanout"; }; return AIQueryFanout; })(); E2E.AIRichResponseMessage = (function() { /** * Properties of a AIRichResponseMessage. * @memberof E2E * @interface IAIRichResponseMessage * @property {AICommon.AIRichResponseMessageType|null} [messageType] AIRichResponseMessage messageType * @property {Array.<AICommon.IAIRichResponseSubMessage>|null} [submessages] AIRichResponseMessage submessages * @property {AICommon.IAIRichResponseUnifiedResponse|null} [unifiedResponse] AIRichResponseMessage unifiedResponse * @property {E2E.IContextInfo|null} [contextInfo] AIRichResponseMessage contextInfo */ /** * Constructs a new AIRichResponseMessage. * @memberof E2E * @classdesc Represents a AIRichResponseMessage. * @implements IAIRichResponseMessage * @constructor * @param {E2E.IAIRichResponseMessage=} [properties] Properties to set */ function AIRichResponseMessage(properties) { this.submessages = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * AIRichResponseMessage messageType. * @member {AICommon.AIRichResponseMessageType} messageType * @memberof E2E.AIRichResponseMessage * @instance */ AIRichResponseMessage.prototype.messageType = 0; /** * AIRichResponseMessage submessages. * @member {Array.<AICommon.IAIRichResponseSubMessage>} submessages * @memberof E2E.AIRichResponseMessage * @instance */ AIRichResponseMessage.prototype.submessages = $util.emptyArray; /** * AIRichResponseMessage unifiedResponse. * @member {AICommon.IAIRichResponseUnifiedResponse|null|undefined} unifiedResponse * @memberof E2E.AIRichResponseMessage * @instance */ AIRichResponseMessage.prototype.unifiedResponse = null; /** * AIRichResponseMessage contextInfo. * @member {E2E.IContextInfo|null|undefined} contextInfo * @memberof E2E.AIRichResponseMessage * @instance */ AIRichResponseMessage.prototype.contextInfo = null; /** * Creates a new AIRichResponseMessage instance using the specified properties. * @function create * @memberof E2E.AIRichResponseMessage * @static * @param {E2E.IAIRichResponseMessage=} [properties] Properties to set * @returns {E2E.AIRichResponseMessage} AIRichResponseMessage instance */ AIRichResponseMessage.create = function create(properties) { return new AIRichResponseMessage(properties); }; /** * Encodes the specified AIRichResponseMessage message. Does not implicitly {@link E2E.AIRichResponseMessage.verify|verify} messages. * @function encode * @memberof E2E.AIRichResponseMessage * @static * @param {E2E.IAIRichResponseMessage} message AIRichResponseMessage message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ AIRichResponseMessage.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.messageType != null && Object.hasOwnProperty.call(message, "messageType")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.messageType); if (message.submessages != null && message.submessages.length) for (var i = 0; i < message.submessages.length; ++i) $root.AICommon.AIRichResponseSubMessage.encode(message.submessages[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.unifiedResponse != null && Object.hasOwnProperty.call(message, "unifiedResponse")) $root.AICommon.AIRichResponseUnifiedResponse.encode(message.unifiedResponse, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); if (message.contextInfo != null && Object.hasOwnProperty.call(message, "contextInfo")) $root.E2E.ContextInfo.encode(message.contextInfo, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); return writer; }; /** * Encodes the specified AIRichResponseMessage message, length delimited. Does not implicitly {@link E2E.AIRichResponseMessage.verify|verify} messages. * @function encodeDelimited * @memberof E2E.AIRichResponseMessage * @static * @param {E2E.IAIRichResponseMessage} message AIRichResponseMessage message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ AIRichResponseMessage.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a AIRichResponseMessage message from the specified reader or buffer. * @function decode * @memberof E2E.AIRichResponseMessage * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {E2E.AIRichResponseMessage} AIRichResponseMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ AIRichResponseMessage.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.E2E.AIRichResponseMessage(); while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) break; switch (tag >>> 3) { case 1: { message.messageType = reader.int32(); break; } case 2: { if (!(message.submessages && message.submessages.length)) message.submessages = []; message.submessages.push($root.AICommon.AIRichResponseSubMessage.decode(reader, reader.uint32())); break; } case 3: { message.unifiedResponse = $root.AICommon.AIRichResponseUnifiedResponse.decode(reader, reader.uint32()); break; } case 4: { message.contextInfo = $root.E2E.ContextInfo.decode(reader, reader.uint32()); break; } default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a AIRichResponseMessage message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof E2E.AIRichResponseMessage * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {E2E.AIRichResponseMessage} AIRichResponseMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ AIRichResponseMessage.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a AIRichResponseMessage message. * @function verify * @memberof E2E.AIRichResponseMessage * @static * @param {Object.<string,*>} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ AIRichResponseMessage.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.messageType != null && message.hasOwnProperty("messageType")) switch (message.messageType) { default: return "messageType: enum value expected"; case 0: case 1: break; } if (message.submessages != null && message.hasOwnProperty("submessages")) { if (!Array.isArray(message.submessages)) return "submessages: array expected"; for (var i = 0; i < message.submessages.length; ++i) { var error = $root.AICommon.AIRichResponseSubMessage.verify(message.submessages[i]); if (error) return "submessages." + error; } } if (message.unifiedResponse != null && message.hasOwnProperty("unifiedResponse")) { var error = $root.AICommon.AIRichResponseUnifiedResponse.verify(message.unifiedResponse); if (error) return "unifiedResponse." + error; } if (message.contextInfo != null && message.hasOwnProperty("contextInfo")) { var error = $root.E2E.ContextInfo.verify(message.contextInfo); if (error) return "contextInfo." + error; } return null; }; /** * Creates a AIRichResponseMessage message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof E2E.AIRichResponseMessage * @static * @param {Object.<string,*>} object Plain object * @returns {E2E.AIRichResponseMessage} AIRichResponseMessage */ AIRichResponseMessage.fromObject = function fromObject(object) { if (object instanceof $root.E2E.AIRichResponseMessage) return object; var message = new $root.E2E.AIRichResponseMessage(); switch (object.messageType) { default: if (typeof object.messageType === "number") { message.messageType = object.messageType; break; } break; case "AI_RICH_RESPONSE_TYPE_UNKNOWN": case 0: message.messageType = 0; break; case "AI_RICH_RESPONSE_TYPE_STANDARD": case 1: message.messageType = 1; break; } if (object.submessages) { if (!Array.isArray(object.submessages)) throw TypeError(".E2E.AIRichResponseMessage.submessages: array expected"); message.submessages = []; for (var i = 0; i < object.submessages.length; ++i) { if (typeof object.submessages[i] !== "object") throw TypeError(".E2E.AIRichResponseMessage.submessages: object expected"); message.submessages[i] = $root.AICommon.AIRichResponseSubMessage.fromObject(object.submessages[i]); } } if (object.unifiedResponse != null) { if (typeof object.unifiedResponse !== "object") throw TypeError(".E2E.AIRichResponseMessage.unifiedResponse: object expected"); message.unifiedResponse = $root.AICommon.AIRichResponseUnifiedResponse.fromObject(object.unifiedResponse); } if (object.contextInfo != null) { if (typeof object.contextInfo !== "object") throw TypeError(".E2E.AIRichResponseMessage.contextInfo: object expected"); message.contextInfo = $root.E2E.ContextInfo.fromObject(object.contextInfo); } return message; }; /** * Creates a plain object from a AIRichResponseMessage message. Also converts values to other types if specified. * @function toObject * @memberof E2E.AIRichResponseMessage * @static * @param {E2E.AIRichResponseMessage} message AIRichResponseMessage * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.<string,*>} Plain object */ AIRichResponseMessage.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) object.submessages = []; if (options.defaults) { object.messageType = options.enums === String ? "AI_RICH_RESPONSE_TYPE_UNKNOWN" : 0; object.unifiedResponse = null; object.contextInfo = null; } if (message.messageType != null && message.hasOwnProperty("messageType")) object.messageType = options.enums === String ? $root.AICommon.AIRichResponseMessageType[message.messageType] === undefined ? message.messageType : $root.AICommon.AIRichResponseMessageType[message.messageType] : message.messageType; if (message.submessages && message.submessages.length) { object.submessages = []; for (var j = 0; j < message.submessages.length; ++j) object.submessages[j] = $root.AICommon.AIRichResponseSubMessage.toObject(message.submessages[j], options); } if (message.unifiedResponse != null && message.hasOwnProperty("unifiedResponse")) object.unifiedResponse = $root.AICommon.AIRichResponseUnifiedResponse.toObject(message.unifiedResponse, options); if (message.contextInfo != null && message.hasOwnProperty("contextInfo")) object.contextInfo = $root.E2E.ContextInfo.toObject(message.contextInfo, options); return object; }; /** * Converts this AIRichResponseMessage to JSON. * @function toJSON * @memberof E2E.AIRichResponseMessage * @instance * @returns {Object.<string,*>} JSON object */ AIRichResponseMessage.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** * Gets the default type url for AIRichResponseMessage * @function getTypeUrl * @memberof E2E.AIRichResponseMessage * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ AIRichResponseMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } return typeUrlPrefix + "/E2E.AIRichResponseMessage"; }; return AIRichResponseMessage; })(); E2E.MemberLabel = (function() { /** * Properties of a MemberLabel. * @memberof E2E * @interface IMemberLabel * @property {string|null} [label] MemberLabel label * @property {number|Long|null} [labelTimestamp] MemberLabel labelTimestamp */ /** * Constructs a new MemberLabel. * @memberof E2E * @classdesc Represents a MemberLabel. * @implements IMemberLabel * @constructor * @param {E2E.IMemberLabel=} [properties] Properties to set */ function MemberLabel(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * MemberLabel label. * @member {string} label * @memberof E2E.MemberLabel * @instance */ MemberLabel.prototype.label = ""; /** * MemberLabel labelTimestamp. * @member {number|Long} labelTimestamp * @memberof E2E.MemberLabel * @instance */ MemberLabel.prototype.labelTimestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** * Creates a new MemberLabel instance using the specified properties. * @function create * @memberof E2E.MemberLabel * @static * @param {E2E.IMemberLabel=} [properties] Properties to set * @returns {E2E.MemberLabel} MemberLabel instance */ MemberLabel.create = function create(properties) { return new MemberLabel(properties); }; /** * Encodes the specified MemberLabel message. Does not implicitly {@link E2E.MemberLabel.verify|verify} messages. * @function encode * @memberof E2E.MemberLabel * @static * @param {E2E.IMemberLabel} message MemberLabel message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ MemberLabel.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.label != null && Object.hasOwnProperty.call(message, "label")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.label); if (message.labelTimestamp != null && Object.hasOwnProperty.call(message, "labelTimestamp")) writer.uint32(/* id 2, wireType 0 =*/16).int64(message.labelTimestamp); return writer; }; /** * Encodes the specified MemberLabel message, length delimited. Does not implicitly {@link E2E.MemberLabel.verify|verify} messages. * @function encodeDelimited * @memberof E2E.MemberLabel * @static * @param {E2E.IMemberLabel} message MemberLabel message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ MemberLabel.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a MemberLabel message from the specified reader or buffer. * @function decode * @memberof E2E.MemberLabel * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {E2E.MemberLabel} MemberLabel * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ MemberLabel.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.E2E.MemberLabel(); while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) break; switch (tag >>> 3) { case 1: { message.label = reader.string(); break; } case 2: { message.labelTimestamp = reader.int64(); break; } default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a MemberLabel message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof E2E.MemberLabel * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {E2E.MemberLabel} MemberLabel * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ MemberLabel.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a MemberLabel message. * @function verify * @memberof E2E.MemberLabel * @static * @param {Object.<string,*>} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ MemberLabel.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.label != null && message.hasOwnProperty("label")) if (!$util.isString(message.label)) return "label: string expected"; if (message.labelTimestamp != null && message.hasOwnProperty("labelTimestamp")) if (!$util.isInteger(message.labelTimestamp) && !(message.labelTimestamp && $util.isInteger(message.labelTimestamp.low) && $util.isInteger(message.labelTimestamp.high))) return "labelTimestamp: integer|Long expected"; return null; }; /** * Creates a MemberLabel message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof E2E.MemberLabel * @static * @param {Object.<string,*>} object Plain object * @returns {E2E.MemberLabel} MemberLabel */ MemberLabel.fromObject = function fromObject(object) { if (object instanceof $root.E2E.MemberLabel) return object; var message = new $root.E2E.MemberLabel(); if (object.label != null) message.label = String(object.label); if (object.labelTimestamp != null) if ($util.Long) (message.labelTimestamp = $util.Long.fromValue(object.labelTimestamp)).unsigned = false; else if (typeof object.labelTimestamp === "string") message.labelTimestamp = parseInt(object.labelTimestamp, 10); else if (typeof object.labelTimestamp === "number") message.labelTimestamp = object.labelTimestamp; else if (typeof object.labelTimestamp === "object") message.labelTimestamp = new $util.LongBits(object.labelTimestamp.low >>> 0, object.labelTimestamp.high >>> 0).toNumber(); return message; }; /** * Creates a plain object from a MemberLabel message. Also converts values to other types if specified. * @function toObject * @memberof E2E.MemberLabel * @static * @param {E2E.MemberLabel} message MemberLabel * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.<string,*>} Plain object */ MemberLabel.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.label = ""; if ($util.Long) { var long = new $util.Long(0, 0, false); object.labelTimestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; } else object.labelTimestamp = options.longs === String ? "0" : 0; } if (message.label != null && message.hasOwnProperty("label")) object.label = message.label; if (message.labelTimestamp != null && message.hasOwnProperty("labelTimestamp")) if (typeof message.labelTimestamp === "number") object.labelTimestamp = options.longs === String ? String(message.labelTimestamp) : message.labelTimestamp; else object.labelTimestamp = options.longs === String ? $util.Long.prototype.toString.call(message.labelTimestamp) : options.longs === Number ? new $util.LongBits(message.labelTimestamp.low >>> 0, message.labelTimestamp.high >>> 0).toNumber() : message.labelTimestamp; return object; }; /** * Converts this MemberLabel to JSON. * @function toJSON * @memberof E2E.MemberLabel * @instance * @returns {Object.<string,*>} JSON object */ MemberLabel.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** * Gets the default type url for MemberLabel * @function getTypeUrl * @memberof E2E.MemberLabel * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ MemberLabel.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } return typeUrlPrefix + "/E2E.MemberLabel"; }; return MemberLabel; })(); E2E.UrlTrackingMap = (function() { /** * Properties of an UrlTrackingMap. * @memberof E2E * @interface IUrlTrackingMap * @property {Array.<E2E.UrlTrackingMap.IUrlTrackingMapElement>|null} [urlTrackingMapElements] UrlTrackingMap urlTrackingMapElements */ /** * Constructs a new UrlTrackingMap. * @memberof E2E * @classdesc Represents an UrlTrackingMap. * @implements IUrlTrackingMap * @constructor * @param {E2E.IUrlTrackingMap=} [properties] Properties to set */ function UrlTrackingMap(properties) { this.urlTrackingMapElements = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * UrlTrackingMap urlTrackingMapElements. * @member {Array.<E2E.UrlTrackingMap.IUrlTrackingMapElement>} urlTrackingMapElements * @memberof E2E.UrlTrackingMap * @instance */ UrlTrackingMap.prototype.urlTrackingMapElements = $util.emptyArray; /** * Creates a new UrlTrackingMap instance using the specified properties. * @function create * @memberof E2E.UrlTrackingMap * @static * @param {E2E.IUrlTrackingMap=} [properties] Properties to set * @returns {E2E.UrlTrackingMap} UrlTrackingMap instance */ UrlTrackingMap.create = function create(properties) { return new UrlTrackingMap(properties); }; /** * Encodes the specified UrlTrackingMap message. Does not implicitly {@link E2E.UrlTrackingMap.verify|verify} messages. * @function encode * @memberof E2E.UrlTrackingMap * @static * @param {E2E.IUrlTrackingMap} message UrlTrackingMap message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ UrlTrackingMap.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.urlTrackingMapElements != null && message.urlTrackingMapElements.length) for (var i = 0; i < message.urlTrackingMapElements.length; ++i) $root.E2E.UrlTrackingMap.UrlTrackingMapElement.encode(message.urlTrackingMapElements[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** * Encodes the specified UrlTrackingMap message, length delimited. Does not implicitly {@link E2E.UrlTrackingMap.verify|verify} messages. * @function encodeDelimited * @memberof E2E.UrlTrackingMap * @static * @param {E2E.IUrlTrackingMap} message UrlTrackingMap message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ UrlTrackingMap.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes an UrlTrackingMap message from the specified reader or buffer. * @function decode * @memberof E2E.UrlTrackingMap * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {E2E.UrlTrackingMap} UrlTrackingMap * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ UrlTrackingMap.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.E2E.UrlTrackingMap(); while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) break; switch (tag >>> 3) { case 1: { if (!(message.urlTrackingMapElements && message.urlTrackingMapElements.length)) message.urlTrackingMapElements = []; message.urlTrackingMapElements.push($root.E2E.UrlTrackingMap.UrlTrackingMapElement.decode(reader, reader.uint32())); break; } default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes an UrlTrackingMap message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof E2E.UrlTrackingMap * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {E2E.UrlTrackingMap} UrlTrackingMap * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ UrlTrackingMap.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies an UrlTrackingMap message. * @function verify * @memberof E2E.UrlTrackingMap * @static * @param {Object.<string,*>} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ UrlTrackingMap.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.urlTrackingMapElements != null && message.hasOwnProperty("urlTrackingMapElements")) { if (!Array.isArray(message.urlTrackingMapElements)) return "urlTrackingMapElements: array expected"; for (var i = 0; i < message.urlTrackingMapElements.length; ++i) { var error = $root.E2E.UrlTrackingMap.UrlTrackingMapElement.verify(message.urlTrackingMapElements[i]); if (error) return "urlTrackingMapElements." + error; } } return null; }; /** * Creates an UrlTrackingMap message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof E2E.UrlTrackingMap * @static * @param {Object.<string,*>} object Plain object * @returns {E2E.UrlTrackingMap} UrlTrackingMap */ UrlTrackingMap.fromObject = function fromObject(object) { if (object instanceof $root.E2E.UrlTrackingMap) return object; var message = new $root.E2E.UrlTrackingMap(); if (object.urlTrackingMapElements) { if (!Array.isArray(object.urlTrackingMapElements)) throw TypeError(".E2E.UrlTrackingMap.urlTrackingMapElements: array expected"); message.urlTrackingMapElements = []; for (var i = 0; i < object.urlTrackingMapElements.length; ++i) { if (typeof object.urlTrackingMapElements[i] !== "object") throw TypeError(".E2E.UrlTrackingMap.urlTrackingMapElements: object expected"); message.urlTrackingMapElements[i] = $root.E2E.UrlTrackingMap.UrlTrackingMapElement.fromObject(object.urlTrackingMapElements[i]); } } return message; }; /** * Creates a plain object from an UrlTrackingMap message. Also converts values to other types if specified. * @function toObject * @memberof E2E.UrlTrackingMap * @static * @param {E2E.UrlTrackingMap} message UrlTrackingMap * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.<string,*>} Plain object */ UrlTrackingMap.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) object.urlTrackingMapElements = []; if (message.urlTrackingMapElements && message.urlTrackingMapElements.length) { object.urlTrackingMapElements = []; for (var j = 0; j < message.urlTrackingMapElements.length; ++j) object.urlTrackingMapElements[j] = $root.E2E.UrlTrackingMap.UrlTrackingMapElement.toObject(message.urlTrackingMapElements[j], options); } return object; }; /** * Converts this UrlTrackingMap to JSON. * @function toJSON * @memberof E2E.UrlTrackingMap * @instance * @returns {Object.<string,*>} JSON object */ UrlTrackingMap.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** * Gets the default type url for UrlTrackingMap * @function getTypeUrl * @memberof E2E.UrlTrackingMap * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ UrlTrackingMap.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } return typeUrlPrefix + "/E2E.UrlTrackingMap"; }; UrlTrackingMap.UrlTrackingMapElement = (function() { /** * Properties of an UrlTrackingMapElement. * @memberof E2E.UrlTrackingMap * @interface IUrlTrackingMapElement * @property {string|null} [originalUrl] UrlTrackingMapElement originalUrl * @property {string|null} [unconsentedUsersUrl] UrlTrackingMapElement unconsentedUsersUrl * @property {string|null} [consentedUsersUrl] UrlTrackingMapElement consentedUsersUrl * @property {number|null} [cardIndex] UrlTrackingMapElement cardIndex */ /** * Constructs a new UrlTrackingMapElement. * @m