neroxbailx
Version:
baileys whatsapp-api
1,538 lines • 215 kB
JavaScript
/*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.Wa6 = (function() {
/**
* Namespace Wa6.
* @exports Wa6
* @namespace
*/
var Wa6 = {};
Wa6.ClientPayload = (function() {
/**
* Properties of a ClientPayload.
* @memberof Wa6
* @interface IClientPayload
* @property {number|Long|null} [username] ClientPayload username
* @property {boolean|null} [passive] ClientPayload passive
* @property {Wa6.ClientPayload.IUserAgent|null} [userAgent] ClientPayload userAgent
* @property {Wa6.ClientPayload.IWebInfo|null} [webInfo] ClientPayload webInfo
* @property {string|null} [pushName] ClientPayload pushName
* @property {number|null} [sessionId] ClientPayload sessionId
* @property {boolean|null} [shortConnect] ClientPayload shortConnect
* @property {Wa6.ClientPayload.ConnectType|null} [connectType] ClientPayload connectType
* @property {Wa6.ClientPayload.ConnectReason|null} [connectReason] ClientPayload connectReason
* @property {Array.<number>|null} [shards] ClientPayload shards
* @property {Wa6.ClientPayload.IDNSSource|null} [dnsSource] ClientPayload dnsSource
* @property {number|null} [connectAttemptCount] ClientPayload connectAttemptCount
* @property {number|null} [device] ClientPayload device
* @property {Wa6.ClientPayload.IDevicePairingRegistrationData|null} [devicePairingData] ClientPayload devicePairingData
* @property {Wa6.ClientPayload.Product|null} [product] ClientPayload product
* @property {Uint8Array|null} [fbCat] ClientPayload fbCat
* @property {Uint8Array|null} [fbUserAgent] ClientPayload fbUserAgent
* @property {boolean|null} [oc] ClientPayload oc
* @property {number|null} [lc] ClientPayload lc
* @property {Wa6.ClientPayload.IOSAppExtension|null} [iosAppExtension] ClientPayload iosAppExtension
* @property {number|Long|null} [fbAppId] ClientPayload fbAppId
* @property {Uint8Array|null} [fbDeviceId] ClientPayload fbDeviceId
* @property {boolean|null} [pull] ClientPayload pull
* @property {Uint8Array|null} [paddingBytes] ClientPayload paddingBytes
* @property {number|null} [yearClass] ClientPayload yearClass
* @property {number|null} [memClass] ClientPayload memClass
* @property {Wa6.ClientPayload.IInteropData|null} [interopData] ClientPayload interopData
* @property {Wa6.ClientPayload.TrafficAnonymization|null} [trafficAnonymization] ClientPayload trafficAnonymization
* @property {boolean|null} [lidDbMigrated] ClientPayload lidDbMigrated
* @property {Wa6.ClientPayload.AccountType|null} [accountType] ClientPayload accountType
*/
/**
* Constructs a new ClientPayload.
* @memberof Wa6
* @classdesc Represents a ClientPayload.
* @implements IClientPayload
* @constructor
* @param {Wa6.IClientPayload=} [properties] Properties to set
*/
function ClientPayload(properties) {
this.shards = [];
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]];
}
/**
* ClientPayload username.
* @member {number|Long|null|undefined} username
* @memberof Wa6.ClientPayload
* @instance
*/
ClientPayload.prototype.username = null;
/**
* ClientPayload passive.
* @member {boolean|null|undefined} passive
* @memberof Wa6.ClientPayload
* @instance
*/
ClientPayload.prototype.passive = null;
/**
* ClientPayload userAgent.
* @member {Wa6.ClientPayload.IUserAgent|null|undefined} userAgent
* @memberof Wa6.ClientPayload
* @instance
*/
ClientPayload.prototype.userAgent = null;
/**
* ClientPayload webInfo.
* @member {Wa6.ClientPayload.IWebInfo|null|undefined} webInfo
* @memberof Wa6.ClientPayload
* @instance
*/
ClientPayload.prototype.webInfo = null;
/**
* ClientPayload pushName.
* @member {string|null|undefined} pushName
* @memberof Wa6.ClientPayload
* @instance
*/
ClientPayload.prototype.pushName = null;
/**
* ClientPayload sessionId.
* @member {number|null|undefined} sessionId
* @memberof Wa6.ClientPayload
* @instance
*/
ClientPayload.prototype.sessionId = null;
/**
* ClientPayload shortConnect.
* @member {boolean|null|undefined} shortConnect
* @memberof Wa6.ClientPayload
* @instance
*/
ClientPayload.prototype.shortConnect = null;
/**
* ClientPayload connectType.
* @member {Wa6.ClientPayload.ConnectType|null|undefined} connectType
* @memberof Wa6.ClientPayload
* @instance
*/
ClientPayload.prototype.connectType = null;
/**
* ClientPayload connectReason.
* @member {Wa6.ClientPayload.ConnectReason|null|undefined} connectReason
* @memberof Wa6.ClientPayload
* @instance
*/
ClientPayload.prototype.connectReason = null;
/**
* ClientPayload shards.
* @member {Array.<number>} shards
* @memberof Wa6.ClientPayload
* @instance
*/
ClientPayload.prototype.shards = $util.emptyArray;
/**
* ClientPayload dnsSource.
* @member {Wa6.ClientPayload.IDNSSource|null|undefined} dnsSource
* @memberof Wa6.ClientPayload
* @instance
*/
ClientPayload.prototype.dnsSource = null;
/**
* ClientPayload connectAttemptCount.
* @member {number|null|undefined} connectAttemptCount
* @memberof Wa6.ClientPayload
* @instance
*/
ClientPayload.prototype.connectAttemptCount = null;
/**
* ClientPayload device.
* @member {number|null|undefined} device
* @memberof Wa6.ClientPayload
* @instance
*/
ClientPayload.prototype.device = null;
/**
* ClientPayload devicePairingData.
* @member {Wa6.ClientPayload.IDevicePairingRegistrationData|null|undefined} devicePairingData
* @memberof Wa6.ClientPayload
* @instance
*/
ClientPayload.prototype.devicePairingData = null;
/**
* ClientPayload product.
* @member {Wa6.ClientPayload.Product|null|undefined} product
* @memberof Wa6.ClientPayload
* @instance
*/
ClientPayload.prototype.product = null;
/**
* ClientPayload fbCat.
* @member {Uint8Array|null|undefined} fbCat
* @memberof Wa6.ClientPayload
* @instance
*/
ClientPayload.prototype.fbCat = null;
/**
* ClientPayload fbUserAgent.
* @member {Uint8Array|null|undefined} fbUserAgent
* @memberof Wa6.ClientPayload
* @instance
*/
ClientPayload.prototype.fbUserAgent = null;
/**
* ClientPayload oc.
* @member {boolean|null|undefined} oc
* @memberof Wa6.ClientPayload
* @instance
*/
ClientPayload.prototype.oc = null;
/**
* ClientPayload lc.
* @member {number|null|undefined} lc
* @memberof Wa6.ClientPayload
* @instance
*/
ClientPayload.prototype.lc = null;
/**
* ClientPayload iosAppExtension.
* @member {Wa6.ClientPayload.IOSAppExtension|null|undefined} iosAppExtension
* @memberof Wa6.ClientPayload
* @instance
*/
ClientPayload.prototype.iosAppExtension = null;
/**
* ClientPayload fbAppId.
* @member {number|Long|null|undefined} fbAppId
* @memberof Wa6.ClientPayload
* @instance
*/
ClientPayload.prototype.fbAppId = null;
/**
* ClientPayload fbDeviceId.
* @member {Uint8Array|null|undefined} fbDeviceId
* @memberof Wa6.ClientPayload
* @instance
*/
ClientPayload.prototype.fbDeviceId = null;
/**
* ClientPayload pull.
* @member {boolean|null|undefined} pull
* @memberof Wa6.ClientPayload
* @instance
*/
ClientPayload.prototype.pull = null;
/**
* ClientPayload paddingBytes.
* @member {Uint8Array|null|undefined} paddingBytes
* @memberof Wa6.ClientPayload
* @instance
*/
ClientPayload.prototype.paddingBytes = null;
/**
* ClientPayload yearClass.
* @member {number|null|undefined} yearClass
* @memberof Wa6.ClientPayload
* @instance
*/
ClientPayload.prototype.yearClass = null;
/**
* ClientPayload memClass.
* @member {number|null|undefined} memClass
* @memberof Wa6.ClientPayload
* @instance
*/
ClientPayload.prototype.memClass = null;
/**
* ClientPayload interopData.
* @member {Wa6.ClientPayload.IInteropData|null|undefined} interopData
* @memberof Wa6.ClientPayload
* @instance
*/
ClientPayload.prototype.interopData = null;
/**
* ClientPayload trafficAnonymization.
* @member {Wa6.ClientPayload.TrafficAnonymization|null|undefined} trafficAnonymization
* @memberof Wa6.ClientPayload
* @instance
*/
ClientPayload.prototype.trafficAnonymization = null;
/**
* ClientPayload lidDbMigrated.
* @member {boolean|null|undefined} lidDbMigrated
* @memberof Wa6.ClientPayload
* @instance
*/
ClientPayload.prototype.lidDbMigrated = null;
/**
* ClientPayload accountType.
* @member {Wa6.ClientPayload.AccountType|null|undefined} accountType
* @memberof Wa6.ClientPayload
* @instance
*/
ClientPayload.prototype.accountType = null;
// OneOf field names bound to virtual getters and setters
var $oneOfFields;
/**
* ClientPayload _username.
* @member {"username"|undefined} _username
* @memberof Wa6.ClientPayload
* @instance
*/
Object.defineProperty(ClientPayload.prototype, "_username", {
get: $util.oneOfGetter($oneOfFields = ["username"]),
set: $util.oneOfSetter($oneOfFields)
});
/**
* ClientPayload _passive.
* @member {"passive"|undefined} _passive
* @memberof Wa6.ClientPayload
* @instance
*/
Object.defineProperty(ClientPayload.prototype, "_passive", {
get: $util.oneOfGetter($oneOfFields = ["passive"]),
set: $util.oneOfSetter($oneOfFields)
});
/**
* ClientPayload _userAgent.
* @member {"userAgent"|undefined} _userAgent
* @memberof Wa6.ClientPayload
* @instance
*/
Object.defineProperty(ClientPayload.prototype, "_userAgent", {
get: $util.oneOfGetter($oneOfFields = ["userAgent"]),
set: $util.oneOfSetter($oneOfFields)
});
/**
* ClientPayload _webInfo.
* @member {"webInfo"|undefined} _webInfo
* @memberof Wa6.ClientPayload
* @instance
*/
Object.defineProperty(ClientPayload.prototype, "_webInfo", {
get: $util.oneOfGetter($oneOfFields = ["webInfo"]),
set: $util.oneOfSetter($oneOfFields)
});
/**
* ClientPayload _pushName.
* @member {"pushName"|undefined} _pushName
* @memberof Wa6.ClientPayload
* @instance
*/
Object.defineProperty(ClientPayload.prototype, "_pushName", {
get: $util.oneOfGetter($oneOfFields = ["pushName"]),
set: $util.oneOfSetter($oneOfFields)
});
/**
* ClientPayload _sessionId.
* @member {"sessionId"|undefined} _sessionId
* @memberof Wa6.ClientPayload
* @instance
*/
Object.defineProperty(ClientPayload.prototype, "_sessionId", {
get: $util.oneOfGetter($oneOfFields = ["sessionId"]),
set: $util.oneOfSetter($oneOfFields)
});
/**
* ClientPayload _shortConnect.
* @member {"shortConnect"|undefined} _shortConnect
* @memberof Wa6.ClientPayload
* @instance
*/
Object.defineProperty(ClientPayload.prototype, "_shortConnect", {
get: $util.oneOfGetter($oneOfFields = ["shortConnect"]),
set: $util.oneOfSetter($oneOfFields)
});
/**
* ClientPayload _connectType.
* @member {"connectType"|undefined} _connectType
* @memberof Wa6.ClientPayload
* @instance
*/
Object.defineProperty(ClientPayload.prototype, "_connectType", {
get: $util.oneOfGetter($oneOfFields = ["connectType"]),
set: $util.oneOfSetter($oneOfFields)
});
/**
* ClientPayload _connectReason.
* @member {"connectReason"|undefined} _connectReason
* @memberof Wa6.ClientPayload
* @instance
*/
Object.defineProperty(ClientPayload.prototype, "_connectReason", {
get: $util.oneOfGetter($oneOfFields = ["connectReason"]),
set: $util.oneOfSetter($oneOfFields)
});
/**
* ClientPayload _dnsSource.
* @member {"dnsSource"|undefined} _dnsSource
* @memberof Wa6.ClientPayload
* @instance
*/
Object.defineProperty(ClientPayload.prototype, "_dnsSource", {
get: $util.oneOfGetter($oneOfFields = ["dnsSource"]),
set: $util.oneOfSetter($oneOfFields)
});
/**
* ClientPayload _connectAttemptCount.
* @member {"connectAttemptCount"|undefined} _connectAttemptCount
* @memberof Wa6.ClientPayload
* @instance
*/
Object.defineProperty(ClientPayload.prototype, "_connectAttemptCount", {
get: $util.oneOfGetter($oneOfFields = ["connectAttemptCount"]),
set: $util.oneOfSetter($oneOfFields)
});
/**
* ClientPayload _device.
* @member {"device"|undefined} _device
* @memberof Wa6.ClientPayload
* @instance
*/
Object.defineProperty(ClientPayload.prototype, "_device", {
get: $util.oneOfGetter($oneOfFields = ["device"]),
set: $util.oneOfSetter($oneOfFields)
});
/**
* ClientPayload _devicePairingData.
* @member {"devicePairingData"|undefined} _devicePairingData
* @memberof Wa6.ClientPayload
* @instance
*/
Object.defineProperty(ClientPayload.prototype, "_devicePairingData", {
get: $util.oneOfGetter($oneOfFields = ["devicePairingData"]),
set: $util.oneOfSetter($oneOfFields)
});
/**
* ClientPayload _product.
* @member {"product"|undefined} _product
* @memberof Wa6.ClientPayload
* @instance
*/
Object.defineProperty(ClientPayload.prototype, "_product", {
get: $util.oneOfGetter($oneOfFields = ["product"]),
set: $util.oneOfSetter($oneOfFields)
});
/**
* ClientPayload _fbCat.
* @member {"fbCat"|undefined} _fbCat
* @memberof Wa6.ClientPayload
* @instance
*/
Object.defineProperty(ClientPayload.prototype, "_fbCat", {
get: $util.oneOfGetter($oneOfFields = ["fbCat"]),
set: $util.oneOfSetter($oneOfFields)
});
/**
* ClientPayload _fbUserAgent.
* @member {"fbUserAgent"|undefined} _fbUserAgent
* @memberof Wa6.ClientPayload
* @instance
*/
Object.defineProperty(ClientPayload.prototype, "_fbUserAgent", {
get: $util.oneOfGetter($oneOfFields = ["fbUserAgent"]),
set: $util.oneOfSetter($oneOfFields)
});
/**
* ClientPayload _oc.
* @member {"oc"|undefined} _oc
* @memberof Wa6.ClientPayload
* @instance
*/
Object.defineProperty(ClientPayload.prototype, "_oc", {
get: $util.oneOfGetter($oneOfFields = ["oc"]),
set: $util.oneOfSetter($oneOfFields)
});
/**
* ClientPayload _lc.
* @member {"lc"|undefined} _lc
* @memberof Wa6.ClientPayload
* @instance
*/
Object.defineProperty(ClientPayload.prototype, "_lc", {
get: $util.oneOfGetter($oneOfFields = ["lc"]),
set: $util.oneOfSetter($oneOfFields)
});
/**
* ClientPayload _iosAppExtension.
* @member {"iosAppExtension"|undefined} _iosAppExtension
* @memberof Wa6.ClientPayload
* @instance
*/
Object.defineProperty(ClientPayload.prototype, "_iosAppExtension", {
get: $util.oneOfGetter($oneOfFields = ["iosAppExtension"]),
set: $util.oneOfSetter($oneOfFields)
});
/**
* ClientPayload _fbAppId.
* @member {"fbAppId"|undefined} _fbAppId
* @memberof Wa6.ClientPayload
* @instance
*/
Object.defineProperty(ClientPayload.prototype, "_fbAppId", {
get: $util.oneOfGetter($oneOfFields = ["fbAppId"]),
set: $util.oneOfSetter($oneOfFields)
});
/**
* ClientPayload _fbDeviceId.
* @member {"fbDeviceId"|undefined} _fbDeviceId
* @memberof Wa6.ClientPayload
* @instance
*/
Object.defineProperty(ClientPayload.prototype, "_fbDeviceId", {
get: $util.oneOfGetter($oneOfFields = ["fbDeviceId"]),
set: $util.oneOfSetter($oneOfFields)
});
/**
* ClientPayload _pull.
* @member {"pull"|undefined} _pull
* @memberof Wa6.ClientPayload
* @instance
*/
Object.defineProperty(ClientPayload.prototype, "_pull", {
get: $util.oneOfGetter($oneOfFields = ["pull"]),
set: $util.oneOfSetter($oneOfFields)
});
/**
* ClientPayload _paddingBytes.
* @member {"paddingBytes"|undefined} _paddingBytes
* @memberof Wa6.ClientPayload
* @instance
*/
Object.defineProperty(ClientPayload.prototype, "_paddingBytes", {
get: $util.oneOfGetter($oneOfFields = ["paddingBytes"]),
set: $util.oneOfSetter($oneOfFields)
});
/**
* ClientPayload _yearClass.
* @member {"yearClass"|undefined} _yearClass
* @memberof Wa6.ClientPayload
* @instance
*/
Object.defineProperty(ClientPayload.prototype, "_yearClass", {
get: $util.oneOfGetter($oneOfFields = ["yearClass"]),
set: $util.oneOfSetter($oneOfFields)
});
/**
* ClientPayload _memClass.
* @member {"memClass"|undefined} _memClass
* @memberof Wa6.ClientPayload
* @instance
*/
Object.defineProperty(ClientPayload.prototype, "_memClass", {
get: $util.oneOfGetter($oneOfFields = ["memClass"]),
set: $util.oneOfSetter($oneOfFields)
});
/**
* ClientPayload _interopData.
* @member {"interopData"|undefined} _interopData
* @memberof Wa6.ClientPayload
* @instance
*/
Object.defineProperty(ClientPayload.prototype, "_interopData", {
get: $util.oneOfGetter($oneOfFields = ["interopData"]),
set: $util.oneOfSetter($oneOfFields)
});
/**
* ClientPayload _trafficAnonymization.
* @member {"trafficAnonymization"|undefined} _trafficAnonymization
* @memberof Wa6.ClientPayload
* @instance
*/
Object.defineProperty(ClientPayload.prototype, "_trafficAnonymization", {
get: $util.oneOfGetter($oneOfFields = ["trafficAnonymization"]),
set: $util.oneOfSetter($oneOfFields)
});
/**
* ClientPayload _lidDbMigrated.
* @member {"lidDbMigrated"|undefined} _lidDbMigrated
* @memberof Wa6.ClientPayload
* @instance
*/
Object.defineProperty(ClientPayload.prototype, "_lidDbMigrated", {
get: $util.oneOfGetter($oneOfFields = ["lidDbMigrated"]),
set: $util.oneOfSetter($oneOfFields)
});
/**
* ClientPayload _accountType.
* @member {"accountType"|undefined} _accountType
* @memberof Wa6.ClientPayload
* @instance
*/
Object.defineProperty(ClientPayload.prototype, "_accountType", {
get: $util.oneOfGetter($oneOfFields = ["accountType"]),
set: $util.oneOfSetter($oneOfFields)
});
/**
* Creates a new ClientPayload instance using the specified properties.
* @function create
* @memberof Wa6.ClientPayload
* @static
* @param {Wa6.IClientPayload=} [properties] Properties to set
* @returns {Wa6.ClientPayload} ClientPayload instance
*/
ClientPayload.create = function create(properties) {
return new ClientPayload(properties);
};
/**
* Encodes the specified ClientPayload message. Does not implicitly {@link Wa6.ClientPayload.verify|verify} messages.
* @function encode
* @memberof Wa6.ClientPayload
* @static
* @param {Wa6.IClientPayload} message ClientPayload message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ClientPayload.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.username != null && Object.hasOwnProperty.call(message, "username"))
writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.username);
if (message.passive != null && Object.hasOwnProperty.call(message, "passive"))
writer.uint32(/* id 3, wireType 0 =*/24).bool(message.passive);
if (message.userAgent != null && Object.hasOwnProperty.call(message, "userAgent"))
$root.Wa6.ClientPayload.UserAgent.encode(message.userAgent, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();
if (message.webInfo != null && Object.hasOwnProperty.call(message, "webInfo"))
$root.Wa6.ClientPayload.WebInfo.encode(message.webInfo, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();
if (message.pushName != null && Object.hasOwnProperty.call(message, "pushName"))
writer.uint32(/* id 7, wireType 2 =*/58).string(message.pushName);
if (message.sessionId != null && Object.hasOwnProperty.call(message, "sessionId"))
writer.uint32(/* id 9, wireType 5 =*/77).sfixed32(message.sessionId);
if (message.shortConnect != null && Object.hasOwnProperty.call(message, "shortConnect"))
writer.uint32(/* id 10, wireType 0 =*/80).bool(message.shortConnect);
if (message.connectType != null && Object.hasOwnProperty.call(message, "connectType"))
writer.uint32(/* id 12, wireType 0 =*/96).int32(message.connectType);
if (message.connectReason != null && Object.hasOwnProperty.call(message, "connectReason"))
writer.uint32(/* id 13, wireType 0 =*/104).int32(message.connectReason);
if (message.shards != null && message.shards.length) {
writer.uint32(/* id 14, wireType 2 =*/114).fork();
for (var i = 0; i < message.shards.length; ++i)
writer.int32(message.shards[i]);
writer.ldelim();
}
if (message.dnsSource != null && Object.hasOwnProperty.call(message, "dnsSource"))
$root.Wa6.ClientPayload.DNSSource.encode(message.dnsSource, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim();
if (message.connectAttemptCount != null && Object.hasOwnProperty.call(message, "connectAttemptCount"))
writer.uint32(/* id 16, wireType 0 =*/128).uint32(message.connectAttemptCount);
if (message.device != null && Object.hasOwnProperty.call(message, "device"))
writer.uint32(/* id 18, wireType 0 =*/144).uint32(message.device);
if (message.devicePairingData != null && Object.hasOwnProperty.call(message, "devicePairingData"))
$root.Wa6.ClientPayload.DevicePairingRegistrationData.encode(message.devicePairingData, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim();
if (message.product != null && Object.hasOwnProperty.call(message, "product"))
writer.uint32(/* id 20, wireType 0 =*/160).int32(message.product);
if (message.fbCat != null && Object.hasOwnProperty.call(message, "fbCat"))
writer.uint32(/* id 21, wireType 2 =*/170).bytes(message.fbCat);
if (message.fbUserAgent != null && Object.hasOwnProperty.call(message, "fbUserAgent"))
writer.uint32(/* id 22, wireType 2 =*/178).bytes(message.fbUserAgent);
if (message.oc != null && Object.hasOwnProperty.call(message, "oc"))
writer.uint32(/* id 23, wireType 0 =*/184).bool(message.oc);
if (message.lc != null && Object.hasOwnProperty.call(message, "lc"))
writer.uint32(/* id 24, wireType 0 =*/192).int32(message.lc);
if (message.iosAppExtension != null && Object.hasOwnProperty.call(message, "iosAppExtension"))
writer.uint32(/* id 30, wireType 0 =*/240).int32(message.iosAppExtension);
if (message.fbAppId != null && Object.hasOwnProperty.call(message, "fbAppId"))
writer.uint32(/* id 31, wireType 0 =*/248).uint64(message.fbAppId);
if (message.fbDeviceId != null && Object.hasOwnProperty.call(message, "fbDeviceId"))
writer.uint32(/* id 32, wireType 2 =*/258).bytes(message.fbDeviceId);
if (message.pull != null && Object.hasOwnProperty.call(message, "pull"))
writer.uint32(/* id 33, wireType 0 =*/264).bool(message.pull);
if (message.paddingBytes != null && Object.hasOwnProperty.call(message, "paddingBytes"))
writer.uint32(/* id 34, wireType 2 =*/274).bytes(message.paddingBytes);
if (message.yearClass != null && Object.hasOwnProperty.call(message, "yearClass"))
writer.uint32(/* id 36, wireType 0 =*/288).int32(message.yearClass);
if (message.memClass != null && Object.hasOwnProperty.call(message, "memClass"))
writer.uint32(/* id 37, wireType 0 =*/296).int32(message.memClass);
if (message.interopData != null && Object.hasOwnProperty.call(message, "interopData"))
$root.Wa6.ClientPayload.InteropData.encode(message.interopData, writer.uint32(/* id 38, wireType 2 =*/306).fork()).ldelim();
if (message.trafficAnonymization != null && Object.hasOwnProperty.call(message, "trafficAnonymization"))
writer.uint32(/* id 40, wireType 0 =*/320).int32(message.trafficAnonymization);
if (message.lidDbMigrated != null && Object.hasOwnProperty.call(message, "lidDbMigrated"))
writer.uint32(/* id 41, wireType 0 =*/328).bool(message.lidDbMigrated);
if (message.accountType != null && Object.hasOwnProperty.call(message, "accountType"))
writer.uint32(/* id 42, wireType 0 =*/336).int32(message.accountType);
return writer;
};
/**
* Encodes the specified ClientPayload message, length delimited. Does not implicitly {@link Wa6.ClientPayload.verify|verify} messages.
* @function encodeDelimited
* @memberof Wa6.ClientPayload
* @static
* @param {Wa6.IClientPayload} message ClientPayload message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ClientPayload.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ClientPayload message from the specified reader or buffer.
* @function decode
* @memberof Wa6.ClientPayload
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {Wa6.ClientPayload} ClientPayload
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ClientPayload.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.Wa6.ClientPayload();
while (reader.pos < end) {
var tag = reader.uint32();
if (tag === error)
break;
switch (tag >>> 3) {
case 1: {
message.username = reader.uint64();
break;
}
case 3: {
message.passive = reader.bool();
break;
}
case 5: {
message.userAgent = $root.Wa6.ClientPayload.UserAgent.decode(reader, reader.uint32());
break;
}
case 6: {
message.webInfo = $root.Wa6.ClientPayload.WebInfo.decode(reader, reader.uint32());
break;
}
case 7: {
message.pushName = reader.string();
break;
}
case 9: {
message.sessionId = reader.sfixed32();
break;
}
case 10: {
message.shortConnect = reader.bool();
break;
}
case 12: {
message.connectType = reader.int32();
break;
}
case 13: {
message.connectReason = reader.int32();
break;
}
case 14: {
if (!(message.shards && message.shards.length))
message.shards = [];
if ((tag & 7) === 2) {
var end2 = reader.uint32() + reader.pos;
while (reader.pos < end2)
message.shards.push(reader.int32());
} else
message.shards.push(reader.int32());
break;
}
case 15: {
message.dnsSource = $root.Wa6.ClientPayload.DNSSource.decode(reader, reader.uint32());
break;
}
case 16: {
message.connectAttemptCount = reader.uint32();
break;
}
case 18: {
message.device = reader.uint32();
break;
}
case 19: {
message.devicePairingData = $root.Wa6.ClientPayload.DevicePairingRegistrationData.decode(reader, reader.uint32());
break;
}
case 20: {
message.product = reader.int32();
break;
}
case 21: {
message.fbCat = reader.bytes();
break;
}
case 22: {
message.fbUserAgent = reader.bytes();
break;
}
case 23: {
message.oc = reader.bool();
break;
}
case 24: {
message.lc = reader.int32();
break;
}
case 30: {
message.iosAppExtension = reader.int32();
break;
}
case 31: {
message.fbAppId = reader.uint64();
break;
}
case 32: {
message.fbDeviceId = reader.bytes();
break;
}
case 33: {
message.pull = reader.bool();
break;
}
case 34: {
message.paddingBytes = reader.bytes();
break;
}
case 36: {
message.yearClass = reader.int32();
break;
}
case 37: {
message.memClass = reader.int32();
break;
}
case 38: {
message.interopData = $root.Wa6.ClientPayload.InteropData.decode(reader, reader.uint32());
break;
}
case 40: {
message.trafficAnonymization = reader.int32();
break;
}
case 41: {
message.lidDbMigrated = reader.bool();
break;
}
case 42: {
message.accountType = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ClientPayload message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof Wa6.ClientPayload
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {Wa6.ClientPayload} ClientPayload
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ClientPayload.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ClientPayload message.
* @function verify
* @memberof Wa6.ClientPayload
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ClientPayload.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
var properties = {};
if (message.username != null && message.hasOwnProperty("username")) {
properties._username = 1;
if (!$util.isInteger(message.username) && !(message.username && $util.isInteger(message.username.low) && $util.isInteger(message.username.high)))
return "username: integer|Long expected";
}
if (message.passive != null && message.hasOwnProperty("passive")) {
properties._passive = 1;
if (typeof message.passive !== "boolean")
return "passive: boolean expected";
}
if (message.userAgent != null && message.hasOwnProperty("userAgent")) {
properties._userAgent = 1;
{
var error = $root.Wa6.ClientPayload.UserAgent.verify(message.userAgent);
if (error)
return "userAgent." + error;
}
}
if (message.webInfo != null && message.hasOwnProperty("webInfo")) {
properties._webInfo = 1;
{
var error = $root.Wa6.ClientPayload.WebInfo.verify(message.webInfo);
if (error)
return "webInfo." + error;
}
}
if (message.pushName != null && message.hasOwnProperty("pushName")) {
properties._pushName = 1;
if (!$util.isString(message.pushName))
return "pushName: string expected";
}
if (message.sessionId != null && message.hasOwnProperty("sessionId")) {
properties._sessionId = 1;
if (!$util.isInteger(message.sessionId))
return "sessionId: integer expected";
}
if (message.shortConnect != null && message.hasOwnProperty("shortConnect")) {
properties._shortConnect = 1;
if (typeof message.shortConnect !== "boolean")
return "shortConnect: boolean expected";
}
if (message.connectType != null && message.hasOwnProperty("connectType")) {
properties._connectType = 1;
switch (message.connectType) {
default:
return "connectType: enum value expected";
case 0:
case 1:
case 100:
case 101:
case 102:
case 103:
case 104:
case 105:
case 106:
case 107:
case 108:
case 109:
case 110:
case 111:
case 112:
break;
}
}
if (message.connectReason != null && message.hasOwnProperty("connectReason")) {
properties._connectReason = 1;
switch (message.connectReason) {
default:
return "connectReason: enum value expected";
case 0:
case 1:
case 2:
case 3:
case 4:
case 5:
case 6:
break;
}
}
if (message.shards != null && message.hasOwnProperty("shards")) {
if (!Array.isArray(message.shards))
return "shards: array expected";
for (var i = 0; i < message.shards.length; ++i)
if (!$util.isInteger(message.shards[i]))
return "shards: integer[] expected";
}
if (message.dnsSource != null && message.hasOwnProperty("dnsSource")) {
properties._dnsSource = 1;
{
var error = $root.Wa6.ClientPayload.DNSSource.verify(message.dnsSource);
if (error)
return "dnsSource." + error;
}
}
if (message.connectAttemptCount != null && message.hasOwnProperty("connectAttemptCount")) {
properties._connectAttemptCount = 1;
if (!$util.isInteger(message.connectAttemptCount))
return "connectAttemptCount: integer expected";
}
if (message.device != null && message.hasOwnProperty("device")) {
properties._device = 1;
if (!$util.isInteger(message.device))
return "device: integer expected";
}
if (message.devicePairingData != null && message.hasOwnProperty("devicePairingData")) {
properties._devicePairingData = 1;
{
var error = $root.Wa6.ClientPayload.DevicePairingRegistrationData.verify(message.devicePairingData);
if (error)
return "devicePairingData." + error;
}
}
if (message.product != null && message.hasOwnProperty("product")) {
properties._product = 1;
switch (message.product) {
default:
return "product: enum value expected";
case 0:
case 1:
case 2:
case 3:
case 4:
break;
}
}
if (message.fbCat != null && message.hasOwnProperty("fbCat")) {
properties._fbCat = 1;
if (!(message.fbCat && typeof message.fbCat.length === "number" || $util.isString(message.fbCat)))
return "fbCat: buffer expected";
}
if (message.fbUserAgent != null && message.hasOwnProperty("fbUserAgent")) {
properties._fbUserAgent = 1;
if (!(message.fbUserAgent && typeof message.fbUserAgent.length === "number" || $util.isString(message.fbUserAgent)))
return "fbUserAgent: buffer expected";
}
if (message.oc != null && message.hasOwnProperty("oc")) {
properties._oc = 1;
if (typeof message.oc !== "boolean")
return "oc: boolean expected";
}
if (message.lc != null && message.hasOwnProperty("lc")) {
properties._lc = 1;
if (!$util.isInteger(message.lc))
return "lc: integer expected";
}
if (message.iosAppExtension != null && message.hasOwnProperty("iosAppExtension")) {
properties._iosAppExtension = 1;
switch (message.iosAppExtension) {
default:
return "iosAppExtension: enum value expected";
case 0:
case 1:
case 2:
break;
}
}
if (message.fbAppId != null && message.hasOwnProperty("fbAppId")) {
properties._fbAppId = 1;
if (!$util.isInteger(message.fbAppId) && !(message.fbAppId && $util.isInteger(message.fbAppId.low) && $util.isInteger(message.fbAppId.high)))
return "fbAppId: integer|Long expected";
}
if (message.fbDeviceId != null && message.hasOwnProperty("fbDeviceId")) {
properties._fbDeviceId = 1;
if (!(message.fbDeviceId && typeof message.fbDeviceId.length === "number" || $util.isString(message.fbDeviceId)))
return "fbDeviceId: buffer expected";
}
if (message.pull != null && message.hasOwnProperty("pull")) {
properties._pull = 1;
if (typeof message.pull !== "boolean")
return "pull: boolean expected";
}
if (message.paddingBytes != null && message.hasOwnProperty("paddingBytes")) {
properties._paddingBytes = 1;
if (!(message.paddingBytes && typeof message.paddingBytes.length === "number" || $util.isString(message.paddingBytes)))
return "paddingBytes: buffer expected";
}
if (message.yearClass != null && message.hasOwnProperty("yearClass")) {
properties._yearClass = 1;
if (!$util.isInteger(message.yearClass))
return "yearClass: integer expected";
}
if (message.memClass != null && message.hasOwnProperty("memClass")) {
properties._memClass = 1;
if (!$util.isInteger(message.memClass))
return "memClass: integer expected";
}
if (message.interopData != null && message.hasOwnProperty("interopData")) {
properties._interopData = 1;
{
var error = $root.Wa6.ClientPayload.InteropData.verify(message.interopData);
if (error)
return "interopData." + error;
}
}
if (message.trafficAnonymization != null && message.hasOwnProperty("trafficAnonymization")) {
properties._trafficAnonymization = 1;
switch (message.trafficAnonymization) {
default:
return "trafficAnonymization: enum value expected";
case 0:
case 1:
break;
}
}
if (message.lidDbMigrated != null && message.hasOwnProperty("lidDbMigrated")) {
properties._lidDbMigrated = 1;
if (typeof message.lidDbMigrated !== "boolean")
return "lidDbMigrated: boolean expected";
}
if (message.accountType != null && message.hasOwnProperty("accountType")) {
properties._accountType = 1;
switch (message.accountType) {
default:
return "accountType: enum value expected";
case 0:
case 1:
break;
}
}
return null;
};
/**
* Creates a ClientPayload message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof Wa6.ClientPayload
* @static
* @param {Object.<string,*>} object Plain object
* @returns {Wa6.ClientPayload} ClientPayload
*/
ClientPayload.fromObject = function fromObject(object) {
if (object instanceof $root.Wa6.ClientPayload)
return object;
var message = new $root.Wa6.ClientPayload();
if (object.username != null)
if ($util.Long)
(message.username = $util.Long.fromValue(object.username)).unsigned = true;
else if (typeof object.username === "string")
message.username = parseInt(object.username, 10);
else if (typeof object.username === "number")
message.username = object.username;
else if (typeof object.username === "object")
message.username = new $util.LongBits(object.username.low >>> 0, object.username.high >>> 0).toNumber(true);
if (object.passive != null)
message.passive = Boolean(object.passive);
if (object.userAgent != null) {
if (typeof object.userAgent !== "object")
throw TypeError(".Wa6.ClientPayload.userAgent: object expected");
message.userAgent = $root.Wa6.ClientPayload.UserAgent.fromObject(object.userAgent);
}
if (object.webInfo != null) {
if (typeof object.webInfo !== "object")
throw TypeError(".Wa6.ClientPayload.webInfo: object expected");
message.webInfo = $root.Wa6.ClientPayload.WebInfo.fromObject(object.webInfo);
}
if (object.pushName != null)
message.pushName = String(object.pushName);
if (object.sessionId != null)
message.sessionId = object.sessionId | 0;
if (object.shortConnect != null)
message.shortConnect = Boolean(object.shortConnect);
switch (object.connectType) {
default:
if (typeof object.connectType === "number") {
message.connectType = object.connectType;
break;
}
break;
case "CELLULAR_UNKNOWN":
case 0:
message.connectType = 0;
break;
case "WIFI_UNKNOWN":
case 1:
message.connectType = 1;
break;
case "CELLULAR_EDGE":
case 100:
message.connectType = 100;
break;
case "CELLULAR_IDEN":
case 101:
message.connectType = 101;
break;
case "CELLULAR_UMTS":
case 102:
message.connectType = 102;
break;
case "CELLULAR_EVDO":
case 103:
message.connectType = 103;
break;
case "CELLULAR_GPRS":
case 104:
message.connectType = 104;
break;
case "CELLULAR_HSDPA":
case 105:
message.connectType = 105;
break;
case "CELLULAR_HSUPA":
case 106:
message.connectType = 106;
break;
case "CELLULAR_HSPA":
case 107:
message.connectType = 107;
break;
case "CELLULAR_CDMA":
case 108:
message.connectType = 108;
break;
case "CELLULAR_1XRTT":
case 109:
message.connectType = 109;
break;
case "CELLULAR_EHRPD":
case 110:
message.connectType = 110;
break;
case "CELLULAR_LTE":
case 111:
message.connectType = 111;
break;
case "CELLULAR_HSPAP":
case 112:
message.connectType = 112;
break;
}
switch (object.connectReason) {
default:
if (typeof object.connectReason === "number") {
message.connectReason = object.connectReason;
break;
}
break;
case "PUSH":
case 0:
message.connectReason = 0;
break;
case "USER_ACTIVATED":
case 1:
message.connectReason = 1;
break;
case "SCHEDULED":
case 2:
message.connectReason = 2;
break;
case "ERROR_RECONNECT":
case 3:
message.connectReason = 3;
break;
case "NETWORK_SWITCH":
case 4:
message.connectReason = 4;
break;
case "PING_RECONNECT":
case 5:
message.connectReason = 5;
break;
case "UNKNOWN":
case 6:
message.connectReason = 6;
break;
}
if (object.shards) {
if (!Array.isArray(object.shards))
throw TypeError(".Wa6.ClientPayload.shards: array expected");
message.shards = [];
for (var i = 0; i < object.shards.length; ++i)
message.shards[i] = object.shards[i] | 0;
}
if (object.dnsSource != null) {
if (typeof object.dnsSource !== "object")
throw TypeError(".Wa6.ClientPayload.dnsSource: object expected");
message.dnsSource = $root.Wa6.ClientPayload.DNSSource.fromObject(object.dnsSource);
}
if (object.connectAttemptCount != null)
message.connectAttemptCount = object.connectAttemptCount >>> 0;
if (object.device != null)
message.device = object.device >>> 0;
if (object.devicePairingData != null) {
if (typeof object.devicePairingData !== "object")
throw TypeError(".Wa6.ClientPayload.devicePairingData: object expected");
message.devicePairingData = $root.Wa6.ClientPayload.DevicePairingRegistrationData.fromObject(object.devicePairingData);
}
switch (object.product) {
default:
if (typeof object.product === "number") {
message.product = object.product;
break;
}
break;
case "WHATSAPP":
case 0:
message.product = 0;
break;
case "MESSENGER":
case 1:
message.product = 1;
break;
case "INTEROP":
case 2:
message.product = 2;
break;
case "INTEROP_MSGR":
case 3:
message.product = 3;
break;
case "WHATSAPP_LID":
case 4:
message.product = 4;
break;
}
if (object.fbCat != null)
if (typeof object.fbCat === "string")
$util.base64.decode(object.fbCat, message.fbCat = $util.newBuffer($util.base64.length(object.fbCat)), 0);
else if (object.fbCat.length >= 0)
message.fbCat = object.fbCat;
if (object.fbUserAgent != null)
if (typeof object.fbUserAgent === "string")
$util.base64.decode(object.fbUserAgent, message.fbUserAgent = $util.newBuffer($util.base64.length(object.fbUserAgent)), 0);
else if (object.fbUserAgent.length >= 0)
message.fbUserAgent = object.fbUserAgent;
if (object.oc != null)
message.oc = Boolean(object.oc);
if (object.lc != null)
message.lc = object.lc | 0;
switch (object.iosAppExtension) {
default:
if (typeof object.iosAppExtension === "number") {
message.iosAppExtension = object.iosAppExtension;
break;
}
break;
case "SHARE_EXTENSION":
case 0:
message.iosAppExtension = 0;
break;
case "SERVICE_EXTENSION":
case 1:
message.iosAppExtension = 1;
break;
case "INTENTS_EXTENSION":
case 2:
message.iosAppExtension = 2;
break;
}
if (object.fbAppId != null)
if ($util.Long)
(message.fbAppId = $util.Long.fromValue(object.fbAppId)).unsigned = true;
else if (typeof object.fbAppId === "string")
message.fbAppId = parseInt(object.fbAppId, 10);
else if (typeof object.fbAppId === "number")
message.fbAppId = object.fbAppId;
else if (typeof object.fbAppId === "object")
message.fbAppId = new $util.LongBits(object.fbAppId.low >>> 0, object.fbAppId.high >>> 0).toNumber(true);
if (object.fbDeviceId != null)
if (typeof object.fbDeviceId === "string")
$util.base64.decode(object.fbDeviceId, message.fbDeviceId = $util.newBuffer($util.base64.length(object.fbDeviceId)), 0);
else if (object.fbDeviceId.length >= 0)
message.fbDeviceId = object.fbDeviceId;
if (object.pull != null)
message.pull = Boolean(object.pull);
if (object.paddingBytes != null)
if (typeof object.paddingBytes === "string")
$util.base64.decode(object.paddingBytes, message.paddingBytes = $util.newBuffer($util.base64.length(object.paddingBytes)), 0);
else if (object.paddingBytes.length >= 0)
message.paddingBytes = object.paddingBytes;
if (object.yearClass != null)
message.yearClass = object.yearClass | 0;
if (object.memClass != null)
message.memClass = object.memClass | 0;
if (object.interopData != null) {
if (typeof object.interopData !== "object")
throw TypeError(".Wa6.ClientPayload.interopData: object expected");
message.interopData = $root.Wa6.ClientPayload.InteropData.fromObject(object.interopData);
}
switch (object.trafficAnonymization) {
default:
if (typeof object.trafficAnonymization === "number") {
message.trafficAnonymization = object.trafficAnonymization;
break;
}
break;
case "OFF":
case 0:
message.trafficAnonymization = 0;
break;
case "STANDARD":
case 1:
message.trafficAnonymization = 1;
break;
}
if (object.lidDbMigrated != null)
message.lidDbMigrated = Boolean(object.lidDbMigrated);
switch (object.accountType) {
default:
if (typeof object.accountType === "number") {
message.accountType = object.accountType;
break;
}
break;
case "DEFAULT":
case 0:
message.accountType = 0;
break;
case "GUEST":
case 1:
message.accountType = 1;
break;
}
return message;
};
/**
* Creates a plain object from a ClientPayload message. Also converts values to other types if specified.
* @function toObject
* @memberof Wa6.ClientPayload
* @static
* @param {Wa6.ClientPayload} message ClientPayload
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ClientPayload.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.arrays || options.defaults)
object.shards = [];
if (message.username != null && message.hasOwnProperty("username")) {
if (typeof message.username === "number")
object.username = options.longs === String ? String(message.username) : message.username;
else
object.username = options.longs === String ? $util.Long.prototype.toString.call(message.username) : options.longs === Number ? new $util.LongBits(message.username.low >>> 0, message.username.high >>> 0).toNumber(true) : message.username;
if (options.oneofs)
object._username = "username";
}
if (message.passive != null && message.hasOwnProperty("passive")) {
object.passive = message.passive;
if (options.oneofs)
object._passive = "passive";
}
if (message.userAgent != null && message.hasOwnProperty("userAgent")) {
object.userAgent = $root.Wa6.ClientPayload.UserAgent.toObject(message.userAgent, options);
if (options.oneofs)
object._userAgent = "userAgent";
}
if (message.webInfo != null && message.hasOwnProperty("webInfo")) {
object.webInfo = $root.Wa6.ClientPayload.WebInfo.toObject(message.webInfo, options);
if (options.oneofs)
object._webInfo = "webInfo";
}
if (message.pushName != null && message.hasOwnProperty("pushName")) {
object.pushName = message.pushName;
if (options.oneofs)
object._pushName = "pushName";
}
if (message.sessionId != null && message.hasOwnProperty("sessionId")) {
object.sessionId = message.sessionId;
if (options.oneofs)
object._sessionId = "sessionId";
}
if (message.shortConnect != null && message.hasOwnProperty("shortConnect")) {
object.shortConnect = message.shortConnect;
if (options.oneofs)
object._shortConnect = "shortConnect";
}
if (message.connectType != null && message.hasOwnProperty("connectType")) {
object.connectType = options.enums === String ? $root.Wa6.ClientPayload.ConnectType[message.connectType] === undefined ? message.connectType : $root.Wa6.ClientPayload.ConnectType[message.connectType] : message.connectType;
if (options.oneofs)
object._connectType = "connectType";
}
if (message.connectReason != null && message.hasOwnProperty("connectReason")) {
object.connectReason = options.enums === String ? $root.Wa6.ClientPayload.ConnectReason[message.connectReason] === undefined ? message.connectReason : $root.Wa6.ClientPayload.ConnectReason[message.connectReason] : message.connectReason;
if (options.oneofs)
object._connectReason = "connectReason";
}
if (message.shards && message.shards.length) {
object.shards = [];
for (var j = 0; j < message.shards.length; ++j)
object.shards[j] = message.shards[j];
}
if (message.dnsSource != null && message.hasOwnProperty("dnsSource")) {
object.dnsSource = $root.Wa6.ClientPayload.DNSSource.toObject(message.dnsSource, options);
if (options.oneofs)
object._dnsSource = "dnsSource";
}
if (message.connectAttemptCount != null && message.hasOwnProperty("connectAttemptCount")) {
object.connectAttemptCount = message.connectAttemptCount;
if (options.oneofs)
object._connectAttemptCount = "connectAttemptCount";
}
if (message.device != null && message.hasOwnProperty("device")) {
object.device = message.device;
if (options.oneofs)
object._device = "device";
}
if (message.devicePairingData != null && message.hasOwnProperty("devicePairingData")) {
object.devicePairingData = $root.Wa6.ClientPayload.DevicePairingRegistrationData.toObject(message.devicePairingData, options);
if (options.oneofs)
object._devicePairingData = "devicePairingData";
}
if (message.product != null && message.hasOwnProperty("product")) {
object.product = options.enums === String ? $root.Wa6.ClientPayload.Product[message.product] === undefined ? message.product : $root.Wa6.ClientPayload.Product[message.product] : message.product;
if (options.oneofs)
object._product = "product";
}
if (message.fbCat != null && message.hasOwnProperty("fbCat")) {
object.fbCat = options.bytes === String ? $util.base64.encode(message.fbCat, 0, message.fbCat.length) : options.bytes === Array ? Array.prototype.slice.call(message.fbCat) : message.fbCat;
if (options.oneofs)
object._fbCat = "fbCat";
}
if (message.fbUserAgent != null && message.hasOwnProperty("fbUserAgent")) {
object.fbUserAgent = options.bytes === String ? $util.base64.encode(message.fbUserAgent, 0, message.fbUserAgent.length) : options.bytes === Array ? Array.prototype.slice.call(message.fbUserAgent) : message.fbUserAgent;
if (options.oneofs)
object._fbUserAgent = "fbUserAgent";
}
if (message.oc != null && message.hasOwnProperty("oc")) {
object.oc = message.oc;
if (options.oneofs)
object._oc = "oc";
}
if (message.lc != null && message.hasOwnProperty("lc")) {
object.lc = message.lc;
if (options.oneofs)
object._lc = "lc";
}
if (message.iosAppExtension != null && message.hasOwnProperty("iosAppExtension")) {
object.iosAppExtension = options.enums === String ? $root.Wa6.ClientPayload.IOSAppExtension[message.iosAppExtension] === undefined ? message.iosAppExtension : $root.Wa6.ClientPayload.IOSAppExtension[message.iosAppExtension] : message.iosAppExtension;
if (options.oneofs)
object._iosAppExtension = "iosAppExtension";
}
if (message.fbAppId != null && message.hasOwnProperty("fbAppId")) {
if (typeof message.fbAppId === "number")
object.fbAppId = options.longs === String ? String(message.fbAppId) : message.fbAppId;
else
object.fbAppId = options.longs === String ? $util.Long.prototype.toString.call(message.fbAppId) : options.longs === Number ? new $util.LongBits(message.fbAppId.low >>> 0, message.fbAppId.high >>> 0).toNumber(true) : message.fbAppId;
if (options.oneofs)
object._fbAppId = "fbAppId";
}
if (message.fbDeviceId != null && message.hasOwnProperty("fbDeviceId")) {
object.fbDeviceId = options.bytes === String ? $util.base64.encode(message.fbDeviceId, 0, message.fbDeviceId.length) : options.bytes === Array ? Array.prototype.slice.call(message.fbDeviceId) : message.fbDeviceId;
if (options.oneofs)
object._fbDeviceId = "fbDeviceId";
}
if (message.pull != null && message.hasOwnProperty("pull")) {
object.pull = message.pull;
if (options.oneofs)
object._pull = "pull";
}
if (message.paddingBytes != null && message.hasOwnProperty("paddingBytes")) {
object.paddingBytes = options.bytes === String ? $util.base64.encode(message.paddingBytes, 0, message.paddingBytes.length) : options.bytes === Array ? Array.prototype.slice.call(message.paddingBytes) : message.paddingBytes;
if (options.oneofs)
object._paddingBytes = "paddingBytes";
}
if (message.yearClass != null && message.hasOwnProperty("yearClass")) {
object.yearClass = message.yearClass;
if (options.oneofs)
object._yearClass = "yearClass";
}
if (message.memClass != null && message.hasOwnProperty("memClass")) {
object.memClass = message.memClass;
if (options.oneofs)
object._memClass = "memClass";
}
if (message.interopData != null && message.hasOwnProperty("interopData")) {
object.interopData = $root.Wa6.ClientPayload.InteropData.toObject(message.interopData, options);
if (options.oneofs)
object._interopData = "interopData";
}
if (message.trafficAnonymization != null && message.hasOwnProperty("trafficAnonymization")) {
object.trafficAnonymization = options.enums === String ? $root.Wa6.ClientPayload.TrafficAnonymization[message.trafficAnonymization] === undefined ? message.trafficAnonymization : $root.Wa6.ClientPayload.TrafficAnonymization[message.trafficAnonymization] : message.trafficAnonymization;
if (options.oneofs)
object._trafficAnonymization = "trafficAnonymization";
}
if (message.lidDbMigrated != null && message.hasOwnProperty("lidDbMigrated")) {
object.lidDbMigrated = message.lidDbMigrated;
if (options.oneofs)
object._lidDbMigrated = "lidDbMigrated";
}
if (message.accountType != null && message.hasOwnProperty("accountType")) {
object.accountType = options.enums === String ? $root.Wa6.ClientPayload.AccountType[message.accountType] === undefined ? message.accountType : $root.Wa6.ClientPayload.AccountType[message.accountType] : message.accountType;
if (options.oneofs)
object._accountType = "accountType";
}
return object;
};
/**
* Converts this ClientPayload to JSON.
* @function to