UNPKG

@vreden/meta

Version:

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

1,116 lines (1,047 loc) 108 kB
/*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.VnameCert = (function() { /** * Namespace VnameCert. * @exports VnameCert * @namespace */ var VnameCert = {}; VnameCert.BizIdentityInfo = (function() { /** * Properties of a BizIdentityInfo. * @memberof VnameCert * @interface IBizIdentityInfo * @property {VnameCert.BizIdentityInfo.VerifiedLevelValue|null} [vlevel] BizIdentityInfo vlevel * @property {VnameCert.IVerifiedNameCertificate|null} [vnameCert] BizIdentityInfo vnameCert * @property {boolean|null} [signed] BizIdentityInfo signed * @property {boolean|null} [revoked] BizIdentityInfo revoked * @property {VnameCert.BizIdentityInfo.HostStorageType|null} [hostStorage] BizIdentityInfo hostStorage * @property {VnameCert.BizIdentityInfo.ActualActorsType|null} [actualActors] BizIdentityInfo actualActors * @property {number|Long|null} [privacyModeTs] BizIdentityInfo privacyModeTs * @property {number|Long|null} [featureControls] BizIdentityInfo featureControls */ /** * Constructs a new BizIdentityInfo. * @memberof VnameCert * @classdesc Represents a BizIdentityInfo. * @implements IBizIdentityInfo * @constructor * @param {VnameCert.IBizIdentityInfo=} [properties] Properties to set */ function BizIdentityInfo(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]]; } /** * BizIdentityInfo vlevel. * @member {VnameCert.BizIdentityInfo.VerifiedLevelValue|null|undefined} vlevel * @memberof VnameCert.BizIdentityInfo * @instance */ BizIdentityInfo.prototype.vlevel = null; /** * BizIdentityInfo vnameCert. * @member {VnameCert.IVerifiedNameCertificate|null|undefined} vnameCert * @memberof VnameCert.BizIdentityInfo * @instance */ BizIdentityInfo.prototype.vnameCert = null; /** * BizIdentityInfo signed. * @member {boolean|null|undefined} signed * @memberof VnameCert.BizIdentityInfo * @instance */ BizIdentityInfo.prototype.signed = null; /** * BizIdentityInfo revoked. * @member {boolean|null|undefined} revoked * @memberof VnameCert.BizIdentityInfo * @instance */ BizIdentityInfo.prototype.revoked = null; /** * BizIdentityInfo hostStorage. * @member {VnameCert.BizIdentityInfo.HostStorageType|null|undefined} hostStorage * @memberof VnameCert.BizIdentityInfo * @instance */ BizIdentityInfo.prototype.hostStorage = null; /** * BizIdentityInfo actualActors. * @member {VnameCert.BizIdentityInfo.ActualActorsType|null|undefined} actualActors * @memberof VnameCert.BizIdentityInfo * @instance */ BizIdentityInfo.prototype.actualActors = null; /** * BizIdentityInfo privacyModeTs. * @member {number|Long|null|undefined} privacyModeTs * @memberof VnameCert.BizIdentityInfo * @instance */ BizIdentityInfo.prototype.privacyModeTs = null; /** * BizIdentityInfo featureControls. * @member {number|Long|null|undefined} featureControls * @memberof VnameCert.BizIdentityInfo * @instance */ BizIdentityInfo.prototype.featureControls = null; // OneOf field names bound to virtual getters and setters var $oneOfFields; /** * BizIdentityInfo _vlevel. * @member {"vlevel"|undefined} _vlevel * @memberof VnameCert.BizIdentityInfo * @instance */ Object.defineProperty(BizIdentityInfo.prototype, "_vlevel", { get: $util.oneOfGetter($oneOfFields = ["vlevel"]), set: $util.oneOfSetter($oneOfFields) }); /** * BizIdentityInfo _vnameCert. * @member {"vnameCert"|undefined} _vnameCert * @memberof VnameCert.BizIdentityInfo * @instance */ Object.defineProperty(BizIdentityInfo.prototype, "_vnameCert", { get: $util.oneOfGetter($oneOfFields = ["vnameCert"]), set: $util.oneOfSetter($oneOfFields) }); /** * BizIdentityInfo _signed. * @member {"signed"|undefined} _signed * @memberof VnameCert.BizIdentityInfo * @instance */ Object.defineProperty(BizIdentityInfo.prototype, "_signed", { get: $util.oneOfGetter($oneOfFields = ["signed"]), set: $util.oneOfSetter($oneOfFields) }); /** * BizIdentityInfo _revoked. * @member {"revoked"|undefined} _revoked * @memberof VnameCert.BizIdentityInfo * @instance */ Object.defineProperty(BizIdentityInfo.prototype, "_revoked", { get: $util.oneOfGetter($oneOfFields = ["revoked"]), set: $util.oneOfSetter($oneOfFields) }); /** * BizIdentityInfo _hostStorage. * @member {"hostStorage"|undefined} _hostStorage * @memberof VnameCert.BizIdentityInfo * @instance */ Object.defineProperty(BizIdentityInfo.prototype, "_hostStorage", { get: $util.oneOfGetter($oneOfFields = ["hostStorage"]), set: $util.oneOfSetter($oneOfFields) }); /** * BizIdentityInfo _actualActors. * @member {"actualActors"|undefined} _actualActors * @memberof VnameCert.BizIdentityInfo * @instance */ Object.defineProperty(BizIdentityInfo.prototype, "_actualActors", { get: $util.oneOfGetter($oneOfFields = ["actualActors"]), set: $util.oneOfSetter($oneOfFields) }); /** * BizIdentityInfo _privacyModeTs. * @member {"privacyModeTs"|undefined} _privacyModeTs * @memberof VnameCert.BizIdentityInfo * @instance */ Object.defineProperty(BizIdentityInfo.prototype, "_privacyModeTs", { get: $util.oneOfGetter($oneOfFields = ["privacyModeTs"]), set: $util.oneOfSetter($oneOfFields) }); /** * BizIdentityInfo _featureControls. * @member {"featureControls"|undefined} _featureControls * @memberof VnameCert.BizIdentityInfo * @instance */ Object.defineProperty(BizIdentityInfo.prototype, "_featureControls", { get: $util.oneOfGetter($oneOfFields = ["featureControls"]), set: $util.oneOfSetter($oneOfFields) }); /** * Creates a new BizIdentityInfo instance using the specified properties. * @function create * @memberof VnameCert.BizIdentityInfo * @static * @param {VnameCert.IBizIdentityInfo=} [properties] Properties to set * @returns {VnameCert.BizIdentityInfo} BizIdentityInfo instance */ BizIdentityInfo.create = function create(properties) { return new BizIdentityInfo(properties); }; /** * Encodes the specified BizIdentityInfo message. Does not implicitly {@link VnameCert.BizIdentityInfo.verify|verify} messages. * @function encode * @memberof VnameCert.BizIdentityInfo * @static * @param {VnameCert.IBizIdentityInfo} message BizIdentityInfo message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ BizIdentityInfo.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.vlevel != null && Object.hasOwnProperty.call(message, "vlevel")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.vlevel); if (message.vnameCert != null && Object.hasOwnProperty.call(message, "vnameCert")) $root.VnameCert.VerifiedNameCertificate.encode(message.vnameCert, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.signed != null && Object.hasOwnProperty.call(message, "signed")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.signed); if (message.revoked != null && Object.hasOwnProperty.call(message, "revoked")) writer.uint32(/* id 4, wireType 0 =*/32).bool(message.revoked); if (message.hostStorage != null && Object.hasOwnProperty.call(message, "hostStorage")) writer.uint32(/* id 5, wireType 0 =*/40).int32(message.hostStorage); if (message.actualActors != null && Object.hasOwnProperty.call(message, "actualActors")) writer.uint32(/* id 6, wireType 0 =*/48).int32(message.actualActors); if (message.privacyModeTs != null && Object.hasOwnProperty.call(message, "privacyModeTs")) writer.uint32(/* id 7, wireType 0 =*/56).uint64(message.privacyModeTs); if (message.featureControls != null && Object.hasOwnProperty.call(message, "featureControls")) writer.uint32(/* id 8, wireType 0 =*/64).uint64(message.featureControls); return writer; }; /** * Encodes the specified BizIdentityInfo message, length delimited. Does not implicitly {@link VnameCert.BizIdentityInfo.verify|verify} messages. * @function encodeDelimited * @memberof VnameCert.BizIdentityInfo * @static * @param {VnameCert.IBizIdentityInfo} message BizIdentityInfo message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ BizIdentityInfo.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a BizIdentityInfo message from the specified reader or buffer. * @function decode * @memberof VnameCert.BizIdentityInfo * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {VnameCert.BizIdentityInfo} BizIdentityInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ BizIdentityInfo.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.VnameCert.BizIdentityInfo(); while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) break; switch (tag >>> 3) { case 1: { message.vlevel = reader.int32(); break; } case 2: { message.vnameCert = $root.VnameCert.VerifiedNameCertificate.decode(reader, reader.uint32()); break; } case 3: { message.signed = reader.bool(); break; } case 4: { message.revoked = reader.bool(); break; } case 5: { message.hostStorage = reader.int32(); break; } case 6: { message.actualActors = reader.int32(); break; } case 7: { message.privacyModeTs = reader.uint64(); break; } case 8: { message.featureControls = reader.uint64(); break; } default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a BizIdentityInfo message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof VnameCert.BizIdentityInfo * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {VnameCert.BizIdentityInfo} BizIdentityInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ BizIdentityInfo.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a BizIdentityInfo message. * @function verify * @memberof VnameCert.BizIdentityInfo * @static * @param {Object.<string,*>} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ BizIdentityInfo.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; var properties = {}; if (message.vlevel != null && message.hasOwnProperty("vlevel")) { properties._vlevel = 1; switch (message.vlevel) { default: return "vlevel: enum value expected"; case 0: case 1: case 2: break; } } if (message.vnameCert != null && message.hasOwnProperty("vnameCert")) { properties._vnameCert = 1; { var error = $root.VnameCert.VerifiedNameCertificate.verify(message.vnameCert); if (error) return "vnameCert." + error; } } if (message.signed != null && message.hasOwnProperty("signed")) { properties._signed = 1; if (typeof message.signed !== "boolean") return "signed: boolean expected"; } if (message.revoked != null && message.hasOwnProperty("revoked")) { properties._revoked = 1; if (typeof message.revoked !== "boolean") return "revoked: boolean expected"; } if (message.hostStorage != null && message.hasOwnProperty("hostStorage")) { properties._hostStorage = 1; switch (message.hostStorage) { default: return "hostStorage: enum value expected"; case 0: case 1: break; } } if (message.actualActors != null && message.hasOwnProperty("actualActors")) { properties._actualActors = 1; switch (message.actualActors) { default: return "actualActors: enum value expected"; case 0: case 1: break; } } if (message.privacyModeTs != null && message.hasOwnProperty("privacyModeTs")) { properties._privacyModeTs = 1; if (!$util.isInteger(message.privacyModeTs) && !(message.privacyModeTs && $util.isInteger(message.privacyModeTs.low) && $util.isInteger(message.privacyModeTs.high))) return "privacyModeTs: integer|Long expected"; } if (message.featureControls != null && message.hasOwnProperty("featureControls")) { properties._featureControls = 1; if (!$util.isInteger(message.featureControls) && !(message.featureControls && $util.isInteger(message.featureControls.low) && $util.isInteger(message.featureControls.high))) return "featureControls: integer|Long expected"; } return null; }; /** * Creates a BizIdentityInfo message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof VnameCert.BizIdentityInfo * @static * @param {Object.<string,*>} object Plain object * @returns {VnameCert.BizIdentityInfo} BizIdentityInfo */ BizIdentityInfo.fromObject = function fromObject(object) { if (object instanceof $root.VnameCert.BizIdentityInfo) return object; var message = new $root.VnameCert.BizIdentityInfo(); switch (object.vlevel) { default: if (typeof object.vlevel === "number") { message.vlevel = object.vlevel; break; } break; case "UNKNOWN": case 0: message.vlevel = 0; break; case "LOW": case 1: message.vlevel = 1; break; case "HIGH": case 2: message.vlevel = 2; break; } if (object.vnameCert != null) { if (typeof object.vnameCert !== "object") throw TypeError(".VnameCert.BizIdentityInfo.vnameCert: object expected"); message.vnameCert = $root.VnameCert.VerifiedNameCertificate.fromObject(object.vnameCert); } if (object.signed != null) message.signed = Boolean(object.signed); if (object.revoked != null) message.revoked = Boolean(object.revoked); switch (object.hostStorage) { default: if (typeof object.hostStorage === "number") { message.hostStorage = object.hostStorage; break; } break; case "ON_PREMISE": case 0: message.hostStorage = 0; break; case "FACEBOOK": case 1: message.hostStorage = 1; break; } switch (object.actualActors) { default: if (typeof object.actualActors === "number") { message.actualActors = object.actualActors; break; } break; case "SELF": case 0: message.actualActors = 0; break; case "BSP": case 1: message.actualActors = 1; break; } if (object.privacyModeTs != null) if ($util.Long) (message.privacyModeTs = $util.Long.fromValue(object.privacyModeTs)).unsigned = true; else if (typeof object.privacyModeTs === "string") message.privacyModeTs = parseInt(object.privacyModeTs, 10); else if (typeof object.privacyModeTs === "number") message.privacyModeTs = object.privacyModeTs; else if (typeof object.privacyModeTs === "object") message.privacyModeTs = new $util.LongBits(object.privacyModeTs.low >>> 0, object.privacyModeTs.high >>> 0).toNumber(true); if (object.featureControls != null) if ($util.Long) (message.featureControls = $util.Long.fromValue(object.featureControls)).unsigned = true; else if (typeof object.featureControls === "string") message.featureControls = parseInt(object.featureControls, 10); else if (typeof object.featureControls === "number") message.featureControls = object.featureControls; else if (typeof object.featureControls === "object") message.featureControls = new $util.LongBits(object.featureControls.low >>> 0, object.featureControls.high >>> 0).toNumber(true); return message; }; /** * Creates a plain object from a BizIdentityInfo message. Also converts values to other types if specified. * @function toObject * @memberof VnameCert.BizIdentityInfo * @static * @param {VnameCert.BizIdentityInfo} message BizIdentityInfo * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.<string,*>} Plain object */ BizIdentityInfo.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (message.vlevel != null && message.hasOwnProperty("vlevel")) { object.vlevel = options.enums === String ? $root.VnameCert.BizIdentityInfo.VerifiedLevelValue[message.vlevel] === undefined ? message.vlevel : $root.VnameCert.BizIdentityInfo.VerifiedLevelValue[message.vlevel] : message.vlevel; if (options.oneofs) object._vlevel = "vlevel"; } if (message.vnameCert != null && message.hasOwnProperty("vnameCert")) { object.vnameCert = $root.VnameCert.VerifiedNameCertificate.toObject(message.vnameCert, options); if (options.oneofs) object._vnameCert = "vnameCert"; } if (message.signed != null && message.hasOwnProperty("signed")) { object.signed = message.signed; if (options.oneofs) object._signed = "signed"; } if (message.revoked != null && message.hasOwnProperty("revoked")) { object.revoked = message.revoked; if (options.oneofs) object._revoked = "revoked"; } if (message.hostStorage != null && message.hasOwnProperty("hostStorage")) { object.hostStorage = options.enums === String ? $root.VnameCert.BizIdentityInfo.HostStorageType[message.hostStorage] === undefined ? message.hostStorage : $root.VnameCert.BizIdentityInfo.HostStorageType[message.hostStorage] : message.hostStorage; if (options.oneofs) object._hostStorage = "hostStorage"; } if (message.actualActors != null && message.hasOwnProperty("actualActors")) { object.actualActors = options.enums === String ? $root.VnameCert.BizIdentityInfo.ActualActorsType[message.actualActors] === undefined ? message.actualActors : $root.VnameCert.BizIdentityInfo.ActualActorsType[message.actualActors] : message.actualActors; if (options.oneofs) object._actualActors = "actualActors"; } if (message.privacyModeTs != null && message.hasOwnProperty("privacyModeTs")) { if (typeof message.privacyModeTs === "number") object.privacyModeTs = options.longs === String ? String(message.privacyModeTs) : message.privacyModeTs; else object.privacyModeTs = options.longs === String ? $util.Long.prototype.toString.call(message.privacyModeTs) : options.longs === Number ? new $util.LongBits(message.privacyModeTs.low >>> 0, message.privacyModeTs.high >>> 0).toNumber(true) : message.privacyModeTs; if (options.oneofs) object._privacyModeTs = "privacyModeTs"; } if (message.featureControls != null && message.hasOwnProperty("featureControls")) { if (typeof message.featureControls === "number") object.featureControls = options.longs === String ? String(message.featureControls) : message.featureControls; else object.featureControls = options.longs === String ? $util.Long.prototype.toString.call(message.featureControls) : options.longs === Number ? new $util.LongBits(message.featureControls.low >>> 0, message.featureControls.high >>> 0).toNumber(true) : message.featureControls; if (options.oneofs) object._featureControls = "featureControls"; } return object; }; /** * Converts this BizIdentityInfo to JSON. * @function toJSON * @memberof VnameCert.BizIdentityInfo * @instance * @returns {Object.<string,*>} JSON object */ BizIdentityInfo.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** * Gets the default type url for BizIdentityInfo * @function getTypeUrl * @memberof VnameCert.BizIdentityInfo * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ BizIdentityInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } return typeUrlPrefix + "/VnameCert.BizIdentityInfo"; }; /** * ActualActorsType enum. * @name VnameCert.BizIdentityInfo.ActualActorsType * @enum {number} * @property {number} SELF=0 SELF value * @property {number} BSP=1 BSP value */ BizIdentityInfo.ActualActorsType = (function() { var valuesById = {}, values = Object.create(valuesById); values[valuesById[0] = "SELF"] = 0; values[valuesById[1] = "BSP"] = 1; return values; })(); /** * HostStorageType enum. * @name VnameCert.BizIdentityInfo.HostStorageType * @enum {number} * @property {number} ON_PREMISE=0 ON_PREMISE value * @property {number} FACEBOOK=1 FACEBOOK value */ BizIdentityInfo.HostStorageType = (function() { var valuesById = {}, values = Object.create(valuesById); values[valuesById[0] = "ON_PREMISE"] = 0; values[valuesById[1] = "FACEBOOK"] = 1; return values; })(); /** * VerifiedLevelValue enum. * @name VnameCert.BizIdentityInfo.VerifiedLevelValue * @enum {number} * @property {number} UNKNOWN=0 UNKNOWN value * @property {number} LOW=1 LOW value * @property {number} HIGH=2 HIGH value */ BizIdentityInfo.VerifiedLevelValue = (function() { var valuesById = {}, values = Object.create(valuesById); values[valuesById[0] = "UNKNOWN"] = 0; values[valuesById[1] = "LOW"] = 1; values[valuesById[2] = "HIGH"] = 2; return values; })(); return BizIdentityInfo; })(); VnameCert.BizAccountLinkInfo = (function() { /** * Properties of a BizAccountLinkInfo. * @memberof VnameCert * @interface IBizAccountLinkInfo * @property {number|Long|null} [whatsappBizAcctFbid] BizAccountLinkInfo whatsappBizAcctFbid * @property {string|null} [whatsappAcctNumber] BizAccountLinkInfo whatsappAcctNumber * @property {number|Long|null} [issueTime] BizAccountLinkInfo issueTime * @property {VnameCert.BizAccountLinkInfo.HostStorageType|null} [hostStorage] BizAccountLinkInfo hostStorage * @property {VnameCert.BizAccountLinkInfo.AccountType|null} [accountType] BizAccountLinkInfo accountType */ /** * Constructs a new BizAccountLinkInfo. * @memberof VnameCert * @classdesc Represents a BizAccountLinkInfo. * @implements IBizAccountLinkInfo * @constructor * @param {VnameCert.IBizAccountLinkInfo=} [properties] Properties to set */ function BizAccountLinkInfo(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]]; } /** * BizAccountLinkInfo whatsappBizAcctFbid. * @member {number|Long|null|undefined} whatsappBizAcctFbid * @memberof VnameCert.BizAccountLinkInfo * @instance */ BizAccountLinkInfo.prototype.whatsappBizAcctFbid = null; /** * BizAccountLinkInfo whatsappAcctNumber. * @member {string|null|undefined} whatsappAcctNumber * @memberof VnameCert.BizAccountLinkInfo * @instance */ BizAccountLinkInfo.prototype.whatsappAcctNumber = null; /** * BizAccountLinkInfo issueTime. * @member {number|Long|null|undefined} issueTime * @memberof VnameCert.BizAccountLinkInfo * @instance */ BizAccountLinkInfo.prototype.issueTime = null; /** * BizAccountLinkInfo hostStorage. * @member {VnameCert.BizAccountLinkInfo.HostStorageType|null|undefined} hostStorage * @memberof VnameCert.BizAccountLinkInfo * @instance */ BizAccountLinkInfo.prototype.hostStorage = null; /** * BizAccountLinkInfo accountType. * @member {VnameCert.BizAccountLinkInfo.AccountType|null|undefined} accountType * @memberof VnameCert.BizAccountLinkInfo * @instance */ BizAccountLinkInfo.prototype.accountType = null; // OneOf field names bound to virtual getters and setters var $oneOfFields; /** * BizAccountLinkInfo _whatsappBizAcctFbid. * @member {"whatsappBizAcctFbid"|undefined} _whatsappBizAcctFbid * @memberof VnameCert.BizAccountLinkInfo * @instance */ Object.defineProperty(BizAccountLinkInfo.prototype, "_whatsappBizAcctFbid", { get: $util.oneOfGetter($oneOfFields = ["whatsappBizAcctFbid"]), set: $util.oneOfSetter($oneOfFields) }); /** * BizAccountLinkInfo _whatsappAcctNumber. * @member {"whatsappAcctNumber"|undefined} _whatsappAcctNumber * @memberof VnameCert.BizAccountLinkInfo * @instance */ Object.defineProperty(BizAccountLinkInfo.prototype, "_whatsappAcctNumber", { get: $util.oneOfGetter($oneOfFields = ["whatsappAcctNumber"]), set: $util.oneOfSetter($oneOfFields) }); /** * BizAccountLinkInfo _issueTime. * @member {"issueTime"|undefined} _issueTime * @memberof VnameCert.BizAccountLinkInfo * @instance */ Object.defineProperty(BizAccountLinkInfo.prototype, "_issueTime", { get: $util.oneOfGetter($oneOfFields = ["issueTime"]), set: $util.oneOfSetter($oneOfFields) }); /** * BizAccountLinkInfo _hostStorage. * @member {"hostStorage"|undefined} _hostStorage * @memberof VnameCert.BizAccountLinkInfo * @instance */ Object.defineProperty(BizAccountLinkInfo.prototype, "_hostStorage", { get: $util.oneOfGetter($oneOfFields = ["hostStorage"]), set: $util.oneOfSetter($oneOfFields) }); /** * BizAccountLinkInfo _accountType. * @member {"accountType"|undefined} _accountType * @memberof VnameCert.BizAccountLinkInfo * @instance */ Object.defineProperty(BizAccountLinkInfo.prototype, "_accountType", { get: $util.oneOfGetter($oneOfFields = ["accountType"]), set: $util.oneOfSetter($oneOfFields) }); /** * Creates a new BizAccountLinkInfo instance using the specified properties. * @function create * @memberof VnameCert.BizAccountLinkInfo * @static * @param {VnameCert.IBizAccountLinkInfo=} [properties] Properties to set * @returns {VnameCert.BizAccountLinkInfo} BizAccountLinkInfo instance */ BizAccountLinkInfo.create = function create(properties) { return new BizAccountLinkInfo(properties); }; /** * Encodes the specified BizAccountLinkInfo message. Does not implicitly {@link VnameCert.BizAccountLinkInfo.verify|verify} messages. * @function encode * @memberof VnameCert.BizAccountLinkInfo * @static * @param {VnameCert.IBizAccountLinkInfo} message BizAccountLinkInfo message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ BizAccountLinkInfo.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.whatsappBizAcctFbid != null && Object.hasOwnProperty.call(message, "whatsappBizAcctFbid")) writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.whatsappBizAcctFbid); if (message.whatsappAcctNumber != null && Object.hasOwnProperty.call(message, "whatsappAcctNumber")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.whatsappAcctNumber); if (message.issueTime != null && Object.hasOwnProperty.call(message, "issueTime")) writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.issueTime); if (message.hostStorage != null && Object.hasOwnProperty.call(message, "hostStorage")) writer.uint32(/* id 4, wireType 0 =*/32).int32(message.hostStorage); if (message.accountType != null && Object.hasOwnProperty.call(message, "accountType")) writer.uint32(/* id 5, wireType 0 =*/40).int32(message.accountType); return writer; }; /** * Encodes the specified BizAccountLinkInfo message, length delimited. Does not implicitly {@link VnameCert.BizAccountLinkInfo.verify|verify} messages. * @function encodeDelimited * @memberof VnameCert.BizAccountLinkInfo * @static * @param {VnameCert.IBizAccountLinkInfo} message BizAccountLinkInfo message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ BizAccountLinkInfo.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a BizAccountLinkInfo message from the specified reader or buffer. * @function decode * @memberof VnameCert.BizAccountLinkInfo * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {VnameCert.BizAccountLinkInfo} BizAccountLinkInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ BizAccountLinkInfo.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.VnameCert.BizAccountLinkInfo(); while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) break; switch (tag >>> 3) { case 1: { message.whatsappBizAcctFbid = reader.uint64(); break; } case 2: { message.whatsappAcctNumber = reader.string(); break; } case 3: { message.issueTime = reader.uint64(); break; } case 4: { message.hostStorage = reader.int32(); break; } case 5: { message.accountType = reader.int32(); break; } default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a BizAccountLinkInfo message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof VnameCert.BizAccountLinkInfo * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {VnameCert.BizAccountLinkInfo} BizAccountLinkInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ BizAccountLinkInfo.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a BizAccountLinkInfo message. * @function verify * @memberof VnameCert.BizAccountLinkInfo * @static * @param {Object.<string,*>} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ BizAccountLinkInfo.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; var properties = {}; if (message.whatsappBizAcctFbid != null && message.hasOwnProperty("whatsappBizAcctFbid")) { properties._whatsappBizAcctFbid = 1; if (!$util.isInteger(message.whatsappBizAcctFbid) && !(message.whatsappBizAcctFbid && $util.isInteger(message.whatsappBizAcctFbid.low) && $util.isInteger(message.whatsappBizAcctFbid.high))) return "whatsappBizAcctFbid: integer|Long expected"; } if (message.whatsappAcctNumber != null && message.hasOwnProperty("whatsappAcctNumber")) { properties._whatsappAcctNumber = 1; if (!$util.isString(message.whatsappAcctNumber)) return "whatsappAcctNumber: string expected"; } if (message.issueTime != null && message.hasOwnProperty("issueTime")) { properties._issueTime = 1; if (!$util.isInteger(message.issueTime) && !(message.issueTime && $util.isInteger(message.issueTime.low) && $util.isInteger(message.issueTime.high))) return "issueTime: integer|Long expected"; } if (message.hostStorage != null && message.hasOwnProperty("hostStorage")) { properties._hostStorage = 1; switch (message.hostStorage) { default: return "hostStorage: enum value expected"; case 0: case 1: break; } } if (message.accountType != null && message.hasOwnProperty("accountType")) { properties._accountType = 1; switch (message.accountType) { default: return "accountType: enum value expected"; case 0: break; } } return null; }; /** * Creates a BizAccountLinkInfo message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof VnameCert.BizAccountLinkInfo * @static * @param {Object.<string,*>} object Plain object * @returns {VnameCert.BizAccountLinkInfo} BizAccountLinkInfo */ BizAccountLinkInfo.fromObject = function fromObject(object) { if (object instanceof $root.VnameCert.BizAccountLinkInfo) return object; var message = new $root.VnameCert.BizAccountLinkInfo(); if (object.whatsappBizAcctFbid != null) if ($util.Long) (message.whatsappBizAcctFbid = $util.Long.fromValue(object.whatsappBizAcctFbid)).unsigned = true; else if (typeof object.whatsappBizAcctFbid === "string") message.whatsappBizAcctFbid = parseInt(object.whatsappBizAcctFbid, 10); else if (typeof object.whatsappBizAcctFbid === "number") message.whatsappBizAcctFbid = object.whatsappBizAcctFbid; else if (typeof object.whatsappBizAcctFbid === "object") message.whatsappBizAcctFbid = new $util.LongBits(object.whatsappBizAcctFbid.low >>> 0, object.whatsappBizAcctFbid.high >>> 0).toNumber(true); if (object.whatsappAcctNumber != null) message.whatsappAcctNumber = String(object.whatsappAcctNumber); if (object.issueTime != null) if ($util.Long) (message.issueTime = $util.Long.fromValue(object.issueTime)).unsigned = true; else if (typeof object.issueTime === "string") message.issueTime = parseInt(object.issueTime, 10); else if (typeof object.issueTime === "number") message.issueTime = object.issueTime; else if (typeof object.issueTime === "object") message.issueTime = new $util.LongBits(object.issueTime.low >>> 0, object.issueTime.high >>> 0).toNumber(true); switch (object.hostStorage) { default: if (typeof object.hostStorage === "number") { message.hostStorage = object.hostStorage; break; } break; case "ON_PREMISE": case 0: message.hostStorage = 0; break; case "FACEBOOK": case 1: message.hostStorage = 1; break; } switch (object.accountType) { default: if (typeof object.accountType === "number") { message.accountType = object.accountType; break; } break; case "ENTERPRISE": case 0: message.accountType = 0; break; } return message; }; /** * Creates a plain object from a BizAccountLinkInfo message. Also converts values to other types if specified. * @function toObject * @memberof VnameCert.BizAccountLinkInfo * @static * @param {VnameCert.BizAccountLinkInfo} message BizAccountLinkInfo * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.<string,*>} Plain object */ BizAccountLinkInfo.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (message.whatsappBizAcctFbid != null && message.hasOwnProperty("whatsappBizAcctFbid")) { if (typeof message.whatsappBizAcctFbid === "number") object.whatsappBizAcctFbid = options.longs === String ? String(message.whatsappBizAcctFbid) : message.whatsappBizAcctFbid; else object.whatsappBizAcctFbid = options.longs === String ? $util.Long.prototype.toString.call(message.whatsappBizAcctFbid) : options.longs === Number ? new $util.LongBits(message.whatsappBizAcctFbid.low >>> 0, message.whatsappBizAcctFbid.high >>> 0).toNumber(true) : message.whatsappBizAcctFbid; if (options.oneofs) object._whatsappBizAcctFbid = "whatsappBizAcctFbid"; } if (message.whatsappAcctNumber != null && message.hasOwnProperty("whatsappAcctNumber")) { object.whatsappAcctNumber = message.whatsappAcctNumber; if (options.oneofs) object._whatsappAcctNumber = "whatsappAcctNumber"; } if (message.issueTime != null && message.hasOwnProperty("issueTime")) { if (typeof message.issueTime === "number") object.issueTime = options.longs === String ? String(message.issueTime) : message.issueTime; else object.issueTime = options.longs === String ? $util.Long.prototype.toString.call(message.issueTime) : options.longs === Number ? new $util.LongBits(message.issueTime.low >>> 0, message.issueTime.high >>> 0).toNumber(true) : message.issueTime; if (options.oneofs) object._issueTime = "issueTime"; } if (message.hostStorage != null && message.hasOwnProperty("hostStorage")) { object.hostStorage = options.enums === String ? $root.VnameCert.BizAccountLinkInfo.HostStorageType[message.hostStorage] === undefined ? message.hostStorage : $root.VnameCert.BizAccountLinkInfo.HostStorageType[message.hostStorage] : message.hostStorage; if (options.oneofs) object._hostStorage = "hostStorage"; } if (message.accountType != null && message.hasOwnProperty("accountType")) { object.accountType = options.enums === String ? $root.VnameCert.BizAccountLinkInfo.AccountType[message.accountType] === undefined ? message.accountType : $root.VnameCert.BizAccountLinkInfo.AccountType[message.accountType] : message.accountType; if (options.oneofs) object._accountType = "accountType"; } return object; }; /** * Converts this BizAccountLinkInfo to JSON. * @function toJSON * @memberof VnameCert.BizAccountLinkInfo * @instance * @returns {Object.<string,*>} JSON object */ BizAccountLinkInfo.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** * Gets the default type url for BizAccountLinkInfo * @function getTypeUrl * @memberof VnameCert.BizAccountLinkInfo * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ BizAccountLinkInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } return typeUrlPrefix + "/VnameCert.BizAccountLinkInfo"; }; /** * AccountType enum. * @name VnameCert.BizAccountLinkInfo.AccountType * @enum {number} * @property {number} ENTERPRISE=0 ENTERPRISE value */ BizAccountLinkInfo.AccountType = (function() { var valuesById = {}, values = Object.create(valuesById); values[valuesById[0] = "ENTERPRISE"] = 0; return values; })(); /** * HostStorageType enum. * @name VnameCert.BizAccountLinkInfo.HostStorageType * @enum {number} * @property {number} ON_PREMISE=0 ON_PREMISE value * @property {number} FACEBOOK=1 FACEBOOK value */ BizAccountLinkInfo.HostStorageType = (function() { var valuesById = {}, values = Object.create(valuesById); values[valuesById[0] = "ON_PREMISE"] = 0; values[valuesById[1] = "FACEBOOK"] = 1; return values; })(); return BizAccountLinkInfo; })(); VnameCert.BizAccountPayload = (function() { /** * Properties of a BizAccountPayload. * @memberof VnameCert * @interface IBizAccountPayload * @property {VnameCert.IVerifiedNameCertificate|null} [vnameCert] BizAccountPayload vnameCert * @property {Uint8Array|null} [bizAcctLinkInfo] BizAccountPayload bizAcctLinkInfo */ /** * Constructs a new BizAccountPayload. * @memberof VnameCert * @classdesc Represents a BizAccountPayload. * @implements IBizAccountPayload * @constructor * @param {VnameCert.IBizAccountPayload=} [properties] Properties to set */ function BizAccountPayload(properties) { if (properties) for (var keys = Object.keys