17947 lines
675 KiB
JavaScript
17947 lines
675 KiB
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.js");
|
|
|
|
// Common aliases
|
|
var $Reader = $protobuf.Reader,
|
|
$Writer = $protobuf.Writer,
|
|
$util = $protobuf.util;
|
|
|
|
// Exported root namespace
|
|
var $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {});
|
|
|
|
$root.ProtoMsg = (function () {
|
|
/**
|
|
* Namespace ProtoMsg.
|
|
* @exports ProtoMsg
|
|
* @namespace
|
|
*/
|
|
var ProtoMsg = {};
|
|
|
|
ProtoMsg.CommonRsp = (function () {
|
|
/**
|
|
* Properties of a CommonRsp.
|
|
* @memberof ProtoMsg
|
|
* @interface ICommonRsp
|
|
* @property {ProtoMsg.ErrorCode|null} [RetCode] CommonRsp RetCode
|
|
* @property {string|null} [ErrMsg] CommonRsp ErrMsg
|
|
* @property {number|null} [MsgId] CommonRsp MsgId
|
|
* @property {number|null} [SubMsgId] CommonRsp SubMsgId
|
|
* @property {number|null} [DataType] CommonRsp DataType
|
|
* @property {string|null} [Data] CommonRsp Data
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new CommonRsp.
|
|
* @memberof ProtoMsg
|
|
* @classdesc Represents a CommonRsp.
|
|
* @implements ICommonRsp
|
|
* @constructor
|
|
* @param {ProtoMsg.ICommonRsp=} [properties] Properties to set
|
|
*/
|
|
function CommonRsp(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]];
|
|
}
|
|
|
|
/**
|
|
* CommonRsp RetCode.
|
|
* @member {ProtoMsg.ErrorCode} RetCode
|
|
* @memberof ProtoMsg.CommonRsp
|
|
* @instance
|
|
*/
|
|
CommonRsp.prototype.RetCode = 0;
|
|
|
|
/**
|
|
* CommonRsp ErrMsg.
|
|
* @member {string} ErrMsg
|
|
* @memberof ProtoMsg.CommonRsp
|
|
* @instance
|
|
*/
|
|
CommonRsp.prototype.ErrMsg = "";
|
|
|
|
/**
|
|
* CommonRsp MsgId.
|
|
* @member {number} MsgId
|
|
* @memberof ProtoMsg.CommonRsp
|
|
* @instance
|
|
*/
|
|
CommonRsp.prototype.MsgId = 0;
|
|
|
|
/**
|
|
* CommonRsp SubMsgId.
|
|
* @member {number} SubMsgId
|
|
* @memberof ProtoMsg.CommonRsp
|
|
* @instance
|
|
*/
|
|
CommonRsp.prototype.SubMsgId = 0;
|
|
|
|
/**
|
|
* CommonRsp DataType.
|
|
* @member {number} DataType
|
|
* @memberof ProtoMsg.CommonRsp
|
|
* @instance
|
|
*/
|
|
CommonRsp.prototype.DataType = 0;
|
|
|
|
/**
|
|
* CommonRsp Data.
|
|
* @member {string} Data
|
|
* @memberof ProtoMsg.CommonRsp
|
|
* @instance
|
|
*/
|
|
CommonRsp.prototype.Data = "";
|
|
|
|
/**
|
|
* Creates a new CommonRsp instance using the specified properties.
|
|
* @function create
|
|
* @memberof ProtoMsg.CommonRsp
|
|
* @static
|
|
* @param {ProtoMsg.ICommonRsp=} [properties] Properties to set
|
|
* @returns {ProtoMsg.CommonRsp} CommonRsp instance
|
|
*/
|
|
CommonRsp.create = function create(properties) {
|
|
return new CommonRsp(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified CommonRsp message. Does not implicitly {@link ProtoMsg.CommonRsp.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof ProtoMsg.CommonRsp
|
|
* @static
|
|
* @param {ProtoMsg.ICommonRsp} message CommonRsp message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
CommonRsp.encode = function encode(message, writer) {
|
|
if (!writer) writer = $Writer.create();
|
|
if (
|
|
message.RetCode != null &&
|
|
Object.hasOwnProperty.call(message, "RetCode")
|
|
)
|
|
writer.uint32(/* id 1, wireType 0 =*/ 8).int32(message.RetCode);
|
|
if (
|
|
message.ErrMsg != null &&
|
|
Object.hasOwnProperty.call(message, "ErrMsg")
|
|
)
|
|
writer.uint32(/* id 2, wireType 2 =*/ 18).string(message.ErrMsg);
|
|
if (message.MsgId != null && Object.hasOwnProperty.call(message, "MsgId"))
|
|
writer.uint32(/* id 3, wireType 0 =*/ 24).int32(message.MsgId);
|
|
if (
|
|
message.SubMsgId != null &&
|
|
Object.hasOwnProperty.call(message, "SubMsgId")
|
|
)
|
|
writer.uint32(/* id 4, wireType 0 =*/ 32).int32(message.SubMsgId);
|
|
if (
|
|
message.DataType != null &&
|
|
Object.hasOwnProperty.call(message, "DataType")
|
|
)
|
|
writer.uint32(/* id 5, wireType 0 =*/ 40).int32(message.DataType);
|
|
if (message.Data != null && Object.hasOwnProperty.call(message, "Data"))
|
|
writer.uint32(/* id 6, wireType 2 =*/ 50).string(message.Data);
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified CommonRsp message, length delimited. Does not implicitly {@link ProtoMsg.CommonRsp.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof ProtoMsg.CommonRsp
|
|
* @static
|
|
* @param {ProtoMsg.ICommonRsp} message CommonRsp message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
CommonRsp.encodeDelimited = function encodeDelimited(message, writer) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes a CommonRsp message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof ProtoMsg.CommonRsp
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {ProtoMsg.CommonRsp} CommonRsp
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
CommonRsp.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.ProtoMsg.CommonRsp();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
if (tag === error) break;
|
|
switch (tag >>> 3) {
|
|
case 1: {
|
|
message.RetCode = reader.int32();
|
|
break;
|
|
}
|
|
case 2: {
|
|
message.ErrMsg = reader.string();
|
|
break;
|
|
}
|
|
case 3: {
|
|
message.MsgId = reader.int32();
|
|
break;
|
|
}
|
|
case 4: {
|
|
message.SubMsgId = reader.int32();
|
|
break;
|
|
}
|
|
case 5: {
|
|
message.DataType = reader.int32();
|
|
break;
|
|
}
|
|
case 6: {
|
|
message.Data = reader.string();
|
|
break;
|
|
}
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes a CommonRsp message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof ProtoMsg.CommonRsp
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {ProtoMsg.CommonRsp} CommonRsp
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
CommonRsp.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader)) reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies a CommonRsp message.
|
|
* @function verify
|
|
* @memberof ProtoMsg.CommonRsp
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
CommonRsp.verify = function verify(message) {
|
|
if (typeof message !== "object" || message === null)
|
|
return "object expected";
|
|
if (message.RetCode != null && message.hasOwnProperty("RetCode"))
|
|
switch (message.RetCode) {
|
|
default:
|
|
return "RetCode: enum value expected";
|
|
case 0:
|
|
case 1:
|
|
case 2:
|
|
case 3:
|
|
case 4:
|
|
case 5:
|
|
case 6:
|
|
case 7:
|
|
case 10:
|
|
case 100:
|
|
case 101:
|
|
case 102:
|
|
case 103:
|
|
case 104:
|
|
case 105:
|
|
case 106:
|
|
case 107:
|
|
break;
|
|
}
|
|
if (message.ErrMsg != null && message.hasOwnProperty("ErrMsg"))
|
|
if (!$util.isString(message.ErrMsg)) return "ErrMsg: string expected";
|
|
if (message.MsgId != null && message.hasOwnProperty("MsgId"))
|
|
if (!$util.isInteger(message.MsgId)) return "MsgId: integer expected";
|
|
if (message.SubMsgId != null && message.hasOwnProperty("SubMsgId"))
|
|
if (!$util.isInteger(message.SubMsgId))
|
|
return "SubMsgId: integer expected";
|
|
if (message.DataType != null && message.hasOwnProperty("DataType"))
|
|
if (!$util.isInteger(message.DataType))
|
|
return "DataType: integer expected";
|
|
if (message.Data != null && message.hasOwnProperty("Data"))
|
|
if (!$util.isString(message.Data)) return "Data: string expected";
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates a CommonRsp message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof ProtoMsg.CommonRsp
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {ProtoMsg.CommonRsp} CommonRsp
|
|
*/
|
|
CommonRsp.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.ProtoMsg.CommonRsp) return object;
|
|
var message = new $root.ProtoMsg.CommonRsp();
|
|
switch (object.RetCode) {
|
|
default:
|
|
if (typeof object.RetCode === "number") {
|
|
message.RetCode = object.RetCode;
|
|
break;
|
|
}
|
|
break;
|
|
case "Succeed":
|
|
case 0:
|
|
message.RetCode = 0;
|
|
break;
|
|
case "TokenWrong":
|
|
case 1:
|
|
message.RetCode = 1;
|
|
break;
|
|
case "TokenExpire":
|
|
case 2:
|
|
message.RetCode = 2;
|
|
break;
|
|
case "SystemFail":
|
|
case 3:
|
|
message.RetCode = 3;
|
|
break;
|
|
case "RequestParamWrong":
|
|
case 4:
|
|
message.RetCode = 4;
|
|
break;
|
|
case "HeaderParamWrong":
|
|
case 5:
|
|
message.RetCode = 5;
|
|
break;
|
|
case "ConfigError":
|
|
case 6:
|
|
message.RetCode = 6;
|
|
break;
|
|
case "MachineIdentifierNotMathch":
|
|
case 7:
|
|
message.RetCode = 7;
|
|
break;
|
|
case "ModuleNotOpen":
|
|
case 10:
|
|
message.RetCode = 10;
|
|
break;
|
|
case "SystemError":
|
|
case 100:
|
|
message.RetCode = 100;
|
|
break;
|
|
case "RewardClaimed":
|
|
case 101:
|
|
message.RetCode = 101;
|
|
break;
|
|
case "ItemNotEnough":
|
|
case 102:
|
|
message.RetCode = 102;
|
|
break;
|
|
case "ItemConfigNotExist":
|
|
case 103:
|
|
message.RetCode = 103;
|
|
break;
|
|
case "PlayerNotExist":
|
|
case 104:
|
|
message.RetCode = 104;
|
|
break;
|
|
case "PlayerLevelNotEnough":
|
|
case 105:
|
|
message.RetCode = 105;
|
|
break;
|
|
case "PlayerNameAlreadyExist":
|
|
case 106:
|
|
message.RetCode = 106;
|
|
break;
|
|
case "RewardNotAchieve":
|
|
case 107:
|
|
message.RetCode = 107;
|
|
break;
|
|
}
|
|
if (object.ErrMsg != null) message.ErrMsg = String(object.ErrMsg);
|
|
if (object.MsgId != null) message.MsgId = object.MsgId | 0;
|
|
if (object.SubMsgId != null) message.SubMsgId = object.SubMsgId | 0;
|
|
if (object.DataType != null) message.DataType = object.DataType | 0;
|
|
if (object.Data != null) message.Data = String(object.Data);
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from a CommonRsp message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof ProtoMsg.CommonRsp
|
|
* @static
|
|
* @param {ProtoMsg.CommonRsp} message CommonRsp
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
CommonRsp.toObject = function toObject(message, options) {
|
|
if (!options) options = {};
|
|
var object = {};
|
|
if (options.defaults) {
|
|
object.RetCode = options.enums === String ? "Succeed" : 0;
|
|
object.ErrMsg = "";
|
|
object.MsgId = 0;
|
|
object.SubMsgId = 0;
|
|
object.DataType = 0;
|
|
object.Data = "";
|
|
}
|
|
if (message.RetCode != null && message.hasOwnProperty("RetCode"))
|
|
object.RetCode =
|
|
options.enums === String
|
|
? $root.ProtoMsg.ErrorCode[message.RetCode] === undefined
|
|
? message.RetCode
|
|
: $root.ProtoMsg.ErrorCode[message.RetCode]
|
|
: message.RetCode;
|
|
if (message.ErrMsg != null && message.hasOwnProperty("ErrMsg"))
|
|
object.ErrMsg = message.ErrMsg;
|
|
if (message.MsgId != null && message.hasOwnProperty("MsgId"))
|
|
object.MsgId = message.MsgId;
|
|
if (message.SubMsgId != null && message.hasOwnProperty("SubMsgId"))
|
|
object.SubMsgId = message.SubMsgId;
|
|
if (message.DataType != null && message.hasOwnProperty("DataType"))
|
|
object.DataType = message.DataType;
|
|
if (message.Data != null && message.hasOwnProperty("Data"))
|
|
object.Data = message.Data;
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this CommonRsp to JSON.
|
|
* @function toJSON
|
|
* @memberof ProtoMsg.CommonRsp
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
CommonRsp.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
/**
|
|
* Gets the default type url for CommonRsp
|
|
* @function getTypeUrl
|
|
* @memberof ProtoMsg.CommonRsp
|
|
* @static
|
|
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
|
* @returns {string} The default type url
|
|
*/
|
|
CommonRsp.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
if (typeUrlPrefix === undefined) {
|
|
typeUrlPrefix = "type.googleapis.com";
|
|
}
|
|
return typeUrlPrefix + "/ProtoMsg.CommonRsp";
|
|
};
|
|
|
|
return CommonRsp;
|
|
})();
|
|
|
|
/**
|
|
* MsgId enum.
|
|
* @name ProtoMsg.MsgId
|
|
* @enum {number}
|
|
* @property {number} None=0 None value
|
|
* @property {number} Account=1 Account value
|
|
* @property {number} PlayerData=2 PlayerData value
|
|
* @property {number} Admin=99 Admin value
|
|
*/
|
|
ProtoMsg.MsgId = (function () {
|
|
var valuesById = {},
|
|
values = Object.create(valuesById);
|
|
values[(valuesById[0] = "None")] = 0;
|
|
values[(valuesById[1] = "Account")] = 1;
|
|
values[(valuesById[2] = "PlayerData")] = 2;
|
|
values[(valuesById[99] = "Admin")] = 99;
|
|
return values;
|
|
})();
|
|
|
|
/**
|
|
* SubMsgId_Account enum.
|
|
* @name ProtoMsg.SubMsgId_Account
|
|
* @enum {number}
|
|
* @property {number} Account_None=0 Account_None value
|
|
* @property {number} Login=1 Login value
|
|
*/
|
|
ProtoMsg.SubMsgId_Account = (function () {
|
|
var valuesById = {},
|
|
values = Object.create(valuesById);
|
|
values[(valuesById[0] = "Account_None")] = 0;
|
|
values[(valuesById[1] = "Login")] = 1;
|
|
return values;
|
|
})();
|
|
|
|
/**
|
|
* SubMsgId_PlayerData enum.
|
|
* @name ProtoMsg.SubMsgId_PlayerData
|
|
* @enum {number}
|
|
* @property {number} PlayerData_None=0 PlayerData_None value
|
|
* @property {number} QueryPlayerData=1 QueryPlayerData value
|
|
* @property {number} SavePlayerData=2 SavePlayerData value
|
|
*/
|
|
ProtoMsg.SubMsgId_PlayerData = (function () {
|
|
var valuesById = {},
|
|
values = Object.create(valuesById);
|
|
values[(valuesById[0] = "PlayerData_None")] = 0;
|
|
values[(valuesById[1] = "QueryPlayerData")] = 1;
|
|
values[(valuesById[2] = "SavePlayerData")] = 2;
|
|
return values;
|
|
})();
|
|
|
|
/**
|
|
* ErrorCode enum.
|
|
* @name ProtoMsg.ErrorCode
|
|
* @enum {number}
|
|
* @property {number} Succeed=0 Succeed value
|
|
* @property {number} TokenWrong=1 TokenWrong value
|
|
* @property {number} TokenExpire=2 TokenExpire value
|
|
* @property {number} SystemFail=3 SystemFail value
|
|
* @property {number} RequestParamWrong=4 RequestParamWrong value
|
|
* @property {number} HeaderParamWrong=5 HeaderParamWrong value
|
|
* @property {number} ConfigError=6 ConfigError value
|
|
* @property {number} MachineIdentifierNotMathch=7 MachineIdentifierNotMathch value
|
|
* @property {number} ModuleNotOpen=10 ModuleNotOpen value
|
|
* @property {number} SystemError=100 SystemError value
|
|
* @property {number} RewardClaimed=101 RewardClaimed value
|
|
* @property {number} ItemNotEnough=102 ItemNotEnough value
|
|
* @property {number} ItemConfigNotExist=103 ItemConfigNotExist value
|
|
* @property {number} PlayerNotExist=104 PlayerNotExist value
|
|
* @property {number} PlayerLevelNotEnough=105 PlayerLevelNotEnough value
|
|
* @property {number} PlayerNameAlreadyExist=106 PlayerNameAlreadyExist value
|
|
* @property {number} RewardNotAchieve=107 RewardNotAchieve value
|
|
*/
|
|
ProtoMsg.ErrorCode = (function () {
|
|
var valuesById = {},
|
|
values = Object.create(valuesById);
|
|
values[(valuesById[0] = "Succeed")] = 0;
|
|
values[(valuesById[1] = "TokenWrong")] = 1;
|
|
values[(valuesById[2] = "TokenExpire")] = 2;
|
|
values[(valuesById[3] = "SystemFail")] = 3;
|
|
values[(valuesById[4] = "RequestParamWrong")] = 4;
|
|
values[(valuesById[5] = "HeaderParamWrong")] = 5;
|
|
values[(valuesById[6] = "ConfigError")] = 6;
|
|
values[(valuesById[7] = "MachineIdentifierNotMathch")] = 7;
|
|
values[(valuesById[10] = "ModuleNotOpen")] = 10;
|
|
values[(valuesById[100] = "SystemError")] = 100;
|
|
values[(valuesById[101] = "RewardClaimed")] = 101;
|
|
values[(valuesById[102] = "ItemNotEnough")] = 102;
|
|
values[(valuesById[103] = "ItemConfigNotExist")] = 103;
|
|
values[(valuesById[104] = "PlayerNotExist")] = 104;
|
|
values[(valuesById[105] = "PlayerLevelNotEnough")] = 105;
|
|
values[(valuesById[106] = "PlayerNameAlreadyExist")] = 106;
|
|
values[(valuesById[107] = "RewardNotAchieve")] = 107;
|
|
return values;
|
|
})();
|
|
|
|
ProtoMsg.LoginReq = (function () {
|
|
/**
|
|
* Properties of a LoginReq.
|
|
* @memberof ProtoMsg
|
|
* @interface ILoginReq
|
|
* @property {string|null} [GameName] LoginReq GameName
|
|
* @property {string|null} [Identifier] LoginReq Identifier
|
|
* @property {number|null} [IdentityType] LoginReq IdentityType
|
|
* @property {number|null} [OperateType] LoginReq OperateType
|
|
* @property {string|null} [ShareDeposit] LoginReq ShareDeposit
|
|
* @property {string|null} [MachineIdentifier] LoginReq MachineIdentifier
|
|
* @property {string|null} [SdkUid] LoginReq SdkUid
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new LoginReq.
|
|
* @memberof ProtoMsg
|
|
* @classdesc Represents a LoginReq.
|
|
* @implements ILoginReq
|
|
* @constructor
|
|
* @param {ProtoMsg.ILoginReq=} [properties] Properties to set
|
|
*/
|
|
function LoginReq(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]];
|
|
}
|
|
|
|
/**
|
|
* LoginReq GameName.
|
|
* @member {string} GameName
|
|
* @memberof ProtoMsg.LoginReq
|
|
* @instance
|
|
*/
|
|
LoginReq.prototype.GameName = "";
|
|
|
|
/**
|
|
* LoginReq Identifier.
|
|
* @member {string} Identifier
|
|
* @memberof ProtoMsg.LoginReq
|
|
* @instance
|
|
*/
|
|
LoginReq.prototype.Identifier = "";
|
|
|
|
/**
|
|
* LoginReq IdentityType.
|
|
* @member {number} IdentityType
|
|
* @memberof ProtoMsg.LoginReq
|
|
* @instance
|
|
*/
|
|
LoginReq.prototype.IdentityType = 0;
|
|
|
|
/**
|
|
* LoginReq OperateType.
|
|
* @member {number} OperateType
|
|
* @memberof ProtoMsg.LoginReq
|
|
* @instance
|
|
*/
|
|
LoginReq.prototype.OperateType = 0;
|
|
|
|
/**
|
|
* LoginReq ShareDeposit.
|
|
* @member {string} ShareDeposit
|
|
* @memberof ProtoMsg.LoginReq
|
|
* @instance
|
|
*/
|
|
LoginReq.prototype.ShareDeposit = "";
|
|
|
|
/**
|
|
* LoginReq MachineIdentifier.
|
|
* @member {string|null|undefined} MachineIdentifier
|
|
* @memberof ProtoMsg.LoginReq
|
|
* @instance
|
|
*/
|
|
LoginReq.prototype.MachineIdentifier = null;
|
|
|
|
/**
|
|
* LoginReq SdkUid.
|
|
* @member {string|null|undefined} SdkUid
|
|
* @memberof ProtoMsg.LoginReq
|
|
* @instance
|
|
*/
|
|
LoginReq.prototype.SdkUid = null;
|
|
|
|
// OneOf field names bound to virtual getters and setters
|
|
var $oneOfFields;
|
|
|
|
/**
|
|
* LoginReq _MachineIdentifier.
|
|
* @member {"MachineIdentifier"|undefined} _MachineIdentifier
|
|
* @memberof ProtoMsg.LoginReq
|
|
* @instance
|
|
*/
|
|
Object.defineProperty(LoginReq.prototype, "_MachineIdentifier", {
|
|
get: $util.oneOfGetter(($oneOfFields = ["MachineIdentifier"])),
|
|
set: $util.oneOfSetter($oneOfFields),
|
|
});
|
|
|
|
/**
|
|
* LoginReq _SdkUid.
|
|
* @member {"SdkUid"|undefined} _SdkUid
|
|
* @memberof ProtoMsg.LoginReq
|
|
* @instance
|
|
*/
|
|
Object.defineProperty(LoginReq.prototype, "_SdkUid", {
|
|
get: $util.oneOfGetter(($oneOfFields = ["SdkUid"])),
|
|
set: $util.oneOfSetter($oneOfFields),
|
|
});
|
|
|
|
/**
|
|
* Creates a new LoginReq instance using the specified properties.
|
|
* @function create
|
|
* @memberof ProtoMsg.LoginReq
|
|
* @static
|
|
* @param {ProtoMsg.ILoginReq=} [properties] Properties to set
|
|
* @returns {ProtoMsg.LoginReq} LoginReq instance
|
|
*/
|
|
LoginReq.create = function create(properties) {
|
|
return new LoginReq(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified LoginReq message. Does not implicitly {@link ProtoMsg.LoginReq.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof ProtoMsg.LoginReq
|
|
* @static
|
|
* @param {ProtoMsg.ILoginReq} message LoginReq message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
LoginReq.encode = function encode(message, writer) {
|
|
if (!writer) writer = $Writer.create();
|
|
if (
|
|
message.GameName != null &&
|
|
Object.hasOwnProperty.call(message, "GameName")
|
|
)
|
|
writer.uint32(/* id 1, wireType 2 =*/ 10).string(message.GameName);
|
|
if (
|
|
message.Identifier != null &&
|
|
Object.hasOwnProperty.call(message, "Identifier")
|
|
)
|
|
writer.uint32(/* id 2, wireType 2 =*/ 18).string(message.Identifier);
|
|
if (
|
|
message.IdentityType != null &&
|
|
Object.hasOwnProperty.call(message, "IdentityType")
|
|
)
|
|
writer.uint32(/* id 3, wireType 0 =*/ 24).int32(message.IdentityType);
|
|
if (
|
|
message.OperateType != null &&
|
|
Object.hasOwnProperty.call(message, "OperateType")
|
|
)
|
|
writer.uint32(/* id 4, wireType 0 =*/ 32).int32(message.OperateType);
|
|
if (
|
|
message.ShareDeposit != null &&
|
|
Object.hasOwnProperty.call(message, "ShareDeposit")
|
|
)
|
|
writer.uint32(/* id 5, wireType 2 =*/ 42).string(message.ShareDeposit);
|
|
if (
|
|
message.MachineIdentifier != null &&
|
|
Object.hasOwnProperty.call(message, "MachineIdentifier")
|
|
)
|
|
writer
|
|
.uint32(/* id 6, wireType 2 =*/ 50)
|
|
.string(message.MachineIdentifier);
|
|
if (
|
|
message.SdkUid != null &&
|
|
Object.hasOwnProperty.call(message, "SdkUid")
|
|
)
|
|
writer.uint32(/* id 7, wireType 2 =*/ 58).string(message.SdkUid);
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified LoginReq message, length delimited. Does not implicitly {@link ProtoMsg.LoginReq.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof ProtoMsg.LoginReq
|
|
* @static
|
|
* @param {ProtoMsg.ILoginReq} message LoginReq message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
LoginReq.encodeDelimited = function encodeDelimited(message, writer) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes a LoginReq message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof ProtoMsg.LoginReq
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {ProtoMsg.LoginReq} LoginReq
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
LoginReq.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.ProtoMsg.LoginReq();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
if (tag === error) break;
|
|
switch (tag >>> 3) {
|
|
case 1: {
|
|
message.GameName = reader.string();
|
|
break;
|
|
}
|
|
case 2: {
|
|
message.Identifier = reader.string();
|
|
break;
|
|
}
|
|
case 3: {
|
|
message.IdentityType = reader.int32();
|
|
break;
|
|
}
|
|
case 4: {
|
|
message.OperateType = reader.int32();
|
|
break;
|
|
}
|
|
case 5: {
|
|
message.ShareDeposit = reader.string();
|
|
break;
|
|
}
|
|
case 6: {
|
|
message.MachineIdentifier = reader.string();
|
|
break;
|
|
}
|
|
case 7: {
|
|
message.SdkUid = reader.string();
|
|
break;
|
|
}
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes a LoginReq message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof ProtoMsg.LoginReq
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {ProtoMsg.LoginReq} LoginReq
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
LoginReq.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader)) reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies a LoginReq message.
|
|
* @function verify
|
|
* @memberof ProtoMsg.LoginReq
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
LoginReq.verify = function verify(message) {
|
|
if (typeof message !== "object" || message === null)
|
|
return "object expected";
|
|
var properties = {};
|
|
if (message.GameName != null && message.hasOwnProperty("GameName"))
|
|
if (!$util.isString(message.GameName))
|
|
return "GameName: string expected";
|
|
if (message.Identifier != null && message.hasOwnProperty("Identifier"))
|
|
if (!$util.isString(message.Identifier))
|
|
return "Identifier: string expected";
|
|
if (
|
|
message.IdentityType != null &&
|
|
message.hasOwnProperty("IdentityType")
|
|
)
|
|
if (!$util.isInteger(message.IdentityType))
|
|
return "IdentityType: integer expected";
|
|
if (message.OperateType != null && message.hasOwnProperty("OperateType"))
|
|
if (!$util.isInteger(message.OperateType))
|
|
return "OperateType: integer expected";
|
|
if (
|
|
message.ShareDeposit != null &&
|
|
message.hasOwnProperty("ShareDeposit")
|
|
)
|
|
if (!$util.isString(message.ShareDeposit))
|
|
return "ShareDeposit: string expected";
|
|
if (
|
|
message.MachineIdentifier != null &&
|
|
message.hasOwnProperty("MachineIdentifier")
|
|
) {
|
|
properties._MachineIdentifier = 1;
|
|
if (!$util.isString(message.MachineIdentifier))
|
|
return "MachineIdentifier: string expected";
|
|
}
|
|
if (message.SdkUid != null && message.hasOwnProperty("SdkUid")) {
|
|
properties._SdkUid = 1;
|
|
if (!$util.isString(message.SdkUid)) return "SdkUid: string expected";
|
|
}
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates a LoginReq message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof ProtoMsg.LoginReq
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {ProtoMsg.LoginReq} LoginReq
|
|
*/
|
|
LoginReq.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.ProtoMsg.LoginReq) return object;
|
|
var message = new $root.ProtoMsg.LoginReq();
|
|
if (object.GameName != null) message.GameName = String(object.GameName);
|
|
if (object.Identifier != null)
|
|
message.Identifier = String(object.Identifier);
|
|
if (object.IdentityType != null)
|
|
message.IdentityType = object.IdentityType | 0;
|
|
if (object.OperateType != null)
|
|
message.OperateType = object.OperateType | 0;
|
|
if (object.ShareDeposit != null)
|
|
message.ShareDeposit = String(object.ShareDeposit);
|
|
if (object.MachineIdentifier != null)
|
|
message.MachineIdentifier = String(object.MachineIdentifier);
|
|
if (object.SdkUid != null) message.SdkUid = String(object.SdkUid);
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from a LoginReq message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof ProtoMsg.LoginReq
|
|
* @static
|
|
* @param {ProtoMsg.LoginReq} message LoginReq
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
LoginReq.toObject = function toObject(message, options) {
|
|
if (!options) options = {};
|
|
var object = {};
|
|
if (options.defaults) {
|
|
object.GameName = "";
|
|
object.Identifier = "";
|
|
object.IdentityType = 0;
|
|
object.OperateType = 0;
|
|
object.ShareDeposit = "";
|
|
}
|
|
if (message.GameName != null && message.hasOwnProperty("GameName"))
|
|
object.GameName = message.GameName;
|
|
if (message.Identifier != null && message.hasOwnProperty("Identifier"))
|
|
object.Identifier = message.Identifier;
|
|
if (
|
|
message.IdentityType != null &&
|
|
message.hasOwnProperty("IdentityType")
|
|
)
|
|
object.IdentityType = message.IdentityType;
|
|
if (message.OperateType != null && message.hasOwnProperty("OperateType"))
|
|
object.OperateType = message.OperateType;
|
|
if (
|
|
message.ShareDeposit != null &&
|
|
message.hasOwnProperty("ShareDeposit")
|
|
)
|
|
object.ShareDeposit = message.ShareDeposit;
|
|
if (
|
|
message.MachineIdentifier != null &&
|
|
message.hasOwnProperty("MachineIdentifier")
|
|
) {
|
|
object.MachineIdentifier = message.MachineIdentifier;
|
|
if (options.oneofs) object._MachineIdentifier = "MachineIdentifier";
|
|
}
|
|
if (message.SdkUid != null && message.hasOwnProperty("SdkUid")) {
|
|
object.SdkUid = message.SdkUid;
|
|
if (options.oneofs) object._SdkUid = "SdkUid";
|
|
}
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this LoginReq to JSON.
|
|
* @function toJSON
|
|
* @memberof ProtoMsg.LoginReq
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
LoginReq.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
/**
|
|
* Gets the default type url for LoginReq
|
|
* @function getTypeUrl
|
|
* @memberof ProtoMsg.LoginReq
|
|
* @static
|
|
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
|
* @returns {string} The default type url
|
|
*/
|
|
LoginReq.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
if (typeUrlPrefix === undefined) {
|
|
typeUrlPrefix = "type.googleapis.com";
|
|
}
|
|
return typeUrlPrefix + "/ProtoMsg.LoginReq";
|
|
};
|
|
|
|
return LoginReq;
|
|
})();
|
|
|
|
ProtoMsg.LoginRsp = (function () {
|
|
/**
|
|
* Properties of a LoginRsp.
|
|
* @memberof ProtoMsg
|
|
* @interface ILoginRsp
|
|
* @property {string|null} [GameName] LoginRsp GameName
|
|
* @property {string|null} [Identifier] LoginRsp Identifier
|
|
* @property {number|null} [IdentityType] LoginRsp IdentityType
|
|
* @property {number|null} [OperateType] LoginRsp OperateType
|
|
* @property {number|Long|null} [Uid] LoginRsp Uid
|
|
* @property {string|null} [Token] LoginRsp Token
|
|
* @property {number|Long|null} [ServerTime] LoginRsp ServerTime
|
|
* @property {number|null} [TimezoneOffset] LoginRsp TimezoneOffset
|
|
* @property {string|null} [Ip] LoginRsp Ip
|
|
* @property {string|null} [MachineIdentifier] LoginRsp MachineIdentifier
|
|
* @property {string|null} [SdkUid] LoginRsp SdkUid
|
|
* @property {boolean|null} [IsNewGuide] LoginRsp IsNewGuide
|
|
* @property {boolean|null} [IsNewRegist] LoginRsp IsNewRegist
|
|
* @property {number|Long|null} [LastLoginTime] LoginRsp LastLoginTime
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new LoginRsp.
|
|
* @memberof ProtoMsg
|
|
* @classdesc Represents a LoginRsp.
|
|
* @implements ILoginRsp
|
|
* @constructor
|
|
* @param {ProtoMsg.ILoginRsp=} [properties] Properties to set
|
|
*/
|
|
function LoginRsp(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]];
|
|
}
|
|
|
|
/**
|
|
* LoginRsp GameName.
|
|
* @member {string} GameName
|
|
* @memberof ProtoMsg.LoginRsp
|
|
* @instance
|
|
*/
|
|
LoginRsp.prototype.GameName = "";
|
|
|
|
/**
|
|
* LoginRsp Identifier.
|
|
* @member {string} Identifier
|
|
* @memberof ProtoMsg.LoginRsp
|
|
* @instance
|
|
*/
|
|
LoginRsp.prototype.Identifier = "";
|
|
|
|
/**
|
|
* LoginRsp IdentityType.
|
|
* @member {number} IdentityType
|
|
* @memberof ProtoMsg.LoginRsp
|
|
* @instance
|
|
*/
|
|
LoginRsp.prototype.IdentityType = 0;
|
|
|
|
/**
|
|
* LoginRsp OperateType.
|
|
* @member {number} OperateType
|
|
* @memberof ProtoMsg.LoginRsp
|
|
* @instance
|
|
*/
|
|
LoginRsp.prototype.OperateType = 0;
|
|
|
|
/**
|
|
* LoginRsp Uid.
|
|
* @member {number|Long} Uid
|
|
* @memberof ProtoMsg.LoginRsp
|
|
* @instance
|
|
*/
|
|
LoginRsp.prototype.Uid = $util.Long ? $util.Long.fromBits(0, 0, false) : 0;
|
|
|
|
/**
|
|
* LoginRsp Token.
|
|
* @member {string} Token
|
|
* @memberof ProtoMsg.LoginRsp
|
|
* @instance
|
|
*/
|
|
LoginRsp.prototype.Token = "";
|
|
|
|
/**
|
|
* LoginRsp ServerTime.
|
|
* @member {number|Long} ServerTime
|
|
* @memberof ProtoMsg.LoginRsp
|
|
* @instance
|
|
*/
|
|
LoginRsp.prototype.ServerTime = $util.Long
|
|
? $util.Long.fromBits(0, 0, false)
|
|
: 0;
|
|
|
|
/**
|
|
* LoginRsp TimezoneOffset.
|
|
* @member {number} TimezoneOffset
|
|
* @memberof ProtoMsg.LoginRsp
|
|
* @instance
|
|
*/
|
|
LoginRsp.prototype.TimezoneOffset = 0;
|
|
|
|
/**
|
|
* LoginRsp Ip.
|
|
* @member {string} Ip
|
|
* @memberof ProtoMsg.LoginRsp
|
|
* @instance
|
|
*/
|
|
LoginRsp.prototype.Ip = "";
|
|
|
|
/**
|
|
* LoginRsp MachineIdentifier.
|
|
* @member {string|null|undefined} MachineIdentifier
|
|
* @memberof ProtoMsg.LoginRsp
|
|
* @instance
|
|
*/
|
|
LoginRsp.prototype.MachineIdentifier = null;
|
|
|
|
/**
|
|
* LoginRsp SdkUid.
|
|
* @member {string|null|undefined} SdkUid
|
|
* @memberof ProtoMsg.LoginRsp
|
|
* @instance
|
|
*/
|
|
LoginRsp.prototype.SdkUid = null;
|
|
|
|
/**
|
|
* LoginRsp IsNewGuide.
|
|
* @member {boolean|null|undefined} IsNewGuide
|
|
* @memberof ProtoMsg.LoginRsp
|
|
* @instance
|
|
*/
|
|
LoginRsp.prototype.IsNewGuide = null;
|
|
|
|
/**
|
|
* LoginRsp IsNewRegist.
|
|
* @member {boolean|null|undefined} IsNewRegist
|
|
* @memberof ProtoMsg.LoginRsp
|
|
* @instance
|
|
*/
|
|
LoginRsp.prototype.IsNewRegist = null;
|
|
|
|
/**
|
|
* LoginRsp LastLoginTime.
|
|
* @member {number|Long|null|undefined} LastLoginTime
|
|
* @memberof ProtoMsg.LoginRsp
|
|
* @instance
|
|
*/
|
|
LoginRsp.prototype.LastLoginTime = null;
|
|
|
|
// OneOf field names bound to virtual getters and setters
|
|
var $oneOfFields;
|
|
|
|
/**
|
|
* LoginRsp _MachineIdentifier.
|
|
* @member {"MachineIdentifier"|undefined} _MachineIdentifier
|
|
* @memberof ProtoMsg.LoginRsp
|
|
* @instance
|
|
*/
|
|
Object.defineProperty(LoginRsp.prototype, "_MachineIdentifier", {
|
|
get: $util.oneOfGetter(($oneOfFields = ["MachineIdentifier"])),
|
|
set: $util.oneOfSetter($oneOfFields),
|
|
});
|
|
|
|
/**
|
|
* LoginRsp _SdkUid.
|
|
* @member {"SdkUid"|undefined} _SdkUid
|
|
* @memberof ProtoMsg.LoginRsp
|
|
* @instance
|
|
*/
|
|
Object.defineProperty(LoginRsp.prototype, "_SdkUid", {
|
|
get: $util.oneOfGetter(($oneOfFields = ["SdkUid"])),
|
|
set: $util.oneOfSetter($oneOfFields),
|
|
});
|
|
|
|
/**
|
|
* LoginRsp _IsNewGuide.
|
|
* @member {"IsNewGuide"|undefined} _IsNewGuide
|
|
* @memberof ProtoMsg.LoginRsp
|
|
* @instance
|
|
*/
|
|
Object.defineProperty(LoginRsp.prototype, "_IsNewGuide", {
|
|
get: $util.oneOfGetter(($oneOfFields = ["IsNewGuide"])),
|
|
set: $util.oneOfSetter($oneOfFields),
|
|
});
|
|
|
|
/**
|
|
* LoginRsp _IsNewRegist.
|
|
* @member {"IsNewRegist"|undefined} _IsNewRegist
|
|
* @memberof ProtoMsg.LoginRsp
|
|
* @instance
|
|
*/
|
|
Object.defineProperty(LoginRsp.prototype, "_IsNewRegist", {
|
|
get: $util.oneOfGetter(($oneOfFields = ["IsNewRegist"])),
|
|
set: $util.oneOfSetter($oneOfFields),
|
|
});
|
|
|
|
/**
|
|
* LoginRsp _LastLoginTime.
|
|
* @member {"LastLoginTime"|undefined} _LastLoginTime
|
|
* @memberof ProtoMsg.LoginRsp
|
|
* @instance
|
|
*/
|
|
Object.defineProperty(LoginRsp.prototype, "_LastLoginTime", {
|
|
get: $util.oneOfGetter(($oneOfFields = ["LastLoginTime"])),
|
|
set: $util.oneOfSetter($oneOfFields),
|
|
});
|
|
|
|
/**
|
|
* Creates a new LoginRsp instance using the specified properties.
|
|
* @function create
|
|
* @memberof ProtoMsg.LoginRsp
|
|
* @static
|
|
* @param {ProtoMsg.ILoginRsp=} [properties] Properties to set
|
|
* @returns {ProtoMsg.LoginRsp} LoginRsp instance
|
|
*/
|
|
LoginRsp.create = function create(properties) {
|
|
return new LoginRsp(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified LoginRsp message. Does not implicitly {@link ProtoMsg.LoginRsp.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof ProtoMsg.LoginRsp
|
|
* @static
|
|
* @param {ProtoMsg.ILoginRsp} message LoginRsp message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
LoginRsp.encode = function encode(message, writer) {
|
|
if (!writer) writer = $Writer.create();
|
|
if (
|
|
message.GameName != null &&
|
|
Object.hasOwnProperty.call(message, "GameName")
|
|
)
|
|
writer.uint32(/* id 1, wireType 2 =*/ 10).string(message.GameName);
|
|
if (
|
|
message.Identifier != null &&
|
|
Object.hasOwnProperty.call(message, "Identifier")
|
|
)
|
|
writer.uint32(/* id 2, wireType 2 =*/ 18).string(message.Identifier);
|
|
if (
|
|
message.IdentityType != null &&
|
|
Object.hasOwnProperty.call(message, "IdentityType")
|
|
)
|
|
writer.uint32(/* id 3, wireType 0 =*/ 24).int32(message.IdentityType);
|
|
if (
|
|
message.OperateType != null &&
|
|
Object.hasOwnProperty.call(message, "OperateType")
|
|
)
|
|
writer.uint32(/* id 4, wireType 0 =*/ 32).int32(message.OperateType);
|
|
if (message.Uid != null && Object.hasOwnProperty.call(message, "Uid"))
|
|
writer.uint32(/* id 5, wireType 0 =*/ 40).int64(message.Uid);
|
|
if (message.Token != null && Object.hasOwnProperty.call(message, "Token"))
|
|
writer.uint32(/* id 6, wireType 2 =*/ 50).string(message.Token);
|
|
if (
|
|
message.ServerTime != null &&
|
|
Object.hasOwnProperty.call(message, "ServerTime")
|
|
)
|
|
writer.uint32(/* id 7, wireType 0 =*/ 56).int64(message.ServerTime);
|
|
if (
|
|
message.TimezoneOffset != null &&
|
|
Object.hasOwnProperty.call(message, "TimezoneOffset")
|
|
)
|
|
writer.uint32(/* id 8, wireType 0 =*/ 64).int32(message.TimezoneOffset);
|
|
if (message.Ip != null && Object.hasOwnProperty.call(message, "Ip"))
|
|
writer.uint32(/* id 10, wireType 2 =*/ 82).string(message.Ip);
|
|
if (
|
|
message.MachineIdentifier != null &&
|
|
Object.hasOwnProperty.call(message, "MachineIdentifier")
|
|
)
|
|
writer
|
|
.uint32(/* id 11, wireType 2 =*/ 90)
|
|
.string(message.MachineIdentifier);
|
|
if (
|
|
message.SdkUid != null &&
|
|
Object.hasOwnProperty.call(message, "SdkUid")
|
|
)
|
|
writer.uint32(/* id 12, wireType 2 =*/ 98).string(message.SdkUid);
|
|
if (
|
|
message.IsNewGuide != null &&
|
|
Object.hasOwnProperty.call(message, "IsNewGuide")
|
|
)
|
|
writer.uint32(/* id 13, wireType 0 =*/ 104).bool(message.IsNewGuide);
|
|
if (
|
|
message.IsNewRegist != null &&
|
|
Object.hasOwnProperty.call(message, "IsNewRegist")
|
|
)
|
|
writer.uint32(/* id 14, wireType 0 =*/ 112).bool(message.IsNewRegist);
|
|
if (
|
|
message.LastLoginTime != null &&
|
|
Object.hasOwnProperty.call(message, "LastLoginTime")
|
|
)
|
|
writer
|
|
.uint32(/* id 15, wireType 0 =*/ 120)
|
|
.int64(message.LastLoginTime);
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified LoginRsp message, length delimited. Does not implicitly {@link ProtoMsg.LoginRsp.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof ProtoMsg.LoginRsp
|
|
* @static
|
|
* @param {ProtoMsg.ILoginRsp} message LoginRsp message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
LoginRsp.encodeDelimited = function encodeDelimited(message, writer) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes a LoginRsp message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof ProtoMsg.LoginRsp
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {ProtoMsg.LoginRsp} LoginRsp
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
LoginRsp.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.ProtoMsg.LoginRsp();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
if (tag === error) break;
|
|
switch (tag >>> 3) {
|
|
case 1: {
|
|
message.GameName = reader.string();
|
|
break;
|
|
}
|
|
case 2: {
|
|
message.Identifier = reader.string();
|
|
break;
|
|
}
|
|
case 3: {
|
|
message.IdentityType = reader.int32();
|
|
break;
|
|
}
|
|
case 4: {
|
|
message.OperateType = reader.int32();
|
|
break;
|
|
}
|
|
case 5: {
|
|
message.Uid = reader.int64();
|
|
break;
|
|
}
|
|
case 6: {
|
|
message.Token = reader.string();
|
|
break;
|
|
}
|
|
case 7: {
|
|
message.ServerTime = reader.int64();
|
|
break;
|
|
}
|
|
case 8: {
|
|
message.TimezoneOffset = reader.int32();
|
|
break;
|
|
}
|
|
case 10: {
|
|
message.Ip = reader.string();
|
|
break;
|
|
}
|
|
case 11: {
|
|
message.MachineIdentifier = reader.string();
|
|
break;
|
|
}
|
|
case 12: {
|
|
message.SdkUid = reader.string();
|
|
break;
|
|
}
|
|
case 13: {
|
|
message.IsNewGuide = reader.bool();
|
|
break;
|
|
}
|
|
case 14: {
|
|
message.IsNewRegist = reader.bool();
|
|
break;
|
|
}
|
|
case 15: {
|
|
message.LastLoginTime = reader.int64();
|
|
break;
|
|
}
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes a LoginRsp message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof ProtoMsg.LoginRsp
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {ProtoMsg.LoginRsp} LoginRsp
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
LoginRsp.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader)) reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies a LoginRsp message.
|
|
* @function verify
|
|
* @memberof ProtoMsg.LoginRsp
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
LoginRsp.verify = function verify(message) {
|
|
if (typeof message !== "object" || message === null)
|
|
return "object expected";
|
|
var properties = {};
|
|
if (message.GameName != null && message.hasOwnProperty("GameName"))
|
|
if (!$util.isString(message.GameName))
|
|
return "GameName: string expected";
|
|
if (message.Identifier != null && message.hasOwnProperty("Identifier"))
|
|
if (!$util.isString(message.Identifier))
|
|
return "Identifier: string expected";
|
|
if (
|
|
message.IdentityType != null &&
|
|
message.hasOwnProperty("IdentityType")
|
|
)
|
|
if (!$util.isInteger(message.IdentityType))
|
|
return "IdentityType: integer expected";
|
|
if (message.OperateType != null && message.hasOwnProperty("OperateType"))
|
|
if (!$util.isInteger(message.OperateType))
|
|
return "OperateType: integer expected";
|
|
if (message.Uid != null && message.hasOwnProperty("Uid"))
|
|
if (
|
|
!$util.isInteger(message.Uid) &&
|
|
!(
|
|
message.Uid &&
|
|
$util.isInteger(message.Uid.low) &&
|
|
$util.isInteger(message.Uid.high)
|
|
)
|
|
)
|
|
return "Uid: integer|Long expected";
|
|
if (message.Token != null && message.hasOwnProperty("Token"))
|
|
if (!$util.isString(message.Token)) return "Token: string expected";
|
|
if (message.ServerTime != null && message.hasOwnProperty("ServerTime"))
|
|
if (
|
|
!$util.isInteger(message.ServerTime) &&
|
|
!(
|
|
message.ServerTime &&
|
|
$util.isInteger(message.ServerTime.low) &&
|
|
$util.isInteger(message.ServerTime.high)
|
|
)
|
|
)
|
|
return "ServerTime: integer|Long expected";
|
|
if (
|
|
message.TimezoneOffset != null &&
|
|
message.hasOwnProperty("TimezoneOffset")
|
|
)
|
|
if (!$util.isInteger(message.TimezoneOffset))
|
|
return "TimezoneOffset: integer expected";
|
|
if (message.Ip != null && message.hasOwnProperty("Ip"))
|
|
if (!$util.isString(message.Ip)) return "Ip: string expected";
|
|
if (
|
|
message.MachineIdentifier != null &&
|
|
message.hasOwnProperty("MachineIdentifier")
|
|
) {
|
|
properties._MachineIdentifier = 1;
|
|
if (!$util.isString(message.MachineIdentifier))
|
|
return "MachineIdentifier: string expected";
|
|
}
|
|
if (message.SdkUid != null && message.hasOwnProperty("SdkUid")) {
|
|
properties._SdkUid = 1;
|
|
if (!$util.isString(message.SdkUid)) return "SdkUid: string expected";
|
|
}
|
|
if (message.IsNewGuide != null && message.hasOwnProperty("IsNewGuide")) {
|
|
properties._IsNewGuide = 1;
|
|
if (typeof message.IsNewGuide !== "boolean")
|
|
return "IsNewGuide: boolean expected";
|
|
}
|
|
if (
|
|
message.IsNewRegist != null &&
|
|
message.hasOwnProperty("IsNewRegist")
|
|
) {
|
|
properties._IsNewRegist = 1;
|
|
if (typeof message.IsNewRegist !== "boolean")
|
|
return "IsNewRegist: boolean expected";
|
|
}
|
|
if (
|
|
message.LastLoginTime != null &&
|
|
message.hasOwnProperty("LastLoginTime")
|
|
) {
|
|
properties._LastLoginTime = 1;
|
|
if (
|
|
!$util.isInteger(message.LastLoginTime) &&
|
|
!(
|
|
message.LastLoginTime &&
|
|
$util.isInteger(message.LastLoginTime.low) &&
|
|
$util.isInteger(message.LastLoginTime.high)
|
|
)
|
|
)
|
|
return "LastLoginTime: integer|Long expected";
|
|
}
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates a LoginRsp message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof ProtoMsg.LoginRsp
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {ProtoMsg.LoginRsp} LoginRsp
|
|
*/
|
|
LoginRsp.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.ProtoMsg.LoginRsp) return object;
|
|
var message = new $root.ProtoMsg.LoginRsp();
|
|
if (object.GameName != null) message.GameName = String(object.GameName);
|
|
if (object.Identifier != null)
|
|
message.Identifier = String(object.Identifier);
|
|
if (object.IdentityType != null)
|
|
message.IdentityType = object.IdentityType | 0;
|
|
if (object.OperateType != null)
|
|
message.OperateType = object.OperateType | 0;
|
|
if (object.Uid != null)
|
|
if ($util.Long)
|
|
(message.Uid = $util.Long.fromValue(object.Uid)).unsigned = false;
|
|
else if (typeof object.Uid === "string")
|
|
message.Uid = parseInt(object.Uid, 10);
|
|
else if (typeof object.Uid === "number") message.Uid = object.Uid;
|
|
else if (typeof object.Uid === "object")
|
|
message.Uid = new $util.LongBits(
|
|
object.Uid.low >>> 0,
|
|
object.Uid.high >>> 0
|
|
).toNumber();
|
|
if (object.Token != null) message.Token = String(object.Token);
|
|
if (object.ServerTime != null)
|
|
if ($util.Long)
|
|
(message.ServerTime = $util.Long.fromValue(
|
|
object.ServerTime
|
|
)).unsigned = false;
|
|
else if (typeof object.ServerTime === "string")
|
|
message.ServerTime = parseInt(object.ServerTime, 10);
|
|
else if (typeof object.ServerTime === "number")
|
|
message.ServerTime = object.ServerTime;
|
|
else if (typeof object.ServerTime === "object")
|
|
message.ServerTime = new $util.LongBits(
|
|
object.ServerTime.low >>> 0,
|
|
object.ServerTime.high >>> 0
|
|
).toNumber();
|
|
if (object.TimezoneOffset != null)
|
|
message.TimezoneOffset = object.TimezoneOffset | 0;
|
|
if (object.Ip != null) message.Ip = String(object.Ip);
|
|
if (object.MachineIdentifier != null)
|
|
message.MachineIdentifier = String(object.MachineIdentifier);
|
|
if (object.SdkUid != null) message.SdkUid = String(object.SdkUid);
|
|
if (object.IsNewGuide != null)
|
|
message.IsNewGuide = Boolean(object.IsNewGuide);
|
|
if (object.IsNewRegist != null)
|
|
message.IsNewRegist = Boolean(object.IsNewRegist);
|
|
if (object.LastLoginTime != null)
|
|
if ($util.Long)
|
|
(message.LastLoginTime = $util.Long.fromValue(
|
|
object.LastLoginTime
|
|
)).unsigned = false;
|
|
else if (typeof object.LastLoginTime === "string")
|
|
message.LastLoginTime = parseInt(object.LastLoginTime, 10);
|
|
else if (typeof object.LastLoginTime === "number")
|
|
message.LastLoginTime = object.LastLoginTime;
|
|
else if (typeof object.LastLoginTime === "object")
|
|
message.LastLoginTime = new $util.LongBits(
|
|
object.LastLoginTime.low >>> 0,
|
|
object.LastLoginTime.high >>> 0
|
|
).toNumber();
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from a LoginRsp message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof ProtoMsg.LoginRsp
|
|
* @static
|
|
* @param {ProtoMsg.LoginRsp} message LoginRsp
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
LoginRsp.toObject = function toObject(message, options) {
|
|
if (!options) options = {};
|
|
var object = {};
|
|
if (options.defaults) {
|
|
object.GameName = "";
|
|
object.Identifier = "";
|
|
object.IdentityType = 0;
|
|
object.OperateType = 0;
|
|
if ($util.Long) {
|
|
var long = new $util.Long(0, 0, false);
|
|
object.Uid =
|
|
options.longs === String
|
|
? long.toString()
|
|
: options.longs === Number
|
|
? long.toNumber()
|
|
: long;
|
|
} else object.Uid = options.longs === String ? "0" : 0;
|
|
object.Token = "";
|
|
if ($util.Long) {
|
|
var long = new $util.Long(0, 0, false);
|
|
object.ServerTime =
|
|
options.longs === String
|
|
? long.toString()
|
|
: options.longs === Number
|
|
? long.toNumber()
|
|
: long;
|
|
} else object.ServerTime = options.longs === String ? "0" : 0;
|
|
object.TimezoneOffset = 0;
|
|
object.Ip = "";
|
|
}
|
|
if (message.GameName != null && message.hasOwnProperty("GameName"))
|
|
object.GameName = message.GameName;
|
|
if (message.Identifier != null && message.hasOwnProperty("Identifier"))
|
|
object.Identifier = message.Identifier;
|
|
if (
|
|
message.IdentityType != null &&
|
|
message.hasOwnProperty("IdentityType")
|
|
)
|
|
object.IdentityType = message.IdentityType;
|
|
if (message.OperateType != null && message.hasOwnProperty("OperateType"))
|
|
object.OperateType = message.OperateType;
|
|
if (message.Uid != null && message.hasOwnProperty("Uid"))
|
|
if (typeof message.Uid === "number")
|
|
object.Uid =
|
|
options.longs === String ? String(message.Uid) : message.Uid;
|
|
else
|
|
object.Uid =
|
|
options.longs === String
|
|
? $util.Long.prototype.toString.call(message.Uid)
|
|
: options.longs === Number
|
|
? new $util.LongBits(
|
|
message.Uid.low >>> 0,
|
|
message.Uid.high >>> 0
|
|
).toNumber()
|
|
: message.Uid;
|
|
if (message.Token != null && message.hasOwnProperty("Token"))
|
|
object.Token = message.Token;
|
|
if (message.ServerTime != null && message.hasOwnProperty("ServerTime"))
|
|
if (typeof message.ServerTime === "number")
|
|
object.ServerTime =
|
|
options.longs === String
|
|
? String(message.ServerTime)
|
|
: message.ServerTime;
|
|
else
|
|
object.ServerTime =
|
|
options.longs === String
|
|
? $util.Long.prototype.toString.call(message.ServerTime)
|
|
: options.longs === Number
|
|
? new $util.LongBits(
|
|
message.ServerTime.low >>> 0,
|
|
message.ServerTime.high >>> 0
|
|
).toNumber()
|
|
: message.ServerTime;
|
|
if (
|
|
message.TimezoneOffset != null &&
|
|
message.hasOwnProperty("TimezoneOffset")
|
|
)
|
|
object.TimezoneOffset = message.TimezoneOffset;
|
|
if (message.Ip != null && message.hasOwnProperty("Ip"))
|
|
object.Ip = message.Ip;
|
|
if (
|
|
message.MachineIdentifier != null &&
|
|
message.hasOwnProperty("MachineIdentifier")
|
|
) {
|
|
object.MachineIdentifier = message.MachineIdentifier;
|
|
if (options.oneofs) object._MachineIdentifier = "MachineIdentifier";
|
|
}
|
|
if (message.SdkUid != null && message.hasOwnProperty("SdkUid")) {
|
|
object.SdkUid = message.SdkUid;
|
|
if (options.oneofs) object._SdkUid = "SdkUid";
|
|
}
|
|
if (message.IsNewGuide != null && message.hasOwnProperty("IsNewGuide")) {
|
|
object.IsNewGuide = message.IsNewGuide;
|
|
if (options.oneofs) object._IsNewGuide = "IsNewGuide";
|
|
}
|
|
if (
|
|
message.IsNewRegist != null &&
|
|
message.hasOwnProperty("IsNewRegist")
|
|
) {
|
|
object.IsNewRegist = message.IsNewRegist;
|
|
if (options.oneofs) object._IsNewRegist = "IsNewRegist";
|
|
}
|
|
if (
|
|
message.LastLoginTime != null &&
|
|
message.hasOwnProperty("LastLoginTime")
|
|
) {
|
|
if (typeof message.LastLoginTime === "number")
|
|
object.LastLoginTime =
|
|
options.longs === String
|
|
? String(message.LastLoginTime)
|
|
: message.LastLoginTime;
|
|
else
|
|
object.LastLoginTime =
|
|
options.longs === String
|
|
? $util.Long.prototype.toString.call(message.LastLoginTime)
|
|
: options.longs === Number
|
|
? new $util.LongBits(
|
|
message.LastLoginTime.low >>> 0,
|
|
message.LastLoginTime.high >>> 0
|
|
).toNumber()
|
|
: message.LastLoginTime;
|
|
if (options.oneofs) object._LastLoginTime = "LastLoginTime";
|
|
}
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this LoginRsp to JSON.
|
|
* @function toJSON
|
|
* @memberof ProtoMsg.LoginRsp
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
LoginRsp.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
/**
|
|
* Gets the default type url for LoginRsp
|
|
* @function getTypeUrl
|
|
* @memberof ProtoMsg.LoginRsp
|
|
* @static
|
|
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
|
* @returns {string} The default type url
|
|
*/
|
|
LoginRsp.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
if (typeUrlPrefix === undefined) {
|
|
typeUrlPrefix = "type.googleapis.com";
|
|
}
|
|
return typeUrlPrefix + "/ProtoMsg.LoginRsp";
|
|
};
|
|
|
|
return LoginRsp;
|
|
})();
|
|
|
|
ProtoMsg.QueryPlayerDataReq = (function () {
|
|
/**
|
|
* Properties of a QueryPlayerDataReq.
|
|
* @memberof ProtoMsg
|
|
* @interface IQueryPlayerDataReq
|
|
* @property {boolean|null} [IsAll] QueryPlayerDataReq IsAll
|
|
* @property {string|null} [GameName] QueryPlayerDataReq GameName
|
|
* @property {Array.<string>|null} [DataFlagList] QueryPlayerDataReq DataFlagList
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new QueryPlayerDataReq.
|
|
* @memberof ProtoMsg
|
|
* @classdesc Represents a QueryPlayerDataReq.
|
|
* @implements IQueryPlayerDataReq
|
|
* @constructor
|
|
* @param {ProtoMsg.IQueryPlayerDataReq=} [properties] Properties to set
|
|
*/
|
|
function QueryPlayerDataReq(properties) {
|
|
this.DataFlagList = [];
|
|
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]];
|
|
}
|
|
|
|
/**
|
|
* QueryPlayerDataReq IsAll.
|
|
* @member {boolean} IsAll
|
|
* @memberof ProtoMsg.QueryPlayerDataReq
|
|
* @instance
|
|
*/
|
|
QueryPlayerDataReq.prototype.IsAll = false;
|
|
|
|
/**
|
|
* QueryPlayerDataReq GameName.
|
|
* @member {string} GameName
|
|
* @memberof ProtoMsg.QueryPlayerDataReq
|
|
* @instance
|
|
*/
|
|
QueryPlayerDataReq.prototype.GameName = "";
|
|
|
|
/**
|
|
* QueryPlayerDataReq DataFlagList.
|
|
* @member {Array.<string>} DataFlagList
|
|
* @memberof ProtoMsg.QueryPlayerDataReq
|
|
* @instance
|
|
*/
|
|
QueryPlayerDataReq.prototype.DataFlagList = $util.emptyArray;
|
|
|
|
/**
|
|
* Creates a new QueryPlayerDataReq instance using the specified properties.
|
|
* @function create
|
|
* @memberof ProtoMsg.QueryPlayerDataReq
|
|
* @static
|
|
* @param {ProtoMsg.IQueryPlayerDataReq=} [properties] Properties to set
|
|
* @returns {ProtoMsg.QueryPlayerDataReq} QueryPlayerDataReq instance
|
|
*/
|
|
QueryPlayerDataReq.create = function create(properties) {
|
|
return new QueryPlayerDataReq(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified QueryPlayerDataReq message. Does not implicitly {@link ProtoMsg.QueryPlayerDataReq.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof ProtoMsg.QueryPlayerDataReq
|
|
* @static
|
|
* @param {ProtoMsg.IQueryPlayerDataReq} message QueryPlayerDataReq message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
QueryPlayerDataReq.encode = function encode(message, writer) {
|
|
if (!writer) writer = $Writer.create();
|
|
if (message.IsAll != null && Object.hasOwnProperty.call(message, "IsAll"))
|
|
writer.uint32(/* id 1, wireType 0 =*/ 8).bool(message.IsAll);
|
|
if (
|
|
message.GameName != null &&
|
|
Object.hasOwnProperty.call(message, "GameName")
|
|
)
|
|
writer.uint32(/* id 2, wireType 2 =*/ 18).string(message.GameName);
|
|
if (message.DataFlagList != null && message.DataFlagList.length)
|
|
for (var i = 0; i < message.DataFlagList.length; ++i)
|
|
writer
|
|
.uint32(/* id 3, wireType 2 =*/ 26)
|
|
.string(message.DataFlagList[i]);
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified QueryPlayerDataReq message, length delimited. Does not implicitly {@link ProtoMsg.QueryPlayerDataReq.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof ProtoMsg.QueryPlayerDataReq
|
|
* @static
|
|
* @param {ProtoMsg.IQueryPlayerDataReq} message QueryPlayerDataReq message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
QueryPlayerDataReq.encodeDelimited = function encodeDelimited(
|
|
message,
|
|
writer
|
|
) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes a QueryPlayerDataReq message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof ProtoMsg.QueryPlayerDataReq
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {ProtoMsg.QueryPlayerDataReq} QueryPlayerDataReq
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
QueryPlayerDataReq.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.ProtoMsg.QueryPlayerDataReq();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
if (tag === error) break;
|
|
switch (tag >>> 3) {
|
|
case 1: {
|
|
message.IsAll = reader.bool();
|
|
break;
|
|
}
|
|
case 2: {
|
|
message.GameName = reader.string();
|
|
break;
|
|
}
|
|
case 3: {
|
|
if (!(message.DataFlagList && message.DataFlagList.length))
|
|
message.DataFlagList = [];
|
|
message.DataFlagList.push(reader.string());
|
|
break;
|
|
}
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes a QueryPlayerDataReq message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof ProtoMsg.QueryPlayerDataReq
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {ProtoMsg.QueryPlayerDataReq} QueryPlayerDataReq
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
QueryPlayerDataReq.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader)) reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies a QueryPlayerDataReq message.
|
|
* @function verify
|
|
* @memberof ProtoMsg.QueryPlayerDataReq
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
QueryPlayerDataReq.verify = function verify(message) {
|
|
if (typeof message !== "object" || message === null)
|
|
return "object expected";
|
|
if (message.IsAll != null && message.hasOwnProperty("IsAll"))
|
|
if (typeof message.IsAll !== "boolean")
|
|
return "IsAll: boolean expected";
|
|
if (message.GameName != null && message.hasOwnProperty("GameName"))
|
|
if (!$util.isString(message.GameName))
|
|
return "GameName: string expected";
|
|
if (
|
|
message.DataFlagList != null &&
|
|
message.hasOwnProperty("DataFlagList")
|
|
) {
|
|
if (!Array.isArray(message.DataFlagList))
|
|
return "DataFlagList: array expected";
|
|
for (var i = 0; i < message.DataFlagList.length; ++i)
|
|
if (!$util.isString(message.DataFlagList[i]))
|
|
return "DataFlagList: string[] expected";
|
|
}
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates a QueryPlayerDataReq message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof ProtoMsg.QueryPlayerDataReq
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {ProtoMsg.QueryPlayerDataReq} QueryPlayerDataReq
|
|
*/
|
|
QueryPlayerDataReq.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.ProtoMsg.QueryPlayerDataReq) return object;
|
|
var message = new $root.ProtoMsg.QueryPlayerDataReq();
|
|
if (object.IsAll != null) message.IsAll = Boolean(object.IsAll);
|
|
if (object.GameName != null) message.GameName = String(object.GameName);
|
|
if (object.DataFlagList) {
|
|
if (!Array.isArray(object.DataFlagList))
|
|
throw TypeError(
|
|
".ProtoMsg.QueryPlayerDataReq.DataFlagList: array expected"
|
|
);
|
|
message.DataFlagList = [];
|
|
for (var i = 0; i < object.DataFlagList.length; ++i)
|
|
message.DataFlagList[i] = String(object.DataFlagList[i]);
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from a QueryPlayerDataReq message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof ProtoMsg.QueryPlayerDataReq
|
|
* @static
|
|
* @param {ProtoMsg.QueryPlayerDataReq} message QueryPlayerDataReq
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
QueryPlayerDataReq.toObject = function toObject(message, options) {
|
|
if (!options) options = {};
|
|
var object = {};
|
|
if (options.arrays || options.defaults) object.DataFlagList = [];
|
|
if (options.defaults) {
|
|
object.IsAll = false;
|
|
object.GameName = "";
|
|
}
|
|
if (message.IsAll != null && message.hasOwnProperty("IsAll"))
|
|
object.IsAll = message.IsAll;
|
|
if (message.GameName != null && message.hasOwnProperty("GameName"))
|
|
object.GameName = message.GameName;
|
|
if (message.DataFlagList && message.DataFlagList.length) {
|
|
object.DataFlagList = [];
|
|
for (var j = 0; j < message.DataFlagList.length; ++j)
|
|
object.DataFlagList[j] = message.DataFlagList[j];
|
|
}
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this QueryPlayerDataReq to JSON.
|
|
* @function toJSON
|
|
* @memberof ProtoMsg.QueryPlayerDataReq
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
QueryPlayerDataReq.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
/**
|
|
* Gets the default type url for QueryPlayerDataReq
|
|
* @function getTypeUrl
|
|
* @memberof ProtoMsg.QueryPlayerDataReq
|
|
* @static
|
|
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
|
* @returns {string} The default type url
|
|
*/
|
|
QueryPlayerDataReq.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
if (typeUrlPrefix === undefined) {
|
|
typeUrlPrefix = "type.googleapis.com";
|
|
}
|
|
return typeUrlPrefix + "/ProtoMsg.QueryPlayerDataReq";
|
|
};
|
|
|
|
return QueryPlayerDataReq;
|
|
})();
|
|
|
|
ProtoMsg.QueryPlayerDataRsp = (function () {
|
|
/**
|
|
* Properties of a QueryPlayerDataRsp.
|
|
* @memberof ProtoMsg
|
|
* @interface IQueryPlayerDataRsp
|
|
* @property {boolean|null} [IsAll] QueryPlayerDataRsp IsAll
|
|
* @property {string|null} [GameName] QueryPlayerDataRsp GameName
|
|
* @property {Array.<ProtoMsg.IPlayerDataPair>|null} [PlayerDataList] QueryPlayerDataRsp PlayerDataList
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new QueryPlayerDataRsp.
|
|
* @memberof ProtoMsg
|
|
* @classdesc Represents a QueryPlayerDataRsp.
|
|
* @implements IQueryPlayerDataRsp
|
|
* @constructor
|
|
* @param {ProtoMsg.IQueryPlayerDataRsp=} [properties] Properties to set
|
|
*/
|
|
function QueryPlayerDataRsp(properties) {
|
|
this.PlayerDataList = [];
|
|
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]];
|
|
}
|
|
|
|
/**
|
|
* QueryPlayerDataRsp IsAll.
|
|
* @member {boolean} IsAll
|
|
* @memberof ProtoMsg.QueryPlayerDataRsp
|
|
* @instance
|
|
*/
|
|
QueryPlayerDataRsp.prototype.IsAll = false;
|
|
|
|
/**
|
|
* QueryPlayerDataRsp GameName.
|
|
* @member {string} GameName
|
|
* @memberof ProtoMsg.QueryPlayerDataRsp
|
|
* @instance
|
|
*/
|
|
QueryPlayerDataRsp.prototype.GameName = "";
|
|
|
|
/**
|
|
* QueryPlayerDataRsp PlayerDataList.
|
|
* @member {Array.<ProtoMsg.IPlayerDataPair>} PlayerDataList
|
|
* @memberof ProtoMsg.QueryPlayerDataRsp
|
|
* @instance
|
|
*/
|
|
QueryPlayerDataRsp.prototype.PlayerDataList = $util.emptyArray;
|
|
|
|
/**
|
|
* Creates a new QueryPlayerDataRsp instance using the specified properties.
|
|
* @function create
|
|
* @memberof ProtoMsg.QueryPlayerDataRsp
|
|
* @static
|
|
* @param {ProtoMsg.IQueryPlayerDataRsp=} [properties] Properties to set
|
|
* @returns {ProtoMsg.QueryPlayerDataRsp} QueryPlayerDataRsp instance
|
|
*/
|
|
QueryPlayerDataRsp.create = function create(properties) {
|
|
return new QueryPlayerDataRsp(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified QueryPlayerDataRsp message. Does not implicitly {@link ProtoMsg.QueryPlayerDataRsp.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof ProtoMsg.QueryPlayerDataRsp
|
|
* @static
|
|
* @param {ProtoMsg.IQueryPlayerDataRsp} message QueryPlayerDataRsp message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
QueryPlayerDataRsp.encode = function encode(message, writer) {
|
|
if (!writer) writer = $Writer.create();
|
|
if (message.IsAll != null && Object.hasOwnProperty.call(message, "IsAll"))
|
|
writer.uint32(/* id 1, wireType 0 =*/ 8).bool(message.IsAll);
|
|
if (
|
|
message.GameName != null &&
|
|
Object.hasOwnProperty.call(message, "GameName")
|
|
)
|
|
writer.uint32(/* id 2, wireType 2 =*/ 18).string(message.GameName);
|
|
if (message.PlayerDataList != null && message.PlayerDataList.length)
|
|
for (var i = 0; i < message.PlayerDataList.length; ++i)
|
|
$root.ProtoMsg.PlayerDataPair.encode(
|
|
message.PlayerDataList[i],
|
|
writer.uint32(/* id 3, wireType 2 =*/ 26).fork()
|
|
).ldelim();
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified QueryPlayerDataRsp message, length delimited. Does not implicitly {@link ProtoMsg.QueryPlayerDataRsp.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof ProtoMsg.QueryPlayerDataRsp
|
|
* @static
|
|
* @param {ProtoMsg.IQueryPlayerDataRsp} message QueryPlayerDataRsp message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
QueryPlayerDataRsp.encodeDelimited = function encodeDelimited(
|
|
message,
|
|
writer
|
|
) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes a QueryPlayerDataRsp message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof ProtoMsg.QueryPlayerDataRsp
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {ProtoMsg.QueryPlayerDataRsp} QueryPlayerDataRsp
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
QueryPlayerDataRsp.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.ProtoMsg.QueryPlayerDataRsp();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
if (tag === error) break;
|
|
switch (tag >>> 3) {
|
|
case 1: {
|
|
message.IsAll = reader.bool();
|
|
break;
|
|
}
|
|
case 2: {
|
|
message.GameName = reader.string();
|
|
break;
|
|
}
|
|
case 3: {
|
|
if (!(message.PlayerDataList && message.PlayerDataList.length))
|
|
message.PlayerDataList = [];
|
|
message.PlayerDataList.push(
|
|
$root.ProtoMsg.PlayerDataPair.decode(reader, reader.uint32())
|
|
);
|
|
break;
|
|
}
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes a QueryPlayerDataRsp message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof ProtoMsg.QueryPlayerDataRsp
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {ProtoMsg.QueryPlayerDataRsp} QueryPlayerDataRsp
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
QueryPlayerDataRsp.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader)) reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies a QueryPlayerDataRsp message.
|
|
* @function verify
|
|
* @memberof ProtoMsg.QueryPlayerDataRsp
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
QueryPlayerDataRsp.verify = function verify(message) {
|
|
if (typeof message !== "object" || message === null)
|
|
return "object expected";
|
|
if (message.IsAll != null && message.hasOwnProperty("IsAll"))
|
|
if (typeof message.IsAll !== "boolean")
|
|
return "IsAll: boolean expected";
|
|
if (message.GameName != null && message.hasOwnProperty("GameName"))
|
|
if (!$util.isString(message.GameName))
|
|
return "GameName: string expected";
|
|
if (
|
|
message.PlayerDataList != null &&
|
|
message.hasOwnProperty("PlayerDataList")
|
|
) {
|
|
if (!Array.isArray(message.PlayerDataList))
|
|
return "PlayerDataList: array expected";
|
|
for (var i = 0; i < message.PlayerDataList.length; ++i) {
|
|
var error = $root.ProtoMsg.PlayerDataPair.verify(
|
|
message.PlayerDataList[i]
|
|
);
|
|
if (error) return "PlayerDataList." + error;
|
|
}
|
|
}
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates a QueryPlayerDataRsp message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof ProtoMsg.QueryPlayerDataRsp
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {ProtoMsg.QueryPlayerDataRsp} QueryPlayerDataRsp
|
|
*/
|
|
QueryPlayerDataRsp.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.ProtoMsg.QueryPlayerDataRsp) return object;
|
|
var message = new $root.ProtoMsg.QueryPlayerDataRsp();
|
|
if (object.IsAll != null) message.IsAll = Boolean(object.IsAll);
|
|
if (object.GameName != null) message.GameName = String(object.GameName);
|
|
if (object.PlayerDataList) {
|
|
if (!Array.isArray(object.PlayerDataList))
|
|
throw TypeError(
|
|
".ProtoMsg.QueryPlayerDataRsp.PlayerDataList: array expected"
|
|
);
|
|
message.PlayerDataList = [];
|
|
for (var i = 0; i < object.PlayerDataList.length; ++i) {
|
|
if (typeof object.PlayerDataList[i] !== "object")
|
|
throw TypeError(
|
|
".ProtoMsg.QueryPlayerDataRsp.PlayerDataList: object expected"
|
|
);
|
|
message.PlayerDataList[i] = $root.ProtoMsg.PlayerDataPair.fromObject(
|
|
object.PlayerDataList[i]
|
|
);
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from a QueryPlayerDataRsp message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof ProtoMsg.QueryPlayerDataRsp
|
|
* @static
|
|
* @param {ProtoMsg.QueryPlayerDataRsp} message QueryPlayerDataRsp
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
QueryPlayerDataRsp.toObject = function toObject(message, options) {
|
|
if (!options) options = {};
|
|
var object = {};
|
|
if (options.arrays || options.defaults) object.PlayerDataList = [];
|
|
if (options.defaults) {
|
|
object.IsAll = false;
|
|
object.GameName = "";
|
|
}
|
|
if (message.IsAll != null && message.hasOwnProperty("IsAll"))
|
|
object.IsAll = message.IsAll;
|
|
if (message.GameName != null && message.hasOwnProperty("GameName"))
|
|
object.GameName = message.GameName;
|
|
if (message.PlayerDataList && message.PlayerDataList.length) {
|
|
object.PlayerDataList = [];
|
|
for (var j = 0; j < message.PlayerDataList.length; ++j)
|
|
object.PlayerDataList[j] = $root.ProtoMsg.PlayerDataPair.toObject(
|
|
message.PlayerDataList[j],
|
|
options
|
|
);
|
|
}
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this QueryPlayerDataRsp to JSON.
|
|
* @function toJSON
|
|
* @memberof ProtoMsg.QueryPlayerDataRsp
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
QueryPlayerDataRsp.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
/**
|
|
* Gets the default type url for QueryPlayerDataRsp
|
|
* @function getTypeUrl
|
|
* @memberof ProtoMsg.QueryPlayerDataRsp
|
|
* @static
|
|
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
|
* @returns {string} The default type url
|
|
*/
|
|
QueryPlayerDataRsp.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
if (typeUrlPrefix === undefined) {
|
|
typeUrlPrefix = "type.googleapis.com";
|
|
}
|
|
return typeUrlPrefix + "/ProtoMsg.QueryPlayerDataRsp";
|
|
};
|
|
|
|
return QueryPlayerDataRsp;
|
|
})();
|
|
|
|
ProtoMsg.PlayerDataPair = (function () {
|
|
/**
|
|
* Properties of a PlayerDataPair.
|
|
* @memberof ProtoMsg
|
|
* @interface IPlayerDataPair
|
|
* @property {string|null} [DataFlag] PlayerDataPair DataFlag
|
|
* @property {string|null} [Content] PlayerDataPair Content
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new PlayerDataPair.
|
|
* @memberof ProtoMsg
|
|
* @classdesc Represents a PlayerDataPair.
|
|
* @implements IPlayerDataPair
|
|
* @constructor
|
|
* @param {ProtoMsg.IPlayerDataPair=} [properties] Properties to set
|
|
*/
|
|
function PlayerDataPair(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]];
|
|
}
|
|
|
|
/**
|
|
* PlayerDataPair DataFlag.
|
|
* @member {string} DataFlag
|
|
* @memberof ProtoMsg.PlayerDataPair
|
|
* @instance
|
|
*/
|
|
PlayerDataPair.prototype.DataFlag = "";
|
|
|
|
/**
|
|
* PlayerDataPair Content.
|
|
* @member {string} Content
|
|
* @memberof ProtoMsg.PlayerDataPair
|
|
* @instance
|
|
*/
|
|
PlayerDataPair.prototype.Content = "";
|
|
|
|
/**
|
|
* Creates a new PlayerDataPair instance using the specified properties.
|
|
* @function create
|
|
* @memberof ProtoMsg.PlayerDataPair
|
|
* @static
|
|
* @param {ProtoMsg.IPlayerDataPair=} [properties] Properties to set
|
|
* @returns {ProtoMsg.PlayerDataPair} PlayerDataPair instance
|
|
*/
|
|
PlayerDataPair.create = function create(properties) {
|
|
return new PlayerDataPair(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified PlayerDataPair message. Does not implicitly {@link ProtoMsg.PlayerDataPair.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof ProtoMsg.PlayerDataPair
|
|
* @static
|
|
* @param {ProtoMsg.IPlayerDataPair} message PlayerDataPair message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
PlayerDataPair.encode = function encode(message, writer) {
|
|
if (!writer) writer = $Writer.create();
|
|
if (
|
|
message.DataFlag != null &&
|
|
Object.hasOwnProperty.call(message, "DataFlag")
|
|
)
|
|
writer.uint32(/* id 1, wireType 2 =*/ 10).string(message.DataFlag);
|
|
if (
|
|
message.Content != null &&
|
|
Object.hasOwnProperty.call(message, "Content")
|
|
)
|
|
writer.uint32(/* id 2, wireType 2 =*/ 18).string(message.Content);
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified PlayerDataPair message, length delimited. Does not implicitly {@link ProtoMsg.PlayerDataPair.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof ProtoMsg.PlayerDataPair
|
|
* @static
|
|
* @param {ProtoMsg.IPlayerDataPair} message PlayerDataPair message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
PlayerDataPair.encodeDelimited = function encodeDelimited(message, writer) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes a PlayerDataPair message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof ProtoMsg.PlayerDataPair
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {ProtoMsg.PlayerDataPair} PlayerDataPair
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
PlayerDataPair.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.ProtoMsg.PlayerDataPair();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
if (tag === error) break;
|
|
switch (tag >>> 3) {
|
|
case 1: {
|
|
message.DataFlag = reader.string();
|
|
break;
|
|
}
|
|
case 2: {
|
|
message.Content = reader.string();
|
|
break;
|
|
}
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes a PlayerDataPair message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof ProtoMsg.PlayerDataPair
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {ProtoMsg.PlayerDataPair} PlayerDataPair
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
PlayerDataPair.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader)) reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies a PlayerDataPair message.
|
|
* @function verify
|
|
* @memberof ProtoMsg.PlayerDataPair
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
PlayerDataPair.verify = function verify(message) {
|
|
if (typeof message !== "object" || message === null)
|
|
return "object expected";
|
|
if (message.DataFlag != null && message.hasOwnProperty("DataFlag"))
|
|
if (!$util.isString(message.DataFlag))
|
|
return "DataFlag: string expected";
|
|
if (message.Content != null && message.hasOwnProperty("Content"))
|
|
if (!$util.isString(message.Content)) return "Content: string expected";
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates a PlayerDataPair message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof ProtoMsg.PlayerDataPair
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {ProtoMsg.PlayerDataPair} PlayerDataPair
|
|
*/
|
|
PlayerDataPair.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.ProtoMsg.PlayerDataPair) return object;
|
|
var message = new $root.ProtoMsg.PlayerDataPair();
|
|
if (object.DataFlag != null) message.DataFlag = String(object.DataFlag);
|
|
if (object.Content != null) message.Content = String(object.Content);
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from a PlayerDataPair message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof ProtoMsg.PlayerDataPair
|
|
* @static
|
|
* @param {ProtoMsg.PlayerDataPair} message PlayerDataPair
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
PlayerDataPair.toObject = function toObject(message, options) {
|
|
if (!options) options = {};
|
|
var object = {};
|
|
if (options.defaults) {
|
|
object.DataFlag = "";
|
|
object.Content = "";
|
|
}
|
|
if (message.DataFlag != null && message.hasOwnProperty("DataFlag"))
|
|
object.DataFlag = message.DataFlag;
|
|
if (message.Content != null && message.hasOwnProperty("Content"))
|
|
object.Content = message.Content;
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this PlayerDataPair to JSON.
|
|
* @function toJSON
|
|
* @memberof ProtoMsg.PlayerDataPair
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
PlayerDataPair.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
/**
|
|
* Gets the default type url for PlayerDataPair
|
|
* @function getTypeUrl
|
|
* @memberof ProtoMsg.PlayerDataPair
|
|
* @static
|
|
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
|
* @returns {string} The default type url
|
|
*/
|
|
PlayerDataPair.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
if (typeUrlPrefix === undefined) {
|
|
typeUrlPrefix = "type.googleapis.com";
|
|
}
|
|
return typeUrlPrefix + "/ProtoMsg.PlayerDataPair";
|
|
};
|
|
|
|
return PlayerDataPair;
|
|
})();
|
|
|
|
ProtoMsg.SavePlayerDataReq = (function () {
|
|
/**
|
|
* Properties of a SavePlayerDataReq.
|
|
* @memberof ProtoMsg
|
|
* @interface ISavePlayerDataReq
|
|
* @property {string|null} [GameName] SavePlayerDataReq GameName
|
|
* @property {string|null} [DataFlag] SavePlayerDataReq DataFlag
|
|
* @property {string|null} [Content] SavePlayerDataReq Content
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new SavePlayerDataReq.
|
|
* @memberof ProtoMsg
|
|
* @classdesc Represents a SavePlayerDataReq.
|
|
* @implements ISavePlayerDataReq
|
|
* @constructor
|
|
* @param {ProtoMsg.ISavePlayerDataReq=} [properties] Properties to set
|
|
*/
|
|
function SavePlayerDataReq(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]];
|
|
}
|
|
|
|
/**
|
|
* SavePlayerDataReq GameName.
|
|
* @member {string} GameName
|
|
* @memberof ProtoMsg.SavePlayerDataReq
|
|
* @instance
|
|
*/
|
|
SavePlayerDataReq.prototype.GameName = "";
|
|
|
|
/**
|
|
* SavePlayerDataReq DataFlag.
|
|
* @member {string} DataFlag
|
|
* @memberof ProtoMsg.SavePlayerDataReq
|
|
* @instance
|
|
*/
|
|
SavePlayerDataReq.prototype.DataFlag = "";
|
|
|
|
/**
|
|
* SavePlayerDataReq Content.
|
|
* @member {string} Content
|
|
* @memberof ProtoMsg.SavePlayerDataReq
|
|
* @instance
|
|
*/
|
|
SavePlayerDataReq.prototype.Content = "";
|
|
|
|
/**
|
|
* Creates a new SavePlayerDataReq instance using the specified properties.
|
|
* @function create
|
|
* @memberof ProtoMsg.SavePlayerDataReq
|
|
* @static
|
|
* @param {ProtoMsg.ISavePlayerDataReq=} [properties] Properties to set
|
|
* @returns {ProtoMsg.SavePlayerDataReq} SavePlayerDataReq instance
|
|
*/
|
|
SavePlayerDataReq.create = function create(properties) {
|
|
return new SavePlayerDataReq(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified SavePlayerDataReq message. Does not implicitly {@link ProtoMsg.SavePlayerDataReq.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof ProtoMsg.SavePlayerDataReq
|
|
* @static
|
|
* @param {ProtoMsg.ISavePlayerDataReq} message SavePlayerDataReq message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
SavePlayerDataReq.encode = function encode(message, writer) {
|
|
if (!writer) writer = $Writer.create();
|
|
if (
|
|
message.GameName != null &&
|
|
Object.hasOwnProperty.call(message, "GameName")
|
|
)
|
|
writer.uint32(/* id 1, wireType 2 =*/ 10).string(message.GameName);
|
|
if (
|
|
message.DataFlag != null &&
|
|
Object.hasOwnProperty.call(message, "DataFlag")
|
|
)
|
|
writer.uint32(/* id 2, wireType 2 =*/ 18).string(message.DataFlag);
|
|
if (
|
|
message.Content != null &&
|
|
Object.hasOwnProperty.call(message, "Content")
|
|
)
|
|
writer.uint32(/* id 3, wireType 2 =*/ 26).string(message.Content);
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified SavePlayerDataReq message, length delimited. Does not implicitly {@link ProtoMsg.SavePlayerDataReq.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof ProtoMsg.SavePlayerDataReq
|
|
* @static
|
|
* @param {ProtoMsg.ISavePlayerDataReq} message SavePlayerDataReq message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
SavePlayerDataReq.encodeDelimited = function encodeDelimited(
|
|
message,
|
|
writer
|
|
) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes a SavePlayerDataReq message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof ProtoMsg.SavePlayerDataReq
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {ProtoMsg.SavePlayerDataReq} SavePlayerDataReq
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
SavePlayerDataReq.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.ProtoMsg.SavePlayerDataReq();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
if (tag === error) break;
|
|
switch (tag >>> 3) {
|
|
case 1: {
|
|
message.GameName = reader.string();
|
|
break;
|
|
}
|
|
case 2: {
|
|
message.DataFlag = reader.string();
|
|
break;
|
|
}
|
|
case 3: {
|
|
message.Content = reader.string();
|
|
break;
|
|
}
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes a SavePlayerDataReq message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof ProtoMsg.SavePlayerDataReq
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {ProtoMsg.SavePlayerDataReq} SavePlayerDataReq
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
SavePlayerDataReq.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader)) reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies a SavePlayerDataReq message.
|
|
* @function verify
|
|
* @memberof ProtoMsg.SavePlayerDataReq
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
SavePlayerDataReq.verify = function verify(message) {
|
|
if (typeof message !== "object" || message === null)
|
|
return "object expected";
|
|
if (message.GameName != null && message.hasOwnProperty("GameName"))
|
|
if (!$util.isString(message.GameName))
|
|
return "GameName: string expected";
|
|
if (message.DataFlag != null && message.hasOwnProperty("DataFlag"))
|
|
if (!$util.isString(message.DataFlag))
|
|
return "DataFlag: string expected";
|
|
if (message.Content != null && message.hasOwnProperty("Content"))
|
|
if (!$util.isString(message.Content)) return "Content: string expected";
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates a SavePlayerDataReq message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof ProtoMsg.SavePlayerDataReq
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {ProtoMsg.SavePlayerDataReq} SavePlayerDataReq
|
|
*/
|
|
SavePlayerDataReq.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.ProtoMsg.SavePlayerDataReq) return object;
|
|
var message = new $root.ProtoMsg.SavePlayerDataReq();
|
|
if (object.GameName != null) message.GameName = String(object.GameName);
|
|
if (object.DataFlag != null) message.DataFlag = String(object.DataFlag);
|
|
if (object.Content != null) message.Content = String(object.Content);
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from a SavePlayerDataReq message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof ProtoMsg.SavePlayerDataReq
|
|
* @static
|
|
* @param {ProtoMsg.SavePlayerDataReq} message SavePlayerDataReq
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
SavePlayerDataReq.toObject = function toObject(message, options) {
|
|
if (!options) options = {};
|
|
var object = {};
|
|
if (options.defaults) {
|
|
object.GameName = "";
|
|
object.DataFlag = "";
|
|
object.Content = "";
|
|
}
|
|
if (message.GameName != null && message.hasOwnProperty("GameName"))
|
|
object.GameName = message.GameName;
|
|
if (message.DataFlag != null && message.hasOwnProperty("DataFlag"))
|
|
object.DataFlag = message.DataFlag;
|
|
if (message.Content != null && message.hasOwnProperty("Content"))
|
|
object.Content = message.Content;
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this SavePlayerDataReq to JSON.
|
|
* @function toJSON
|
|
* @memberof ProtoMsg.SavePlayerDataReq
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
SavePlayerDataReq.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
/**
|
|
* Gets the default type url for SavePlayerDataReq
|
|
* @function getTypeUrl
|
|
* @memberof ProtoMsg.SavePlayerDataReq
|
|
* @static
|
|
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
|
* @returns {string} The default type url
|
|
*/
|
|
SavePlayerDataReq.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
if (typeUrlPrefix === undefined) {
|
|
typeUrlPrefix = "type.googleapis.com";
|
|
}
|
|
return typeUrlPrefix + "/ProtoMsg.SavePlayerDataReq";
|
|
};
|
|
|
|
return SavePlayerDataReq;
|
|
})();
|
|
|
|
ProtoMsg.SavePlayerDataRsp = (function () {
|
|
/**
|
|
* Properties of a SavePlayerDataRsp.
|
|
* @memberof ProtoMsg
|
|
* @interface ISavePlayerDataRsp
|
|
* @property {string|null} [GameName] SavePlayerDataRsp GameName
|
|
* @property {string|null} [DataFlag] SavePlayerDataRsp DataFlag
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new SavePlayerDataRsp.
|
|
* @memberof ProtoMsg
|
|
* @classdesc Represents a SavePlayerDataRsp.
|
|
* @implements ISavePlayerDataRsp
|
|
* @constructor
|
|
* @param {ProtoMsg.ISavePlayerDataRsp=} [properties] Properties to set
|
|
*/
|
|
function SavePlayerDataRsp(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]];
|
|
}
|
|
|
|
/**
|
|
* SavePlayerDataRsp GameName.
|
|
* @member {string} GameName
|
|
* @memberof ProtoMsg.SavePlayerDataRsp
|
|
* @instance
|
|
*/
|
|
SavePlayerDataRsp.prototype.GameName = "";
|
|
|
|
/**
|
|
* SavePlayerDataRsp DataFlag.
|
|
* @member {string} DataFlag
|
|
* @memberof ProtoMsg.SavePlayerDataRsp
|
|
* @instance
|
|
*/
|
|
SavePlayerDataRsp.prototype.DataFlag = "";
|
|
|
|
/**
|
|
* Creates a new SavePlayerDataRsp instance using the specified properties.
|
|
* @function create
|
|
* @memberof ProtoMsg.SavePlayerDataRsp
|
|
* @static
|
|
* @param {ProtoMsg.ISavePlayerDataRsp=} [properties] Properties to set
|
|
* @returns {ProtoMsg.SavePlayerDataRsp} SavePlayerDataRsp instance
|
|
*/
|
|
SavePlayerDataRsp.create = function create(properties) {
|
|
return new SavePlayerDataRsp(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified SavePlayerDataRsp message. Does not implicitly {@link ProtoMsg.SavePlayerDataRsp.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof ProtoMsg.SavePlayerDataRsp
|
|
* @static
|
|
* @param {ProtoMsg.ISavePlayerDataRsp} message SavePlayerDataRsp message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
SavePlayerDataRsp.encode = function encode(message, writer) {
|
|
if (!writer) writer = $Writer.create();
|
|
if (
|
|
message.GameName != null &&
|
|
Object.hasOwnProperty.call(message, "GameName")
|
|
)
|
|
writer.uint32(/* id 1, wireType 2 =*/ 10).string(message.GameName);
|
|
if (
|
|
message.DataFlag != null &&
|
|
Object.hasOwnProperty.call(message, "DataFlag")
|
|
)
|
|
writer.uint32(/* id 2, wireType 2 =*/ 18).string(message.DataFlag);
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified SavePlayerDataRsp message, length delimited. Does not implicitly {@link ProtoMsg.SavePlayerDataRsp.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof ProtoMsg.SavePlayerDataRsp
|
|
* @static
|
|
* @param {ProtoMsg.ISavePlayerDataRsp} message SavePlayerDataRsp message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
SavePlayerDataRsp.encodeDelimited = function encodeDelimited(
|
|
message,
|
|
writer
|
|
) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes a SavePlayerDataRsp message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof ProtoMsg.SavePlayerDataRsp
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {ProtoMsg.SavePlayerDataRsp} SavePlayerDataRsp
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
SavePlayerDataRsp.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.ProtoMsg.SavePlayerDataRsp();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
if (tag === error) break;
|
|
switch (tag >>> 3) {
|
|
case 1: {
|
|
message.GameName = reader.string();
|
|
break;
|
|
}
|
|
case 2: {
|
|
message.DataFlag = reader.string();
|
|
break;
|
|
}
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes a SavePlayerDataRsp message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof ProtoMsg.SavePlayerDataRsp
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {ProtoMsg.SavePlayerDataRsp} SavePlayerDataRsp
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
SavePlayerDataRsp.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader)) reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies a SavePlayerDataRsp message.
|
|
* @function verify
|
|
* @memberof ProtoMsg.SavePlayerDataRsp
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
SavePlayerDataRsp.verify = function verify(message) {
|
|
if (typeof message !== "object" || message === null)
|
|
return "object expected";
|
|
if (message.GameName != null && message.hasOwnProperty("GameName"))
|
|
if (!$util.isString(message.GameName))
|
|
return "GameName: string expected";
|
|
if (message.DataFlag != null && message.hasOwnProperty("DataFlag"))
|
|
if (!$util.isString(message.DataFlag))
|
|
return "DataFlag: string expected";
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates a SavePlayerDataRsp message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof ProtoMsg.SavePlayerDataRsp
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {ProtoMsg.SavePlayerDataRsp} SavePlayerDataRsp
|
|
*/
|
|
SavePlayerDataRsp.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.ProtoMsg.SavePlayerDataRsp) return object;
|
|
var message = new $root.ProtoMsg.SavePlayerDataRsp();
|
|
if (object.GameName != null) message.GameName = String(object.GameName);
|
|
if (object.DataFlag != null) message.DataFlag = String(object.DataFlag);
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from a SavePlayerDataRsp message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof ProtoMsg.SavePlayerDataRsp
|
|
* @static
|
|
* @param {ProtoMsg.SavePlayerDataRsp} message SavePlayerDataRsp
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
SavePlayerDataRsp.toObject = function toObject(message, options) {
|
|
if (!options) options = {};
|
|
var object = {};
|
|
if (options.defaults) {
|
|
object.GameName = "";
|
|
object.DataFlag = "";
|
|
}
|
|
if (message.GameName != null && message.hasOwnProperty("GameName"))
|
|
object.GameName = message.GameName;
|
|
if (message.DataFlag != null && message.hasOwnProperty("DataFlag"))
|
|
object.DataFlag = message.DataFlag;
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this SavePlayerDataRsp to JSON.
|
|
* @function toJSON
|
|
* @memberof ProtoMsg.SavePlayerDataRsp
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
SavePlayerDataRsp.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
/**
|
|
* Gets the default type url for SavePlayerDataRsp
|
|
* @function getTypeUrl
|
|
* @memberof ProtoMsg.SavePlayerDataRsp
|
|
* @static
|
|
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
|
* @returns {string} The default type url
|
|
*/
|
|
SavePlayerDataRsp.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
if (typeUrlPrefix === undefined) {
|
|
typeUrlPrefix = "type.googleapis.com";
|
|
}
|
|
return typeUrlPrefix + "/ProtoMsg.SavePlayerDataRsp";
|
|
};
|
|
|
|
return SavePlayerDataRsp;
|
|
})();
|
|
|
|
return ProtoMsg;
|
|
})();
|
|
|
|
$root.google = (function () {
|
|
/**
|
|
* Namespace google.
|
|
* @exports google
|
|
* @namespace
|
|
*/
|
|
var google = {};
|
|
|
|
google.protobuf = (function () {
|
|
/**
|
|
* Namespace protobuf.
|
|
* @memberof google
|
|
* @namespace
|
|
*/
|
|
var protobuf = {};
|
|
|
|
protobuf.FileDescriptorSet = (function () {
|
|
/**
|
|
* Properties of a FileDescriptorSet.
|
|
* @memberof google.protobuf
|
|
* @interface IFileDescriptorSet
|
|
* @property {Array.<google.protobuf.IFileDescriptorProto>|null} [file] FileDescriptorSet file
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new FileDescriptorSet.
|
|
* @memberof google.protobuf
|
|
* @classdesc Represents a FileDescriptorSet.
|
|
* @implements IFileDescriptorSet
|
|
* @constructor
|
|
* @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set
|
|
*/
|
|
function FileDescriptorSet(properties) {
|
|
this.file = [];
|
|
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]];
|
|
}
|
|
|
|
/**
|
|
* FileDescriptorSet file.
|
|
* @member {Array.<google.protobuf.IFileDescriptorProto>} file
|
|
* @memberof google.protobuf.FileDescriptorSet
|
|
* @instance
|
|
*/
|
|
FileDescriptorSet.prototype.file = $util.emptyArray;
|
|
|
|
/**
|
|
* Creates a new FileDescriptorSet instance using the specified properties.
|
|
* @function create
|
|
* @memberof google.protobuf.FileDescriptorSet
|
|
* @static
|
|
* @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set
|
|
* @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet instance
|
|
*/
|
|
FileDescriptorSet.create = function create(properties) {
|
|
return new FileDescriptorSet(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof google.protobuf.FileDescriptorSet
|
|
* @static
|
|
* @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
FileDescriptorSet.encode = function encode(message, writer) {
|
|
if (!writer) writer = $Writer.create();
|
|
if (message.file != null && message.file.length)
|
|
for (var i = 0; i < message.file.length; ++i)
|
|
$root.google.protobuf.FileDescriptorProto.encode(
|
|
message.file[i],
|
|
writer.uint32(/* id 1, wireType 2 =*/ 10).fork()
|
|
).ldelim();
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof google.protobuf.FileDescriptorSet
|
|
* @static
|
|
* @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
FileDescriptorSet.encodeDelimited = function encodeDelimited(
|
|
message,
|
|
writer
|
|
) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes a FileDescriptorSet message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof google.protobuf.FileDescriptorSet
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
FileDescriptorSet.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.google.protobuf.FileDescriptorSet();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
if (tag === error) break;
|
|
switch (tag >>> 3) {
|
|
case 1: {
|
|
if (!(message.file && message.file.length)) message.file = [];
|
|
message.file.push(
|
|
$root.google.protobuf.FileDescriptorProto.decode(
|
|
reader,
|
|
reader.uint32()
|
|
)
|
|
);
|
|
break;
|
|
}
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof google.protobuf.FileDescriptorSet
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
FileDescriptorSet.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader)) reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies a FileDescriptorSet message.
|
|
* @function verify
|
|
* @memberof google.protobuf.FileDescriptorSet
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
FileDescriptorSet.verify = function verify(message) {
|
|
if (typeof message !== "object" || message === null)
|
|
return "object expected";
|
|
if (message.file != null && message.hasOwnProperty("file")) {
|
|
if (!Array.isArray(message.file)) return "file: array expected";
|
|
for (var i = 0; i < message.file.length; ++i) {
|
|
var error = $root.google.protobuf.FileDescriptorProto.verify(
|
|
message.file[i]
|
|
);
|
|
if (error) return "file." + error;
|
|
}
|
|
}
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof google.protobuf.FileDescriptorSet
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet
|
|
*/
|
|
FileDescriptorSet.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.google.protobuf.FileDescriptorSet)
|
|
return object;
|
|
var message = new $root.google.protobuf.FileDescriptorSet();
|
|
if (object.file) {
|
|
if (!Array.isArray(object.file))
|
|
throw TypeError(
|
|
".google.protobuf.FileDescriptorSet.file: array expected"
|
|
);
|
|
message.file = [];
|
|
for (var i = 0; i < object.file.length; ++i) {
|
|
if (typeof object.file[i] !== "object")
|
|
throw TypeError(
|
|
".google.protobuf.FileDescriptorSet.file: object expected"
|
|
);
|
|
message.file[i] =
|
|
$root.google.protobuf.FileDescriptorProto.fromObject(
|
|
object.file[i]
|
|
);
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof google.protobuf.FileDescriptorSet
|
|
* @static
|
|
* @param {google.protobuf.FileDescriptorSet} message FileDescriptorSet
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
FileDescriptorSet.toObject = function toObject(message, options) {
|
|
if (!options) options = {};
|
|
var object = {};
|
|
if (options.arrays || options.defaults) object.file = [];
|
|
if (message.file && message.file.length) {
|
|
object.file = [];
|
|
for (var j = 0; j < message.file.length; ++j)
|
|
object.file[j] = $root.google.protobuf.FileDescriptorProto.toObject(
|
|
message.file[j],
|
|
options
|
|
);
|
|
}
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this FileDescriptorSet to JSON.
|
|
* @function toJSON
|
|
* @memberof google.protobuf.FileDescriptorSet
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
FileDescriptorSet.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
/**
|
|
* Gets the default type url for FileDescriptorSet
|
|
* @function getTypeUrl
|
|
* @memberof google.protobuf.FileDescriptorSet
|
|
* @static
|
|
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
|
* @returns {string} The default type url
|
|
*/
|
|
FileDescriptorSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
if (typeUrlPrefix === undefined) {
|
|
typeUrlPrefix = "type.googleapis.com";
|
|
}
|
|
return typeUrlPrefix + "/google.protobuf.FileDescriptorSet";
|
|
};
|
|
|
|
return FileDescriptorSet;
|
|
})();
|
|
|
|
/**
|
|
* Edition enum.
|
|
* @name google.protobuf.Edition
|
|
* @enum {number}
|
|
* @property {number} EDITION_UNKNOWN=0 EDITION_UNKNOWN value
|
|
* @property {number} EDITION_LEGACY=900 EDITION_LEGACY value
|
|
* @property {number} EDITION_PROTO2=998 EDITION_PROTO2 value
|
|
* @property {number} EDITION_PROTO3=999 EDITION_PROTO3 value
|
|
* @property {number} EDITION_2023=1000 EDITION_2023 value
|
|
* @property {number} EDITION_2024=1001 EDITION_2024 value
|
|
* @property {number} EDITION_1_TEST_ONLY=1 EDITION_1_TEST_ONLY value
|
|
* @property {number} EDITION_2_TEST_ONLY=2 EDITION_2_TEST_ONLY value
|
|
* @property {number} EDITION_99997_TEST_ONLY=99997 EDITION_99997_TEST_ONLY value
|
|
* @property {number} EDITION_99998_TEST_ONLY=99998 EDITION_99998_TEST_ONLY value
|
|
* @property {number} EDITION_99999_TEST_ONLY=99999 EDITION_99999_TEST_ONLY value
|
|
* @property {number} EDITION_MAX=2147483647 EDITION_MAX value
|
|
*/
|
|
protobuf.Edition = (function () {
|
|
var valuesById = {},
|
|
values = Object.create(valuesById);
|
|
values[(valuesById[0] = "EDITION_UNKNOWN")] = 0;
|
|
values[(valuesById[900] = "EDITION_LEGACY")] = 900;
|
|
values[(valuesById[998] = "EDITION_PROTO2")] = 998;
|
|
values[(valuesById[999] = "EDITION_PROTO3")] = 999;
|
|
values[(valuesById[1000] = "EDITION_2023")] = 1000;
|
|
values[(valuesById[1001] = "EDITION_2024")] = 1001;
|
|
values[(valuesById[1] = "EDITION_1_TEST_ONLY")] = 1;
|
|
values[(valuesById[2] = "EDITION_2_TEST_ONLY")] = 2;
|
|
values[(valuesById[99997] = "EDITION_99997_TEST_ONLY")] = 99997;
|
|
values[(valuesById[99998] = "EDITION_99998_TEST_ONLY")] = 99998;
|
|
values[(valuesById[99999] = "EDITION_99999_TEST_ONLY")] = 99999;
|
|
values[(valuesById[2147483647] = "EDITION_MAX")] = 2147483647;
|
|
return values;
|
|
})();
|
|
|
|
protobuf.FileDescriptorProto = (function () {
|
|
/**
|
|
* Properties of a FileDescriptorProto.
|
|
* @memberof google.protobuf
|
|
* @interface IFileDescriptorProto
|
|
* @property {string|null} [name] FileDescriptorProto name
|
|
* @property {string|null} ["package"] FileDescriptorProto package
|
|
* @property {Array.<string>|null} [dependency] FileDescriptorProto dependency
|
|
* @property {Array.<number>|null} [publicDependency] FileDescriptorProto publicDependency
|
|
* @property {Array.<number>|null} [weakDependency] FileDescriptorProto weakDependency
|
|
* @property {Array.<string>|null} [optionDependency] FileDescriptorProto optionDependency
|
|
* @property {Array.<google.protobuf.IDescriptorProto>|null} [messageType] FileDescriptorProto messageType
|
|
* @property {Array.<google.protobuf.IEnumDescriptorProto>|null} [enumType] FileDescriptorProto enumType
|
|
* @property {Array.<google.protobuf.IServiceDescriptorProto>|null} [service] FileDescriptorProto service
|
|
* @property {Array.<google.protobuf.IFieldDescriptorProto>|null} [extension] FileDescriptorProto extension
|
|
* @property {google.protobuf.IFileOptions|null} [options] FileDescriptorProto options
|
|
* @property {google.protobuf.ISourceCodeInfo|null} [sourceCodeInfo] FileDescriptorProto sourceCodeInfo
|
|
* @property {string|null} [syntax] FileDescriptorProto syntax
|
|
* @property {google.protobuf.Edition|null} [edition] FileDescriptorProto edition
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new FileDescriptorProto.
|
|
* @memberof google.protobuf
|
|
* @classdesc Represents a FileDescriptorProto.
|
|
* @implements IFileDescriptorProto
|
|
* @constructor
|
|
* @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set
|
|
*/
|
|
function FileDescriptorProto(properties) {
|
|
this.dependency = [];
|
|
this.publicDependency = [];
|
|
this.weakDependency = [];
|
|
this.optionDependency = [];
|
|
this.messageType = [];
|
|
this.enumType = [];
|
|
this.service = [];
|
|
this.extension = [];
|
|
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]];
|
|
}
|
|
|
|
/**
|
|
* FileDescriptorProto name.
|
|
* @member {string} name
|
|
* @memberof google.protobuf.FileDescriptorProto
|
|
* @instance
|
|
*/
|
|
FileDescriptorProto.prototype.name = "";
|
|
|
|
/**
|
|
* FileDescriptorProto package.
|
|
* @member {string} package
|
|
* @memberof google.protobuf.FileDescriptorProto
|
|
* @instance
|
|
*/
|
|
FileDescriptorProto.prototype["package"] = "";
|
|
|
|
/**
|
|
* FileDescriptorProto dependency.
|
|
* @member {Array.<string>} dependency
|
|
* @memberof google.protobuf.FileDescriptorProto
|
|
* @instance
|
|
*/
|
|
FileDescriptorProto.prototype.dependency = $util.emptyArray;
|
|
|
|
/**
|
|
* FileDescriptorProto publicDependency.
|
|
* @member {Array.<number>} publicDependency
|
|
* @memberof google.protobuf.FileDescriptorProto
|
|
* @instance
|
|
*/
|
|
FileDescriptorProto.prototype.publicDependency = $util.emptyArray;
|
|
|
|
/**
|
|
* FileDescriptorProto weakDependency.
|
|
* @member {Array.<number>} weakDependency
|
|
* @memberof google.protobuf.FileDescriptorProto
|
|
* @instance
|
|
*/
|
|
FileDescriptorProto.prototype.weakDependency = $util.emptyArray;
|
|
|
|
/**
|
|
* FileDescriptorProto optionDependency.
|
|
* @member {Array.<string>} optionDependency
|
|
* @memberof google.protobuf.FileDescriptorProto
|
|
* @instance
|
|
*/
|
|
FileDescriptorProto.prototype.optionDependency = $util.emptyArray;
|
|
|
|
/**
|
|
* FileDescriptorProto messageType.
|
|
* @member {Array.<google.protobuf.IDescriptorProto>} messageType
|
|
* @memberof google.protobuf.FileDescriptorProto
|
|
* @instance
|
|
*/
|
|
FileDescriptorProto.prototype.messageType = $util.emptyArray;
|
|
|
|
/**
|
|
* FileDescriptorProto enumType.
|
|
* @member {Array.<google.protobuf.IEnumDescriptorProto>} enumType
|
|
* @memberof google.protobuf.FileDescriptorProto
|
|
* @instance
|
|
*/
|
|
FileDescriptorProto.prototype.enumType = $util.emptyArray;
|
|
|
|
/**
|
|
* FileDescriptorProto service.
|
|
* @member {Array.<google.protobuf.IServiceDescriptorProto>} service
|
|
* @memberof google.protobuf.FileDescriptorProto
|
|
* @instance
|
|
*/
|
|
FileDescriptorProto.prototype.service = $util.emptyArray;
|
|
|
|
/**
|
|
* FileDescriptorProto extension.
|
|
* @member {Array.<google.protobuf.IFieldDescriptorProto>} extension
|
|
* @memberof google.protobuf.FileDescriptorProto
|
|
* @instance
|
|
*/
|
|
FileDescriptorProto.prototype.extension = $util.emptyArray;
|
|
|
|
/**
|
|
* FileDescriptorProto options.
|
|
* @member {google.protobuf.IFileOptions|null|undefined} options
|
|
* @memberof google.protobuf.FileDescriptorProto
|
|
* @instance
|
|
*/
|
|
FileDescriptorProto.prototype.options = null;
|
|
|
|
/**
|
|
* FileDescriptorProto sourceCodeInfo.
|
|
* @member {google.protobuf.ISourceCodeInfo|null|undefined} sourceCodeInfo
|
|
* @memberof google.protobuf.FileDescriptorProto
|
|
* @instance
|
|
*/
|
|
FileDescriptorProto.prototype.sourceCodeInfo = null;
|
|
|
|
/**
|
|
* FileDescriptorProto syntax.
|
|
* @member {string} syntax
|
|
* @memberof google.protobuf.FileDescriptorProto
|
|
* @instance
|
|
*/
|
|
FileDescriptorProto.prototype.syntax = "";
|
|
|
|
/**
|
|
* FileDescriptorProto edition.
|
|
* @member {google.protobuf.Edition} edition
|
|
* @memberof google.protobuf.FileDescriptorProto
|
|
* @instance
|
|
*/
|
|
FileDescriptorProto.prototype.edition = 0;
|
|
|
|
/**
|
|
* Creates a new FileDescriptorProto instance using the specified properties.
|
|
* @function create
|
|
* @memberof google.protobuf.FileDescriptorProto
|
|
* @static
|
|
* @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set
|
|
* @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto instance
|
|
*/
|
|
FileDescriptorProto.create = function create(properties) {
|
|
return new FileDescriptorProto(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof google.protobuf.FileDescriptorProto
|
|
* @static
|
|
* @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
FileDescriptorProto.encode = function encode(message, writer) {
|
|
if (!writer) writer = $Writer.create();
|
|
if (message.name != null && Object.hasOwnProperty.call(message, "name"))
|
|
writer.uint32(/* id 1, wireType 2 =*/ 10).string(message.name);
|
|
if (
|
|
message["package"] != null &&
|
|
Object.hasOwnProperty.call(message, "package")
|
|
)
|
|
writer.uint32(/* id 2, wireType 2 =*/ 18).string(message["package"]);
|
|
if (message.dependency != null && message.dependency.length)
|
|
for (var i = 0; i < message.dependency.length; ++i)
|
|
writer
|
|
.uint32(/* id 3, wireType 2 =*/ 26)
|
|
.string(message.dependency[i]);
|
|
if (message.messageType != null && message.messageType.length)
|
|
for (var i = 0; i < message.messageType.length; ++i)
|
|
$root.google.protobuf.DescriptorProto.encode(
|
|
message.messageType[i],
|
|
writer.uint32(/* id 4, wireType 2 =*/ 34).fork()
|
|
).ldelim();
|
|
if (message.enumType != null && message.enumType.length)
|
|
for (var i = 0; i < message.enumType.length; ++i)
|
|
$root.google.protobuf.EnumDescriptorProto.encode(
|
|
message.enumType[i],
|
|
writer.uint32(/* id 5, wireType 2 =*/ 42).fork()
|
|
).ldelim();
|
|
if (message.service != null && message.service.length)
|
|
for (var i = 0; i < message.service.length; ++i)
|
|
$root.google.protobuf.ServiceDescriptorProto.encode(
|
|
message.service[i],
|
|
writer.uint32(/* id 6, wireType 2 =*/ 50).fork()
|
|
).ldelim();
|
|
if (message.extension != null && message.extension.length)
|
|
for (var i = 0; i < message.extension.length; ++i)
|
|
$root.google.protobuf.FieldDescriptorProto.encode(
|
|
message.extension[i],
|
|
writer.uint32(/* id 7, wireType 2 =*/ 58).fork()
|
|
).ldelim();
|
|
if (
|
|
message.options != null &&
|
|
Object.hasOwnProperty.call(message, "options")
|
|
)
|
|
$root.google.protobuf.FileOptions.encode(
|
|
message.options,
|
|
writer.uint32(/* id 8, wireType 2 =*/ 66).fork()
|
|
).ldelim();
|
|
if (
|
|
message.sourceCodeInfo != null &&
|
|
Object.hasOwnProperty.call(message, "sourceCodeInfo")
|
|
)
|
|
$root.google.protobuf.SourceCodeInfo.encode(
|
|
message.sourceCodeInfo,
|
|
writer.uint32(/* id 9, wireType 2 =*/ 74).fork()
|
|
).ldelim();
|
|
if (message.publicDependency != null && message.publicDependency.length)
|
|
for (var i = 0; i < message.publicDependency.length; ++i)
|
|
writer
|
|
.uint32(/* id 10, wireType 0 =*/ 80)
|
|
.int32(message.publicDependency[i]);
|
|
if (message.weakDependency != null && message.weakDependency.length)
|
|
for (var i = 0; i < message.weakDependency.length; ++i)
|
|
writer
|
|
.uint32(/* id 11, wireType 0 =*/ 88)
|
|
.int32(message.weakDependency[i]);
|
|
if (
|
|
message.syntax != null &&
|
|
Object.hasOwnProperty.call(message, "syntax")
|
|
)
|
|
writer.uint32(/* id 12, wireType 2 =*/ 98).string(message.syntax);
|
|
if (
|
|
message.edition != null &&
|
|
Object.hasOwnProperty.call(message, "edition")
|
|
)
|
|
writer.uint32(/* id 14, wireType 0 =*/ 112).int32(message.edition);
|
|
if (message.optionDependency != null && message.optionDependency.length)
|
|
for (var i = 0; i < message.optionDependency.length; ++i)
|
|
writer
|
|
.uint32(/* id 15, wireType 2 =*/ 122)
|
|
.string(message.optionDependency[i]);
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof google.protobuf.FileDescriptorProto
|
|
* @static
|
|
* @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
FileDescriptorProto.encodeDelimited = function encodeDelimited(
|
|
message,
|
|
writer
|
|
) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes a FileDescriptorProto message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof google.protobuf.FileDescriptorProto
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
FileDescriptorProto.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.google.protobuf.FileDescriptorProto();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
if (tag === error) break;
|
|
switch (tag >>> 3) {
|
|
case 1: {
|
|
message.name = reader.string();
|
|
break;
|
|
}
|
|
case 2: {
|
|
message["package"] = reader.string();
|
|
break;
|
|
}
|
|
case 3: {
|
|
if (!(message.dependency && message.dependency.length))
|
|
message.dependency = [];
|
|
message.dependency.push(reader.string());
|
|
break;
|
|
}
|
|
case 10: {
|
|
if (
|
|
!(message.publicDependency && message.publicDependency.length)
|
|
)
|
|
message.publicDependency = [];
|
|
if ((tag & 7) === 2) {
|
|
var end2 = reader.uint32() + reader.pos;
|
|
while (reader.pos < end2)
|
|
message.publicDependency.push(reader.int32());
|
|
} else message.publicDependency.push(reader.int32());
|
|
break;
|
|
}
|
|
case 11: {
|
|
if (!(message.weakDependency && message.weakDependency.length))
|
|
message.weakDependency = [];
|
|
if ((tag & 7) === 2) {
|
|
var end2 = reader.uint32() + reader.pos;
|
|
while (reader.pos < end2)
|
|
message.weakDependency.push(reader.int32());
|
|
} else message.weakDependency.push(reader.int32());
|
|
break;
|
|
}
|
|
case 15: {
|
|
if (
|
|
!(message.optionDependency && message.optionDependency.length)
|
|
)
|
|
message.optionDependency = [];
|
|
message.optionDependency.push(reader.string());
|
|
break;
|
|
}
|
|
case 4: {
|
|
if (!(message.messageType && message.messageType.length))
|
|
message.messageType = [];
|
|
message.messageType.push(
|
|
$root.google.protobuf.DescriptorProto.decode(
|
|
reader,
|
|
reader.uint32()
|
|
)
|
|
);
|
|
break;
|
|
}
|
|
case 5: {
|
|
if (!(message.enumType && message.enumType.length))
|
|
message.enumType = [];
|
|
message.enumType.push(
|
|
$root.google.protobuf.EnumDescriptorProto.decode(
|
|
reader,
|
|
reader.uint32()
|
|
)
|
|
);
|
|
break;
|
|
}
|
|
case 6: {
|
|
if (!(message.service && message.service.length))
|
|
message.service = [];
|
|
message.service.push(
|
|
$root.google.protobuf.ServiceDescriptorProto.decode(
|
|
reader,
|
|
reader.uint32()
|
|
)
|
|
);
|
|
break;
|
|
}
|
|
case 7: {
|
|
if (!(message.extension && message.extension.length))
|
|
message.extension = [];
|
|
message.extension.push(
|
|
$root.google.protobuf.FieldDescriptorProto.decode(
|
|
reader,
|
|
reader.uint32()
|
|
)
|
|
);
|
|
break;
|
|
}
|
|
case 8: {
|
|
message.options = $root.google.protobuf.FileOptions.decode(
|
|
reader,
|
|
reader.uint32()
|
|
);
|
|
break;
|
|
}
|
|
case 9: {
|
|
message.sourceCodeInfo =
|
|
$root.google.protobuf.SourceCodeInfo.decode(
|
|
reader,
|
|
reader.uint32()
|
|
);
|
|
break;
|
|
}
|
|
case 12: {
|
|
message.syntax = reader.string();
|
|
break;
|
|
}
|
|
case 14: {
|
|
message.edition = reader.int32();
|
|
break;
|
|
}
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof google.protobuf.FileDescriptorProto
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
FileDescriptorProto.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader)) reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies a FileDescriptorProto message.
|
|
* @function verify
|
|
* @memberof google.protobuf.FileDescriptorProto
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
FileDescriptorProto.verify = function verify(message) {
|
|
if (typeof message !== "object" || message === null)
|
|
return "object expected";
|
|
if (message.name != null && message.hasOwnProperty("name"))
|
|
if (!$util.isString(message.name)) return "name: string expected";
|
|
if (message["package"] != null && message.hasOwnProperty("package"))
|
|
if (!$util.isString(message["package"]))
|
|
return "package: string expected";
|
|
if (
|
|
message.dependency != null &&
|
|
message.hasOwnProperty("dependency")
|
|
) {
|
|
if (!Array.isArray(message.dependency))
|
|
return "dependency: array expected";
|
|
for (var i = 0; i < message.dependency.length; ++i)
|
|
if (!$util.isString(message.dependency[i]))
|
|
return "dependency: string[] expected";
|
|
}
|
|
if (
|
|
message.publicDependency != null &&
|
|
message.hasOwnProperty("publicDependency")
|
|
) {
|
|
if (!Array.isArray(message.publicDependency))
|
|
return "publicDependency: array expected";
|
|
for (var i = 0; i < message.publicDependency.length; ++i)
|
|
if (!$util.isInteger(message.publicDependency[i]))
|
|
return "publicDependency: integer[] expected";
|
|
}
|
|
if (
|
|
message.weakDependency != null &&
|
|
message.hasOwnProperty("weakDependency")
|
|
) {
|
|
if (!Array.isArray(message.weakDependency))
|
|
return "weakDependency: array expected";
|
|
for (var i = 0; i < message.weakDependency.length; ++i)
|
|
if (!$util.isInteger(message.weakDependency[i]))
|
|
return "weakDependency: integer[] expected";
|
|
}
|
|
if (
|
|
message.optionDependency != null &&
|
|
message.hasOwnProperty("optionDependency")
|
|
) {
|
|
if (!Array.isArray(message.optionDependency))
|
|
return "optionDependency: array expected";
|
|
for (var i = 0; i < message.optionDependency.length; ++i)
|
|
if (!$util.isString(message.optionDependency[i]))
|
|
return "optionDependency: string[] expected";
|
|
}
|
|
if (
|
|
message.messageType != null &&
|
|
message.hasOwnProperty("messageType")
|
|
) {
|
|
if (!Array.isArray(message.messageType))
|
|
return "messageType: array expected";
|
|
for (var i = 0; i < message.messageType.length; ++i) {
|
|
var error = $root.google.protobuf.DescriptorProto.verify(
|
|
message.messageType[i]
|
|
);
|
|
if (error) return "messageType." + error;
|
|
}
|
|
}
|
|
if (message.enumType != null && message.hasOwnProperty("enumType")) {
|
|
if (!Array.isArray(message.enumType))
|
|
return "enumType: array expected";
|
|
for (var i = 0; i < message.enumType.length; ++i) {
|
|
var error = $root.google.protobuf.EnumDescriptorProto.verify(
|
|
message.enumType[i]
|
|
);
|
|
if (error) return "enumType." + error;
|
|
}
|
|
}
|
|
if (message.service != null && message.hasOwnProperty("service")) {
|
|
if (!Array.isArray(message.service)) return "service: array expected";
|
|
for (var i = 0; i < message.service.length; ++i) {
|
|
var error = $root.google.protobuf.ServiceDescriptorProto.verify(
|
|
message.service[i]
|
|
);
|
|
if (error) return "service." + error;
|
|
}
|
|
}
|
|
if (message.extension != null && message.hasOwnProperty("extension")) {
|
|
if (!Array.isArray(message.extension))
|
|
return "extension: array expected";
|
|
for (var i = 0; i < message.extension.length; ++i) {
|
|
var error = $root.google.protobuf.FieldDescriptorProto.verify(
|
|
message.extension[i]
|
|
);
|
|
if (error) return "extension." + error;
|
|
}
|
|
}
|
|
if (message.options != null && message.hasOwnProperty("options")) {
|
|
var error = $root.google.protobuf.FileOptions.verify(message.options);
|
|
if (error) return "options." + error;
|
|
}
|
|
if (
|
|
message.sourceCodeInfo != null &&
|
|
message.hasOwnProperty("sourceCodeInfo")
|
|
) {
|
|
var error = $root.google.protobuf.SourceCodeInfo.verify(
|
|
message.sourceCodeInfo
|
|
);
|
|
if (error) return "sourceCodeInfo." + error;
|
|
}
|
|
if (message.syntax != null && message.hasOwnProperty("syntax"))
|
|
if (!$util.isString(message.syntax)) return "syntax: string expected";
|
|
if (message.edition != null && message.hasOwnProperty("edition"))
|
|
switch (message.edition) {
|
|
default:
|
|
return "edition: enum value expected";
|
|
case 0:
|
|
case 900:
|
|
case 998:
|
|
case 999:
|
|
case 1000:
|
|
case 1001:
|
|
case 1:
|
|
case 2:
|
|
case 99997:
|
|
case 99998:
|
|
case 99999:
|
|
case 2147483647:
|
|
break;
|
|
}
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof google.protobuf.FileDescriptorProto
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto
|
|
*/
|
|
FileDescriptorProto.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.google.protobuf.FileDescriptorProto)
|
|
return object;
|
|
var message = new $root.google.protobuf.FileDescriptorProto();
|
|
if (object.name != null) message.name = String(object.name);
|
|
if (object["package"] != null)
|
|
message["package"] = String(object["package"]);
|
|
if (object.dependency) {
|
|
if (!Array.isArray(object.dependency))
|
|
throw TypeError(
|
|
".google.protobuf.FileDescriptorProto.dependency: array expected"
|
|
);
|
|
message.dependency = [];
|
|
for (var i = 0; i < object.dependency.length; ++i)
|
|
message.dependency[i] = String(object.dependency[i]);
|
|
}
|
|
if (object.publicDependency) {
|
|
if (!Array.isArray(object.publicDependency))
|
|
throw TypeError(
|
|
".google.protobuf.FileDescriptorProto.publicDependency: array expected"
|
|
);
|
|
message.publicDependency = [];
|
|
for (var i = 0; i < object.publicDependency.length; ++i)
|
|
message.publicDependency[i] = object.publicDependency[i] | 0;
|
|
}
|
|
if (object.weakDependency) {
|
|
if (!Array.isArray(object.weakDependency))
|
|
throw TypeError(
|
|
".google.protobuf.FileDescriptorProto.weakDependency: array expected"
|
|
);
|
|
message.weakDependency = [];
|
|
for (var i = 0; i < object.weakDependency.length; ++i)
|
|
message.weakDependency[i] = object.weakDependency[i] | 0;
|
|
}
|
|
if (object.optionDependency) {
|
|
if (!Array.isArray(object.optionDependency))
|
|
throw TypeError(
|
|
".google.protobuf.FileDescriptorProto.optionDependency: array expected"
|
|
);
|
|
message.optionDependency = [];
|
|
for (var i = 0; i < object.optionDependency.length; ++i)
|
|
message.optionDependency[i] = String(object.optionDependency[i]);
|
|
}
|
|
if (object.messageType) {
|
|
if (!Array.isArray(object.messageType))
|
|
throw TypeError(
|
|
".google.protobuf.FileDescriptorProto.messageType: array expected"
|
|
);
|
|
message.messageType = [];
|
|
for (var i = 0; i < object.messageType.length; ++i) {
|
|
if (typeof object.messageType[i] !== "object")
|
|
throw TypeError(
|
|
".google.protobuf.FileDescriptorProto.messageType: object expected"
|
|
);
|
|
message.messageType[i] =
|
|
$root.google.protobuf.DescriptorProto.fromObject(
|
|
object.messageType[i]
|
|
);
|
|
}
|
|
}
|
|
if (object.enumType) {
|
|
if (!Array.isArray(object.enumType))
|
|
throw TypeError(
|
|
".google.protobuf.FileDescriptorProto.enumType: array expected"
|
|
);
|
|
message.enumType = [];
|
|
for (var i = 0; i < object.enumType.length; ++i) {
|
|
if (typeof object.enumType[i] !== "object")
|
|
throw TypeError(
|
|
".google.protobuf.FileDescriptorProto.enumType: object expected"
|
|
);
|
|
message.enumType[i] =
|
|
$root.google.protobuf.EnumDescriptorProto.fromObject(
|
|
object.enumType[i]
|
|
);
|
|
}
|
|
}
|
|
if (object.service) {
|
|
if (!Array.isArray(object.service))
|
|
throw TypeError(
|
|
".google.protobuf.FileDescriptorProto.service: array expected"
|
|
);
|
|
message.service = [];
|
|
for (var i = 0; i < object.service.length; ++i) {
|
|
if (typeof object.service[i] !== "object")
|
|
throw TypeError(
|
|
".google.protobuf.FileDescriptorProto.service: object expected"
|
|
);
|
|
message.service[i] =
|
|
$root.google.protobuf.ServiceDescriptorProto.fromObject(
|
|
object.service[i]
|
|
);
|
|
}
|
|
}
|
|
if (object.extension) {
|
|
if (!Array.isArray(object.extension))
|
|
throw TypeError(
|
|
".google.protobuf.FileDescriptorProto.extension: array expected"
|
|
);
|
|
message.extension = [];
|
|
for (var i = 0; i < object.extension.length; ++i) {
|
|
if (typeof object.extension[i] !== "object")
|
|
throw TypeError(
|
|
".google.protobuf.FileDescriptorProto.extension: object expected"
|
|
);
|
|
message.extension[i] =
|
|
$root.google.protobuf.FieldDescriptorProto.fromObject(
|
|
object.extension[i]
|
|
);
|
|
}
|
|
}
|
|
if (object.options != null) {
|
|
if (typeof object.options !== "object")
|
|
throw TypeError(
|
|
".google.protobuf.FileDescriptorProto.options: object expected"
|
|
);
|
|
message.options = $root.google.protobuf.FileOptions.fromObject(
|
|
object.options
|
|
);
|
|
}
|
|
if (object.sourceCodeInfo != null) {
|
|
if (typeof object.sourceCodeInfo !== "object")
|
|
throw TypeError(
|
|
".google.protobuf.FileDescriptorProto.sourceCodeInfo: object expected"
|
|
);
|
|
message.sourceCodeInfo =
|
|
$root.google.protobuf.SourceCodeInfo.fromObject(
|
|
object.sourceCodeInfo
|
|
);
|
|
}
|
|
if (object.syntax != null) message.syntax = String(object.syntax);
|
|
switch (object.edition) {
|
|
default:
|
|
if (typeof object.edition === "number") {
|
|
message.edition = object.edition;
|
|
break;
|
|
}
|
|
break;
|
|
case "EDITION_UNKNOWN":
|
|
case 0:
|
|
message.edition = 0;
|
|
break;
|
|
case "EDITION_LEGACY":
|
|
case 900:
|
|
message.edition = 900;
|
|
break;
|
|
case "EDITION_PROTO2":
|
|
case 998:
|
|
message.edition = 998;
|
|
break;
|
|
case "EDITION_PROTO3":
|
|
case 999:
|
|
message.edition = 999;
|
|
break;
|
|
case "EDITION_2023":
|
|
case 1000:
|
|
message.edition = 1000;
|
|
break;
|
|
case "EDITION_2024":
|
|
case 1001:
|
|
message.edition = 1001;
|
|
break;
|
|
case "EDITION_1_TEST_ONLY":
|
|
case 1:
|
|
message.edition = 1;
|
|
break;
|
|
case "EDITION_2_TEST_ONLY":
|
|
case 2:
|
|
message.edition = 2;
|
|
break;
|
|
case "EDITION_99997_TEST_ONLY":
|
|
case 99997:
|
|
message.edition = 99997;
|
|
break;
|
|
case "EDITION_99998_TEST_ONLY":
|
|
case 99998:
|
|
message.edition = 99998;
|
|
break;
|
|
case "EDITION_99999_TEST_ONLY":
|
|
case 99999:
|
|
message.edition = 99999;
|
|
break;
|
|
case "EDITION_MAX":
|
|
case 2147483647:
|
|
message.edition = 2147483647;
|
|
break;
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof google.protobuf.FileDescriptorProto
|
|
* @static
|
|
* @param {google.protobuf.FileDescriptorProto} message FileDescriptorProto
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
FileDescriptorProto.toObject = function toObject(message, options) {
|
|
if (!options) options = {};
|
|
var object = {};
|
|
if (options.arrays || options.defaults) {
|
|
object.dependency = [];
|
|
object.messageType = [];
|
|
object.enumType = [];
|
|
object.service = [];
|
|
object.extension = [];
|
|
object.publicDependency = [];
|
|
object.weakDependency = [];
|
|
object.optionDependency = [];
|
|
}
|
|
if (options.defaults) {
|
|
object.name = "";
|
|
object["package"] = "";
|
|
object.options = null;
|
|
object.sourceCodeInfo = null;
|
|
object.syntax = "";
|
|
object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0;
|
|
}
|
|
if (message.name != null && message.hasOwnProperty("name"))
|
|
object.name = message.name;
|
|
if (message["package"] != null && message.hasOwnProperty("package"))
|
|
object["package"] = message["package"];
|
|
if (message.dependency && message.dependency.length) {
|
|
object.dependency = [];
|
|
for (var j = 0; j < message.dependency.length; ++j)
|
|
object.dependency[j] = message.dependency[j];
|
|
}
|
|
if (message.messageType && message.messageType.length) {
|
|
object.messageType = [];
|
|
for (var j = 0; j < message.messageType.length; ++j)
|
|
object.messageType[j] =
|
|
$root.google.protobuf.DescriptorProto.toObject(
|
|
message.messageType[j],
|
|
options
|
|
);
|
|
}
|
|
if (message.enumType && message.enumType.length) {
|
|
object.enumType = [];
|
|
for (var j = 0; j < message.enumType.length; ++j)
|
|
object.enumType[j] =
|
|
$root.google.protobuf.EnumDescriptorProto.toObject(
|
|
message.enumType[j],
|
|
options
|
|
);
|
|
}
|
|
if (message.service && message.service.length) {
|
|
object.service = [];
|
|
for (var j = 0; j < message.service.length; ++j)
|
|
object.service[j] =
|
|
$root.google.protobuf.ServiceDescriptorProto.toObject(
|
|
message.service[j],
|
|
options
|
|
);
|
|
}
|
|
if (message.extension && message.extension.length) {
|
|
object.extension = [];
|
|
for (var j = 0; j < message.extension.length; ++j)
|
|
object.extension[j] =
|
|
$root.google.protobuf.FieldDescriptorProto.toObject(
|
|
message.extension[j],
|
|
options
|
|
);
|
|
}
|
|
if (message.options != null && message.hasOwnProperty("options"))
|
|
object.options = $root.google.protobuf.FileOptions.toObject(
|
|
message.options,
|
|
options
|
|
);
|
|
if (
|
|
message.sourceCodeInfo != null &&
|
|
message.hasOwnProperty("sourceCodeInfo")
|
|
)
|
|
object.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.toObject(
|
|
message.sourceCodeInfo,
|
|
options
|
|
);
|
|
if (message.publicDependency && message.publicDependency.length) {
|
|
object.publicDependency = [];
|
|
for (var j = 0; j < message.publicDependency.length; ++j)
|
|
object.publicDependency[j] = message.publicDependency[j];
|
|
}
|
|
if (message.weakDependency && message.weakDependency.length) {
|
|
object.weakDependency = [];
|
|
for (var j = 0; j < message.weakDependency.length; ++j)
|
|
object.weakDependency[j] = message.weakDependency[j];
|
|
}
|
|
if (message.syntax != null && message.hasOwnProperty("syntax"))
|
|
object.syntax = message.syntax;
|
|
if (message.edition != null && message.hasOwnProperty("edition"))
|
|
object.edition =
|
|
options.enums === String
|
|
? $root.google.protobuf.Edition[message.edition] === undefined
|
|
? message.edition
|
|
: $root.google.protobuf.Edition[message.edition]
|
|
: message.edition;
|
|
if (message.optionDependency && message.optionDependency.length) {
|
|
object.optionDependency = [];
|
|
for (var j = 0; j < message.optionDependency.length; ++j)
|
|
object.optionDependency[j] = message.optionDependency[j];
|
|
}
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this FileDescriptorProto to JSON.
|
|
* @function toJSON
|
|
* @memberof google.protobuf.FileDescriptorProto
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
FileDescriptorProto.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
/**
|
|
* Gets the default type url for FileDescriptorProto
|
|
* @function getTypeUrl
|
|
* @memberof google.protobuf.FileDescriptorProto
|
|
* @static
|
|
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
|
* @returns {string} The default type url
|
|
*/
|
|
FileDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
if (typeUrlPrefix === undefined) {
|
|
typeUrlPrefix = "type.googleapis.com";
|
|
}
|
|
return typeUrlPrefix + "/google.protobuf.FileDescriptorProto";
|
|
};
|
|
|
|
return FileDescriptorProto;
|
|
})();
|
|
|
|
protobuf.DescriptorProto = (function () {
|
|
/**
|
|
* Properties of a DescriptorProto.
|
|
* @memberof google.protobuf
|
|
* @interface IDescriptorProto
|
|
* @property {string|null} [name] DescriptorProto name
|
|
* @property {Array.<google.protobuf.IFieldDescriptorProto>|null} [field] DescriptorProto field
|
|
* @property {Array.<google.protobuf.IFieldDescriptorProto>|null} [extension] DescriptorProto extension
|
|
* @property {Array.<google.protobuf.IDescriptorProto>|null} [nestedType] DescriptorProto nestedType
|
|
* @property {Array.<google.protobuf.IEnumDescriptorProto>|null} [enumType] DescriptorProto enumType
|
|
* @property {Array.<google.protobuf.DescriptorProto.IExtensionRange>|null} [extensionRange] DescriptorProto extensionRange
|
|
* @property {Array.<google.protobuf.IOneofDescriptorProto>|null} [oneofDecl] DescriptorProto oneofDecl
|
|
* @property {google.protobuf.IMessageOptions|null} [options] DescriptorProto options
|
|
* @property {Array.<google.protobuf.DescriptorProto.IReservedRange>|null} [reservedRange] DescriptorProto reservedRange
|
|
* @property {Array.<string>|null} [reservedName] DescriptorProto reservedName
|
|
* @property {google.protobuf.SymbolVisibility|null} [visibility] DescriptorProto visibility
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new DescriptorProto.
|
|
* @memberof google.protobuf
|
|
* @classdesc Represents a DescriptorProto.
|
|
* @implements IDescriptorProto
|
|
* @constructor
|
|
* @param {google.protobuf.IDescriptorProto=} [properties] Properties to set
|
|
*/
|
|
function DescriptorProto(properties) {
|
|
this.field = [];
|
|
this.extension = [];
|
|
this.nestedType = [];
|
|
this.enumType = [];
|
|
this.extensionRange = [];
|
|
this.oneofDecl = [];
|
|
this.reservedRange = [];
|
|
this.reservedName = [];
|
|
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]];
|
|
}
|
|
|
|
/**
|
|
* DescriptorProto name.
|
|
* @member {string} name
|
|
* @memberof google.protobuf.DescriptorProto
|
|
* @instance
|
|
*/
|
|
DescriptorProto.prototype.name = "";
|
|
|
|
/**
|
|
* DescriptorProto field.
|
|
* @member {Array.<google.protobuf.IFieldDescriptorProto>} field
|
|
* @memberof google.protobuf.DescriptorProto
|
|
* @instance
|
|
*/
|
|
DescriptorProto.prototype.field = $util.emptyArray;
|
|
|
|
/**
|
|
* DescriptorProto extension.
|
|
* @member {Array.<google.protobuf.IFieldDescriptorProto>} extension
|
|
* @memberof google.protobuf.DescriptorProto
|
|
* @instance
|
|
*/
|
|
DescriptorProto.prototype.extension = $util.emptyArray;
|
|
|
|
/**
|
|
* DescriptorProto nestedType.
|
|
* @member {Array.<google.protobuf.IDescriptorProto>} nestedType
|
|
* @memberof google.protobuf.DescriptorProto
|
|
* @instance
|
|
*/
|
|
DescriptorProto.prototype.nestedType = $util.emptyArray;
|
|
|
|
/**
|
|
* DescriptorProto enumType.
|
|
* @member {Array.<google.protobuf.IEnumDescriptorProto>} enumType
|
|
* @memberof google.protobuf.DescriptorProto
|
|
* @instance
|
|
*/
|
|
DescriptorProto.prototype.enumType = $util.emptyArray;
|
|
|
|
/**
|
|
* DescriptorProto extensionRange.
|
|
* @member {Array.<google.protobuf.DescriptorProto.IExtensionRange>} extensionRange
|
|
* @memberof google.protobuf.DescriptorProto
|
|
* @instance
|
|
*/
|
|
DescriptorProto.prototype.extensionRange = $util.emptyArray;
|
|
|
|
/**
|
|
* DescriptorProto oneofDecl.
|
|
* @member {Array.<google.protobuf.IOneofDescriptorProto>} oneofDecl
|
|
* @memberof google.protobuf.DescriptorProto
|
|
* @instance
|
|
*/
|
|
DescriptorProto.prototype.oneofDecl = $util.emptyArray;
|
|
|
|
/**
|
|
* DescriptorProto options.
|
|
* @member {google.protobuf.IMessageOptions|null|undefined} options
|
|
* @memberof google.protobuf.DescriptorProto
|
|
* @instance
|
|
*/
|
|
DescriptorProto.prototype.options = null;
|
|
|
|
/**
|
|
* DescriptorProto reservedRange.
|
|
* @member {Array.<google.protobuf.DescriptorProto.IReservedRange>} reservedRange
|
|
* @memberof google.protobuf.DescriptorProto
|
|
* @instance
|
|
*/
|
|
DescriptorProto.prototype.reservedRange = $util.emptyArray;
|
|
|
|
/**
|
|
* DescriptorProto reservedName.
|
|
* @member {Array.<string>} reservedName
|
|
* @memberof google.protobuf.DescriptorProto
|
|
* @instance
|
|
*/
|
|
DescriptorProto.prototype.reservedName = $util.emptyArray;
|
|
|
|
/**
|
|
* DescriptorProto visibility.
|
|
* @member {google.protobuf.SymbolVisibility} visibility
|
|
* @memberof google.protobuf.DescriptorProto
|
|
* @instance
|
|
*/
|
|
DescriptorProto.prototype.visibility = 0;
|
|
|
|
/**
|
|
* Creates a new DescriptorProto instance using the specified properties.
|
|
* @function create
|
|
* @memberof google.protobuf.DescriptorProto
|
|
* @static
|
|
* @param {google.protobuf.IDescriptorProto=} [properties] Properties to set
|
|
* @returns {google.protobuf.DescriptorProto} DescriptorProto instance
|
|
*/
|
|
DescriptorProto.create = function create(properties) {
|
|
return new DescriptorProto(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof google.protobuf.DescriptorProto
|
|
* @static
|
|
* @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
DescriptorProto.encode = function encode(message, writer) {
|
|
if (!writer) writer = $Writer.create();
|
|
if (message.name != null && Object.hasOwnProperty.call(message, "name"))
|
|
writer.uint32(/* id 1, wireType 2 =*/ 10).string(message.name);
|
|
if (message.field != null && message.field.length)
|
|
for (var i = 0; i < message.field.length; ++i)
|
|
$root.google.protobuf.FieldDescriptorProto.encode(
|
|
message.field[i],
|
|
writer.uint32(/* id 2, wireType 2 =*/ 18).fork()
|
|
).ldelim();
|
|
if (message.nestedType != null && message.nestedType.length)
|
|
for (var i = 0; i < message.nestedType.length; ++i)
|
|
$root.google.protobuf.DescriptorProto.encode(
|
|
message.nestedType[i],
|
|
writer.uint32(/* id 3, wireType 2 =*/ 26).fork()
|
|
).ldelim();
|
|
if (message.enumType != null && message.enumType.length)
|
|
for (var i = 0; i < message.enumType.length; ++i)
|
|
$root.google.protobuf.EnumDescriptorProto.encode(
|
|
message.enumType[i],
|
|
writer.uint32(/* id 4, wireType 2 =*/ 34).fork()
|
|
).ldelim();
|
|
if (message.extensionRange != null && message.extensionRange.length)
|
|
for (var i = 0; i < message.extensionRange.length; ++i)
|
|
$root.google.protobuf.DescriptorProto.ExtensionRange.encode(
|
|
message.extensionRange[i],
|
|
writer.uint32(/* id 5, wireType 2 =*/ 42).fork()
|
|
).ldelim();
|
|
if (message.extension != null && message.extension.length)
|
|
for (var i = 0; i < message.extension.length; ++i)
|
|
$root.google.protobuf.FieldDescriptorProto.encode(
|
|
message.extension[i],
|
|
writer.uint32(/* id 6, wireType 2 =*/ 50).fork()
|
|
).ldelim();
|
|
if (
|
|
message.options != null &&
|
|
Object.hasOwnProperty.call(message, "options")
|
|
)
|
|
$root.google.protobuf.MessageOptions.encode(
|
|
message.options,
|
|
writer.uint32(/* id 7, wireType 2 =*/ 58).fork()
|
|
).ldelim();
|
|
if (message.oneofDecl != null && message.oneofDecl.length)
|
|
for (var i = 0; i < message.oneofDecl.length; ++i)
|
|
$root.google.protobuf.OneofDescriptorProto.encode(
|
|
message.oneofDecl[i],
|
|
writer.uint32(/* id 8, wireType 2 =*/ 66).fork()
|
|
).ldelim();
|
|
if (message.reservedRange != null && message.reservedRange.length)
|
|
for (var i = 0; i < message.reservedRange.length; ++i)
|
|
$root.google.protobuf.DescriptorProto.ReservedRange.encode(
|
|
message.reservedRange[i],
|
|
writer.uint32(/* id 9, wireType 2 =*/ 74).fork()
|
|
).ldelim();
|
|
if (message.reservedName != null && message.reservedName.length)
|
|
for (var i = 0; i < message.reservedName.length; ++i)
|
|
writer
|
|
.uint32(/* id 10, wireType 2 =*/ 82)
|
|
.string(message.reservedName[i]);
|
|
if (
|
|
message.visibility != null &&
|
|
Object.hasOwnProperty.call(message, "visibility")
|
|
)
|
|
writer.uint32(/* id 11, wireType 0 =*/ 88).int32(message.visibility);
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof google.protobuf.DescriptorProto
|
|
* @static
|
|
* @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
DescriptorProto.encodeDelimited = function encodeDelimited(
|
|
message,
|
|
writer
|
|
) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes a DescriptorProto message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof google.protobuf.DescriptorProto
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {google.protobuf.DescriptorProto} DescriptorProto
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
DescriptorProto.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.google.protobuf.DescriptorProto();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
if (tag === error) break;
|
|
switch (tag >>> 3) {
|
|
case 1: {
|
|
message.name = reader.string();
|
|
break;
|
|
}
|
|
case 2: {
|
|
if (!(message.field && message.field.length)) message.field = [];
|
|
message.field.push(
|
|
$root.google.protobuf.FieldDescriptorProto.decode(
|
|
reader,
|
|
reader.uint32()
|
|
)
|
|
);
|
|
break;
|
|
}
|
|
case 6: {
|
|
if (!(message.extension && message.extension.length))
|
|
message.extension = [];
|
|
message.extension.push(
|
|
$root.google.protobuf.FieldDescriptorProto.decode(
|
|
reader,
|
|
reader.uint32()
|
|
)
|
|
);
|
|
break;
|
|
}
|
|
case 3: {
|
|
if (!(message.nestedType && message.nestedType.length))
|
|
message.nestedType = [];
|
|
message.nestedType.push(
|
|
$root.google.protobuf.DescriptorProto.decode(
|
|
reader,
|
|
reader.uint32()
|
|
)
|
|
);
|
|
break;
|
|
}
|
|
case 4: {
|
|
if (!(message.enumType && message.enumType.length))
|
|
message.enumType = [];
|
|
message.enumType.push(
|
|
$root.google.protobuf.EnumDescriptorProto.decode(
|
|
reader,
|
|
reader.uint32()
|
|
)
|
|
);
|
|
break;
|
|
}
|
|
case 5: {
|
|
if (!(message.extensionRange && message.extensionRange.length))
|
|
message.extensionRange = [];
|
|
message.extensionRange.push(
|
|
$root.google.protobuf.DescriptorProto.ExtensionRange.decode(
|
|
reader,
|
|
reader.uint32()
|
|
)
|
|
);
|
|
break;
|
|
}
|
|
case 8: {
|
|
if (!(message.oneofDecl && message.oneofDecl.length))
|
|
message.oneofDecl = [];
|
|
message.oneofDecl.push(
|
|
$root.google.protobuf.OneofDescriptorProto.decode(
|
|
reader,
|
|
reader.uint32()
|
|
)
|
|
);
|
|
break;
|
|
}
|
|
case 7: {
|
|
message.options = $root.google.protobuf.MessageOptions.decode(
|
|
reader,
|
|
reader.uint32()
|
|
);
|
|
break;
|
|
}
|
|
case 9: {
|
|
if (!(message.reservedRange && message.reservedRange.length))
|
|
message.reservedRange = [];
|
|
message.reservedRange.push(
|
|
$root.google.protobuf.DescriptorProto.ReservedRange.decode(
|
|
reader,
|
|
reader.uint32()
|
|
)
|
|
);
|
|
break;
|
|
}
|
|
case 10: {
|
|
if (!(message.reservedName && message.reservedName.length))
|
|
message.reservedName = [];
|
|
message.reservedName.push(reader.string());
|
|
break;
|
|
}
|
|
case 11: {
|
|
message.visibility = reader.int32();
|
|
break;
|
|
}
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes a DescriptorProto message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof google.protobuf.DescriptorProto
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {google.protobuf.DescriptorProto} DescriptorProto
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
DescriptorProto.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader)) reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies a DescriptorProto message.
|
|
* @function verify
|
|
* @memberof google.protobuf.DescriptorProto
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
DescriptorProto.verify = function verify(message) {
|
|
if (typeof message !== "object" || message === null)
|
|
return "object expected";
|
|
if (message.name != null && message.hasOwnProperty("name"))
|
|
if (!$util.isString(message.name)) return "name: string expected";
|
|
if (message.field != null && message.hasOwnProperty("field")) {
|
|
if (!Array.isArray(message.field)) return "field: array expected";
|
|
for (var i = 0; i < message.field.length; ++i) {
|
|
var error = $root.google.protobuf.FieldDescriptorProto.verify(
|
|
message.field[i]
|
|
);
|
|
if (error) return "field." + error;
|
|
}
|
|
}
|
|
if (message.extension != null && message.hasOwnProperty("extension")) {
|
|
if (!Array.isArray(message.extension))
|
|
return "extension: array expected";
|
|
for (var i = 0; i < message.extension.length; ++i) {
|
|
var error = $root.google.protobuf.FieldDescriptorProto.verify(
|
|
message.extension[i]
|
|
);
|
|
if (error) return "extension." + error;
|
|
}
|
|
}
|
|
if (
|
|
message.nestedType != null &&
|
|
message.hasOwnProperty("nestedType")
|
|
) {
|
|
if (!Array.isArray(message.nestedType))
|
|
return "nestedType: array expected";
|
|
for (var i = 0; i < message.nestedType.length; ++i) {
|
|
var error = $root.google.protobuf.DescriptorProto.verify(
|
|
message.nestedType[i]
|
|
);
|
|
if (error) return "nestedType." + error;
|
|
}
|
|
}
|
|
if (message.enumType != null && message.hasOwnProperty("enumType")) {
|
|
if (!Array.isArray(message.enumType))
|
|
return "enumType: array expected";
|
|
for (var i = 0; i < message.enumType.length; ++i) {
|
|
var error = $root.google.protobuf.EnumDescriptorProto.verify(
|
|
message.enumType[i]
|
|
);
|
|
if (error) return "enumType." + error;
|
|
}
|
|
}
|
|
if (
|
|
message.extensionRange != null &&
|
|
message.hasOwnProperty("extensionRange")
|
|
) {
|
|
if (!Array.isArray(message.extensionRange))
|
|
return "extensionRange: array expected";
|
|
for (var i = 0; i < message.extensionRange.length; ++i) {
|
|
var error =
|
|
$root.google.protobuf.DescriptorProto.ExtensionRange.verify(
|
|
message.extensionRange[i]
|
|
);
|
|
if (error) return "extensionRange." + error;
|
|
}
|
|
}
|
|
if (message.oneofDecl != null && message.hasOwnProperty("oneofDecl")) {
|
|
if (!Array.isArray(message.oneofDecl))
|
|
return "oneofDecl: array expected";
|
|
for (var i = 0; i < message.oneofDecl.length; ++i) {
|
|
var error = $root.google.protobuf.OneofDescriptorProto.verify(
|
|
message.oneofDecl[i]
|
|
);
|
|
if (error) return "oneofDecl." + error;
|
|
}
|
|
}
|
|
if (message.options != null && message.hasOwnProperty("options")) {
|
|
var error = $root.google.protobuf.MessageOptions.verify(
|
|
message.options
|
|
);
|
|
if (error) return "options." + error;
|
|
}
|
|
if (
|
|
message.reservedRange != null &&
|
|
message.hasOwnProperty("reservedRange")
|
|
) {
|
|
if (!Array.isArray(message.reservedRange))
|
|
return "reservedRange: array expected";
|
|
for (var i = 0; i < message.reservedRange.length; ++i) {
|
|
var error =
|
|
$root.google.protobuf.DescriptorProto.ReservedRange.verify(
|
|
message.reservedRange[i]
|
|
);
|
|
if (error) return "reservedRange." + error;
|
|
}
|
|
}
|
|
if (
|
|
message.reservedName != null &&
|
|
message.hasOwnProperty("reservedName")
|
|
) {
|
|
if (!Array.isArray(message.reservedName))
|
|
return "reservedName: array expected";
|
|
for (var i = 0; i < message.reservedName.length; ++i)
|
|
if (!$util.isString(message.reservedName[i]))
|
|
return "reservedName: string[] expected";
|
|
}
|
|
if (message.visibility != null && message.hasOwnProperty("visibility"))
|
|
switch (message.visibility) {
|
|
default:
|
|
return "visibility: enum value expected";
|
|
case 0:
|
|
case 1:
|
|
case 2:
|
|
break;
|
|
}
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof google.protobuf.DescriptorProto
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {google.protobuf.DescriptorProto} DescriptorProto
|
|
*/
|
|
DescriptorProto.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.google.protobuf.DescriptorProto)
|
|
return object;
|
|
var message = new $root.google.protobuf.DescriptorProto();
|
|
if (object.name != null) message.name = String(object.name);
|
|
if (object.field) {
|
|
if (!Array.isArray(object.field))
|
|
throw TypeError(
|
|
".google.protobuf.DescriptorProto.field: array expected"
|
|
);
|
|
message.field = [];
|
|
for (var i = 0; i < object.field.length; ++i) {
|
|
if (typeof object.field[i] !== "object")
|
|
throw TypeError(
|
|
".google.protobuf.DescriptorProto.field: object expected"
|
|
);
|
|
message.field[i] =
|
|
$root.google.protobuf.FieldDescriptorProto.fromObject(
|
|
object.field[i]
|
|
);
|
|
}
|
|
}
|
|
if (object.extension) {
|
|
if (!Array.isArray(object.extension))
|
|
throw TypeError(
|
|
".google.protobuf.DescriptorProto.extension: array expected"
|
|
);
|
|
message.extension = [];
|
|
for (var i = 0; i < object.extension.length; ++i) {
|
|
if (typeof object.extension[i] !== "object")
|
|
throw TypeError(
|
|
".google.protobuf.DescriptorProto.extension: object expected"
|
|
);
|
|
message.extension[i] =
|
|
$root.google.protobuf.FieldDescriptorProto.fromObject(
|
|
object.extension[i]
|
|
);
|
|
}
|
|
}
|
|
if (object.nestedType) {
|
|
if (!Array.isArray(object.nestedType))
|
|
throw TypeError(
|
|
".google.protobuf.DescriptorProto.nestedType: array expected"
|
|
);
|
|
message.nestedType = [];
|
|
for (var i = 0; i < object.nestedType.length; ++i) {
|
|
if (typeof object.nestedType[i] !== "object")
|
|
throw TypeError(
|
|
".google.protobuf.DescriptorProto.nestedType: object expected"
|
|
);
|
|
message.nestedType[i] =
|
|
$root.google.protobuf.DescriptorProto.fromObject(
|
|
object.nestedType[i]
|
|
);
|
|
}
|
|
}
|
|
if (object.enumType) {
|
|
if (!Array.isArray(object.enumType))
|
|
throw TypeError(
|
|
".google.protobuf.DescriptorProto.enumType: array expected"
|
|
);
|
|
message.enumType = [];
|
|
for (var i = 0; i < object.enumType.length; ++i) {
|
|
if (typeof object.enumType[i] !== "object")
|
|
throw TypeError(
|
|
".google.protobuf.DescriptorProto.enumType: object expected"
|
|
);
|
|
message.enumType[i] =
|
|
$root.google.protobuf.EnumDescriptorProto.fromObject(
|
|
object.enumType[i]
|
|
);
|
|
}
|
|
}
|
|
if (object.extensionRange) {
|
|
if (!Array.isArray(object.extensionRange))
|
|
throw TypeError(
|
|
".google.protobuf.DescriptorProto.extensionRange: array expected"
|
|
);
|
|
message.extensionRange = [];
|
|
for (var i = 0; i < object.extensionRange.length; ++i) {
|
|
if (typeof object.extensionRange[i] !== "object")
|
|
throw TypeError(
|
|
".google.protobuf.DescriptorProto.extensionRange: object expected"
|
|
);
|
|
message.extensionRange[i] =
|
|
$root.google.protobuf.DescriptorProto.ExtensionRange.fromObject(
|
|
object.extensionRange[i]
|
|
);
|
|
}
|
|
}
|
|
if (object.oneofDecl) {
|
|
if (!Array.isArray(object.oneofDecl))
|
|
throw TypeError(
|
|
".google.protobuf.DescriptorProto.oneofDecl: array expected"
|
|
);
|
|
message.oneofDecl = [];
|
|
for (var i = 0; i < object.oneofDecl.length; ++i) {
|
|
if (typeof object.oneofDecl[i] !== "object")
|
|
throw TypeError(
|
|
".google.protobuf.DescriptorProto.oneofDecl: object expected"
|
|
);
|
|
message.oneofDecl[i] =
|
|
$root.google.protobuf.OneofDescriptorProto.fromObject(
|
|
object.oneofDecl[i]
|
|
);
|
|
}
|
|
}
|
|
if (object.options != null) {
|
|
if (typeof object.options !== "object")
|
|
throw TypeError(
|
|
".google.protobuf.DescriptorProto.options: object expected"
|
|
);
|
|
message.options = $root.google.protobuf.MessageOptions.fromObject(
|
|
object.options
|
|
);
|
|
}
|
|
if (object.reservedRange) {
|
|
if (!Array.isArray(object.reservedRange))
|
|
throw TypeError(
|
|
".google.protobuf.DescriptorProto.reservedRange: array expected"
|
|
);
|
|
message.reservedRange = [];
|
|
for (var i = 0; i < object.reservedRange.length; ++i) {
|
|
if (typeof object.reservedRange[i] !== "object")
|
|
throw TypeError(
|
|
".google.protobuf.DescriptorProto.reservedRange: object expected"
|
|
);
|
|
message.reservedRange[i] =
|
|
$root.google.protobuf.DescriptorProto.ReservedRange.fromObject(
|
|
object.reservedRange[i]
|
|
);
|
|
}
|
|
}
|
|
if (object.reservedName) {
|
|
if (!Array.isArray(object.reservedName))
|
|
throw TypeError(
|
|
".google.protobuf.DescriptorProto.reservedName: array expected"
|
|
);
|
|
message.reservedName = [];
|
|
for (var i = 0; i < object.reservedName.length; ++i)
|
|
message.reservedName[i] = String(object.reservedName[i]);
|
|
}
|
|
switch (object.visibility) {
|
|
default:
|
|
if (typeof object.visibility === "number") {
|
|
message.visibility = object.visibility;
|
|
break;
|
|
}
|
|
break;
|
|
case "VISIBILITY_UNSET":
|
|
case 0:
|
|
message.visibility = 0;
|
|
break;
|
|
case "VISIBILITY_LOCAL":
|
|
case 1:
|
|
message.visibility = 1;
|
|
break;
|
|
case "VISIBILITY_EXPORT":
|
|
case 2:
|
|
message.visibility = 2;
|
|
break;
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from a DescriptorProto message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof google.protobuf.DescriptorProto
|
|
* @static
|
|
* @param {google.protobuf.DescriptorProto} message DescriptorProto
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
DescriptorProto.toObject = function toObject(message, options) {
|
|
if (!options) options = {};
|
|
var object = {};
|
|
if (options.arrays || options.defaults) {
|
|
object.field = [];
|
|
object.nestedType = [];
|
|
object.enumType = [];
|
|
object.extensionRange = [];
|
|
object.extension = [];
|
|
object.oneofDecl = [];
|
|
object.reservedRange = [];
|
|
object.reservedName = [];
|
|
}
|
|
if (options.defaults) {
|
|
object.name = "";
|
|
object.options = null;
|
|
object.visibility = options.enums === String ? "VISIBILITY_UNSET" : 0;
|
|
}
|
|
if (message.name != null && message.hasOwnProperty("name"))
|
|
object.name = message.name;
|
|
if (message.field && message.field.length) {
|
|
object.field = [];
|
|
for (var j = 0; j < message.field.length; ++j)
|
|
object.field[j] =
|
|
$root.google.protobuf.FieldDescriptorProto.toObject(
|
|
message.field[j],
|
|
options
|
|
);
|
|
}
|
|
if (message.nestedType && message.nestedType.length) {
|
|
object.nestedType = [];
|
|
for (var j = 0; j < message.nestedType.length; ++j)
|
|
object.nestedType[j] =
|
|
$root.google.protobuf.DescriptorProto.toObject(
|
|
message.nestedType[j],
|
|
options
|
|
);
|
|
}
|
|
if (message.enumType && message.enumType.length) {
|
|
object.enumType = [];
|
|
for (var j = 0; j < message.enumType.length; ++j)
|
|
object.enumType[j] =
|
|
$root.google.protobuf.EnumDescriptorProto.toObject(
|
|
message.enumType[j],
|
|
options
|
|
);
|
|
}
|
|
if (message.extensionRange && message.extensionRange.length) {
|
|
object.extensionRange = [];
|
|
for (var j = 0; j < message.extensionRange.length; ++j)
|
|
object.extensionRange[j] =
|
|
$root.google.protobuf.DescriptorProto.ExtensionRange.toObject(
|
|
message.extensionRange[j],
|
|
options
|
|
);
|
|
}
|
|
if (message.extension && message.extension.length) {
|
|
object.extension = [];
|
|
for (var j = 0; j < message.extension.length; ++j)
|
|
object.extension[j] =
|
|
$root.google.protobuf.FieldDescriptorProto.toObject(
|
|
message.extension[j],
|
|
options
|
|
);
|
|
}
|
|
if (message.options != null && message.hasOwnProperty("options"))
|
|
object.options = $root.google.protobuf.MessageOptions.toObject(
|
|
message.options,
|
|
options
|
|
);
|
|
if (message.oneofDecl && message.oneofDecl.length) {
|
|
object.oneofDecl = [];
|
|
for (var j = 0; j < message.oneofDecl.length; ++j)
|
|
object.oneofDecl[j] =
|
|
$root.google.protobuf.OneofDescriptorProto.toObject(
|
|
message.oneofDecl[j],
|
|
options
|
|
);
|
|
}
|
|
if (message.reservedRange && message.reservedRange.length) {
|
|
object.reservedRange = [];
|
|
for (var j = 0; j < message.reservedRange.length; ++j)
|
|
object.reservedRange[j] =
|
|
$root.google.protobuf.DescriptorProto.ReservedRange.toObject(
|
|
message.reservedRange[j],
|
|
options
|
|
);
|
|
}
|
|
if (message.reservedName && message.reservedName.length) {
|
|
object.reservedName = [];
|
|
for (var j = 0; j < message.reservedName.length; ++j)
|
|
object.reservedName[j] = message.reservedName[j];
|
|
}
|
|
if (message.visibility != null && message.hasOwnProperty("visibility"))
|
|
object.visibility =
|
|
options.enums === String
|
|
? $root.google.protobuf.SymbolVisibility[message.visibility] ===
|
|
undefined
|
|
? message.visibility
|
|
: $root.google.protobuf.SymbolVisibility[message.visibility]
|
|
: message.visibility;
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this DescriptorProto to JSON.
|
|
* @function toJSON
|
|
* @memberof google.protobuf.DescriptorProto
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
DescriptorProto.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
/**
|
|
* Gets the default type url for DescriptorProto
|
|
* @function getTypeUrl
|
|
* @memberof google.protobuf.DescriptorProto
|
|
* @static
|
|
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
|
* @returns {string} The default type url
|
|
*/
|
|
DescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
if (typeUrlPrefix === undefined) {
|
|
typeUrlPrefix = "type.googleapis.com";
|
|
}
|
|
return typeUrlPrefix + "/google.protobuf.DescriptorProto";
|
|
};
|
|
|
|
DescriptorProto.ExtensionRange = (function () {
|
|
/**
|
|
* Properties of an ExtensionRange.
|
|
* @memberof google.protobuf.DescriptorProto
|
|
* @interface IExtensionRange
|
|
* @property {number|null} [start] ExtensionRange start
|
|
* @property {number|null} [end] ExtensionRange end
|
|
* @property {google.protobuf.IExtensionRangeOptions|null} [options] ExtensionRange options
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new ExtensionRange.
|
|
* @memberof google.protobuf.DescriptorProto
|
|
* @classdesc Represents an ExtensionRange.
|
|
* @implements IExtensionRange
|
|
* @constructor
|
|
* @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set
|
|
*/
|
|
function ExtensionRange(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]];
|
|
}
|
|
|
|
/**
|
|
* ExtensionRange start.
|
|
* @member {number} start
|
|
* @memberof google.protobuf.DescriptorProto.ExtensionRange
|
|
* @instance
|
|
*/
|
|
ExtensionRange.prototype.start = 0;
|
|
|
|
/**
|
|
* ExtensionRange end.
|
|
* @member {number} end
|
|
* @memberof google.protobuf.DescriptorProto.ExtensionRange
|
|
* @instance
|
|
*/
|
|
ExtensionRange.prototype.end = 0;
|
|
|
|
/**
|
|
* ExtensionRange options.
|
|
* @member {google.protobuf.IExtensionRangeOptions|null|undefined} options
|
|
* @memberof google.protobuf.DescriptorProto.ExtensionRange
|
|
* @instance
|
|
*/
|
|
ExtensionRange.prototype.options = null;
|
|
|
|
/**
|
|
* Creates a new ExtensionRange instance using the specified properties.
|
|
* @function create
|
|
* @memberof google.protobuf.DescriptorProto.ExtensionRange
|
|
* @static
|
|
* @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set
|
|
* @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange instance
|
|
*/
|
|
ExtensionRange.create = function create(properties) {
|
|
return new ExtensionRange(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof google.protobuf.DescriptorProto.ExtensionRange
|
|
* @static
|
|
* @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
ExtensionRange.encode = function encode(message, writer) {
|
|
if (!writer) writer = $Writer.create();
|
|
if (
|
|
message.start != null &&
|
|
Object.hasOwnProperty.call(message, "start")
|
|
)
|
|
writer.uint32(/* id 1, wireType 0 =*/ 8).int32(message.start);
|
|
if (message.end != null && Object.hasOwnProperty.call(message, "end"))
|
|
writer.uint32(/* id 2, wireType 0 =*/ 16).int32(message.end);
|
|
if (
|
|
message.options != null &&
|
|
Object.hasOwnProperty.call(message, "options")
|
|
)
|
|
$root.google.protobuf.ExtensionRangeOptions.encode(
|
|
message.options,
|
|
writer.uint32(/* id 3, wireType 2 =*/ 26).fork()
|
|
).ldelim();
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof google.protobuf.DescriptorProto.ExtensionRange
|
|
* @static
|
|
* @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
ExtensionRange.encodeDelimited = function encodeDelimited(
|
|
message,
|
|
writer
|
|
) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes an ExtensionRange message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof google.protobuf.DescriptorProto.ExtensionRange
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
ExtensionRange.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.google.protobuf.DescriptorProto.ExtensionRange();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
if (tag === error) break;
|
|
switch (tag >>> 3) {
|
|
case 1: {
|
|
message.start = reader.int32();
|
|
break;
|
|
}
|
|
case 2: {
|
|
message.end = reader.int32();
|
|
break;
|
|
}
|
|
case 3: {
|
|
message.options =
|
|
$root.google.protobuf.ExtensionRangeOptions.decode(
|
|
reader,
|
|
reader.uint32()
|
|
);
|
|
break;
|
|
}
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes an ExtensionRange message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof google.protobuf.DescriptorProto.ExtensionRange
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
ExtensionRange.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader)) reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies an ExtensionRange message.
|
|
* @function verify
|
|
* @memberof google.protobuf.DescriptorProto.ExtensionRange
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
ExtensionRange.verify = function verify(message) {
|
|
if (typeof message !== "object" || message === null)
|
|
return "object expected";
|
|
if (message.start != null && message.hasOwnProperty("start"))
|
|
if (!$util.isInteger(message.start))
|
|
return "start: integer expected";
|
|
if (message.end != null && message.hasOwnProperty("end"))
|
|
if (!$util.isInteger(message.end)) return "end: integer expected";
|
|
if (message.options != null && message.hasOwnProperty("options")) {
|
|
var error = $root.google.protobuf.ExtensionRangeOptions.verify(
|
|
message.options
|
|
);
|
|
if (error) return "options." + error;
|
|
}
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof google.protobuf.DescriptorProto.ExtensionRange
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange
|
|
*/
|
|
ExtensionRange.fromObject = function fromObject(object) {
|
|
if (
|
|
object instanceof
|
|
$root.google.protobuf.DescriptorProto.ExtensionRange
|
|
)
|
|
return object;
|
|
var message =
|
|
new $root.google.protobuf.DescriptorProto.ExtensionRange();
|
|
if (object.start != null) message.start = object.start | 0;
|
|
if (object.end != null) message.end = object.end | 0;
|
|
if (object.options != null) {
|
|
if (typeof object.options !== "object")
|
|
throw TypeError(
|
|
".google.protobuf.DescriptorProto.ExtensionRange.options: object expected"
|
|
);
|
|
message.options =
|
|
$root.google.protobuf.ExtensionRangeOptions.fromObject(
|
|
object.options
|
|
);
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from an ExtensionRange message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof google.protobuf.DescriptorProto.ExtensionRange
|
|
* @static
|
|
* @param {google.protobuf.DescriptorProto.ExtensionRange} message ExtensionRange
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
ExtensionRange.toObject = function toObject(message, options) {
|
|
if (!options) options = {};
|
|
var object = {};
|
|
if (options.defaults) {
|
|
object.start = 0;
|
|
object.end = 0;
|
|
object.options = null;
|
|
}
|
|
if (message.start != null && message.hasOwnProperty("start"))
|
|
object.start = message.start;
|
|
if (message.end != null && message.hasOwnProperty("end"))
|
|
object.end = message.end;
|
|
if (message.options != null && message.hasOwnProperty("options"))
|
|
object.options =
|
|
$root.google.protobuf.ExtensionRangeOptions.toObject(
|
|
message.options,
|
|
options
|
|
);
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this ExtensionRange to JSON.
|
|
* @function toJSON
|
|
* @memberof google.protobuf.DescriptorProto.ExtensionRange
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
ExtensionRange.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
/**
|
|
* Gets the default type url for ExtensionRange
|
|
* @function getTypeUrl
|
|
* @memberof google.protobuf.DescriptorProto.ExtensionRange
|
|
* @static
|
|
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
|
* @returns {string} The default type url
|
|
*/
|
|
ExtensionRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
if (typeUrlPrefix === undefined) {
|
|
typeUrlPrefix = "type.googleapis.com";
|
|
}
|
|
return (
|
|
typeUrlPrefix + "/google.protobuf.DescriptorProto.ExtensionRange"
|
|
);
|
|
};
|
|
|
|
return ExtensionRange;
|
|
})();
|
|
|
|
DescriptorProto.ReservedRange = (function () {
|
|
/**
|
|
* Properties of a ReservedRange.
|
|
* @memberof google.protobuf.DescriptorProto
|
|
* @interface IReservedRange
|
|
* @property {number|null} [start] ReservedRange start
|
|
* @property {number|null} [end] ReservedRange end
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new ReservedRange.
|
|
* @memberof google.protobuf.DescriptorProto
|
|
* @classdesc Represents a ReservedRange.
|
|
* @implements IReservedRange
|
|
* @constructor
|
|
* @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set
|
|
*/
|
|
function ReservedRange(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]];
|
|
}
|
|
|
|
/**
|
|
* ReservedRange start.
|
|
* @member {number} start
|
|
* @memberof google.protobuf.DescriptorProto.ReservedRange
|
|
* @instance
|
|
*/
|
|
ReservedRange.prototype.start = 0;
|
|
|
|
/**
|
|
* ReservedRange end.
|
|
* @member {number} end
|
|
* @memberof google.protobuf.DescriptorProto.ReservedRange
|
|
* @instance
|
|
*/
|
|
ReservedRange.prototype.end = 0;
|
|
|
|
/**
|
|
* Creates a new ReservedRange instance using the specified properties.
|
|
* @function create
|
|
* @memberof google.protobuf.DescriptorProto.ReservedRange
|
|
* @static
|
|
* @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set
|
|
* @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange instance
|
|
*/
|
|
ReservedRange.create = function create(properties) {
|
|
return new ReservedRange(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof google.protobuf.DescriptorProto.ReservedRange
|
|
* @static
|
|
* @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
ReservedRange.encode = function encode(message, writer) {
|
|
if (!writer) writer = $Writer.create();
|
|
if (
|
|
message.start != null &&
|
|
Object.hasOwnProperty.call(message, "start")
|
|
)
|
|
writer.uint32(/* id 1, wireType 0 =*/ 8).int32(message.start);
|
|
if (message.end != null && Object.hasOwnProperty.call(message, "end"))
|
|
writer.uint32(/* id 2, wireType 0 =*/ 16).int32(message.end);
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof google.protobuf.DescriptorProto.ReservedRange
|
|
* @static
|
|
* @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
ReservedRange.encodeDelimited = function encodeDelimited(
|
|
message,
|
|
writer
|
|
) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes a ReservedRange message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof google.protobuf.DescriptorProto.ReservedRange
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
ReservedRange.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.google.protobuf.DescriptorProto.ReservedRange();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
if (tag === error) break;
|
|
switch (tag >>> 3) {
|
|
case 1: {
|
|
message.start = reader.int32();
|
|
break;
|
|
}
|
|
case 2: {
|
|
message.end = reader.int32();
|
|
break;
|
|
}
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes a ReservedRange message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof google.protobuf.DescriptorProto.ReservedRange
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
ReservedRange.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader)) reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies a ReservedRange message.
|
|
* @function verify
|
|
* @memberof google.protobuf.DescriptorProto.ReservedRange
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
ReservedRange.verify = function verify(message) {
|
|
if (typeof message !== "object" || message === null)
|
|
return "object expected";
|
|
if (message.start != null && message.hasOwnProperty("start"))
|
|
if (!$util.isInteger(message.start))
|
|
return "start: integer expected";
|
|
if (message.end != null && message.hasOwnProperty("end"))
|
|
if (!$util.isInteger(message.end)) return "end: integer expected";
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates a ReservedRange message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof google.protobuf.DescriptorProto.ReservedRange
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange
|
|
*/
|
|
ReservedRange.fromObject = function fromObject(object) {
|
|
if (
|
|
object instanceof
|
|
$root.google.protobuf.DescriptorProto.ReservedRange
|
|
)
|
|
return object;
|
|
var message =
|
|
new $root.google.protobuf.DescriptorProto.ReservedRange();
|
|
if (object.start != null) message.start = object.start | 0;
|
|
if (object.end != null) message.end = object.end | 0;
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from a ReservedRange message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof google.protobuf.DescriptorProto.ReservedRange
|
|
* @static
|
|
* @param {google.protobuf.DescriptorProto.ReservedRange} message ReservedRange
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
ReservedRange.toObject = function toObject(message, options) {
|
|
if (!options) options = {};
|
|
var object = {};
|
|
if (options.defaults) {
|
|
object.start = 0;
|
|
object.end = 0;
|
|
}
|
|
if (message.start != null && message.hasOwnProperty("start"))
|
|
object.start = message.start;
|
|
if (message.end != null && message.hasOwnProperty("end"))
|
|
object.end = message.end;
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this ReservedRange to JSON.
|
|
* @function toJSON
|
|
* @memberof google.protobuf.DescriptorProto.ReservedRange
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
ReservedRange.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
/**
|
|
* Gets the default type url for ReservedRange
|
|
* @function getTypeUrl
|
|
* @memberof google.protobuf.DescriptorProto.ReservedRange
|
|
* @static
|
|
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
|
* @returns {string} The default type url
|
|
*/
|
|
ReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
if (typeUrlPrefix === undefined) {
|
|
typeUrlPrefix = "type.googleapis.com";
|
|
}
|
|
return (
|
|
typeUrlPrefix + "/google.protobuf.DescriptorProto.ReservedRange"
|
|
);
|
|
};
|
|
|
|
return ReservedRange;
|
|
})();
|
|
|
|
return DescriptorProto;
|
|
})();
|
|
|
|
protobuf.ExtensionRangeOptions = (function () {
|
|
/**
|
|
* Properties of an ExtensionRangeOptions.
|
|
* @memberof google.protobuf
|
|
* @interface IExtensionRangeOptions
|
|
* @property {Array.<google.protobuf.IUninterpretedOption>|null} [uninterpretedOption] ExtensionRangeOptions uninterpretedOption
|
|
* @property {Array.<google.protobuf.ExtensionRangeOptions.IDeclaration>|null} [declaration] ExtensionRangeOptions declaration
|
|
* @property {google.protobuf.IFeatureSet|null} [features] ExtensionRangeOptions features
|
|
* @property {google.protobuf.ExtensionRangeOptions.VerificationState|null} [verification] ExtensionRangeOptions verification
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new ExtensionRangeOptions.
|
|
* @memberof google.protobuf
|
|
* @classdesc Represents an ExtensionRangeOptions.
|
|
* @implements IExtensionRangeOptions
|
|
* @constructor
|
|
* @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set
|
|
*/
|
|
function ExtensionRangeOptions(properties) {
|
|
this.uninterpretedOption = [];
|
|
this.declaration = [];
|
|
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]];
|
|
}
|
|
|
|
/**
|
|
* ExtensionRangeOptions uninterpretedOption.
|
|
* @member {Array.<google.protobuf.IUninterpretedOption>} uninterpretedOption
|
|
* @memberof google.protobuf.ExtensionRangeOptions
|
|
* @instance
|
|
*/
|
|
ExtensionRangeOptions.prototype.uninterpretedOption = $util.emptyArray;
|
|
|
|
/**
|
|
* ExtensionRangeOptions declaration.
|
|
* @member {Array.<google.protobuf.ExtensionRangeOptions.IDeclaration>} declaration
|
|
* @memberof google.protobuf.ExtensionRangeOptions
|
|
* @instance
|
|
*/
|
|
ExtensionRangeOptions.prototype.declaration = $util.emptyArray;
|
|
|
|
/**
|
|
* ExtensionRangeOptions features.
|
|
* @member {google.protobuf.IFeatureSet|null|undefined} features
|
|
* @memberof google.protobuf.ExtensionRangeOptions
|
|
* @instance
|
|
*/
|
|
ExtensionRangeOptions.prototype.features = null;
|
|
|
|
/**
|
|
* ExtensionRangeOptions verification.
|
|
* @member {google.protobuf.ExtensionRangeOptions.VerificationState} verification
|
|
* @memberof google.protobuf.ExtensionRangeOptions
|
|
* @instance
|
|
*/
|
|
ExtensionRangeOptions.prototype.verification = 1;
|
|
|
|
/**
|
|
* Creates a new ExtensionRangeOptions instance using the specified properties.
|
|
* @function create
|
|
* @memberof google.protobuf.ExtensionRangeOptions
|
|
* @static
|
|
* @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set
|
|
* @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions instance
|
|
*/
|
|
ExtensionRangeOptions.create = function create(properties) {
|
|
return new ExtensionRangeOptions(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof google.protobuf.ExtensionRangeOptions
|
|
* @static
|
|
* @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
ExtensionRangeOptions.encode = function encode(message, writer) {
|
|
if (!writer) writer = $Writer.create();
|
|
if (message.declaration != null && message.declaration.length)
|
|
for (var i = 0; i < message.declaration.length; ++i)
|
|
$root.google.protobuf.ExtensionRangeOptions.Declaration.encode(
|
|
message.declaration[i],
|
|
writer.uint32(/* id 2, wireType 2 =*/ 18).fork()
|
|
).ldelim();
|
|
if (
|
|
message.verification != null &&
|
|
Object.hasOwnProperty.call(message, "verification")
|
|
)
|
|
writer.uint32(/* id 3, wireType 0 =*/ 24).int32(message.verification);
|
|
if (
|
|
message.features != null &&
|
|
Object.hasOwnProperty.call(message, "features")
|
|
)
|
|
$root.google.protobuf.FeatureSet.encode(
|
|
message.features,
|
|
writer.uint32(/* id 50, wireType 2 =*/ 402).fork()
|
|
).ldelim();
|
|
if (
|
|
message.uninterpretedOption != null &&
|
|
message.uninterpretedOption.length
|
|
)
|
|
for (var i = 0; i < message.uninterpretedOption.length; ++i)
|
|
$root.google.protobuf.UninterpretedOption.encode(
|
|
message.uninterpretedOption[i],
|
|
writer.uint32(/* id 999, wireType 2 =*/ 7994).fork()
|
|
).ldelim();
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof google.protobuf.ExtensionRangeOptions
|
|
* @static
|
|
* @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
ExtensionRangeOptions.encodeDelimited = function encodeDelimited(
|
|
message,
|
|
writer
|
|
) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes an ExtensionRangeOptions message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof google.protobuf.ExtensionRangeOptions
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
ExtensionRangeOptions.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.google.protobuf.ExtensionRangeOptions();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
if (tag === error) break;
|
|
switch (tag >>> 3) {
|
|
case 999: {
|
|
if (
|
|
!(
|
|
message.uninterpretedOption &&
|
|
message.uninterpretedOption.length
|
|
)
|
|
)
|
|
message.uninterpretedOption = [];
|
|
message.uninterpretedOption.push(
|
|
$root.google.protobuf.UninterpretedOption.decode(
|
|
reader,
|
|
reader.uint32()
|
|
)
|
|
);
|
|
break;
|
|
}
|
|
case 2: {
|
|
if (!(message.declaration && message.declaration.length))
|
|
message.declaration = [];
|
|
message.declaration.push(
|
|
$root.google.protobuf.ExtensionRangeOptions.Declaration.decode(
|
|
reader,
|
|
reader.uint32()
|
|
)
|
|
);
|
|
break;
|
|
}
|
|
case 50: {
|
|
message.features = $root.google.protobuf.FeatureSet.decode(
|
|
reader,
|
|
reader.uint32()
|
|
);
|
|
break;
|
|
}
|
|
case 3: {
|
|
message.verification = reader.int32();
|
|
break;
|
|
}
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof google.protobuf.ExtensionRangeOptions
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
ExtensionRangeOptions.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader)) reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies an ExtensionRangeOptions message.
|
|
* @function verify
|
|
* @memberof google.protobuf.ExtensionRangeOptions
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
ExtensionRangeOptions.verify = function verify(message) {
|
|
if (typeof message !== "object" || message === null)
|
|
return "object expected";
|
|
if (
|
|
message.uninterpretedOption != null &&
|
|
message.hasOwnProperty("uninterpretedOption")
|
|
) {
|
|
if (!Array.isArray(message.uninterpretedOption))
|
|
return "uninterpretedOption: array expected";
|
|
for (var i = 0; i < message.uninterpretedOption.length; ++i) {
|
|
var error = $root.google.protobuf.UninterpretedOption.verify(
|
|
message.uninterpretedOption[i]
|
|
);
|
|
if (error) return "uninterpretedOption." + error;
|
|
}
|
|
}
|
|
if (
|
|
message.declaration != null &&
|
|
message.hasOwnProperty("declaration")
|
|
) {
|
|
if (!Array.isArray(message.declaration))
|
|
return "declaration: array expected";
|
|
for (var i = 0; i < message.declaration.length; ++i) {
|
|
var error =
|
|
$root.google.protobuf.ExtensionRangeOptions.Declaration.verify(
|
|
message.declaration[i]
|
|
);
|
|
if (error) return "declaration." + error;
|
|
}
|
|
}
|
|
if (message.features != null && message.hasOwnProperty("features")) {
|
|
var error = $root.google.protobuf.FeatureSet.verify(message.features);
|
|
if (error) return "features." + error;
|
|
}
|
|
if (
|
|
message.verification != null &&
|
|
message.hasOwnProperty("verification")
|
|
)
|
|
switch (message.verification) {
|
|
default:
|
|
return "verification: enum value expected";
|
|
case 0:
|
|
case 1:
|
|
break;
|
|
}
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof google.protobuf.ExtensionRangeOptions
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions
|
|
*/
|
|
ExtensionRangeOptions.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.google.protobuf.ExtensionRangeOptions)
|
|
return object;
|
|
var message = new $root.google.protobuf.ExtensionRangeOptions();
|
|
if (object.uninterpretedOption) {
|
|
if (!Array.isArray(object.uninterpretedOption))
|
|
throw TypeError(
|
|
".google.protobuf.ExtensionRangeOptions.uninterpretedOption: array expected"
|
|
);
|
|
message.uninterpretedOption = [];
|
|
for (var i = 0; i < object.uninterpretedOption.length; ++i) {
|
|
if (typeof object.uninterpretedOption[i] !== "object")
|
|
throw TypeError(
|
|
".google.protobuf.ExtensionRangeOptions.uninterpretedOption: object expected"
|
|
);
|
|
message.uninterpretedOption[i] =
|
|
$root.google.protobuf.UninterpretedOption.fromObject(
|
|
object.uninterpretedOption[i]
|
|
);
|
|
}
|
|
}
|
|
if (object.declaration) {
|
|
if (!Array.isArray(object.declaration))
|
|
throw TypeError(
|
|
".google.protobuf.ExtensionRangeOptions.declaration: array expected"
|
|
);
|
|
message.declaration = [];
|
|
for (var i = 0; i < object.declaration.length; ++i) {
|
|
if (typeof object.declaration[i] !== "object")
|
|
throw TypeError(
|
|
".google.protobuf.ExtensionRangeOptions.declaration: object expected"
|
|
);
|
|
message.declaration[i] =
|
|
$root.google.protobuf.ExtensionRangeOptions.Declaration.fromObject(
|
|
object.declaration[i]
|
|
);
|
|
}
|
|
}
|
|
if (object.features != null) {
|
|
if (typeof object.features !== "object")
|
|
throw TypeError(
|
|
".google.protobuf.ExtensionRangeOptions.features: object expected"
|
|
);
|
|
message.features = $root.google.protobuf.FeatureSet.fromObject(
|
|
object.features
|
|
);
|
|
}
|
|
switch (object.verification) {
|
|
case "DECLARATION":
|
|
case 0:
|
|
message.verification = 0;
|
|
break;
|
|
default:
|
|
if (typeof object.verification === "number") {
|
|
message.verification = object.verification;
|
|
break;
|
|
}
|
|
break;
|
|
case "UNVERIFIED":
|
|
case 1:
|
|
message.verification = 1;
|
|
break;
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof google.protobuf.ExtensionRangeOptions
|
|
* @static
|
|
* @param {google.protobuf.ExtensionRangeOptions} message ExtensionRangeOptions
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
ExtensionRangeOptions.toObject = function toObject(message, options) {
|
|
if (!options) options = {};
|
|
var object = {};
|
|
if (options.arrays || options.defaults) {
|
|
object.declaration = [];
|
|
object.uninterpretedOption = [];
|
|
}
|
|
if (options.defaults) {
|
|
object.verification = options.enums === String ? "UNVERIFIED" : 1;
|
|
object.features = null;
|
|
}
|
|
if (message.declaration && message.declaration.length) {
|
|
object.declaration = [];
|
|
for (var j = 0; j < message.declaration.length; ++j)
|
|
object.declaration[j] =
|
|
$root.google.protobuf.ExtensionRangeOptions.Declaration.toObject(
|
|
message.declaration[j],
|
|
options
|
|
);
|
|
}
|
|
if (
|
|
message.verification != null &&
|
|
message.hasOwnProperty("verification")
|
|
)
|
|
object.verification =
|
|
options.enums === String
|
|
? $root.google.protobuf.ExtensionRangeOptions.VerificationState[
|
|
message.verification
|
|
] === undefined
|
|
? message.verification
|
|
: $root.google.protobuf.ExtensionRangeOptions.VerificationState[
|
|
message.verification
|
|
]
|
|
: message.verification;
|
|
if (message.features != null && message.hasOwnProperty("features"))
|
|
object.features = $root.google.protobuf.FeatureSet.toObject(
|
|
message.features,
|
|
options
|
|
);
|
|
if (message.uninterpretedOption && message.uninterpretedOption.length) {
|
|
object.uninterpretedOption = [];
|
|
for (var j = 0; j < message.uninterpretedOption.length; ++j)
|
|
object.uninterpretedOption[j] =
|
|
$root.google.protobuf.UninterpretedOption.toObject(
|
|
message.uninterpretedOption[j],
|
|
options
|
|
);
|
|
}
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this ExtensionRangeOptions to JSON.
|
|
* @function toJSON
|
|
* @memberof google.protobuf.ExtensionRangeOptions
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
ExtensionRangeOptions.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
/**
|
|
* Gets the default type url for ExtensionRangeOptions
|
|
* @function getTypeUrl
|
|
* @memberof google.protobuf.ExtensionRangeOptions
|
|
* @static
|
|
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
|
* @returns {string} The default type url
|
|
*/
|
|
ExtensionRangeOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
if (typeUrlPrefix === undefined) {
|
|
typeUrlPrefix = "type.googleapis.com";
|
|
}
|
|
return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions";
|
|
};
|
|
|
|
ExtensionRangeOptions.Declaration = (function () {
|
|
/**
|
|
* Properties of a Declaration.
|
|
* @memberof google.protobuf.ExtensionRangeOptions
|
|
* @interface IDeclaration
|
|
* @property {number|null} [number] Declaration number
|
|
* @property {string|null} [fullName] Declaration fullName
|
|
* @property {string|null} [type] Declaration type
|
|
* @property {boolean|null} [reserved] Declaration reserved
|
|
* @property {boolean|null} [repeated] Declaration repeated
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new Declaration.
|
|
* @memberof google.protobuf.ExtensionRangeOptions
|
|
* @classdesc Represents a Declaration.
|
|
* @implements IDeclaration
|
|
* @constructor
|
|
* @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set
|
|
*/
|
|
function Declaration(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]];
|
|
}
|
|
|
|
/**
|
|
* Declaration number.
|
|
* @member {number} number
|
|
* @memberof google.protobuf.ExtensionRangeOptions.Declaration
|
|
* @instance
|
|
*/
|
|
Declaration.prototype.number = 0;
|
|
|
|
/**
|
|
* Declaration fullName.
|
|
* @member {string} fullName
|
|
* @memberof google.protobuf.ExtensionRangeOptions.Declaration
|
|
* @instance
|
|
*/
|
|
Declaration.prototype.fullName = "";
|
|
|
|
/**
|
|
* Declaration type.
|
|
* @member {string} type
|
|
* @memberof google.protobuf.ExtensionRangeOptions.Declaration
|
|
* @instance
|
|
*/
|
|
Declaration.prototype.type = "";
|
|
|
|
/**
|
|
* Declaration reserved.
|
|
* @member {boolean} reserved
|
|
* @memberof google.protobuf.ExtensionRangeOptions.Declaration
|
|
* @instance
|
|
*/
|
|
Declaration.prototype.reserved = false;
|
|
|
|
/**
|
|
* Declaration repeated.
|
|
* @member {boolean} repeated
|
|
* @memberof google.protobuf.ExtensionRangeOptions.Declaration
|
|
* @instance
|
|
*/
|
|
Declaration.prototype.repeated = false;
|
|
|
|
/**
|
|
* Creates a new Declaration instance using the specified properties.
|
|
* @function create
|
|
* @memberof google.protobuf.ExtensionRangeOptions.Declaration
|
|
* @static
|
|
* @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set
|
|
* @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration instance
|
|
*/
|
|
Declaration.create = function create(properties) {
|
|
return new Declaration(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof google.protobuf.ExtensionRangeOptions.Declaration
|
|
* @static
|
|
* @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
Declaration.encode = function encode(message, writer) {
|
|
if (!writer) writer = $Writer.create();
|
|
if (
|
|
message.number != null &&
|
|
Object.hasOwnProperty.call(message, "number")
|
|
)
|
|
writer.uint32(/* id 1, wireType 0 =*/ 8).int32(message.number);
|
|
if (
|
|
message.fullName != null &&
|
|
Object.hasOwnProperty.call(message, "fullName")
|
|
)
|
|
writer.uint32(/* id 2, wireType 2 =*/ 18).string(message.fullName);
|
|
if (
|
|
message.type != null &&
|
|
Object.hasOwnProperty.call(message, "type")
|
|
)
|
|
writer.uint32(/* id 3, wireType 2 =*/ 26).string(message.type);
|
|
if (
|
|
message.reserved != null &&
|
|
Object.hasOwnProperty.call(message, "reserved")
|
|
)
|
|
writer.uint32(/* id 5, wireType 0 =*/ 40).bool(message.reserved);
|
|
if (
|
|
message.repeated != null &&
|
|
Object.hasOwnProperty.call(message, "repeated")
|
|
)
|
|
writer.uint32(/* id 6, wireType 0 =*/ 48).bool(message.repeated);
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof google.protobuf.ExtensionRangeOptions.Declaration
|
|
* @static
|
|
* @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
Declaration.encodeDelimited = function encodeDelimited(
|
|
message,
|
|
writer
|
|
) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes a Declaration message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof google.protobuf.ExtensionRangeOptions.Declaration
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
Declaration.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.google.protobuf.ExtensionRangeOptions.Declaration();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
if (tag === error) break;
|
|
switch (tag >>> 3) {
|
|
case 1: {
|
|
message.number = reader.int32();
|
|
break;
|
|
}
|
|
case 2: {
|
|
message.fullName = reader.string();
|
|
break;
|
|
}
|
|
case 3: {
|
|
message.type = reader.string();
|
|
break;
|
|
}
|
|
case 5: {
|
|
message.reserved = reader.bool();
|
|
break;
|
|
}
|
|
case 6: {
|
|
message.repeated = reader.bool();
|
|
break;
|
|
}
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes a Declaration message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof google.protobuf.ExtensionRangeOptions.Declaration
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
Declaration.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader)) reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies a Declaration message.
|
|
* @function verify
|
|
* @memberof google.protobuf.ExtensionRangeOptions.Declaration
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
Declaration.verify = function verify(message) {
|
|
if (typeof message !== "object" || message === null)
|
|
return "object expected";
|
|
if (message.number != null && message.hasOwnProperty("number"))
|
|
if (!$util.isInteger(message.number))
|
|
return "number: integer expected";
|
|
if (message.fullName != null && message.hasOwnProperty("fullName"))
|
|
if (!$util.isString(message.fullName))
|
|
return "fullName: string expected";
|
|
if (message.type != null && message.hasOwnProperty("type"))
|
|
if (!$util.isString(message.type)) return "type: string expected";
|
|
if (message.reserved != null && message.hasOwnProperty("reserved"))
|
|
if (typeof message.reserved !== "boolean")
|
|
return "reserved: boolean expected";
|
|
if (message.repeated != null && message.hasOwnProperty("repeated"))
|
|
if (typeof message.repeated !== "boolean")
|
|
return "repeated: boolean expected";
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates a Declaration message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof google.protobuf.ExtensionRangeOptions.Declaration
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration
|
|
*/
|
|
Declaration.fromObject = function fromObject(object) {
|
|
if (
|
|
object instanceof
|
|
$root.google.protobuf.ExtensionRangeOptions.Declaration
|
|
)
|
|
return object;
|
|
var message =
|
|
new $root.google.protobuf.ExtensionRangeOptions.Declaration();
|
|
if (object.number != null) message.number = object.number | 0;
|
|
if (object.fullName != null)
|
|
message.fullName = String(object.fullName);
|
|
if (object.type != null) message.type = String(object.type);
|
|
if (object.reserved != null)
|
|
message.reserved = Boolean(object.reserved);
|
|
if (object.repeated != null)
|
|
message.repeated = Boolean(object.repeated);
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from a Declaration message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof google.protobuf.ExtensionRangeOptions.Declaration
|
|
* @static
|
|
* @param {google.protobuf.ExtensionRangeOptions.Declaration} message Declaration
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
Declaration.toObject = function toObject(message, options) {
|
|
if (!options) options = {};
|
|
var object = {};
|
|
if (options.defaults) {
|
|
object.number = 0;
|
|
object.fullName = "";
|
|
object.type = "";
|
|
object.reserved = false;
|
|
object.repeated = false;
|
|
}
|
|
if (message.number != null && message.hasOwnProperty("number"))
|
|
object.number = message.number;
|
|
if (message.fullName != null && message.hasOwnProperty("fullName"))
|
|
object.fullName = message.fullName;
|
|
if (message.type != null && message.hasOwnProperty("type"))
|
|
object.type = message.type;
|
|
if (message.reserved != null && message.hasOwnProperty("reserved"))
|
|
object.reserved = message.reserved;
|
|
if (message.repeated != null && message.hasOwnProperty("repeated"))
|
|
object.repeated = message.repeated;
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this Declaration to JSON.
|
|
* @function toJSON
|
|
* @memberof google.protobuf.ExtensionRangeOptions.Declaration
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
Declaration.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
/**
|
|
* Gets the default type url for Declaration
|
|
* @function getTypeUrl
|
|
* @memberof google.protobuf.ExtensionRangeOptions.Declaration
|
|
* @static
|
|
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
|
* @returns {string} The default type url
|
|
*/
|
|
Declaration.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
if (typeUrlPrefix === undefined) {
|
|
typeUrlPrefix = "type.googleapis.com";
|
|
}
|
|
return (
|
|
typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions.Declaration"
|
|
);
|
|
};
|
|
|
|
return Declaration;
|
|
})();
|
|
|
|
/**
|
|
* VerificationState enum.
|
|
* @name google.protobuf.ExtensionRangeOptions.VerificationState
|
|
* @enum {number}
|
|
* @property {number} DECLARATION=0 DECLARATION value
|
|
* @property {number} UNVERIFIED=1 UNVERIFIED value
|
|
*/
|
|
ExtensionRangeOptions.VerificationState = (function () {
|
|
var valuesById = {},
|
|
values = Object.create(valuesById);
|
|
values[(valuesById[0] = "DECLARATION")] = 0;
|
|
values[(valuesById[1] = "UNVERIFIED")] = 1;
|
|
return values;
|
|
})();
|
|
|
|
return ExtensionRangeOptions;
|
|
})();
|
|
|
|
protobuf.FieldDescriptorProto = (function () {
|
|
/**
|
|
* Properties of a FieldDescriptorProto.
|
|
* @memberof google.protobuf
|
|
* @interface IFieldDescriptorProto
|
|
* @property {string|null} [name] FieldDescriptorProto name
|
|
* @property {number|null} [number] FieldDescriptorProto number
|
|
* @property {google.protobuf.FieldDescriptorProto.Label|null} [label] FieldDescriptorProto label
|
|
* @property {google.protobuf.FieldDescriptorProto.Type|null} [type] FieldDescriptorProto type
|
|
* @property {string|null} [typeName] FieldDescriptorProto typeName
|
|
* @property {string|null} [extendee] FieldDescriptorProto extendee
|
|
* @property {string|null} [defaultValue] FieldDescriptorProto defaultValue
|
|
* @property {number|null} [oneofIndex] FieldDescriptorProto oneofIndex
|
|
* @property {string|null} [jsonName] FieldDescriptorProto jsonName
|
|
* @property {google.protobuf.IFieldOptions|null} [options] FieldDescriptorProto options
|
|
* @property {boolean|null} [proto3Optional] FieldDescriptorProto proto3Optional
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new FieldDescriptorProto.
|
|
* @memberof google.protobuf
|
|
* @classdesc Represents a FieldDescriptorProto.
|
|
* @implements IFieldDescriptorProto
|
|
* @constructor
|
|
* @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set
|
|
*/
|
|
function FieldDescriptorProto(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]];
|
|
}
|
|
|
|
/**
|
|
* FieldDescriptorProto name.
|
|
* @member {string} name
|
|
* @memberof google.protobuf.FieldDescriptorProto
|
|
* @instance
|
|
*/
|
|
FieldDescriptorProto.prototype.name = "";
|
|
|
|
/**
|
|
* FieldDescriptorProto number.
|
|
* @member {number} number
|
|
* @memberof google.protobuf.FieldDescriptorProto
|
|
* @instance
|
|
*/
|
|
FieldDescriptorProto.prototype.number = 0;
|
|
|
|
/**
|
|
* FieldDescriptorProto label.
|
|
* @member {google.protobuf.FieldDescriptorProto.Label} label
|
|
* @memberof google.protobuf.FieldDescriptorProto
|
|
* @instance
|
|
*/
|
|
FieldDescriptorProto.prototype.label = 1;
|
|
|
|
/**
|
|
* FieldDescriptorProto type.
|
|
* @member {google.protobuf.FieldDescriptorProto.Type} type
|
|
* @memberof google.protobuf.FieldDescriptorProto
|
|
* @instance
|
|
*/
|
|
FieldDescriptorProto.prototype.type = 1;
|
|
|
|
/**
|
|
* FieldDescriptorProto typeName.
|
|
* @member {string} typeName
|
|
* @memberof google.protobuf.FieldDescriptorProto
|
|
* @instance
|
|
*/
|
|
FieldDescriptorProto.prototype.typeName = "";
|
|
|
|
/**
|
|
* FieldDescriptorProto extendee.
|
|
* @member {string} extendee
|
|
* @memberof google.protobuf.FieldDescriptorProto
|
|
* @instance
|
|
*/
|
|
FieldDescriptorProto.prototype.extendee = "";
|
|
|
|
/**
|
|
* FieldDescriptorProto defaultValue.
|
|
* @member {string} defaultValue
|
|
* @memberof google.protobuf.FieldDescriptorProto
|
|
* @instance
|
|
*/
|
|
FieldDescriptorProto.prototype.defaultValue = "";
|
|
|
|
/**
|
|
* FieldDescriptorProto oneofIndex.
|
|
* @member {number} oneofIndex
|
|
* @memberof google.protobuf.FieldDescriptorProto
|
|
* @instance
|
|
*/
|
|
FieldDescriptorProto.prototype.oneofIndex = 0;
|
|
|
|
/**
|
|
* FieldDescriptorProto jsonName.
|
|
* @member {string} jsonName
|
|
* @memberof google.protobuf.FieldDescriptorProto
|
|
* @instance
|
|
*/
|
|
FieldDescriptorProto.prototype.jsonName = "";
|
|
|
|
/**
|
|
* FieldDescriptorProto options.
|
|
* @member {google.protobuf.IFieldOptions|null|undefined} options
|
|
* @memberof google.protobuf.FieldDescriptorProto
|
|
* @instance
|
|
*/
|
|
FieldDescriptorProto.prototype.options = null;
|
|
|
|
/**
|
|
* FieldDescriptorProto proto3Optional.
|
|
* @member {boolean} proto3Optional
|
|
* @memberof google.protobuf.FieldDescriptorProto
|
|
* @instance
|
|
*/
|
|
FieldDescriptorProto.prototype.proto3Optional = false;
|
|
|
|
/**
|
|
* Creates a new FieldDescriptorProto instance using the specified properties.
|
|
* @function create
|
|
* @memberof google.protobuf.FieldDescriptorProto
|
|
* @static
|
|
* @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set
|
|
* @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto instance
|
|
*/
|
|
FieldDescriptorProto.create = function create(properties) {
|
|
return new FieldDescriptorProto(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof google.protobuf.FieldDescriptorProto
|
|
* @static
|
|
* @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
FieldDescriptorProto.encode = function encode(message, writer) {
|
|
if (!writer) writer = $Writer.create();
|
|
if (message.name != null && Object.hasOwnProperty.call(message, "name"))
|
|
writer.uint32(/* id 1, wireType 2 =*/ 10).string(message.name);
|
|
if (
|
|
message.extendee != null &&
|
|
Object.hasOwnProperty.call(message, "extendee")
|
|
)
|
|
writer.uint32(/* id 2, wireType 2 =*/ 18).string(message.extendee);
|
|
if (
|
|
message.number != null &&
|
|
Object.hasOwnProperty.call(message, "number")
|
|
)
|
|
writer.uint32(/* id 3, wireType 0 =*/ 24).int32(message.number);
|
|
if (
|
|
message.label != null &&
|
|
Object.hasOwnProperty.call(message, "label")
|
|
)
|
|
writer.uint32(/* id 4, wireType 0 =*/ 32).int32(message.label);
|
|
if (message.type != null && Object.hasOwnProperty.call(message, "type"))
|
|
writer.uint32(/* id 5, wireType 0 =*/ 40).int32(message.type);
|
|
if (
|
|
message.typeName != null &&
|
|
Object.hasOwnProperty.call(message, "typeName")
|
|
)
|
|
writer.uint32(/* id 6, wireType 2 =*/ 50).string(message.typeName);
|
|
if (
|
|
message.defaultValue != null &&
|
|
Object.hasOwnProperty.call(message, "defaultValue")
|
|
)
|
|
writer
|
|
.uint32(/* id 7, wireType 2 =*/ 58)
|
|
.string(message.defaultValue);
|
|
if (
|
|
message.options != null &&
|
|
Object.hasOwnProperty.call(message, "options")
|
|
)
|
|
$root.google.protobuf.FieldOptions.encode(
|
|
message.options,
|
|
writer.uint32(/* id 8, wireType 2 =*/ 66).fork()
|
|
).ldelim();
|
|
if (
|
|
message.oneofIndex != null &&
|
|
Object.hasOwnProperty.call(message, "oneofIndex")
|
|
)
|
|
writer.uint32(/* id 9, wireType 0 =*/ 72).int32(message.oneofIndex);
|
|
if (
|
|
message.jsonName != null &&
|
|
Object.hasOwnProperty.call(message, "jsonName")
|
|
)
|
|
writer.uint32(/* id 10, wireType 2 =*/ 82).string(message.jsonName);
|
|
if (
|
|
message.proto3Optional != null &&
|
|
Object.hasOwnProperty.call(message, "proto3Optional")
|
|
)
|
|
writer
|
|
.uint32(/* id 17, wireType 0 =*/ 136)
|
|
.bool(message.proto3Optional);
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof google.protobuf.FieldDescriptorProto
|
|
* @static
|
|
* @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
FieldDescriptorProto.encodeDelimited = function encodeDelimited(
|
|
message,
|
|
writer
|
|
) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes a FieldDescriptorProto message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof google.protobuf.FieldDescriptorProto
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
FieldDescriptorProto.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.google.protobuf.FieldDescriptorProto();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
if (tag === error) break;
|
|
switch (tag >>> 3) {
|
|
case 1: {
|
|
message.name = reader.string();
|
|
break;
|
|
}
|
|
case 3: {
|
|
message.number = reader.int32();
|
|
break;
|
|
}
|
|
case 4: {
|
|
message.label = reader.int32();
|
|
break;
|
|
}
|
|
case 5: {
|
|
message.type = reader.int32();
|
|
break;
|
|
}
|
|
case 6: {
|
|
message.typeName = reader.string();
|
|
break;
|
|
}
|
|
case 2: {
|
|
message.extendee = reader.string();
|
|
break;
|
|
}
|
|
case 7: {
|
|
message.defaultValue = reader.string();
|
|
break;
|
|
}
|
|
case 9: {
|
|
message.oneofIndex = reader.int32();
|
|
break;
|
|
}
|
|
case 10: {
|
|
message.jsonName = reader.string();
|
|
break;
|
|
}
|
|
case 8: {
|
|
message.options = $root.google.protobuf.FieldOptions.decode(
|
|
reader,
|
|
reader.uint32()
|
|
);
|
|
break;
|
|
}
|
|
case 17: {
|
|
message.proto3Optional = reader.bool();
|
|
break;
|
|
}
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof google.protobuf.FieldDescriptorProto
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
FieldDescriptorProto.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader)) reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies a FieldDescriptorProto message.
|
|
* @function verify
|
|
* @memberof google.protobuf.FieldDescriptorProto
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
FieldDescriptorProto.verify = function verify(message) {
|
|
if (typeof message !== "object" || message === null)
|
|
return "object expected";
|
|
if (message.name != null && message.hasOwnProperty("name"))
|
|
if (!$util.isString(message.name)) return "name: string expected";
|
|
if (message.number != null && message.hasOwnProperty("number"))
|
|
if (!$util.isInteger(message.number))
|
|
return "number: integer expected";
|
|
if (message.label != null && message.hasOwnProperty("label"))
|
|
switch (message.label) {
|
|
default:
|
|
return "label: enum value expected";
|
|
case 1:
|
|
case 3:
|
|
case 2:
|
|
break;
|
|
}
|
|
if (message.type != null && message.hasOwnProperty("type"))
|
|
switch (message.type) {
|
|
default:
|
|
return "type: enum value expected";
|
|
case 1:
|
|
case 2:
|
|
case 3:
|
|
case 4:
|
|
case 5:
|
|
case 6:
|
|
case 7:
|
|
case 8:
|
|
case 9:
|
|
case 10:
|
|
case 11:
|
|
case 12:
|
|
case 13:
|
|
case 14:
|
|
case 15:
|
|
case 16:
|
|
case 17:
|
|
case 18:
|
|
break;
|
|
}
|
|
if (message.typeName != null && message.hasOwnProperty("typeName"))
|
|
if (!$util.isString(message.typeName))
|
|
return "typeName: string expected";
|
|
if (message.extendee != null && message.hasOwnProperty("extendee"))
|
|
if (!$util.isString(message.extendee))
|
|
return "extendee: string expected";
|
|
if (
|
|
message.defaultValue != null &&
|
|
message.hasOwnProperty("defaultValue")
|
|
)
|
|
if (!$util.isString(message.defaultValue))
|
|
return "defaultValue: string expected";
|
|
if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex"))
|
|
if (!$util.isInteger(message.oneofIndex))
|
|
return "oneofIndex: integer expected";
|
|
if (message.jsonName != null && message.hasOwnProperty("jsonName"))
|
|
if (!$util.isString(message.jsonName))
|
|
return "jsonName: string expected";
|
|
if (message.options != null && message.hasOwnProperty("options")) {
|
|
var error = $root.google.protobuf.FieldOptions.verify(
|
|
message.options
|
|
);
|
|
if (error) return "options." + error;
|
|
}
|
|
if (
|
|
message.proto3Optional != null &&
|
|
message.hasOwnProperty("proto3Optional")
|
|
)
|
|
if (typeof message.proto3Optional !== "boolean")
|
|
return "proto3Optional: boolean expected";
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof google.protobuf.FieldDescriptorProto
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto
|
|
*/
|
|
FieldDescriptorProto.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.google.protobuf.FieldDescriptorProto)
|
|
return object;
|
|
var message = new $root.google.protobuf.FieldDescriptorProto();
|
|
if (object.name != null) message.name = String(object.name);
|
|
if (object.number != null) message.number = object.number | 0;
|
|
switch (object.label) {
|
|
default:
|
|
if (typeof object.label === "number") {
|
|
message.label = object.label;
|
|
break;
|
|
}
|
|
break;
|
|
case "LABEL_OPTIONAL":
|
|
case 1:
|
|
message.label = 1;
|
|
break;
|
|
case "LABEL_REPEATED":
|
|
case 3:
|
|
message.label = 3;
|
|
break;
|
|
case "LABEL_REQUIRED":
|
|
case 2:
|
|
message.label = 2;
|
|
break;
|
|
}
|
|
switch (object.type) {
|
|
default:
|
|
if (typeof object.type === "number") {
|
|
message.type = object.type;
|
|
break;
|
|
}
|
|
break;
|
|
case "TYPE_DOUBLE":
|
|
case 1:
|
|
message.type = 1;
|
|
break;
|
|
case "TYPE_FLOAT":
|
|
case 2:
|
|
message.type = 2;
|
|
break;
|
|
case "TYPE_INT64":
|
|
case 3:
|
|
message.type = 3;
|
|
break;
|
|
case "TYPE_UINT64":
|
|
case 4:
|
|
message.type = 4;
|
|
break;
|
|
case "TYPE_INT32":
|
|
case 5:
|
|
message.type = 5;
|
|
break;
|
|
case "TYPE_FIXED64":
|
|
case 6:
|
|
message.type = 6;
|
|
break;
|
|
case "TYPE_FIXED32":
|
|
case 7:
|
|
message.type = 7;
|
|
break;
|
|
case "TYPE_BOOL":
|
|
case 8:
|
|
message.type = 8;
|
|
break;
|
|
case "TYPE_STRING":
|
|
case 9:
|
|
message.type = 9;
|
|
break;
|
|
case "TYPE_GROUP":
|
|
case 10:
|
|
message.type = 10;
|
|
break;
|
|
case "TYPE_MESSAGE":
|
|
case 11:
|
|
message.type = 11;
|
|
break;
|
|
case "TYPE_BYTES":
|
|
case 12:
|
|
message.type = 12;
|
|
break;
|
|
case "TYPE_UINT32":
|
|
case 13:
|
|
message.type = 13;
|
|
break;
|
|
case "TYPE_ENUM":
|
|
case 14:
|
|
message.type = 14;
|
|
break;
|
|
case "TYPE_SFIXED32":
|
|
case 15:
|
|
message.type = 15;
|
|
break;
|
|
case "TYPE_SFIXED64":
|
|
case 16:
|
|
message.type = 16;
|
|
break;
|
|
case "TYPE_SINT32":
|
|
case 17:
|
|
message.type = 17;
|
|
break;
|
|
case "TYPE_SINT64":
|
|
case 18:
|
|
message.type = 18;
|
|
break;
|
|
}
|
|
if (object.typeName != null) message.typeName = String(object.typeName);
|
|
if (object.extendee != null) message.extendee = String(object.extendee);
|
|
if (object.defaultValue != null)
|
|
message.defaultValue = String(object.defaultValue);
|
|
if (object.oneofIndex != null)
|
|
message.oneofIndex = object.oneofIndex | 0;
|
|
if (object.jsonName != null) message.jsonName = String(object.jsonName);
|
|
if (object.options != null) {
|
|
if (typeof object.options !== "object")
|
|
throw TypeError(
|
|
".google.protobuf.FieldDescriptorProto.options: object expected"
|
|
);
|
|
message.options = $root.google.protobuf.FieldOptions.fromObject(
|
|
object.options
|
|
);
|
|
}
|
|
if (object.proto3Optional != null)
|
|
message.proto3Optional = Boolean(object.proto3Optional);
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof google.protobuf.FieldDescriptorProto
|
|
* @static
|
|
* @param {google.protobuf.FieldDescriptorProto} message FieldDescriptorProto
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
FieldDescriptorProto.toObject = function toObject(message, options) {
|
|
if (!options) options = {};
|
|
var object = {};
|
|
if (options.defaults) {
|
|
object.name = "";
|
|
object.extendee = "";
|
|
object.number = 0;
|
|
object.label = options.enums === String ? "LABEL_OPTIONAL" : 1;
|
|
object.type = options.enums === String ? "TYPE_DOUBLE" : 1;
|
|
object.typeName = "";
|
|
object.defaultValue = "";
|
|
object.options = null;
|
|
object.oneofIndex = 0;
|
|
object.jsonName = "";
|
|
object.proto3Optional = false;
|
|
}
|
|
if (message.name != null && message.hasOwnProperty("name"))
|
|
object.name = message.name;
|
|
if (message.extendee != null && message.hasOwnProperty("extendee"))
|
|
object.extendee = message.extendee;
|
|
if (message.number != null && message.hasOwnProperty("number"))
|
|
object.number = message.number;
|
|
if (message.label != null && message.hasOwnProperty("label"))
|
|
object.label =
|
|
options.enums === String
|
|
? $root.google.protobuf.FieldDescriptorProto.Label[
|
|
message.label
|
|
] === undefined
|
|
? message.label
|
|
: $root.google.protobuf.FieldDescriptorProto.Label[
|
|
message.label
|
|
]
|
|
: message.label;
|
|
if (message.type != null && message.hasOwnProperty("type"))
|
|
object.type =
|
|
options.enums === String
|
|
? $root.google.protobuf.FieldDescriptorProto.Type[
|
|
message.type
|
|
] === undefined
|
|
? message.type
|
|
: $root.google.protobuf.FieldDescriptorProto.Type[message.type]
|
|
: message.type;
|
|
if (message.typeName != null && message.hasOwnProperty("typeName"))
|
|
object.typeName = message.typeName;
|
|
if (
|
|
message.defaultValue != null &&
|
|
message.hasOwnProperty("defaultValue")
|
|
)
|
|
object.defaultValue = message.defaultValue;
|
|
if (message.options != null && message.hasOwnProperty("options"))
|
|
object.options = $root.google.protobuf.FieldOptions.toObject(
|
|
message.options,
|
|
options
|
|
);
|
|
if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex"))
|
|
object.oneofIndex = message.oneofIndex;
|
|
if (message.jsonName != null && message.hasOwnProperty("jsonName"))
|
|
object.jsonName = message.jsonName;
|
|
if (
|
|
message.proto3Optional != null &&
|
|
message.hasOwnProperty("proto3Optional")
|
|
)
|
|
object.proto3Optional = message.proto3Optional;
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this FieldDescriptorProto to JSON.
|
|
* @function toJSON
|
|
* @memberof google.protobuf.FieldDescriptorProto
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
FieldDescriptorProto.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
/**
|
|
* Gets the default type url for FieldDescriptorProto
|
|
* @function getTypeUrl
|
|
* @memberof google.protobuf.FieldDescriptorProto
|
|
* @static
|
|
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
|
* @returns {string} The default type url
|
|
*/
|
|
FieldDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
if (typeUrlPrefix === undefined) {
|
|
typeUrlPrefix = "type.googleapis.com";
|
|
}
|
|
return typeUrlPrefix + "/google.protobuf.FieldDescriptorProto";
|
|
};
|
|
|
|
/**
|
|
* Type enum.
|
|
* @name google.protobuf.FieldDescriptorProto.Type
|
|
* @enum {number}
|
|
* @property {number} TYPE_DOUBLE=1 TYPE_DOUBLE value
|
|
* @property {number} TYPE_FLOAT=2 TYPE_FLOAT value
|
|
* @property {number} TYPE_INT64=3 TYPE_INT64 value
|
|
* @property {number} TYPE_UINT64=4 TYPE_UINT64 value
|
|
* @property {number} TYPE_INT32=5 TYPE_INT32 value
|
|
* @property {number} TYPE_FIXED64=6 TYPE_FIXED64 value
|
|
* @property {number} TYPE_FIXED32=7 TYPE_FIXED32 value
|
|
* @property {number} TYPE_BOOL=8 TYPE_BOOL value
|
|
* @property {number} TYPE_STRING=9 TYPE_STRING value
|
|
* @property {number} TYPE_GROUP=10 TYPE_GROUP value
|
|
* @property {number} TYPE_MESSAGE=11 TYPE_MESSAGE value
|
|
* @property {number} TYPE_BYTES=12 TYPE_BYTES value
|
|
* @property {number} TYPE_UINT32=13 TYPE_UINT32 value
|
|
* @property {number} TYPE_ENUM=14 TYPE_ENUM value
|
|
* @property {number} TYPE_SFIXED32=15 TYPE_SFIXED32 value
|
|
* @property {number} TYPE_SFIXED64=16 TYPE_SFIXED64 value
|
|
* @property {number} TYPE_SINT32=17 TYPE_SINT32 value
|
|
* @property {number} TYPE_SINT64=18 TYPE_SINT64 value
|
|
*/
|
|
FieldDescriptorProto.Type = (function () {
|
|
var valuesById = {},
|
|
values = Object.create(valuesById);
|
|
values[(valuesById[1] = "TYPE_DOUBLE")] = 1;
|
|
values[(valuesById[2] = "TYPE_FLOAT")] = 2;
|
|
values[(valuesById[3] = "TYPE_INT64")] = 3;
|
|
values[(valuesById[4] = "TYPE_UINT64")] = 4;
|
|
values[(valuesById[5] = "TYPE_INT32")] = 5;
|
|
values[(valuesById[6] = "TYPE_FIXED64")] = 6;
|
|
values[(valuesById[7] = "TYPE_FIXED32")] = 7;
|
|
values[(valuesById[8] = "TYPE_BOOL")] = 8;
|
|
values[(valuesById[9] = "TYPE_STRING")] = 9;
|
|
values[(valuesById[10] = "TYPE_GROUP")] = 10;
|
|
values[(valuesById[11] = "TYPE_MESSAGE")] = 11;
|
|
values[(valuesById[12] = "TYPE_BYTES")] = 12;
|
|
values[(valuesById[13] = "TYPE_UINT32")] = 13;
|
|
values[(valuesById[14] = "TYPE_ENUM")] = 14;
|
|
values[(valuesById[15] = "TYPE_SFIXED32")] = 15;
|
|
values[(valuesById[16] = "TYPE_SFIXED64")] = 16;
|
|
values[(valuesById[17] = "TYPE_SINT32")] = 17;
|
|
values[(valuesById[18] = "TYPE_SINT64")] = 18;
|
|
return values;
|
|
})();
|
|
|
|
/**
|
|
* Label enum.
|
|
* @name google.protobuf.FieldDescriptorProto.Label
|
|
* @enum {number}
|
|
* @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value
|
|
* @property {number} LABEL_REPEATED=3 LABEL_REPEATED value
|
|
* @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value
|
|
*/
|
|
FieldDescriptorProto.Label = (function () {
|
|
var valuesById = {},
|
|
values = Object.create(valuesById);
|
|
values[(valuesById[1] = "LABEL_OPTIONAL")] = 1;
|
|
values[(valuesById[3] = "LABEL_REPEATED")] = 3;
|
|
values[(valuesById[2] = "LABEL_REQUIRED")] = 2;
|
|
return values;
|
|
})();
|
|
|
|
return FieldDescriptorProto;
|
|
})();
|
|
|
|
protobuf.OneofDescriptorProto = (function () {
|
|
/**
|
|
* Properties of an OneofDescriptorProto.
|
|
* @memberof google.protobuf
|
|
* @interface IOneofDescriptorProto
|
|
* @property {string|null} [name] OneofDescriptorProto name
|
|
* @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new OneofDescriptorProto.
|
|
* @memberof google.protobuf
|
|
* @classdesc Represents an OneofDescriptorProto.
|
|
* @implements IOneofDescriptorProto
|
|
* @constructor
|
|
* @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set
|
|
*/
|
|
function OneofDescriptorProto(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]];
|
|
}
|
|
|
|
/**
|
|
* OneofDescriptorProto name.
|
|
* @member {string} name
|
|
* @memberof google.protobuf.OneofDescriptorProto
|
|
* @instance
|
|
*/
|
|
OneofDescriptorProto.prototype.name = "";
|
|
|
|
/**
|
|
* OneofDescriptorProto options.
|
|
* @member {google.protobuf.IOneofOptions|null|undefined} options
|
|
* @memberof google.protobuf.OneofDescriptorProto
|
|
* @instance
|
|
*/
|
|
OneofDescriptorProto.prototype.options = null;
|
|
|
|
/**
|
|
* Creates a new OneofDescriptorProto instance using the specified properties.
|
|
* @function create
|
|
* @memberof google.protobuf.OneofDescriptorProto
|
|
* @static
|
|
* @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set
|
|
* @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto instance
|
|
*/
|
|
OneofDescriptorProto.create = function create(properties) {
|
|
return new OneofDescriptorProto(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof google.protobuf.OneofDescriptorProto
|
|
* @static
|
|
* @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
OneofDescriptorProto.encode = function encode(message, writer) {
|
|
if (!writer) writer = $Writer.create();
|
|
if (message.name != null && Object.hasOwnProperty.call(message, "name"))
|
|
writer.uint32(/* id 1, wireType 2 =*/ 10).string(message.name);
|
|
if (
|
|
message.options != null &&
|
|
Object.hasOwnProperty.call(message, "options")
|
|
)
|
|
$root.google.protobuf.OneofOptions.encode(
|
|
message.options,
|
|
writer.uint32(/* id 2, wireType 2 =*/ 18).fork()
|
|
).ldelim();
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof google.protobuf.OneofDescriptorProto
|
|
* @static
|
|
* @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
OneofDescriptorProto.encodeDelimited = function encodeDelimited(
|
|
message,
|
|
writer
|
|
) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes an OneofDescriptorProto message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof google.protobuf.OneofDescriptorProto
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
OneofDescriptorProto.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.google.protobuf.OneofDescriptorProto();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
if (tag === error) break;
|
|
switch (tag >>> 3) {
|
|
case 1: {
|
|
message.name = reader.string();
|
|
break;
|
|
}
|
|
case 2: {
|
|
message.options = $root.google.protobuf.OneofOptions.decode(
|
|
reader,
|
|
reader.uint32()
|
|
);
|
|
break;
|
|
}
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof google.protobuf.OneofDescriptorProto
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
OneofDescriptorProto.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader)) reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies an OneofDescriptorProto message.
|
|
* @function verify
|
|
* @memberof google.protobuf.OneofDescriptorProto
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
OneofDescriptorProto.verify = function verify(message) {
|
|
if (typeof message !== "object" || message === null)
|
|
return "object expected";
|
|
if (message.name != null && message.hasOwnProperty("name"))
|
|
if (!$util.isString(message.name)) return "name: string expected";
|
|
if (message.options != null && message.hasOwnProperty("options")) {
|
|
var error = $root.google.protobuf.OneofOptions.verify(
|
|
message.options
|
|
);
|
|
if (error) return "options." + error;
|
|
}
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof google.protobuf.OneofDescriptorProto
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto
|
|
*/
|
|
OneofDescriptorProto.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.google.protobuf.OneofDescriptorProto)
|
|
return object;
|
|
var message = new $root.google.protobuf.OneofDescriptorProto();
|
|
if (object.name != null) message.name = String(object.name);
|
|
if (object.options != null) {
|
|
if (typeof object.options !== "object")
|
|
throw TypeError(
|
|
".google.protobuf.OneofDescriptorProto.options: object expected"
|
|
);
|
|
message.options = $root.google.protobuf.OneofOptions.fromObject(
|
|
object.options
|
|
);
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof google.protobuf.OneofDescriptorProto
|
|
* @static
|
|
* @param {google.protobuf.OneofDescriptorProto} message OneofDescriptorProto
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
OneofDescriptorProto.toObject = function toObject(message, options) {
|
|
if (!options) options = {};
|
|
var object = {};
|
|
if (options.defaults) {
|
|
object.name = "";
|
|
object.options = null;
|
|
}
|
|
if (message.name != null && message.hasOwnProperty("name"))
|
|
object.name = message.name;
|
|
if (message.options != null && message.hasOwnProperty("options"))
|
|
object.options = $root.google.protobuf.OneofOptions.toObject(
|
|
message.options,
|
|
options
|
|
);
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this OneofDescriptorProto to JSON.
|
|
* @function toJSON
|
|
* @memberof google.protobuf.OneofDescriptorProto
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
OneofDescriptorProto.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
/**
|
|
* Gets the default type url for OneofDescriptorProto
|
|
* @function getTypeUrl
|
|
* @memberof google.protobuf.OneofDescriptorProto
|
|
* @static
|
|
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
|
* @returns {string} The default type url
|
|
*/
|
|
OneofDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
if (typeUrlPrefix === undefined) {
|
|
typeUrlPrefix = "type.googleapis.com";
|
|
}
|
|
return typeUrlPrefix + "/google.protobuf.OneofDescriptorProto";
|
|
};
|
|
|
|
return OneofDescriptorProto;
|
|
})();
|
|
|
|
protobuf.EnumDescriptorProto = (function () {
|
|
/**
|
|
* Properties of an EnumDescriptorProto.
|
|
* @memberof google.protobuf
|
|
* @interface IEnumDescriptorProto
|
|
* @property {string|null} [name] EnumDescriptorProto name
|
|
* @property {Array.<google.protobuf.IEnumValueDescriptorProto>|null} [value] EnumDescriptorProto value
|
|
* @property {google.protobuf.IEnumOptions|null} [options] EnumDescriptorProto options
|
|
* @property {Array.<google.protobuf.EnumDescriptorProto.IEnumReservedRange>|null} [reservedRange] EnumDescriptorProto reservedRange
|
|
* @property {Array.<string>|null} [reservedName] EnumDescriptorProto reservedName
|
|
* @property {google.protobuf.SymbolVisibility|null} [visibility] EnumDescriptorProto visibility
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new EnumDescriptorProto.
|
|
* @memberof google.protobuf
|
|
* @classdesc Represents an EnumDescriptorProto.
|
|
* @implements IEnumDescriptorProto
|
|
* @constructor
|
|
* @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set
|
|
*/
|
|
function EnumDescriptorProto(properties) {
|
|
this.value = [];
|
|
this.reservedRange = [];
|
|
this.reservedName = [];
|
|
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]];
|
|
}
|
|
|
|
/**
|
|
* EnumDescriptorProto name.
|
|
* @member {string} name
|
|
* @memberof google.protobuf.EnumDescriptorProto
|
|
* @instance
|
|
*/
|
|
EnumDescriptorProto.prototype.name = "";
|
|
|
|
/**
|
|
* EnumDescriptorProto value.
|
|
* @member {Array.<google.protobuf.IEnumValueDescriptorProto>} value
|
|
* @memberof google.protobuf.EnumDescriptorProto
|
|
* @instance
|
|
*/
|
|
EnumDescriptorProto.prototype.value = $util.emptyArray;
|
|
|
|
/**
|
|
* EnumDescriptorProto options.
|
|
* @member {google.protobuf.IEnumOptions|null|undefined} options
|
|
* @memberof google.protobuf.EnumDescriptorProto
|
|
* @instance
|
|
*/
|
|
EnumDescriptorProto.prototype.options = null;
|
|
|
|
/**
|
|
* EnumDescriptorProto reservedRange.
|
|
* @member {Array.<google.protobuf.EnumDescriptorProto.IEnumReservedRange>} reservedRange
|
|
* @memberof google.protobuf.EnumDescriptorProto
|
|
* @instance
|
|
*/
|
|
EnumDescriptorProto.prototype.reservedRange = $util.emptyArray;
|
|
|
|
/**
|
|
* EnumDescriptorProto reservedName.
|
|
* @member {Array.<string>} reservedName
|
|
* @memberof google.protobuf.EnumDescriptorProto
|
|
* @instance
|
|
*/
|
|
EnumDescriptorProto.prototype.reservedName = $util.emptyArray;
|
|
|
|
/**
|
|
* EnumDescriptorProto visibility.
|
|
* @member {google.protobuf.SymbolVisibility} visibility
|
|
* @memberof google.protobuf.EnumDescriptorProto
|
|
* @instance
|
|
*/
|
|
EnumDescriptorProto.prototype.visibility = 0;
|
|
|
|
/**
|
|
* Creates a new EnumDescriptorProto instance using the specified properties.
|
|
* @function create
|
|
* @memberof google.protobuf.EnumDescriptorProto
|
|
* @static
|
|
* @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set
|
|
* @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto instance
|
|
*/
|
|
EnumDescriptorProto.create = function create(properties) {
|
|
return new EnumDescriptorProto(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof google.protobuf.EnumDescriptorProto
|
|
* @static
|
|
* @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
EnumDescriptorProto.encode = function encode(message, writer) {
|
|
if (!writer) writer = $Writer.create();
|
|
if (message.name != null && Object.hasOwnProperty.call(message, "name"))
|
|
writer.uint32(/* id 1, wireType 2 =*/ 10).string(message.name);
|
|
if (message.value != null && message.value.length)
|
|
for (var i = 0; i < message.value.length; ++i)
|
|
$root.google.protobuf.EnumValueDescriptorProto.encode(
|
|
message.value[i],
|
|
writer.uint32(/* id 2, wireType 2 =*/ 18).fork()
|
|
).ldelim();
|
|
if (
|
|
message.options != null &&
|
|
Object.hasOwnProperty.call(message, "options")
|
|
)
|
|
$root.google.protobuf.EnumOptions.encode(
|
|
message.options,
|
|
writer.uint32(/* id 3, wireType 2 =*/ 26).fork()
|
|
).ldelim();
|
|
if (message.reservedRange != null && message.reservedRange.length)
|
|
for (var i = 0; i < message.reservedRange.length; ++i)
|
|
$root.google.protobuf.EnumDescriptorProto.EnumReservedRange.encode(
|
|
message.reservedRange[i],
|
|
writer.uint32(/* id 4, wireType 2 =*/ 34).fork()
|
|
).ldelim();
|
|
if (message.reservedName != null && message.reservedName.length)
|
|
for (var i = 0; i < message.reservedName.length; ++i)
|
|
writer
|
|
.uint32(/* id 5, wireType 2 =*/ 42)
|
|
.string(message.reservedName[i]);
|
|
if (
|
|
message.visibility != null &&
|
|
Object.hasOwnProperty.call(message, "visibility")
|
|
)
|
|
writer.uint32(/* id 6, wireType 0 =*/ 48).int32(message.visibility);
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof google.protobuf.EnumDescriptorProto
|
|
* @static
|
|
* @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
EnumDescriptorProto.encodeDelimited = function encodeDelimited(
|
|
message,
|
|
writer
|
|
) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes an EnumDescriptorProto message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof google.protobuf.EnumDescriptorProto
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
EnumDescriptorProto.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.google.protobuf.EnumDescriptorProto();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
if (tag === error) break;
|
|
switch (tag >>> 3) {
|
|
case 1: {
|
|
message.name = reader.string();
|
|
break;
|
|
}
|
|
case 2: {
|
|
if (!(message.value && message.value.length)) message.value = [];
|
|
message.value.push(
|
|
$root.google.protobuf.EnumValueDescriptorProto.decode(
|
|
reader,
|
|
reader.uint32()
|
|
)
|
|
);
|
|
break;
|
|
}
|
|
case 3: {
|
|
message.options = $root.google.protobuf.EnumOptions.decode(
|
|
reader,
|
|
reader.uint32()
|
|
);
|
|
break;
|
|
}
|
|
case 4: {
|
|
if (!(message.reservedRange && message.reservedRange.length))
|
|
message.reservedRange = [];
|
|
message.reservedRange.push(
|
|
$root.google.protobuf.EnumDescriptorProto.EnumReservedRange.decode(
|
|
reader,
|
|
reader.uint32()
|
|
)
|
|
);
|
|
break;
|
|
}
|
|
case 5: {
|
|
if (!(message.reservedName && message.reservedName.length))
|
|
message.reservedName = [];
|
|
message.reservedName.push(reader.string());
|
|
break;
|
|
}
|
|
case 6: {
|
|
message.visibility = reader.int32();
|
|
break;
|
|
}
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof google.protobuf.EnumDescriptorProto
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
EnumDescriptorProto.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader)) reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies an EnumDescriptorProto message.
|
|
* @function verify
|
|
* @memberof google.protobuf.EnumDescriptorProto
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
EnumDescriptorProto.verify = function verify(message) {
|
|
if (typeof message !== "object" || message === null)
|
|
return "object expected";
|
|
if (message.name != null && message.hasOwnProperty("name"))
|
|
if (!$util.isString(message.name)) return "name: string expected";
|
|
if (message.value != null && message.hasOwnProperty("value")) {
|
|
if (!Array.isArray(message.value)) return "value: array expected";
|
|
for (var i = 0; i < message.value.length; ++i) {
|
|
var error = $root.google.protobuf.EnumValueDescriptorProto.verify(
|
|
message.value[i]
|
|
);
|
|
if (error) return "value." + error;
|
|
}
|
|
}
|
|
if (message.options != null && message.hasOwnProperty("options")) {
|
|
var error = $root.google.protobuf.EnumOptions.verify(message.options);
|
|
if (error) return "options." + error;
|
|
}
|
|
if (
|
|
message.reservedRange != null &&
|
|
message.hasOwnProperty("reservedRange")
|
|
) {
|
|
if (!Array.isArray(message.reservedRange))
|
|
return "reservedRange: array expected";
|
|
for (var i = 0; i < message.reservedRange.length; ++i) {
|
|
var error =
|
|
$root.google.protobuf.EnumDescriptorProto.EnumReservedRange.verify(
|
|
message.reservedRange[i]
|
|
);
|
|
if (error) return "reservedRange." + error;
|
|
}
|
|
}
|
|
if (
|
|
message.reservedName != null &&
|
|
message.hasOwnProperty("reservedName")
|
|
) {
|
|
if (!Array.isArray(message.reservedName))
|
|
return "reservedName: array expected";
|
|
for (var i = 0; i < message.reservedName.length; ++i)
|
|
if (!$util.isString(message.reservedName[i]))
|
|
return "reservedName: string[] expected";
|
|
}
|
|
if (message.visibility != null && message.hasOwnProperty("visibility"))
|
|
switch (message.visibility) {
|
|
default:
|
|
return "visibility: enum value expected";
|
|
case 0:
|
|
case 1:
|
|
case 2:
|
|
break;
|
|
}
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof google.protobuf.EnumDescriptorProto
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto
|
|
*/
|
|
EnumDescriptorProto.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.google.protobuf.EnumDescriptorProto)
|
|
return object;
|
|
var message = new $root.google.protobuf.EnumDescriptorProto();
|
|
if (object.name != null) message.name = String(object.name);
|
|
if (object.value) {
|
|
if (!Array.isArray(object.value))
|
|
throw TypeError(
|
|
".google.protobuf.EnumDescriptorProto.value: array expected"
|
|
);
|
|
message.value = [];
|
|
for (var i = 0; i < object.value.length; ++i) {
|
|
if (typeof object.value[i] !== "object")
|
|
throw TypeError(
|
|
".google.protobuf.EnumDescriptorProto.value: object expected"
|
|
);
|
|
message.value[i] =
|
|
$root.google.protobuf.EnumValueDescriptorProto.fromObject(
|
|
object.value[i]
|
|
);
|
|
}
|
|
}
|
|
if (object.options != null) {
|
|
if (typeof object.options !== "object")
|
|
throw TypeError(
|
|
".google.protobuf.EnumDescriptorProto.options: object expected"
|
|
);
|
|
message.options = $root.google.protobuf.EnumOptions.fromObject(
|
|
object.options
|
|
);
|
|
}
|
|
if (object.reservedRange) {
|
|
if (!Array.isArray(object.reservedRange))
|
|
throw TypeError(
|
|
".google.protobuf.EnumDescriptorProto.reservedRange: array expected"
|
|
);
|
|
message.reservedRange = [];
|
|
for (var i = 0; i < object.reservedRange.length; ++i) {
|
|
if (typeof object.reservedRange[i] !== "object")
|
|
throw TypeError(
|
|
".google.protobuf.EnumDescriptorProto.reservedRange: object expected"
|
|
);
|
|
message.reservedRange[i] =
|
|
$root.google.protobuf.EnumDescriptorProto.EnumReservedRange.fromObject(
|
|
object.reservedRange[i]
|
|
);
|
|
}
|
|
}
|
|
if (object.reservedName) {
|
|
if (!Array.isArray(object.reservedName))
|
|
throw TypeError(
|
|
".google.protobuf.EnumDescriptorProto.reservedName: array expected"
|
|
);
|
|
message.reservedName = [];
|
|
for (var i = 0; i < object.reservedName.length; ++i)
|
|
message.reservedName[i] = String(object.reservedName[i]);
|
|
}
|
|
switch (object.visibility) {
|
|
default:
|
|
if (typeof object.visibility === "number") {
|
|
message.visibility = object.visibility;
|
|
break;
|
|
}
|
|
break;
|
|
case "VISIBILITY_UNSET":
|
|
case 0:
|
|
message.visibility = 0;
|
|
break;
|
|
case "VISIBILITY_LOCAL":
|
|
case 1:
|
|
message.visibility = 1;
|
|
break;
|
|
case "VISIBILITY_EXPORT":
|
|
case 2:
|
|
message.visibility = 2;
|
|
break;
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof google.protobuf.EnumDescriptorProto
|
|
* @static
|
|
* @param {google.protobuf.EnumDescriptorProto} message EnumDescriptorProto
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
EnumDescriptorProto.toObject = function toObject(message, options) {
|
|
if (!options) options = {};
|
|
var object = {};
|
|
if (options.arrays || options.defaults) {
|
|
object.value = [];
|
|
object.reservedRange = [];
|
|
object.reservedName = [];
|
|
}
|
|
if (options.defaults) {
|
|
object.name = "";
|
|
object.options = null;
|
|
object.visibility = options.enums === String ? "VISIBILITY_UNSET" : 0;
|
|
}
|
|
if (message.name != null && message.hasOwnProperty("name"))
|
|
object.name = message.name;
|
|
if (message.value && message.value.length) {
|
|
object.value = [];
|
|
for (var j = 0; j < message.value.length; ++j)
|
|
object.value[j] =
|
|
$root.google.protobuf.EnumValueDescriptorProto.toObject(
|
|
message.value[j],
|
|
options
|
|
);
|
|
}
|
|
if (message.options != null && message.hasOwnProperty("options"))
|
|
object.options = $root.google.protobuf.EnumOptions.toObject(
|
|
message.options,
|
|
options
|
|
);
|
|
if (message.reservedRange && message.reservedRange.length) {
|
|
object.reservedRange = [];
|
|
for (var j = 0; j < message.reservedRange.length; ++j)
|
|
object.reservedRange[j] =
|
|
$root.google.protobuf.EnumDescriptorProto.EnumReservedRange.toObject(
|
|
message.reservedRange[j],
|
|
options
|
|
);
|
|
}
|
|
if (message.reservedName && message.reservedName.length) {
|
|
object.reservedName = [];
|
|
for (var j = 0; j < message.reservedName.length; ++j)
|
|
object.reservedName[j] = message.reservedName[j];
|
|
}
|
|
if (message.visibility != null && message.hasOwnProperty("visibility"))
|
|
object.visibility =
|
|
options.enums === String
|
|
? $root.google.protobuf.SymbolVisibility[message.visibility] ===
|
|
undefined
|
|
? message.visibility
|
|
: $root.google.protobuf.SymbolVisibility[message.visibility]
|
|
: message.visibility;
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this EnumDescriptorProto to JSON.
|
|
* @function toJSON
|
|
* @memberof google.protobuf.EnumDescriptorProto
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
EnumDescriptorProto.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
/**
|
|
* Gets the default type url for EnumDescriptorProto
|
|
* @function getTypeUrl
|
|
* @memberof google.protobuf.EnumDescriptorProto
|
|
* @static
|
|
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
|
* @returns {string} The default type url
|
|
*/
|
|
EnumDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
if (typeUrlPrefix === undefined) {
|
|
typeUrlPrefix = "type.googleapis.com";
|
|
}
|
|
return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto";
|
|
};
|
|
|
|
EnumDescriptorProto.EnumReservedRange = (function () {
|
|
/**
|
|
* Properties of an EnumReservedRange.
|
|
* @memberof google.protobuf.EnumDescriptorProto
|
|
* @interface IEnumReservedRange
|
|
* @property {number|null} [start] EnumReservedRange start
|
|
* @property {number|null} [end] EnumReservedRange end
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new EnumReservedRange.
|
|
* @memberof google.protobuf.EnumDescriptorProto
|
|
* @classdesc Represents an EnumReservedRange.
|
|
* @implements IEnumReservedRange
|
|
* @constructor
|
|
* @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set
|
|
*/
|
|
function EnumReservedRange(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]];
|
|
}
|
|
|
|
/**
|
|
* EnumReservedRange start.
|
|
* @member {number} start
|
|
* @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange
|
|
* @instance
|
|
*/
|
|
EnumReservedRange.prototype.start = 0;
|
|
|
|
/**
|
|
* EnumReservedRange end.
|
|
* @member {number} end
|
|
* @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange
|
|
* @instance
|
|
*/
|
|
EnumReservedRange.prototype.end = 0;
|
|
|
|
/**
|
|
* Creates a new EnumReservedRange instance using the specified properties.
|
|
* @function create
|
|
* @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange
|
|
* @static
|
|
* @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set
|
|
* @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange instance
|
|
*/
|
|
EnumReservedRange.create = function create(properties) {
|
|
return new EnumReservedRange(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange
|
|
* @static
|
|
* @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
EnumReservedRange.encode = function encode(message, writer) {
|
|
if (!writer) writer = $Writer.create();
|
|
if (
|
|
message.start != null &&
|
|
Object.hasOwnProperty.call(message, "start")
|
|
)
|
|
writer.uint32(/* id 1, wireType 0 =*/ 8).int32(message.start);
|
|
if (message.end != null && Object.hasOwnProperty.call(message, "end"))
|
|
writer.uint32(/* id 2, wireType 0 =*/ 16).int32(message.end);
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange
|
|
* @static
|
|
* @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
EnumReservedRange.encodeDelimited = function encodeDelimited(
|
|
message,
|
|
writer
|
|
) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes an EnumReservedRange message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
EnumReservedRange.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.google.protobuf.EnumDescriptorProto.EnumReservedRange();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
if (tag === error) break;
|
|
switch (tag >>> 3) {
|
|
case 1: {
|
|
message.start = reader.int32();
|
|
break;
|
|
}
|
|
case 2: {
|
|
message.end = reader.int32();
|
|
break;
|
|
}
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes an EnumReservedRange message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
EnumReservedRange.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader)) reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies an EnumReservedRange message.
|
|
* @function verify
|
|
* @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
EnumReservedRange.verify = function verify(message) {
|
|
if (typeof message !== "object" || message === null)
|
|
return "object expected";
|
|
if (message.start != null && message.hasOwnProperty("start"))
|
|
if (!$util.isInteger(message.start))
|
|
return "start: integer expected";
|
|
if (message.end != null && message.hasOwnProperty("end"))
|
|
if (!$util.isInteger(message.end)) return "end: integer expected";
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange
|
|
*/
|
|
EnumReservedRange.fromObject = function fromObject(object) {
|
|
if (
|
|
object instanceof
|
|
$root.google.protobuf.EnumDescriptorProto.EnumReservedRange
|
|
)
|
|
return object;
|
|
var message =
|
|
new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange();
|
|
if (object.start != null) message.start = object.start | 0;
|
|
if (object.end != null) message.end = object.end | 0;
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange
|
|
* @static
|
|
* @param {google.protobuf.EnumDescriptorProto.EnumReservedRange} message EnumReservedRange
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
EnumReservedRange.toObject = function toObject(message, options) {
|
|
if (!options) options = {};
|
|
var object = {};
|
|
if (options.defaults) {
|
|
object.start = 0;
|
|
object.end = 0;
|
|
}
|
|
if (message.start != null && message.hasOwnProperty("start"))
|
|
object.start = message.start;
|
|
if (message.end != null && message.hasOwnProperty("end"))
|
|
object.end = message.end;
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this EnumReservedRange to JSON.
|
|
* @function toJSON
|
|
* @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
EnumReservedRange.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
/**
|
|
* Gets the default type url for EnumReservedRange
|
|
* @function getTypeUrl
|
|
* @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange
|
|
* @static
|
|
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
|
* @returns {string} The default type url
|
|
*/
|
|
EnumReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
if (typeUrlPrefix === undefined) {
|
|
typeUrlPrefix = "type.googleapis.com";
|
|
}
|
|
return (
|
|
typeUrlPrefix +
|
|
"/google.protobuf.EnumDescriptorProto.EnumReservedRange"
|
|
);
|
|
};
|
|
|
|
return EnumReservedRange;
|
|
})();
|
|
|
|
return EnumDescriptorProto;
|
|
})();
|
|
|
|
protobuf.EnumValueDescriptorProto = (function () {
|
|
/**
|
|
* Properties of an EnumValueDescriptorProto.
|
|
* @memberof google.protobuf
|
|
* @interface IEnumValueDescriptorProto
|
|
* @property {string|null} [name] EnumValueDescriptorProto name
|
|
* @property {number|null} [number] EnumValueDescriptorProto number
|
|
* @property {google.protobuf.IEnumValueOptions|null} [options] EnumValueDescriptorProto options
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new EnumValueDescriptorProto.
|
|
* @memberof google.protobuf
|
|
* @classdesc Represents an EnumValueDescriptorProto.
|
|
* @implements IEnumValueDescriptorProto
|
|
* @constructor
|
|
* @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set
|
|
*/
|
|
function EnumValueDescriptorProto(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]];
|
|
}
|
|
|
|
/**
|
|
* EnumValueDescriptorProto name.
|
|
* @member {string} name
|
|
* @memberof google.protobuf.EnumValueDescriptorProto
|
|
* @instance
|
|
*/
|
|
EnumValueDescriptorProto.prototype.name = "";
|
|
|
|
/**
|
|
* EnumValueDescriptorProto number.
|
|
* @member {number} number
|
|
* @memberof google.protobuf.EnumValueDescriptorProto
|
|
* @instance
|
|
*/
|
|
EnumValueDescriptorProto.prototype.number = 0;
|
|
|
|
/**
|
|
* EnumValueDescriptorProto options.
|
|
* @member {google.protobuf.IEnumValueOptions|null|undefined} options
|
|
* @memberof google.protobuf.EnumValueDescriptorProto
|
|
* @instance
|
|
*/
|
|
EnumValueDescriptorProto.prototype.options = null;
|
|
|
|
/**
|
|
* Creates a new EnumValueDescriptorProto instance using the specified properties.
|
|
* @function create
|
|
* @memberof google.protobuf.EnumValueDescriptorProto
|
|
* @static
|
|
* @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set
|
|
* @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto instance
|
|
*/
|
|
EnumValueDescriptorProto.create = function create(properties) {
|
|
return new EnumValueDescriptorProto(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof google.protobuf.EnumValueDescriptorProto
|
|
* @static
|
|
* @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
EnumValueDescriptorProto.encode = function encode(message, writer) {
|
|
if (!writer) writer = $Writer.create();
|
|
if (message.name != null && Object.hasOwnProperty.call(message, "name"))
|
|
writer.uint32(/* id 1, wireType 2 =*/ 10).string(message.name);
|
|
if (
|
|
message.number != null &&
|
|
Object.hasOwnProperty.call(message, "number")
|
|
)
|
|
writer.uint32(/* id 2, wireType 0 =*/ 16).int32(message.number);
|
|
if (
|
|
message.options != null &&
|
|
Object.hasOwnProperty.call(message, "options")
|
|
)
|
|
$root.google.protobuf.EnumValueOptions.encode(
|
|
message.options,
|
|
writer.uint32(/* id 3, wireType 2 =*/ 26).fork()
|
|
).ldelim();
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof google.protobuf.EnumValueDescriptorProto
|
|
* @static
|
|
* @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(
|
|
message,
|
|
writer
|
|
) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes an EnumValueDescriptorProto message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof google.protobuf.EnumValueDescriptorProto
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
EnumValueDescriptorProto.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.google.protobuf.EnumValueDescriptorProto();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
if (tag === error) break;
|
|
switch (tag >>> 3) {
|
|
case 1: {
|
|
message.name = reader.string();
|
|
break;
|
|
}
|
|
case 2: {
|
|
message.number = reader.int32();
|
|
break;
|
|
}
|
|
case 3: {
|
|
message.options = $root.google.protobuf.EnumValueOptions.decode(
|
|
reader,
|
|
reader.uint32()
|
|
);
|
|
break;
|
|
}
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof google.protobuf.EnumValueDescriptorProto
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
EnumValueDescriptorProto.decodeDelimited = function decodeDelimited(
|
|
reader
|
|
) {
|
|
if (!(reader instanceof $Reader)) reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies an EnumValueDescriptorProto message.
|
|
* @function verify
|
|
* @memberof google.protobuf.EnumValueDescriptorProto
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
EnumValueDescriptorProto.verify = function verify(message) {
|
|
if (typeof message !== "object" || message === null)
|
|
return "object expected";
|
|
if (message.name != null && message.hasOwnProperty("name"))
|
|
if (!$util.isString(message.name)) return "name: string expected";
|
|
if (message.number != null && message.hasOwnProperty("number"))
|
|
if (!$util.isInteger(message.number))
|
|
return "number: integer expected";
|
|
if (message.options != null && message.hasOwnProperty("options")) {
|
|
var error = $root.google.protobuf.EnumValueOptions.verify(
|
|
message.options
|
|
);
|
|
if (error) return "options." + error;
|
|
}
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof google.protobuf.EnumValueDescriptorProto
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto
|
|
*/
|
|
EnumValueDescriptorProto.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.google.protobuf.EnumValueDescriptorProto)
|
|
return object;
|
|
var message = new $root.google.protobuf.EnumValueDescriptorProto();
|
|
if (object.name != null) message.name = String(object.name);
|
|
if (object.number != null) message.number = object.number | 0;
|
|
if (object.options != null) {
|
|
if (typeof object.options !== "object")
|
|
throw TypeError(
|
|
".google.protobuf.EnumValueDescriptorProto.options: object expected"
|
|
);
|
|
message.options = $root.google.protobuf.EnumValueOptions.fromObject(
|
|
object.options
|
|
);
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof google.protobuf.EnumValueDescriptorProto
|
|
* @static
|
|
* @param {google.protobuf.EnumValueDescriptorProto} message EnumValueDescriptorProto
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
EnumValueDescriptorProto.toObject = function toObject(message, options) {
|
|
if (!options) options = {};
|
|
var object = {};
|
|
if (options.defaults) {
|
|
object.name = "";
|
|
object.number = 0;
|
|
object.options = null;
|
|
}
|
|
if (message.name != null && message.hasOwnProperty("name"))
|
|
object.name = message.name;
|
|
if (message.number != null && message.hasOwnProperty("number"))
|
|
object.number = message.number;
|
|
if (message.options != null && message.hasOwnProperty("options"))
|
|
object.options = $root.google.protobuf.EnumValueOptions.toObject(
|
|
message.options,
|
|
options
|
|
);
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this EnumValueDescriptorProto to JSON.
|
|
* @function toJSON
|
|
* @memberof google.protobuf.EnumValueDescriptorProto
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
EnumValueDescriptorProto.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
/**
|
|
* Gets the default type url for EnumValueDescriptorProto
|
|
* @function getTypeUrl
|
|
* @memberof google.protobuf.EnumValueDescriptorProto
|
|
* @static
|
|
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
|
* @returns {string} The default type url
|
|
*/
|
|
EnumValueDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
if (typeUrlPrefix === undefined) {
|
|
typeUrlPrefix = "type.googleapis.com";
|
|
}
|
|
return typeUrlPrefix + "/google.protobuf.EnumValueDescriptorProto";
|
|
};
|
|
|
|
return EnumValueDescriptorProto;
|
|
})();
|
|
|
|
protobuf.ServiceDescriptorProto = (function () {
|
|
/**
|
|
* Properties of a ServiceDescriptorProto.
|
|
* @memberof google.protobuf
|
|
* @interface IServiceDescriptorProto
|
|
* @property {string|null} [name] ServiceDescriptorProto name
|
|
* @property {Array.<google.protobuf.IMethodDescriptorProto>|null} [method] ServiceDescriptorProto method
|
|
* @property {google.protobuf.IServiceOptions|null} [options] ServiceDescriptorProto options
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new ServiceDescriptorProto.
|
|
* @memberof google.protobuf
|
|
* @classdesc Represents a ServiceDescriptorProto.
|
|
* @implements IServiceDescriptorProto
|
|
* @constructor
|
|
* @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set
|
|
*/
|
|
function ServiceDescriptorProto(properties) {
|
|
this.method = [];
|
|
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]];
|
|
}
|
|
|
|
/**
|
|
* ServiceDescriptorProto name.
|
|
* @member {string} name
|
|
* @memberof google.protobuf.ServiceDescriptorProto
|
|
* @instance
|
|
*/
|
|
ServiceDescriptorProto.prototype.name = "";
|
|
|
|
/**
|
|
* ServiceDescriptorProto method.
|
|
* @member {Array.<google.protobuf.IMethodDescriptorProto>} method
|
|
* @memberof google.protobuf.ServiceDescriptorProto
|
|
* @instance
|
|
*/
|
|
ServiceDescriptorProto.prototype.method = $util.emptyArray;
|
|
|
|
/**
|
|
* ServiceDescriptorProto options.
|
|
* @member {google.protobuf.IServiceOptions|null|undefined} options
|
|
* @memberof google.protobuf.ServiceDescriptorProto
|
|
* @instance
|
|
*/
|
|
ServiceDescriptorProto.prototype.options = null;
|
|
|
|
/**
|
|
* Creates a new ServiceDescriptorProto instance using the specified properties.
|
|
* @function create
|
|
* @memberof google.protobuf.ServiceDescriptorProto
|
|
* @static
|
|
* @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set
|
|
* @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto instance
|
|
*/
|
|
ServiceDescriptorProto.create = function create(properties) {
|
|
return new ServiceDescriptorProto(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof google.protobuf.ServiceDescriptorProto
|
|
* @static
|
|
* @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
ServiceDescriptorProto.encode = function encode(message, writer) {
|
|
if (!writer) writer = $Writer.create();
|
|
if (message.name != null && Object.hasOwnProperty.call(message, "name"))
|
|
writer.uint32(/* id 1, wireType 2 =*/ 10).string(message.name);
|
|
if (message.method != null && message.method.length)
|
|
for (var i = 0; i < message.method.length; ++i)
|
|
$root.google.protobuf.MethodDescriptorProto.encode(
|
|
message.method[i],
|
|
writer.uint32(/* id 2, wireType 2 =*/ 18).fork()
|
|
).ldelim();
|
|
if (
|
|
message.options != null &&
|
|
Object.hasOwnProperty.call(message, "options")
|
|
)
|
|
$root.google.protobuf.ServiceOptions.encode(
|
|
message.options,
|
|
writer.uint32(/* id 3, wireType 2 =*/ 26).fork()
|
|
).ldelim();
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof google.protobuf.ServiceDescriptorProto
|
|
* @static
|
|
* @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
ServiceDescriptorProto.encodeDelimited = function encodeDelimited(
|
|
message,
|
|
writer
|
|
) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes a ServiceDescriptorProto message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof google.protobuf.ServiceDescriptorProto
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
ServiceDescriptorProto.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.google.protobuf.ServiceDescriptorProto();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
if (tag === error) break;
|
|
switch (tag >>> 3) {
|
|
case 1: {
|
|
message.name = reader.string();
|
|
break;
|
|
}
|
|
case 2: {
|
|
if (!(message.method && message.method.length))
|
|
message.method = [];
|
|
message.method.push(
|
|
$root.google.protobuf.MethodDescriptorProto.decode(
|
|
reader,
|
|
reader.uint32()
|
|
)
|
|
);
|
|
break;
|
|
}
|
|
case 3: {
|
|
message.options = $root.google.protobuf.ServiceOptions.decode(
|
|
reader,
|
|
reader.uint32()
|
|
);
|
|
break;
|
|
}
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof google.protobuf.ServiceDescriptorProto
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
ServiceDescriptorProto.decodeDelimited = function decodeDelimited(
|
|
reader
|
|
) {
|
|
if (!(reader instanceof $Reader)) reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies a ServiceDescriptorProto message.
|
|
* @function verify
|
|
* @memberof google.protobuf.ServiceDescriptorProto
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
ServiceDescriptorProto.verify = function verify(message) {
|
|
if (typeof message !== "object" || message === null)
|
|
return "object expected";
|
|
if (message.name != null && message.hasOwnProperty("name"))
|
|
if (!$util.isString(message.name)) return "name: string expected";
|
|
if (message.method != null && message.hasOwnProperty("method")) {
|
|
if (!Array.isArray(message.method)) return "method: array expected";
|
|
for (var i = 0; i < message.method.length; ++i) {
|
|
var error = $root.google.protobuf.MethodDescriptorProto.verify(
|
|
message.method[i]
|
|
);
|
|
if (error) return "method." + error;
|
|
}
|
|
}
|
|
if (message.options != null && message.hasOwnProperty("options")) {
|
|
var error = $root.google.protobuf.ServiceOptions.verify(
|
|
message.options
|
|
);
|
|
if (error) return "options." + error;
|
|
}
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof google.protobuf.ServiceDescriptorProto
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto
|
|
*/
|
|
ServiceDescriptorProto.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.google.protobuf.ServiceDescriptorProto)
|
|
return object;
|
|
var message = new $root.google.protobuf.ServiceDescriptorProto();
|
|
if (object.name != null) message.name = String(object.name);
|
|
if (object.method) {
|
|
if (!Array.isArray(object.method))
|
|
throw TypeError(
|
|
".google.protobuf.ServiceDescriptorProto.method: array expected"
|
|
);
|
|
message.method = [];
|
|
for (var i = 0; i < object.method.length; ++i) {
|
|
if (typeof object.method[i] !== "object")
|
|
throw TypeError(
|
|
".google.protobuf.ServiceDescriptorProto.method: object expected"
|
|
);
|
|
message.method[i] =
|
|
$root.google.protobuf.MethodDescriptorProto.fromObject(
|
|
object.method[i]
|
|
);
|
|
}
|
|
}
|
|
if (object.options != null) {
|
|
if (typeof object.options !== "object")
|
|
throw TypeError(
|
|
".google.protobuf.ServiceDescriptorProto.options: object expected"
|
|
);
|
|
message.options = $root.google.protobuf.ServiceOptions.fromObject(
|
|
object.options
|
|
);
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof google.protobuf.ServiceDescriptorProto
|
|
* @static
|
|
* @param {google.protobuf.ServiceDescriptorProto} message ServiceDescriptorProto
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
ServiceDescriptorProto.toObject = function toObject(message, options) {
|
|
if (!options) options = {};
|
|
var object = {};
|
|
if (options.arrays || options.defaults) object.method = [];
|
|
if (options.defaults) {
|
|
object.name = "";
|
|
object.options = null;
|
|
}
|
|
if (message.name != null && message.hasOwnProperty("name"))
|
|
object.name = message.name;
|
|
if (message.method && message.method.length) {
|
|
object.method = [];
|
|
for (var j = 0; j < message.method.length; ++j)
|
|
object.method[j] =
|
|
$root.google.protobuf.MethodDescriptorProto.toObject(
|
|
message.method[j],
|
|
options
|
|
);
|
|
}
|
|
if (message.options != null && message.hasOwnProperty("options"))
|
|
object.options = $root.google.protobuf.ServiceOptions.toObject(
|
|
message.options,
|
|
options
|
|
);
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this ServiceDescriptorProto to JSON.
|
|
* @function toJSON
|
|
* @memberof google.protobuf.ServiceDescriptorProto
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
ServiceDescriptorProto.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
/**
|
|
* Gets the default type url for ServiceDescriptorProto
|
|
* @function getTypeUrl
|
|
* @memberof google.protobuf.ServiceDescriptorProto
|
|
* @static
|
|
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
|
* @returns {string} The default type url
|
|
*/
|
|
ServiceDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
if (typeUrlPrefix === undefined) {
|
|
typeUrlPrefix = "type.googleapis.com";
|
|
}
|
|
return typeUrlPrefix + "/google.protobuf.ServiceDescriptorProto";
|
|
};
|
|
|
|
return ServiceDescriptorProto;
|
|
})();
|
|
|
|
protobuf.MethodDescriptorProto = (function () {
|
|
/**
|
|
* Properties of a MethodDescriptorProto.
|
|
* @memberof google.protobuf
|
|
* @interface IMethodDescriptorProto
|
|
* @property {string|null} [name] MethodDescriptorProto name
|
|
* @property {string|null} [inputType] MethodDescriptorProto inputType
|
|
* @property {string|null} [outputType] MethodDescriptorProto outputType
|
|
* @property {google.protobuf.IMethodOptions|null} [options] MethodDescriptorProto options
|
|
* @property {boolean|null} [clientStreaming] MethodDescriptorProto clientStreaming
|
|
* @property {boolean|null} [serverStreaming] MethodDescriptorProto serverStreaming
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new MethodDescriptorProto.
|
|
* @memberof google.protobuf
|
|
* @classdesc Represents a MethodDescriptorProto.
|
|
* @implements IMethodDescriptorProto
|
|
* @constructor
|
|
* @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set
|
|
*/
|
|
function MethodDescriptorProto(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]];
|
|
}
|
|
|
|
/**
|
|
* MethodDescriptorProto name.
|
|
* @member {string} name
|
|
* @memberof google.protobuf.MethodDescriptorProto
|
|
* @instance
|
|
*/
|
|
MethodDescriptorProto.prototype.name = "";
|
|
|
|
/**
|
|
* MethodDescriptorProto inputType.
|
|
* @member {string} inputType
|
|
* @memberof google.protobuf.MethodDescriptorProto
|
|
* @instance
|
|
*/
|
|
MethodDescriptorProto.prototype.inputType = "";
|
|
|
|
/**
|
|
* MethodDescriptorProto outputType.
|
|
* @member {string} outputType
|
|
* @memberof google.protobuf.MethodDescriptorProto
|
|
* @instance
|
|
*/
|
|
MethodDescriptorProto.prototype.outputType = "";
|
|
|
|
/**
|
|
* MethodDescriptorProto options.
|
|
* @member {google.protobuf.IMethodOptions|null|undefined} options
|
|
* @memberof google.protobuf.MethodDescriptorProto
|
|
* @instance
|
|
*/
|
|
MethodDescriptorProto.prototype.options = null;
|
|
|
|
/**
|
|
* MethodDescriptorProto clientStreaming.
|
|
* @member {boolean} clientStreaming
|
|
* @memberof google.protobuf.MethodDescriptorProto
|
|
* @instance
|
|
*/
|
|
MethodDescriptorProto.prototype.clientStreaming = false;
|
|
|
|
/**
|
|
* MethodDescriptorProto serverStreaming.
|
|
* @member {boolean} serverStreaming
|
|
* @memberof google.protobuf.MethodDescriptorProto
|
|
* @instance
|
|
*/
|
|
MethodDescriptorProto.prototype.serverStreaming = false;
|
|
|
|
/**
|
|
* Creates a new MethodDescriptorProto instance using the specified properties.
|
|
* @function create
|
|
* @memberof google.protobuf.MethodDescriptorProto
|
|
* @static
|
|
* @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set
|
|
* @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto instance
|
|
*/
|
|
MethodDescriptorProto.create = function create(properties) {
|
|
return new MethodDescriptorProto(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof google.protobuf.MethodDescriptorProto
|
|
* @static
|
|
* @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
MethodDescriptorProto.encode = function encode(message, writer) {
|
|
if (!writer) writer = $Writer.create();
|
|
if (message.name != null && Object.hasOwnProperty.call(message, "name"))
|
|
writer.uint32(/* id 1, wireType 2 =*/ 10).string(message.name);
|
|
if (
|
|
message.inputType != null &&
|
|
Object.hasOwnProperty.call(message, "inputType")
|
|
)
|
|
writer.uint32(/* id 2, wireType 2 =*/ 18).string(message.inputType);
|
|
if (
|
|
message.outputType != null &&
|
|
Object.hasOwnProperty.call(message, "outputType")
|
|
)
|
|
writer.uint32(/* id 3, wireType 2 =*/ 26).string(message.outputType);
|
|
if (
|
|
message.options != null &&
|
|
Object.hasOwnProperty.call(message, "options")
|
|
)
|
|
$root.google.protobuf.MethodOptions.encode(
|
|
message.options,
|
|
writer.uint32(/* id 4, wireType 2 =*/ 34).fork()
|
|
).ldelim();
|
|
if (
|
|
message.clientStreaming != null &&
|
|
Object.hasOwnProperty.call(message, "clientStreaming")
|
|
)
|
|
writer
|
|
.uint32(/* id 5, wireType 0 =*/ 40)
|
|
.bool(message.clientStreaming);
|
|
if (
|
|
message.serverStreaming != null &&
|
|
Object.hasOwnProperty.call(message, "serverStreaming")
|
|
)
|
|
writer
|
|
.uint32(/* id 6, wireType 0 =*/ 48)
|
|
.bool(message.serverStreaming);
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof google.protobuf.MethodDescriptorProto
|
|
* @static
|
|
* @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
MethodDescriptorProto.encodeDelimited = function encodeDelimited(
|
|
message,
|
|
writer
|
|
) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes a MethodDescriptorProto message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof google.protobuf.MethodDescriptorProto
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
MethodDescriptorProto.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.google.protobuf.MethodDescriptorProto();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
if (tag === error) break;
|
|
switch (tag >>> 3) {
|
|
case 1: {
|
|
message.name = reader.string();
|
|
break;
|
|
}
|
|
case 2: {
|
|
message.inputType = reader.string();
|
|
break;
|
|
}
|
|
case 3: {
|
|
message.outputType = reader.string();
|
|
break;
|
|
}
|
|
case 4: {
|
|
message.options = $root.google.protobuf.MethodOptions.decode(
|
|
reader,
|
|
reader.uint32()
|
|
);
|
|
break;
|
|
}
|
|
case 5: {
|
|
message.clientStreaming = reader.bool();
|
|
break;
|
|
}
|
|
case 6: {
|
|
message.serverStreaming = reader.bool();
|
|
break;
|
|
}
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof google.protobuf.MethodDescriptorProto
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
MethodDescriptorProto.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader)) reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies a MethodDescriptorProto message.
|
|
* @function verify
|
|
* @memberof google.protobuf.MethodDescriptorProto
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
MethodDescriptorProto.verify = function verify(message) {
|
|
if (typeof message !== "object" || message === null)
|
|
return "object expected";
|
|
if (message.name != null && message.hasOwnProperty("name"))
|
|
if (!$util.isString(message.name)) return "name: string expected";
|
|
if (message.inputType != null && message.hasOwnProperty("inputType"))
|
|
if (!$util.isString(message.inputType))
|
|
return "inputType: string expected";
|
|
if (message.outputType != null && message.hasOwnProperty("outputType"))
|
|
if (!$util.isString(message.outputType))
|
|
return "outputType: string expected";
|
|
if (message.options != null && message.hasOwnProperty("options")) {
|
|
var error = $root.google.protobuf.MethodOptions.verify(
|
|
message.options
|
|
);
|
|
if (error) return "options." + error;
|
|
}
|
|
if (
|
|
message.clientStreaming != null &&
|
|
message.hasOwnProperty("clientStreaming")
|
|
)
|
|
if (typeof message.clientStreaming !== "boolean")
|
|
return "clientStreaming: boolean expected";
|
|
if (
|
|
message.serverStreaming != null &&
|
|
message.hasOwnProperty("serverStreaming")
|
|
)
|
|
if (typeof message.serverStreaming !== "boolean")
|
|
return "serverStreaming: boolean expected";
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof google.protobuf.MethodDescriptorProto
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto
|
|
*/
|
|
MethodDescriptorProto.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.google.protobuf.MethodDescriptorProto)
|
|
return object;
|
|
var message = new $root.google.protobuf.MethodDescriptorProto();
|
|
if (object.name != null) message.name = String(object.name);
|
|
if (object.inputType != null)
|
|
message.inputType = String(object.inputType);
|
|
if (object.outputType != null)
|
|
message.outputType = String(object.outputType);
|
|
if (object.options != null) {
|
|
if (typeof object.options !== "object")
|
|
throw TypeError(
|
|
".google.protobuf.MethodDescriptorProto.options: object expected"
|
|
);
|
|
message.options = $root.google.protobuf.MethodOptions.fromObject(
|
|
object.options
|
|
);
|
|
}
|
|
if (object.clientStreaming != null)
|
|
message.clientStreaming = Boolean(object.clientStreaming);
|
|
if (object.serverStreaming != null)
|
|
message.serverStreaming = Boolean(object.serverStreaming);
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof google.protobuf.MethodDescriptorProto
|
|
* @static
|
|
* @param {google.protobuf.MethodDescriptorProto} message MethodDescriptorProto
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
MethodDescriptorProto.toObject = function toObject(message, options) {
|
|
if (!options) options = {};
|
|
var object = {};
|
|
if (options.defaults) {
|
|
object.name = "";
|
|
object.inputType = "";
|
|
object.outputType = "";
|
|
object.options = null;
|
|
object.clientStreaming = false;
|
|
object.serverStreaming = false;
|
|
}
|
|
if (message.name != null && message.hasOwnProperty("name"))
|
|
object.name = message.name;
|
|
if (message.inputType != null && message.hasOwnProperty("inputType"))
|
|
object.inputType = message.inputType;
|
|
if (message.outputType != null && message.hasOwnProperty("outputType"))
|
|
object.outputType = message.outputType;
|
|
if (message.options != null && message.hasOwnProperty("options"))
|
|
object.options = $root.google.protobuf.MethodOptions.toObject(
|
|
message.options,
|
|
options
|
|
);
|
|
if (
|
|
message.clientStreaming != null &&
|
|
message.hasOwnProperty("clientStreaming")
|
|
)
|
|
object.clientStreaming = message.clientStreaming;
|
|
if (
|
|
message.serverStreaming != null &&
|
|
message.hasOwnProperty("serverStreaming")
|
|
)
|
|
object.serverStreaming = message.serverStreaming;
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this MethodDescriptorProto to JSON.
|
|
* @function toJSON
|
|
* @memberof google.protobuf.MethodDescriptorProto
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
MethodDescriptorProto.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
/**
|
|
* Gets the default type url for MethodDescriptorProto
|
|
* @function getTypeUrl
|
|
* @memberof google.protobuf.MethodDescriptorProto
|
|
* @static
|
|
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
|
* @returns {string} The default type url
|
|
*/
|
|
MethodDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
if (typeUrlPrefix === undefined) {
|
|
typeUrlPrefix = "type.googleapis.com";
|
|
}
|
|
return typeUrlPrefix + "/google.protobuf.MethodDescriptorProto";
|
|
};
|
|
|
|
return MethodDescriptorProto;
|
|
})();
|
|
|
|
protobuf.FileOptions = (function () {
|
|
/**
|
|
* Properties of a FileOptions.
|
|
* @memberof google.protobuf
|
|
* @interface IFileOptions
|
|
* @property {string|null} [javaPackage] FileOptions javaPackage
|
|
* @property {string|null} [javaOuterClassname] FileOptions javaOuterClassname
|
|
* @property {boolean|null} [javaMultipleFiles] FileOptions javaMultipleFiles
|
|
* @property {boolean|null} [javaGenerateEqualsAndHash] FileOptions javaGenerateEqualsAndHash
|
|
* @property {boolean|null} [javaStringCheckUtf8] FileOptions javaStringCheckUtf8
|
|
* @property {google.protobuf.FileOptions.OptimizeMode|null} [optimizeFor] FileOptions optimizeFor
|
|
* @property {string|null} [goPackage] FileOptions goPackage
|
|
* @property {boolean|null} [ccGenericServices] FileOptions ccGenericServices
|
|
* @property {boolean|null} [javaGenericServices] FileOptions javaGenericServices
|
|
* @property {boolean|null} [pyGenericServices] FileOptions pyGenericServices
|
|
* @property {boolean|null} [deprecated] FileOptions deprecated
|
|
* @property {boolean|null} [ccEnableArenas] FileOptions ccEnableArenas
|
|
* @property {string|null} [objcClassPrefix] FileOptions objcClassPrefix
|
|
* @property {string|null} [csharpNamespace] FileOptions csharpNamespace
|
|
* @property {string|null} [swiftPrefix] FileOptions swiftPrefix
|
|
* @property {string|null} [phpClassPrefix] FileOptions phpClassPrefix
|
|
* @property {string|null} [phpNamespace] FileOptions phpNamespace
|
|
* @property {string|null} [phpMetadataNamespace] FileOptions phpMetadataNamespace
|
|
* @property {string|null} [rubyPackage] FileOptions rubyPackage
|
|
* @property {google.protobuf.IFeatureSet|null} [features] FileOptions features
|
|
* @property {Array.<google.protobuf.IUninterpretedOption>|null} [uninterpretedOption] FileOptions uninterpretedOption
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new FileOptions.
|
|
* @memberof google.protobuf
|
|
* @classdesc Represents a FileOptions.
|
|
* @implements IFileOptions
|
|
* @constructor
|
|
* @param {google.protobuf.IFileOptions=} [properties] Properties to set
|
|
*/
|
|
function FileOptions(properties) {
|
|
this.uninterpretedOption = [];
|
|
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]];
|
|
}
|
|
|
|
/**
|
|
* FileOptions javaPackage.
|
|
* @member {string} javaPackage
|
|
* @memberof google.protobuf.FileOptions
|
|
* @instance
|
|
*/
|
|
FileOptions.prototype.javaPackage = "";
|
|
|
|
/**
|
|
* FileOptions javaOuterClassname.
|
|
* @member {string} javaOuterClassname
|
|
* @memberof google.protobuf.FileOptions
|
|
* @instance
|
|
*/
|
|
FileOptions.prototype.javaOuterClassname = "";
|
|
|
|
/**
|
|
* FileOptions javaMultipleFiles.
|
|
* @member {boolean} javaMultipleFiles
|
|
* @memberof google.protobuf.FileOptions
|
|
* @instance
|
|
*/
|
|
FileOptions.prototype.javaMultipleFiles = false;
|
|
|
|
/**
|
|
* FileOptions javaGenerateEqualsAndHash.
|
|
* @member {boolean} javaGenerateEqualsAndHash
|
|
* @memberof google.protobuf.FileOptions
|
|
* @instance
|
|
*/
|
|
FileOptions.prototype.javaGenerateEqualsAndHash = false;
|
|
|
|
/**
|
|
* FileOptions javaStringCheckUtf8.
|
|
* @member {boolean} javaStringCheckUtf8
|
|
* @memberof google.protobuf.FileOptions
|
|
* @instance
|
|
*/
|
|
FileOptions.prototype.javaStringCheckUtf8 = false;
|
|
|
|
/**
|
|
* FileOptions optimizeFor.
|
|
* @member {google.protobuf.FileOptions.OptimizeMode} optimizeFor
|
|
* @memberof google.protobuf.FileOptions
|
|
* @instance
|
|
*/
|
|
FileOptions.prototype.optimizeFor = 1;
|
|
|
|
/**
|
|
* FileOptions goPackage.
|
|
* @member {string} goPackage
|
|
* @memberof google.protobuf.FileOptions
|
|
* @instance
|
|
*/
|
|
FileOptions.prototype.goPackage = "";
|
|
|
|
/**
|
|
* FileOptions ccGenericServices.
|
|
* @member {boolean} ccGenericServices
|
|
* @memberof google.protobuf.FileOptions
|
|
* @instance
|
|
*/
|
|
FileOptions.prototype.ccGenericServices = false;
|
|
|
|
/**
|
|
* FileOptions javaGenericServices.
|
|
* @member {boolean} javaGenericServices
|
|
* @memberof google.protobuf.FileOptions
|
|
* @instance
|
|
*/
|
|
FileOptions.prototype.javaGenericServices = false;
|
|
|
|
/**
|
|
* FileOptions pyGenericServices.
|
|
* @member {boolean} pyGenericServices
|
|
* @memberof google.protobuf.FileOptions
|
|
* @instance
|
|
*/
|
|
FileOptions.prototype.pyGenericServices = false;
|
|
|
|
/**
|
|
* FileOptions deprecated.
|
|
* @member {boolean} deprecated
|
|
* @memberof google.protobuf.FileOptions
|
|
* @instance
|
|
*/
|
|
FileOptions.prototype.deprecated = false;
|
|
|
|
/**
|
|
* FileOptions ccEnableArenas.
|
|
* @member {boolean} ccEnableArenas
|
|
* @memberof google.protobuf.FileOptions
|
|
* @instance
|
|
*/
|
|
FileOptions.prototype.ccEnableArenas = true;
|
|
|
|
/**
|
|
* FileOptions objcClassPrefix.
|
|
* @member {string} objcClassPrefix
|
|
* @memberof google.protobuf.FileOptions
|
|
* @instance
|
|
*/
|
|
FileOptions.prototype.objcClassPrefix = "";
|
|
|
|
/**
|
|
* FileOptions csharpNamespace.
|
|
* @member {string} csharpNamespace
|
|
* @memberof google.protobuf.FileOptions
|
|
* @instance
|
|
*/
|
|
FileOptions.prototype.csharpNamespace = "";
|
|
|
|
/**
|
|
* FileOptions swiftPrefix.
|
|
* @member {string} swiftPrefix
|
|
* @memberof google.protobuf.FileOptions
|
|
* @instance
|
|
*/
|
|
FileOptions.prototype.swiftPrefix = "";
|
|
|
|
/**
|
|
* FileOptions phpClassPrefix.
|
|
* @member {string} phpClassPrefix
|
|
* @memberof google.protobuf.FileOptions
|
|
* @instance
|
|
*/
|
|
FileOptions.prototype.phpClassPrefix = "";
|
|
|
|
/**
|
|
* FileOptions phpNamespace.
|
|
* @member {string} phpNamespace
|
|
* @memberof google.protobuf.FileOptions
|
|
* @instance
|
|
*/
|
|
FileOptions.prototype.phpNamespace = "";
|
|
|
|
/**
|
|
* FileOptions phpMetadataNamespace.
|
|
* @member {string} phpMetadataNamespace
|
|
* @memberof google.protobuf.FileOptions
|
|
* @instance
|
|
*/
|
|
FileOptions.prototype.phpMetadataNamespace = "";
|
|
|
|
/**
|
|
* FileOptions rubyPackage.
|
|
* @member {string} rubyPackage
|
|
* @memberof google.protobuf.FileOptions
|
|
* @instance
|
|
*/
|
|
FileOptions.prototype.rubyPackage = "";
|
|
|
|
/**
|
|
* FileOptions features.
|
|
* @member {google.protobuf.IFeatureSet|null|undefined} features
|
|
* @memberof google.protobuf.FileOptions
|
|
* @instance
|
|
*/
|
|
FileOptions.prototype.features = null;
|
|
|
|
/**
|
|
* FileOptions uninterpretedOption.
|
|
* @member {Array.<google.protobuf.IUninterpretedOption>} uninterpretedOption
|
|
* @memberof google.protobuf.FileOptions
|
|
* @instance
|
|
*/
|
|
FileOptions.prototype.uninterpretedOption = $util.emptyArray;
|
|
|
|
/**
|
|
* Creates a new FileOptions instance using the specified properties.
|
|
* @function create
|
|
* @memberof google.protobuf.FileOptions
|
|
* @static
|
|
* @param {google.protobuf.IFileOptions=} [properties] Properties to set
|
|
* @returns {google.protobuf.FileOptions} FileOptions instance
|
|
*/
|
|
FileOptions.create = function create(properties) {
|
|
return new FileOptions(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof google.protobuf.FileOptions
|
|
* @static
|
|
* @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
FileOptions.encode = function encode(message, writer) {
|
|
if (!writer) writer = $Writer.create();
|
|
if (
|
|
message.javaPackage != null &&
|
|
Object.hasOwnProperty.call(message, "javaPackage")
|
|
)
|
|
writer.uint32(/* id 1, wireType 2 =*/ 10).string(message.javaPackage);
|
|
if (
|
|
message.javaOuterClassname != null &&
|
|
Object.hasOwnProperty.call(message, "javaOuterClassname")
|
|
)
|
|
writer
|
|
.uint32(/* id 8, wireType 2 =*/ 66)
|
|
.string(message.javaOuterClassname);
|
|
if (
|
|
message.optimizeFor != null &&
|
|
Object.hasOwnProperty.call(message, "optimizeFor")
|
|
)
|
|
writer.uint32(/* id 9, wireType 0 =*/ 72).int32(message.optimizeFor);
|
|
if (
|
|
message.javaMultipleFiles != null &&
|
|
Object.hasOwnProperty.call(message, "javaMultipleFiles")
|
|
)
|
|
writer
|
|
.uint32(/* id 10, wireType 0 =*/ 80)
|
|
.bool(message.javaMultipleFiles);
|
|
if (
|
|
message.goPackage != null &&
|
|
Object.hasOwnProperty.call(message, "goPackage")
|
|
)
|
|
writer.uint32(/* id 11, wireType 2 =*/ 90).string(message.goPackage);
|
|
if (
|
|
message.ccGenericServices != null &&
|
|
Object.hasOwnProperty.call(message, "ccGenericServices")
|
|
)
|
|
writer
|
|
.uint32(/* id 16, wireType 0 =*/ 128)
|
|
.bool(message.ccGenericServices);
|
|
if (
|
|
message.javaGenericServices != null &&
|
|
Object.hasOwnProperty.call(message, "javaGenericServices")
|
|
)
|
|
writer
|
|
.uint32(/* id 17, wireType 0 =*/ 136)
|
|
.bool(message.javaGenericServices);
|
|
if (
|
|
message.pyGenericServices != null &&
|
|
Object.hasOwnProperty.call(message, "pyGenericServices")
|
|
)
|
|
writer
|
|
.uint32(/* id 18, wireType 0 =*/ 144)
|
|
.bool(message.pyGenericServices);
|
|
if (
|
|
message.javaGenerateEqualsAndHash != null &&
|
|
Object.hasOwnProperty.call(message, "javaGenerateEqualsAndHash")
|
|
)
|
|
writer
|
|
.uint32(/* id 20, wireType 0 =*/ 160)
|
|
.bool(message.javaGenerateEqualsAndHash);
|
|
if (
|
|
message.deprecated != null &&
|
|
Object.hasOwnProperty.call(message, "deprecated")
|
|
)
|
|
writer.uint32(/* id 23, wireType 0 =*/ 184).bool(message.deprecated);
|
|
if (
|
|
message.javaStringCheckUtf8 != null &&
|
|
Object.hasOwnProperty.call(message, "javaStringCheckUtf8")
|
|
)
|
|
writer
|
|
.uint32(/* id 27, wireType 0 =*/ 216)
|
|
.bool(message.javaStringCheckUtf8);
|
|
if (
|
|
message.ccEnableArenas != null &&
|
|
Object.hasOwnProperty.call(message, "ccEnableArenas")
|
|
)
|
|
writer
|
|
.uint32(/* id 31, wireType 0 =*/ 248)
|
|
.bool(message.ccEnableArenas);
|
|
if (
|
|
message.objcClassPrefix != null &&
|
|
Object.hasOwnProperty.call(message, "objcClassPrefix")
|
|
)
|
|
writer
|
|
.uint32(/* id 36, wireType 2 =*/ 290)
|
|
.string(message.objcClassPrefix);
|
|
if (
|
|
message.csharpNamespace != null &&
|
|
Object.hasOwnProperty.call(message, "csharpNamespace")
|
|
)
|
|
writer
|
|
.uint32(/* id 37, wireType 2 =*/ 298)
|
|
.string(message.csharpNamespace);
|
|
if (
|
|
message.swiftPrefix != null &&
|
|
Object.hasOwnProperty.call(message, "swiftPrefix")
|
|
)
|
|
writer
|
|
.uint32(/* id 39, wireType 2 =*/ 314)
|
|
.string(message.swiftPrefix);
|
|
if (
|
|
message.phpClassPrefix != null &&
|
|
Object.hasOwnProperty.call(message, "phpClassPrefix")
|
|
)
|
|
writer
|
|
.uint32(/* id 40, wireType 2 =*/ 322)
|
|
.string(message.phpClassPrefix);
|
|
if (
|
|
message.phpNamespace != null &&
|
|
Object.hasOwnProperty.call(message, "phpNamespace")
|
|
)
|
|
writer
|
|
.uint32(/* id 41, wireType 2 =*/ 330)
|
|
.string(message.phpNamespace);
|
|
if (
|
|
message.phpMetadataNamespace != null &&
|
|
Object.hasOwnProperty.call(message, "phpMetadataNamespace")
|
|
)
|
|
writer
|
|
.uint32(/* id 44, wireType 2 =*/ 354)
|
|
.string(message.phpMetadataNamespace);
|
|
if (
|
|
message.rubyPackage != null &&
|
|
Object.hasOwnProperty.call(message, "rubyPackage")
|
|
)
|
|
writer
|
|
.uint32(/* id 45, wireType 2 =*/ 362)
|
|
.string(message.rubyPackage);
|
|
if (
|
|
message.features != null &&
|
|
Object.hasOwnProperty.call(message, "features")
|
|
)
|
|
$root.google.protobuf.FeatureSet.encode(
|
|
message.features,
|
|
writer.uint32(/* id 50, wireType 2 =*/ 402).fork()
|
|
).ldelim();
|
|
if (
|
|
message.uninterpretedOption != null &&
|
|
message.uninterpretedOption.length
|
|
)
|
|
for (var i = 0; i < message.uninterpretedOption.length; ++i)
|
|
$root.google.protobuf.UninterpretedOption.encode(
|
|
message.uninterpretedOption[i],
|
|
writer.uint32(/* id 999, wireType 2 =*/ 7994).fork()
|
|
).ldelim();
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof google.protobuf.FileOptions
|
|
* @static
|
|
* @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
FileOptions.encodeDelimited = function encodeDelimited(message, writer) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes a FileOptions message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof google.protobuf.FileOptions
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {google.protobuf.FileOptions} FileOptions
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
FileOptions.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.google.protobuf.FileOptions();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
if (tag === error) break;
|
|
switch (tag >>> 3) {
|
|
case 1: {
|
|
message.javaPackage = reader.string();
|
|
break;
|
|
}
|
|
case 8: {
|
|
message.javaOuterClassname = reader.string();
|
|
break;
|
|
}
|
|
case 10: {
|
|
message.javaMultipleFiles = reader.bool();
|
|
break;
|
|
}
|
|
case 20: {
|
|
message.javaGenerateEqualsAndHash = reader.bool();
|
|
break;
|
|
}
|
|
case 27: {
|
|
message.javaStringCheckUtf8 = reader.bool();
|
|
break;
|
|
}
|
|
case 9: {
|
|
message.optimizeFor = reader.int32();
|
|
break;
|
|
}
|
|
case 11: {
|
|
message.goPackage = reader.string();
|
|
break;
|
|
}
|
|
case 16: {
|
|
message.ccGenericServices = reader.bool();
|
|
break;
|
|
}
|
|
case 17: {
|
|
message.javaGenericServices = reader.bool();
|
|
break;
|
|
}
|
|
case 18: {
|
|
message.pyGenericServices = reader.bool();
|
|
break;
|
|
}
|
|
case 23: {
|
|
message.deprecated = reader.bool();
|
|
break;
|
|
}
|
|
case 31: {
|
|
message.ccEnableArenas = reader.bool();
|
|
break;
|
|
}
|
|
case 36: {
|
|
message.objcClassPrefix = reader.string();
|
|
break;
|
|
}
|
|
case 37: {
|
|
message.csharpNamespace = reader.string();
|
|
break;
|
|
}
|
|
case 39: {
|
|
message.swiftPrefix = reader.string();
|
|
break;
|
|
}
|
|
case 40: {
|
|
message.phpClassPrefix = reader.string();
|
|
break;
|
|
}
|
|
case 41: {
|
|
message.phpNamespace = reader.string();
|
|
break;
|
|
}
|
|
case 44: {
|
|
message.phpMetadataNamespace = reader.string();
|
|
break;
|
|
}
|
|
case 45: {
|
|
message.rubyPackage = reader.string();
|
|
break;
|
|
}
|
|
case 50: {
|
|
message.features = $root.google.protobuf.FeatureSet.decode(
|
|
reader,
|
|
reader.uint32()
|
|
);
|
|
break;
|
|
}
|
|
case 999: {
|
|
if (
|
|
!(
|
|
message.uninterpretedOption &&
|
|
message.uninterpretedOption.length
|
|
)
|
|
)
|
|
message.uninterpretedOption = [];
|
|
message.uninterpretedOption.push(
|
|
$root.google.protobuf.UninterpretedOption.decode(
|
|
reader,
|
|
reader.uint32()
|
|
)
|
|
);
|
|
break;
|
|
}
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes a FileOptions message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof google.protobuf.FileOptions
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {google.protobuf.FileOptions} FileOptions
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
FileOptions.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader)) reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies a FileOptions message.
|
|
* @function verify
|
|
* @memberof google.protobuf.FileOptions
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
FileOptions.verify = function verify(message) {
|
|
if (typeof message !== "object" || message === null)
|
|
return "object expected";
|
|
if (
|
|
message.javaPackage != null &&
|
|
message.hasOwnProperty("javaPackage")
|
|
)
|
|
if (!$util.isString(message.javaPackage))
|
|
return "javaPackage: string expected";
|
|
if (
|
|
message.javaOuterClassname != null &&
|
|
message.hasOwnProperty("javaOuterClassname")
|
|
)
|
|
if (!$util.isString(message.javaOuterClassname))
|
|
return "javaOuterClassname: string expected";
|
|
if (
|
|
message.javaMultipleFiles != null &&
|
|
message.hasOwnProperty("javaMultipleFiles")
|
|
)
|
|
if (typeof message.javaMultipleFiles !== "boolean")
|
|
return "javaMultipleFiles: boolean expected";
|
|
if (
|
|
message.javaGenerateEqualsAndHash != null &&
|
|
message.hasOwnProperty("javaGenerateEqualsAndHash")
|
|
)
|
|
if (typeof message.javaGenerateEqualsAndHash !== "boolean")
|
|
return "javaGenerateEqualsAndHash: boolean expected";
|
|
if (
|
|
message.javaStringCheckUtf8 != null &&
|
|
message.hasOwnProperty("javaStringCheckUtf8")
|
|
)
|
|
if (typeof message.javaStringCheckUtf8 !== "boolean")
|
|
return "javaStringCheckUtf8: boolean expected";
|
|
if (
|
|
message.optimizeFor != null &&
|
|
message.hasOwnProperty("optimizeFor")
|
|
)
|
|
switch (message.optimizeFor) {
|
|
default:
|
|
return "optimizeFor: enum value expected";
|
|
case 1:
|
|
case 2:
|
|
case 3:
|
|
break;
|
|
}
|
|
if (message.goPackage != null && message.hasOwnProperty("goPackage"))
|
|
if (!$util.isString(message.goPackage))
|
|
return "goPackage: string expected";
|
|
if (
|
|
message.ccGenericServices != null &&
|
|
message.hasOwnProperty("ccGenericServices")
|
|
)
|
|
if (typeof message.ccGenericServices !== "boolean")
|
|
return "ccGenericServices: boolean expected";
|
|
if (
|
|
message.javaGenericServices != null &&
|
|
message.hasOwnProperty("javaGenericServices")
|
|
)
|
|
if (typeof message.javaGenericServices !== "boolean")
|
|
return "javaGenericServices: boolean expected";
|
|
if (
|
|
message.pyGenericServices != null &&
|
|
message.hasOwnProperty("pyGenericServices")
|
|
)
|
|
if (typeof message.pyGenericServices !== "boolean")
|
|
return "pyGenericServices: boolean expected";
|
|
if (message.deprecated != null && message.hasOwnProperty("deprecated"))
|
|
if (typeof message.deprecated !== "boolean")
|
|
return "deprecated: boolean expected";
|
|
if (
|
|
message.ccEnableArenas != null &&
|
|
message.hasOwnProperty("ccEnableArenas")
|
|
)
|
|
if (typeof message.ccEnableArenas !== "boolean")
|
|
return "ccEnableArenas: boolean expected";
|
|
if (
|
|
message.objcClassPrefix != null &&
|
|
message.hasOwnProperty("objcClassPrefix")
|
|
)
|
|
if (!$util.isString(message.objcClassPrefix))
|
|
return "objcClassPrefix: string expected";
|
|
if (
|
|
message.csharpNamespace != null &&
|
|
message.hasOwnProperty("csharpNamespace")
|
|
)
|
|
if (!$util.isString(message.csharpNamespace))
|
|
return "csharpNamespace: string expected";
|
|
if (
|
|
message.swiftPrefix != null &&
|
|
message.hasOwnProperty("swiftPrefix")
|
|
)
|
|
if (!$util.isString(message.swiftPrefix))
|
|
return "swiftPrefix: string expected";
|
|
if (
|
|
message.phpClassPrefix != null &&
|
|
message.hasOwnProperty("phpClassPrefix")
|
|
)
|
|
if (!$util.isString(message.phpClassPrefix))
|
|
return "phpClassPrefix: string expected";
|
|
if (
|
|
message.phpNamespace != null &&
|
|
message.hasOwnProperty("phpNamespace")
|
|
)
|
|
if (!$util.isString(message.phpNamespace))
|
|
return "phpNamespace: string expected";
|
|
if (
|
|
message.phpMetadataNamespace != null &&
|
|
message.hasOwnProperty("phpMetadataNamespace")
|
|
)
|
|
if (!$util.isString(message.phpMetadataNamespace))
|
|
return "phpMetadataNamespace: string expected";
|
|
if (
|
|
message.rubyPackage != null &&
|
|
message.hasOwnProperty("rubyPackage")
|
|
)
|
|
if (!$util.isString(message.rubyPackage))
|
|
return "rubyPackage: string expected";
|
|
if (message.features != null && message.hasOwnProperty("features")) {
|
|
var error = $root.google.protobuf.FeatureSet.verify(message.features);
|
|
if (error) return "features." + error;
|
|
}
|
|
if (
|
|
message.uninterpretedOption != null &&
|
|
message.hasOwnProperty("uninterpretedOption")
|
|
) {
|
|
if (!Array.isArray(message.uninterpretedOption))
|
|
return "uninterpretedOption: array expected";
|
|
for (var i = 0; i < message.uninterpretedOption.length; ++i) {
|
|
var error = $root.google.protobuf.UninterpretedOption.verify(
|
|
message.uninterpretedOption[i]
|
|
);
|
|
if (error) return "uninterpretedOption." + error;
|
|
}
|
|
}
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates a FileOptions message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof google.protobuf.FileOptions
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {google.protobuf.FileOptions} FileOptions
|
|
*/
|
|
FileOptions.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.google.protobuf.FileOptions) return object;
|
|
var message = new $root.google.protobuf.FileOptions();
|
|
if (object.javaPackage != null)
|
|
message.javaPackage = String(object.javaPackage);
|
|
if (object.javaOuterClassname != null)
|
|
message.javaOuterClassname = String(object.javaOuterClassname);
|
|
if (object.javaMultipleFiles != null)
|
|
message.javaMultipleFiles = Boolean(object.javaMultipleFiles);
|
|
if (object.javaGenerateEqualsAndHash != null)
|
|
message.javaGenerateEqualsAndHash = Boolean(
|
|
object.javaGenerateEqualsAndHash
|
|
);
|
|
if (object.javaStringCheckUtf8 != null)
|
|
message.javaStringCheckUtf8 = Boolean(object.javaStringCheckUtf8);
|
|
switch (object.optimizeFor) {
|
|
default:
|
|
if (typeof object.optimizeFor === "number") {
|
|
message.optimizeFor = object.optimizeFor;
|
|
break;
|
|
}
|
|
break;
|
|
case "SPEED":
|
|
case 1:
|
|
message.optimizeFor = 1;
|
|
break;
|
|
case "CODE_SIZE":
|
|
case 2:
|
|
message.optimizeFor = 2;
|
|
break;
|
|
case "LITE_RUNTIME":
|
|
case 3:
|
|
message.optimizeFor = 3;
|
|
break;
|
|
}
|
|
if (object.goPackage != null)
|
|
message.goPackage = String(object.goPackage);
|
|
if (object.ccGenericServices != null)
|
|
message.ccGenericServices = Boolean(object.ccGenericServices);
|
|
if (object.javaGenericServices != null)
|
|
message.javaGenericServices = Boolean(object.javaGenericServices);
|
|
if (object.pyGenericServices != null)
|
|
message.pyGenericServices = Boolean(object.pyGenericServices);
|
|
if (object.deprecated != null)
|
|
message.deprecated = Boolean(object.deprecated);
|
|
if (object.ccEnableArenas != null)
|
|
message.ccEnableArenas = Boolean(object.ccEnableArenas);
|
|
if (object.objcClassPrefix != null)
|
|
message.objcClassPrefix = String(object.objcClassPrefix);
|
|
if (object.csharpNamespace != null)
|
|
message.csharpNamespace = String(object.csharpNamespace);
|
|
if (object.swiftPrefix != null)
|
|
message.swiftPrefix = String(object.swiftPrefix);
|
|
if (object.phpClassPrefix != null)
|
|
message.phpClassPrefix = String(object.phpClassPrefix);
|
|
if (object.phpNamespace != null)
|
|
message.phpNamespace = String(object.phpNamespace);
|
|
if (object.phpMetadataNamespace != null)
|
|
message.phpMetadataNamespace = String(object.phpMetadataNamespace);
|
|
if (object.rubyPackage != null)
|
|
message.rubyPackage = String(object.rubyPackage);
|
|
if (object.features != null) {
|
|
if (typeof object.features !== "object")
|
|
throw TypeError(
|
|
".google.protobuf.FileOptions.features: object expected"
|
|
);
|
|
message.features = $root.google.protobuf.FeatureSet.fromObject(
|
|
object.features
|
|
);
|
|
}
|
|
if (object.uninterpretedOption) {
|
|
if (!Array.isArray(object.uninterpretedOption))
|
|
throw TypeError(
|
|
".google.protobuf.FileOptions.uninterpretedOption: array expected"
|
|
);
|
|
message.uninterpretedOption = [];
|
|
for (var i = 0; i < object.uninterpretedOption.length; ++i) {
|
|
if (typeof object.uninterpretedOption[i] !== "object")
|
|
throw TypeError(
|
|
".google.protobuf.FileOptions.uninterpretedOption: object expected"
|
|
);
|
|
message.uninterpretedOption[i] =
|
|
$root.google.protobuf.UninterpretedOption.fromObject(
|
|
object.uninterpretedOption[i]
|
|
);
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from a FileOptions message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof google.protobuf.FileOptions
|
|
* @static
|
|
* @param {google.protobuf.FileOptions} message FileOptions
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
FileOptions.toObject = function toObject(message, options) {
|
|
if (!options) options = {};
|
|
var object = {};
|
|
if (options.arrays || options.defaults) object.uninterpretedOption = [];
|
|
if (options.defaults) {
|
|
object.javaPackage = "";
|
|
object.javaOuterClassname = "";
|
|
object.optimizeFor = options.enums === String ? "SPEED" : 1;
|
|
object.javaMultipleFiles = false;
|
|
object.goPackage = "";
|
|
object.ccGenericServices = false;
|
|
object.javaGenericServices = false;
|
|
object.pyGenericServices = false;
|
|
object.javaGenerateEqualsAndHash = false;
|
|
object.deprecated = false;
|
|
object.javaStringCheckUtf8 = false;
|
|
object.ccEnableArenas = true;
|
|
object.objcClassPrefix = "";
|
|
object.csharpNamespace = "";
|
|
object.swiftPrefix = "";
|
|
object.phpClassPrefix = "";
|
|
object.phpNamespace = "";
|
|
object.phpMetadataNamespace = "";
|
|
object.rubyPackage = "";
|
|
object.features = null;
|
|
}
|
|
if (
|
|
message.javaPackage != null &&
|
|
message.hasOwnProperty("javaPackage")
|
|
)
|
|
object.javaPackage = message.javaPackage;
|
|
if (
|
|
message.javaOuterClassname != null &&
|
|
message.hasOwnProperty("javaOuterClassname")
|
|
)
|
|
object.javaOuterClassname = message.javaOuterClassname;
|
|
if (
|
|
message.optimizeFor != null &&
|
|
message.hasOwnProperty("optimizeFor")
|
|
)
|
|
object.optimizeFor =
|
|
options.enums === String
|
|
? $root.google.protobuf.FileOptions.OptimizeMode[
|
|
message.optimizeFor
|
|
] === undefined
|
|
? message.optimizeFor
|
|
: $root.google.protobuf.FileOptions.OptimizeMode[
|
|
message.optimizeFor
|
|
]
|
|
: message.optimizeFor;
|
|
if (
|
|
message.javaMultipleFiles != null &&
|
|
message.hasOwnProperty("javaMultipleFiles")
|
|
)
|
|
object.javaMultipleFiles = message.javaMultipleFiles;
|
|
if (message.goPackage != null && message.hasOwnProperty("goPackage"))
|
|
object.goPackage = message.goPackage;
|
|
if (
|
|
message.ccGenericServices != null &&
|
|
message.hasOwnProperty("ccGenericServices")
|
|
)
|
|
object.ccGenericServices = message.ccGenericServices;
|
|
if (
|
|
message.javaGenericServices != null &&
|
|
message.hasOwnProperty("javaGenericServices")
|
|
)
|
|
object.javaGenericServices = message.javaGenericServices;
|
|
if (
|
|
message.pyGenericServices != null &&
|
|
message.hasOwnProperty("pyGenericServices")
|
|
)
|
|
object.pyGenericServices = message.pyGenericServices;
|
|
if (
|
|
message.javaGenerateEqualsAndHash != null &&
|
|
message.hasOwnProperty("javaGenerateEqualsAndHash")
|
|
)
|
|
object.javaGenerateEqualsAndHash = message.javaGenerateEqualsAndHash;
|
|
if (message.deprecated != null && message.hasOwnProperty("deprecated"))
|
|
object.deprecated = message.deprecated;
|
|
if (
|
|
message.javaStringCheckUtf8 != null &&
|
|
message.hasOwnProperty("javaStringCheckUtf8")
|
|
)
|
|
object.javaStringCheckUtf8 = message.javaStringCheckUtf8;
|
|
if (
|
|
message.ccEnableArenas != null &&
|
|
message.hasOwnProperty("ccEnableArenas")
|
|
)
|
|
object.ccEnableArenas = message.ccEnableArenas;
|
|
if (
|
|
message.objcClassPrefix != null &&
|
|
message.hasOwnProperty("objcClassPrefix")
|
|
)
|
|
object.objcClassPrefix = message.objcClassPrefix;
|
|
if (
|
|
message.csharpNamespace != null &&
|
|
message.hasOwnProperty("csharpNamespace")
|
|
)
|
|
object.csharpNamespace = message.csharpNamespace;
|
|
if (
|
|
message.swiftPrefix != null &&
|
|
message.hasOwnProperty("swiftPrefix")
|
|
)
|
|
object.swiftPrefix = message.swiftPrefix;
|
|
if (
|
|
message.phpClassPrefix != null &&
|
|
message.hasOwnProperty("phpClassPrefix")
|
|
)
|
|
object.phpClassPrefix = message.phpClassPrefix;
|
|
if (
|
|
message.phpNamespace != null &&
|
|
message.hasOwnProperty("phpNamespace")
|
|
)
|
|
object.phpNamespace = message.phpNamespace;
|
|
if (
|
|
message.phpMetadataNamespace != null &&
|
|
message.hasOwnProperty("phpMetadataNamespace")
|
|
)
|
|
object.phpMetadataNamespace = message.phpMetadataNamespace;
|
|
if (
|
|
message.rubyPackage != null &&
|
|
message.hasOwnProperty("rubyPackage")
|
|
)
|
|
object.rubyPackage = message.rubyPackage;
|
|
if (message.features != null && message.hasOwnProperty("features"))
|
|
object.features = $root.google.protobuf.FeatureSet.toObject(
|
|
message.features,
|
|
options
|
|
);
|
|
if (message.uninterpretedOption && message.uninterpretedOption.length) {
|
|
object.uninterpretedOption = [];
|
|
for (var j = 0; j < message.uninterpretedOption.length; ++j)
|
|
object.uninterpretedOption[j] =
|
|
$root.google.protobuf.UninterpretedOption.toObject(
|
|
message.uninterpretedOption[j],
|
|
options
|
|
);
|
|
}
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this FileOptions to JSON.
|
|
* @function toJSON
|
|
* @memberof google.protobuf.FileOptions
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
FileOptions.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
/**
|
|
* Gets the default type url for FileOptions
|
|
* @function getTypeUrl
|
|
* @memberof google.protobuf.FileOptions
|
|
* @static
|
|
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
|
* @returns {string} The default type url
|
|
*/
|
|
FileOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
if (typeUrlPrefix === undefined) {
|
|
typeUrlPrefix = "type.googleapis.com";
|
|
}
|
|
return typeUrlPrefix + "/google.protobuf.FileOptions";
|
|
};
|
|
|
|
/**
|
|
* OptimizeMode enum.
|
|
* @name google.protobuf.FileOptions.OptimizeMode
|
|
* @enum {number}
|
|
* @property {number} SPEED=1 SPEED value
|
|
* @property {number} CODE_SIZE=2 CODE_SIZE value
|
|
* @property {number} LITE_RUNTIME=3 LITE_RUNTIME value
|
|
*/
|
|
FileOptions.OptimizeMode = (function () {
|
|
var valuesById = {},
|
|
values = Object.create(valuesById);
|
|
values[(valuesById[1] = "SPEED")] = 1;
|
|
values[(valuesById[2] = "CODE_SIZE")] = 2;
|
|
values[(valuesById[3] = "LITE_RUNTIME")] = 3;
|
|
return values;
|
|
})();
|
|
|
|
return FileOptions;
|
|
})();
|
|
|
|
protobuf.MessageOptions = (function () {
|
|
/**
|
|
* Properties of a MessageOptions.
|
|
* @memberof google.protobuf
|
|
* @interface IMessageOptions
|
|
* @property {boolean|null} [messageSetWireFormat] MessageOptions messageSetWireFormat
|
|
* @property {boolean|null} [noStandardDescriptorAccessor] MessageOptions noStandardDescriptorAccessor
|
|
* @property {boolean|null} [deprecated] MessageOptions deprecated
|
|
* @property {boolean|null} [mapEntry] MessageOptions mapEntry
|
|
* @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] MessageOptions deprecatedLegacyJsonFieldConflicts
|
|
* @property {google.protobuf.IFeatureSet|null} [features] MessageOptions features
|
|
* @property {Array.<google.protobuf.IUninterpretedOption>|null} [uninterpretedOption] MessageOptions uninterpretedOption
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new MessageOptions.
|
|
* @memberof google.protobuf
|
|
* @classdesc Represents a MessageOptions.
|
|
* @implements IMessageOptions
|
|
* @constructor
|
|
* @param {google.protobuf.IMessageOptions=} [properties] Properties to set
|
|
*/
|
|
function MessageOptions(properties) {
|
|
this.uninterpretedOption = [];
|
|
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]];
|
|
}
|
|
|
|
/**
|
|
* MessageOptions messageSetWireFormat.
|
|
* @member {boolean} messageSetWireFormat
|
|
* @memberof google.protobuf.MessageOptions
|
|
* @instance
|
|
*/
|
|
MessageOptions.prototype.messageSetWireFormat = false;
|
|
|
|
/**
|
|
* MessageOptions noStandardDescriptorAccessor.
|
|
* @member {boolean} noStandardDescriptorAccessor
|
|
* @memberof google.protobuf.MessageOptions
|
|
* @instance
|
|
*/
|
|
MessageOptions.prototype.noStandardDescriptorAccessor = false;
|
|
|
|
/**
|
|
* MessageOptions deprecated.
|
|
* @member {boolean} deprecated
|
|
* @memberof google.protobuf.MessageOptions
|
|
* @instance
|
|
*/
|
|
MessageOptions.prototype.deprecated = false;
|
|
|
|
/**
|
|
* MessageOptions mapEntry.
|
|
* @member {boolean} mapEntry
|
|
* @memberof google.protobuf.MessageOptions
|
|
* @instance
|
|
*/
|
|
MessageOptions.prototype.mapEntry = false;
|
|
|
|
/**
|
|
* MessageOptions deprecatedLegacyJsonFieldConflicts.
|
|
* @member {boolean} deprecatedLegacyJsonFieldConflicts
|
|
* @memberof google.protobuf.MessageOptions
|
|
* @instance
|
|
*/
|
|
MessageOptions.prototype.deprecatedLegacyJsonFieldConflicts = false;
|
|
|
|
/**
|
|
* MessageOptions features.
|
|
* @member {google.protobuf.IFeatureSet|null|undefined} features
|
|
* @memberof google.protobuf.MessageOptions
|
|
* @instance
|
|
*/
|
|
MessageOptions.prototype.features = null;
|
|
|
|
/**
|
|
* MessageOptions uninterpretedOption.
|
|
* @member {Array.<google.protobuf.IUninterpretedOption>} uninterpretedOption
|
|
* @memberof google.protobuf.MessageOptions
|
|
* @instance
|
|
*/
|
|
MessageOptions.prototype.uninterpretedOption = $util.emptyArray;
|
|
|
|
/**
|
|
* Creates a new MessageOptions instance using the specified properties.
|
|
* @function create
|
|
* @memberof google.protobuf.MessageOptions
|
|
* @static
|
|
* @param {google.protobuf.IMessageOptions=} [properties] Properties to set
|
|
* @returns {google.protobuf.MessageOptions} MessageOptions instance
|
|
*/
|
|
MessageOptions.create = function create(properties) {
|
|
return new MessageOptions(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof google.protobuf.MessageOptions
|
|
* @static
|
|
* @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
MessageOptions.encode = function encode(message, writer) {
|
|
if (!writer) writer = $Writer.create();
|
|
if (
|
|
message.messageSetWireFormat != null &&
|
|
Object.hasOwnProperty.call(message, "messageSetWireFormat")
|
|
)
|
|
writer
|
|
.uint32(/* id 1, wireType 0 =*/ 8)
|
|
.bool(message.messageSetWireFormat);
|
|
if (
|
|
message.noStandardDescriptorAccessor != null &&
|
|
Object.hasOwnProperty.call(message, "noStandardDescriptorAccessor")
|
|
)
|
|
writer
|
|
.uint32(/* id 2, wireType 0 =*/ 16)
|
|
.bool(message.noStandardDescriptorAccessor);
|
|
if (
|
|
message.deprecated != null &&
|
|
Object.hasOwnProperty.call(message, "deprecated")
|
|
)
|
|
writer.uint32(/* id 3, wireType 0 =*/ 24).bool(message.deprecated);
|
|
if (
|
|
message.mapEntry != null &&
|
|
Object.hasOwnProperty.call(message, "mapEntry")
|
|
)
|
|
writer.uint32(/* id 7, wireType 0 =*/ 56).bool(message.mapEntry);
|
|
if (
|
|
message.deprecatedLegacyJsonFieldConflicts != null &&
|
|
Object.hasOwnProperty.call(
|
|
message,
|
|
"deprecatedLegacyJsonFieldConflicts"
|
|
)
|
|
)
|
|
writer
|
|
.uint32(/* id 11, wireType 0 =*/ 88)
|
|
.bool(message.deprecatedLegacyJsonFieldConflicts);
|
|
if (
|
|
message.features != null &&
|
|
Object.hasOwnProperty.call(message, "features")
|
|
)
|
|
$root.google.protobuf.FeatureSet.encode(
|
|
message.features,
|
|
writer.uint32(/* id 12, wireType 2 =*/ 98).fork()
|
|
).ldelim();
|
|
if (
|
|
message.uninterpretedOption != null &&
|
|
message.uninterpretedOption.length
|
|
)
|
|
for (var i = 0; i < message.uninterpretedOption.length; ++i)
|
|
$root.google.protobuf.UninterpretedOption.encode(
|
|
message.uninterpretedOption[i],
|
|
writer.uint32(/* id 999, wireType 2 =*/ 7994).fork()
|
|
).ldelim();
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof google.protobuf.MessageOptions
|
|
* @static
|
|
* @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
MessageOptions.encodeDelimited = function encodeDelimited(
|
|
message,
|
|
writer
|
|
) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes a MessageOptions message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof google.protobuf.MessageOptions
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {google.protobuf.MessageOptions} MessageOptions
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
MessageOptions.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.google.protobuf.MessageOptions();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
if (tag === error) break;
|
|
switch (tag >>> 3) {
|
|
case 1: {
|
|
message.messageSetWireFormat = reader.bool();
|
|
break;
|
|
}
|
|
case 2: {
|
|
message.noStandardDescriptorAccessor = reader.bool();
|
|
break;
|
|
}
|
|
case 3: {
|
|
message.deprecated = reader.bool();
|
|
break;
|
|
}
|
|
case 7: {
|
|
message.mapEntry = reader.bool();
|
|
break;
|
|
}
|
|
case 11: {
|
|
message.deprecatedLegacyJsonFieldConflicts = reader.bool();
|
|
break;
|
|
}
|
|
case 12: {
|
|
message.features = $root.google.protobuf.FeatureSet.decode(
|
|
reader,
|
|
reader.uint32()
|
|
);
|
|
break;
|
|
}
|
|
case 999: {
|
|
if (
|
|
!(
|
|
message.uninterpretedOption &&
|
|
message.uninterpretedOption.length
|
|
)
|
|
)
|
|
message.uninterpretedOption = [];
|
|
message.uninterpretedOption.push(
|
|
$root.google.protobuf.UninterpretedOption.decode(
|
|
reader,
|
|
reader.uint32()
|
|
)
|
|
);
|
|
break;
|
|
}
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes a MessageOptions message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof google.protobuf.MessageOptions
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {google.protobuf.MessageOptions} MessageOptions
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
MessageOptions.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader)) reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies a MessageOptions message.
|
|
* @function verify
|
|
* @memberof google.protobuf.MessageOptions
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
MessageOptions.verify = function verify(message) {
|
|
if (typeof message !== "object" || message === null)
|
|
return "object expected";
|
|
if (
|
|
message.messageSetWireFormat != null &&
|
|
message.hasOwnProperty("messageSetWireFormat")
|
|
)
|
|
if (typeof message.messageSetWireFormat !== "boolean")
|
|
return "messageSetWireFormat: boolean expected";
|
|
if (
|
|
message.noStandardDescriptorAccessor != null &&
|
|
message.hasOwnProperty("noStandardDescriptorAccessor")
|
|
)
|
|
if (typeof message.noStandardDescriptorAccessor !== "boolean")
|
|
return "noStandardDescriptorAccessor: boolean expected";
|
|
if (message.deprecated != null && message.hasOwnProperty("deprecated"))
|
|
if (typeof message.deprecated !== "boolean")
|
|
return "deprecated: boolean expected";
|
|
if (message.mapEntry != null && message.hasOwnProperty("mapEntry"))
|
|
if (typeof message.mapEntry !== "boolean")
|
|
return "mapEntry: boolean expected";
|
|
if (
|
|
message.deprecatedLegacyJsonFieldConflicts != null &&
|
|
message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")
|
|
)
|
|
if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean")
|
|
return "deprecatedLegacyJsonFieldConflicts: boolean expected";
|
|
if (message.features != null && message.hasOwnProperty("features")) {
|
|
var error = $root.google.protobuf.FeatureSet.verify(message.features);
|
|
if (error) return "features." + error;
|
|
}
|
|
if (
|
|
message.uninterpretedOption != null &&
|
|
message.hasOwnProperty("uninterpretedOption")
|
|
) {
|
|
if (!Array.isArray(message.uninterpretedOption))
|
|
return "uninterpretedOption: array expected";
|
|
for (var i = 0; i < message.uninterpretedOption.length; ++i) {
|
|
var error = $root.google.protobuf.UninterpretedOption.verify(
|
|
message.uninterpretedOption[i]
|
|
);
|
|
if (error) return "uninterpretedOption." + error;
|
|
}
|
|
}
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates a MessageOptions message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof google.protobuf.MessageOptions
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {google.protobuf.MessageOptions} MessageOptions
|
|
*/
|
|
MessageOptions.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.google.protobuf.MessageOptions)
|
|
return object;
|
|
var message = new $root.google.protobuf.MessageOptions();
|
|
if (object.messageSetWireFormat != null)
|
|
message.messageSetWireFormat = Boolean(object.messageSetWireFormat);
|
|
if (object.noStandardDescriptorAccessor != null)
|
|
message.noStandardDescriptorAccessor = Boolean(
|
|
object.noStandardDescriptorAccessor
|
|
);
|
|
if (object.deprecated != null)
|
|
message.deprecated = Boolean(object.deprecated);
|
|
if (object.mapEntry != null)
|
|
message.mapEntry = Boolean(object.mapEntry);
|
|
if (object.deprecatedLegacyJsonFieldConflicts != null)
|
|
message.deprecatedLegacyJsonFieldConflicts = Boolean(
|
|
object.deprecatedLegacyJsonFieldConflicts
|
|
);
|
|
if (object.features != null) {
|
|
if (typeof object.features !== "object")
|
|
throw TypeError(
|
|
".google.protobuf.MessageOptions.features: object expected"
|
|
);
|
|
message.features = $root.google.protobuf.FeatureSet.fromObject(
|
|
object.features
|
|
);
|
|
}
|
|
if (object.uninterpretedOption) {
|
|
if (!Array.isArray(object.uninterpretedOption))
|
|
throw TypeError(
|
|
".google.protobuf.MessageOptions.uninterpretedOption: array expected"
|
|
);
|
|
message.uninterpretedOption = [];
|
|
for (var i = 0; i < object.uninterpretedOption.length; ++i) {
|
|
if (typeof object.uninterpretedOption[i] !== "object")
|
|
throw TypeError(
|
|
".google.protobuf.MessageOptions.uninterpretedOption: object expected"
|
|
);
|
|
message.uninterpretedOption[i] =
|
|
$root.google.protobuf.UninterpretedOption.fromObject(
|
|
object.uninterpretedOption[i]
|
|
);
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from a MessageOptions message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof google.protobuf.MessageOptions
|
|
* @static
|
|
* @param {google.protobuf.MessageOptions} message MessageOptions
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
MessageOptions.toObject = function toObject(message, options) {
|
|
if (!options) options = {};
|
|
var object = {};
|
|
if (options.arrays || options.defaults) object.uninterpretedOption = [];
|
|
if (options.defaults) {
|
|
object.messageSetWireFormat = false;
|
|
object.noStandardDescriptorAccessor = false;
|
|
object.deprecated = false;
|
|
object.mapEntry = false;
|
|
object.deprecatedLegacyJsonFieldConflicts = false;
|
|
object.features = null;
|
|
}
|
|
if (
|
|
message.messageSetWireFormat != null &&
|
|
message.hasOwnProperty("messageSetWireFormat")
|
|
)
|
|
object.messageSetWireFormat = message.messageSetWireFormat;
|
|
if (
|
|
message.noStandardDescriptorAccessor != null &&
|
|
message.hasOwnProperty("noStandardDescriptorAccessor")
|
|
)
|
|
object.noStandardDescriptorAccessor =
|
|
message.noStandardDescriptorAccessor;
|
|
if (message.deprecated != null && message.hasOwnProperty("deprecated"))
|
|
object.deprecated = message.deprecated;
|
|
if (message.mapEntry != null && message.hasOwnProperty("mapEntry"))
|
|
object.mapEntry = message.mapEntry;
|
|
if (
|
|
message.deprecatedLegacyJsonFieldConflicts != null &&
|
|
message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")
|
|
)
|
|
object.deprecatedLegacyJsonFieldConflicts =
|
|
message.deprecatedLegacyJsonFieldConflicts;
|
|
if (message.features != null && message.hasOwnProperty("features"))
|
|
object.features = $root.google.protobuf.FeatureSet.toObject(
|
|
message.features,
|
|
options
|
|
);
|
|
if (message.uninterpretedOption && message.uninterpretedOption.length) {
|
|
object.uninterpretedOption = [];
|
|
for (var j = 0; j < message.uninterpretedOption.length; ++j)
|
|
object.uninterpretedOption[j] =
|
|
$root.google.protobuf.UninterpretedOption.toObject(
|
|
message.uninterpretedOption[j],
|
|
options
|
|
);
|
|
}
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this MessageOptions to JSON.
|
|
* @function toJSON
|
|
* @memberof google.protobuf.MessageOptions
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
MessageOptions.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
/**
|
|
* Gets the default type url for MessageOptions
|
|
* @function getTypeUrl
|
|
* @memberof google.protobuf.MessageOptions
|
|
* @static
|
|
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
|
* @returns {string} The default type url
|
|
*/
|
|
MessageOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
if (typeUrlPrefix === undefined) {
|
|
typeUrlPrefix = "type.googleapis.com";
|
|
}
|
|
return typeUrlPrefix + "/google.protobuf.MessageOptions";
|
|
};
|
|
|
|
return MessageOptions;
|
|
})();
|
|
|
|
protobuf.FieldOptions = (function () {
|
|
/**
|
|
* Properties of a FieldOptions.
|
|
* @memberof google.protobuf
|
|
* @interface IFieldOptions
|
|
* @property {google.protobuf.FieldOptions.CType|null} [ctype] FieldOptions ctype
|
|
* @property {boolean|null} [packed] FieldOptions packed
|
|
* @property {google.protobuf.FieldOptions.JSType|null} [jstype] FieldOptions jstype
|
|
* @property {boolean|null} [lazy] FieldOptions lazy
|
|
* @property {boolean|null} [unverifiedLazy] FieldOptions unverifiedLazy
|
|
* @property {boolean|null} [deprecated] FieldOptions deprecated
|
|
* @property {boolean|null} [weak] FieldOptions weak
|
|
* @property {boolean|null} [debugRedact] FieldOptions debugRedact
|
|
* @property {google.protobuf.FieldOptions.OptionRetention|null} [retention] FieldOptions retention
|
|
* @property {Array.<google.protobuf.FieldOptions.OptionTargetType>|null} [targets] FieldOptions targets
|
|
* @property {Array.<google.protobuf.FieldOptions.IEditionDefault>|null} [editionDefaults] FieldOptions editionDefaults
|
|
* @property {google.protobuf.IFeatureSet|null} [features] FieldOptions features
|
|
* @property {google.protobuf.FieldOptions.IFeatureSupport|null} [featureSupport] FieldOptions featureSupport
|
|
* @property {Array.<google.protobuf.IUninterpretedOption>|null} [uninterpretedOption] FieldOptions uninterpretedOption
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new FieldOptions.
|
|
* @memberof google.protobuf
|
|
* @classdesc Represents a FieldOptions.
|
|
* @implements IFieldOptions
|
|
* @constructor
|
|
* @param {google.protobuf.IFieldOptions=} [properties] Properties to set
|
|
*/
|
|
function FieldOptions(properties) {
|
|
this.targets = [];
|
|
this.editionDefaults = [];
|
|
this.uninterpretedOption = [];
|
|
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]];
|
|
}
|
|
|
|
/**
|
|
* FieldOptions ctype.
|
|
* @member {google.protobuf.FieldOptions.CType} ctype
|
|
* @memberof google.protobuf.FieldOptions
|
|
* @instance
|
|
*/
|
|
FieldOptions.prototype.ctype = 0;
|
|
|
|
/**
|
|
* FieldOptions packed.
|
|
* @member {boolean} packed
|
|
* @memberof google.protobuf.FieldOptions
|
|
* @instance
|
|
*/
|
|
FieldOptions.prototype.packed = false;
|
|
|
|
/**
|
|
* FieldOptions jstype.
|
|
* @member {google.protobuf.FieldOptions.JSType} jstype
|
|
* @memberof google.protobuf.FieldOptions
|
|
* @instance
|
|
*/
|
|
FieldOptions.prototype.jstype = 0;
|
|
|
|
/**
|
|
* FieldOptions lazy.
|
|
* @member {boolean} lazy
|
|
* @memberof google.protobuf.FieldOptions
|
|
* @instance
|
|
*/
|
|
FieldOptions.prototype.lazy = false;
|
|
|
|
/**
|
|
* FieldOptions unverifiedLazy.
|
|
* @member {boolean} unverifiedLazy
|
|
* @memberof google.protobuf.FieldOptions
|
|
* @instance
|
|
*/
|
|
FieldOptions.prototype.unverifiedLazy = false;
|
|
|
|
/**
|
|
* FieldOptions deprecated.
|
|
* @member {boolean} deprecated
|
|
* @memberof google.protobuf.FieldOptions
|
|
* @instance
|
|
*/
|
|
FieldOptions.prototype.deprecated = false;
|
|
|
|
/**
|
|
* FieldOptions weak.
|
|
* @member {boolean} weak
|
|
* @memberof google.protobuf.FieldOptions
|
|
* @instance
|
|
*/
|
|
FieldOptions.prototype.weak = false;
|
|
|
|
/**
|
|
* FieldOptions debugRedact.
|
|
* @member {boolean} debugRedact
|
|
* @memberof google.protobuf.FieldOptions
|
|
* @instance
|
|
*/
|
|
FieldOptions.prototype.debugRedact = false;
|
|
|
|
/**
|
|
* FieldOptions retention.
|
|
* @member {google.protobuf.FieldOptions.OptionRetention} retention
|
|
* @memberof google.protobuf.FieldOptions
|
|
* @instance
|
|
*/
|
|
FieldOptions.prototype.retention = 0;
|
|
|
|
/**
|
|
* FieldOptions targets.
|
|
* @member {Array.<google.protobuf.FieldOptions.OptionTargetType>} targets
|
|
* @memberof google.protobuf.FieldOptions
|
|
* @instance
|
|
*/
|
|
FieldOptions.prototype.targets = $util.emptyArray;
|
|
|
|
/**
|
|
* FieldOptions editionDefaults.
|
|
* @member {Array.<google.protobuf.FieldOptions.IEditionDefault>} editionDefaults
|
|
* @memberof google.protobuf.FieldOptions
|
|
* @instance
|
|
*/
|
|
FieldOptions.prototype.editionDefaults = $util.emptyArray;
|
|
|
|
/**
|
|
* FieldOptions features.
|
|
* @member {google.protobuf.IFeatureSet|null|undefined} features
|
|
* @memberof google.protobuf.FieldOptions
|
|
* @instance
|
|
*/
|
|
FieldOptions.prototype.features = null;
|
|
|
|
/**
|
|
* FieldOptions featureSupport.
|
|
* @member {google.protobuf.FieldOptions.IFeatureSupport|null|undefined} featureSupport
|
|
* @memberof google.protobuf.FieldOptions
|
|
* @instance
|
|
*/
|
|
FieldOptions.prototype.featureSupport = null;
|
|
|
|
/**
|
|
* FieldOptions uninterpretedOption.
|
|
* @member {Array.<google.protobuf.IUninterpretedOption>} uninterpretedOption
|
|
* @memberof google.protobuf.FieldOptions
|
|
* @instance
|
|
*/
|
|
FieldOptions.prototype.uninterpretedOption = $util.emptyArray;
|
|
|
|
/**
|
|
* Creates a new FieldOptions instance using the specified properties.
|
|
* @function create
|
|
* @memberof google.protobuf.FieldOptions
|
|
* @static
|
|
* @param {google.protobuf.IFieldOptions=} [properties] Properties to set
|
|
* @returns {google.protobuf.FieldOptions} FieldOptions instance
|
|
*/
|
|
FieldOptions.create = function create(properties) {
|
|
return new FieldOptions(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof google.protobuf.FieldOptions
|
|
* @static
|
|
* @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
FieldOptions.encode = function encode(message, writer) {
|
|
if (!writer) writer = $Writer.create();
|
|
if (
|
|
message.ctype != null &&
|
|
Object.hasOwnProperty.call(message, "ctype")
|
|
)
|
|
writer.uint32(/* id 1, wireType 0 =*/ 8).int32(message.ctype);
|
|
if (
|
|
message.packed != null &&
|
|
Object.hasOwnProperty.call(message, "packed")
|
|
)
|
|
writer.uint32(/* id 2, wireType 0 =*/ 16).bool(message.packed);
|
|
if (
|
|
message.deprecated != null &&
|
|
Object.hasOwnProperty.call(message, "deprecated")
|
|
)
|
|
writer.uint32(/* id 3, wireType 0 =*/ 24).bool(message.deprecated);
|
|
if (message.lazy != null && Object.hasOwnProperty.call(message, "lazy"))
|
|
writer.uint32(/* id 5, wireType 0 =*/ 40).bool(message.lazy);
|
|
if (
|
|
message.jstype != null &&
|
|
Object.hasOwnProperty.call(message, "jstype")
|
|
)
|
|
writer.uint32(/* id 6, wireType 0 =*/ 48).int32(message.jstype);
|
|
if (message.weak != null && Object.hasOwnProperty.call(message, "weak"))
|
|
writer.uint32(/* id 10, wireType 0 =*/ 80).bool(message.weak);
|
|
if (
|
|
message.unverifiedLazy != null &&
|
|
Object.hasOwnProperty.call(message, "unverifiedLazy")
|
|
)
|
|
writer
|
|
.uint32(/* id 15, wireType 0 =*/ 120)
|
|
.bool(message.unverifiedLazy);
|
|
if (
|
|
message.debugRedact != null &&
|
|
Object.hasOwnProperty.call(message, "debugRedact")
|
|
)
|
|
writer.uint32(/* id 16, wireType 0 =*/ 128).bool(message.debugRedact);
|
|
if (
|
|
message.retention != null &&
|
|
Object.hasOwnProperty.call(message, "retention")
|
|
)
|
|
writer.uint32(/* id 17, wireType 0 =*/ 136).int32(message.retention);
|
|
if (message.targets != null && message.targets.length)
|
|
for (var i = 0; i < message.targets.length; ++i)
|
|
writer
|
|
.uint32(/* id 19, wireType 0 =*/ 152)
|
|
.int32(message.targets[i]);
|
|
if (message.editionDefaults != null && message.editionDefaults.length)
|
|
for (var i = 0; i < message.editionDefaults.length; ++i)
|
|
$root.google.protobuf.FieldOptions.EditionDefault.encode(
|
|
message.editionDefaults[i],
|
|
writer.uint32(/* id 20, wireType 2 =*/ 162).fork()
|
|
).ldelim();
|
|
if (
|
|
message.features != null &&
|
|
Object.hasOwnProperty.call(message, "features")
|
|
)
|
|
$root.google.protobuf.FeatureSet.encode(
|
|
message.features,
|
|
writer.uint32(/* id 21, wireType 2 =*/ 170).fork()
|
|
).ldelim();
|
|
if (
|
|
message.featureSupport != null &&
|
|
Object.hasOwnProperty.call(message, "featureSupport")
|
|
)
|
|
$root.google.protobuf.FieldOptions.FeatureSupport.encode(
|
|
message.featureSupport,
|
|
writer.uint32(/* id 22, wireType 2 =*/ 178).fork()
|
|
).ldelim();
|
|
if (
|
|
message.uninterpretedOption != null &&
|
|
message.uninterpretedOption.length
|
|
)
|
|
for (var i = 0; i < message.uninterpretedOption.length; ++i)
|
|
$root.google.protobuf.UninterpretedOption.encode(
|
|
message.uninterpretedOption[i],
|
|
writer.uint32(/* id 999, wireType 2 =*/ 7994).fork()
|
|
).ldelim();
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof google.protobuf.FieldOptions
|
|
* @static
|
|
* @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
FieldOptions.encodeDelimited = function encodeDelimited(message, writer) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes a FieldOptions message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof google.protobuf.FieldOptions
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {google.protobuf.FieldOptions} FieldOptions
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
FieldOptions.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.google.protobuf.FieldOptions();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
if (tag === error) break;
|
|
switch (tag >>> 3) {
|
|
case 1: {
|
|
message.ctype = reader.int32();
|
|
break;
|
|
}
|
|
case 2: {
|
|
message.packed = reader.bool();
|
|
break;
|
|
}
|
|
case 6: {
|
|
message.jstype = reader.int32();
|
|
break;
|
|
}
|
|
case 5: {
|
|
message.lazy = reader.bool();
|
|
break;
|
|
}
|
|
case 15: {
|
|
message.unverifiedLazy = reader.bool();
|
|
break;
|
|
}
|
|
case 3: {
|
|
message.deprecated = reader.bool();
|
|
break;
|
|
}
|
|
case 10: {
|
|
message.weak = reader.bool();
|
|
break;
|
|
}
|
|
case 16: {
|
|
message.debugRedact = reader.bool();
|
|
break;
|
|
}
|
|
case 17: {
|
|
message.retention = reader.int32();
|
|
break;
|
|
}
|
|
case 19: {
|
|
if (!(message.targets && message.targets.length))
|
|
message.targets = [];
|
|
if ((tag & 7) === 2) {
|
|
var end2 = reader.uint32() + reader.pos;
|
|
while (reader.pos < end2) message.targets.push(reader.int32());
|
|
} else message.targets.push(reader.int32());
|
|
break;
|
|
}
|
|
case 20: {
|
|
if (!(message.editionDefaults && message.editionDefaults.length))
|
|
message.editionDefaults = [];
|
|
message.editionDefaults.push(
|
|
$root.google.protobuf.FieldOptions.EditionDefault.decode(
|
|
reader,
|
|
reader.uint32()
|
|
)
|
|
);
|
|
break;
|
|
}
|
|
case 21: {
|
|
message.features = $root.google.protobuf.FeatureSet.decode(
|
|
reader,
|
|
reader.uint32()
|
|
);
|
|
break;
|
|
}
|
|
case 22: {
|
|
message.featureSupport =
|
|
$root.google.protobuf.FieldOptions.FeatureSupport.decode(
|
|
reader,
|
|
reader.uint32()
|
|
);
|
|
break;
|
|
}
|
|
case 999: {
|
|
if (
|
|
!(
|
|
message.uninterpretedOption &&
|
|
message.uninterpretedOption.length
|
|
)
|
|
)
|
|
message.uninterpretedOption = [];
|
|
message.uninterpretedOption.push(
|
|
$root.google.protobuf.UninterpretedOption.decode(
|
|
reader,
|
|
reader.uint32()
|
|
)
|
|
);
|
|
break;
|
|
}
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes a FieldOptions message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof google.protobuf.FieldOptions
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {google.protobuf.FieldOptions} FieldOptions
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
FieldOptions.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader)) reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies a FieldOptions message.
|
|
* @function verify
|
|
* @memberof google.protobuf.FieldOptions
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
FieldOptions.verify = function verify(message) {
|
|
if (typeof message !== "object" || message === null)
|
|
return "object expected";
|
|
if (message.ctype != null && message.hasOwnProperty("ctype"))
|
|
switch (message.ctype) {
|
|
default:
|
|
return "ctype: enum value expected";
|
|
case 0:
|
|
case 1:
|
|
case 2:
|
|
break;
|
|
}
|
|
if (message.packed != null && message.hasOwnProperty("packed"))
|
|
if (typeof message.packed !== "boolean")
|
|
return "packed: boolean expected";
|
|
if (message.jstype != null && message.hasOwnProperty("jstype"))
|
|
switch (message.jstype) {
|
|
default:
|
|
return "jstype: enum value expected";
|
|
case 0:
|
|
case 1:
|
|
case 2:
|
|
break;
|
|
}
|
|
if (message.lazy != null && message.hasOwnProperty("lazy"))
|
|
if (typeof message.lazy !== "boolean")
|
|
return "lazy: boolean expected";
|
|
if (
|
|
message.unverifiedLazy != null &&
|
|
message.hasOwnProperty("unverifiedLazy")
|
|
)
|
|
if (typeof message.unverifiedLazy !== "boolean")
|
|
return "unverifiedLazy: boolean expected";
|
|
if (message.deprecated != null && message.hasOwnProperty("deprecated"))
|
|
if (typeof message.deprecated !== "boolean")
|
|
return "deprecated: boolean expected";
|
|
if (message.weak != null && message.hasOwnProperty("weak"))
|
|
if (typeof message.weak !== "boolean")
|
|
return "weak: boolean expected";
|
|
if (
|
|
message.debugRedact != null &&
|
|
message.hasOwnProperty("debugRedact")
|
|
)
|
|
if (typeof message.debugRedact !== "boolean")
|
|
return "debugRedact: boolean expected";
|
|
if (message.retention != null && message.hasOwnProperty("retention"))
|
|
switch (message.retention) {
|
|
default:
|
|
return "retention: enum value expected";
|
|
case 0:
|
|
case 1:
|
|
case 2:
|
|
break;
|
|
}
|
|
if (message.targets != null && message.hasOwnProperty("targets")) {
|
|
if (!Array.isArray(message.targets)) return "targets: array expected";
|
|
for (var i = 0; i < message.targets.length; ++i)
|
|
switch (message.targets[i]) {
|
|
default:
|
|
return "targets: enum value[] expected";
|
|
case 0:
|
|
case 1:
|
|
case 2:
|
|
case 3:
|
|
case 4:
|
|
case 5:
|
|
case 6:
|
|
case 7:
|
|
case 8:
|
|
case 9:
|
|
break;
|
|
}
|
|
}
|
|
if (
|
|
message.editionDefaults != null &&
|
|
message.hasOwnProperty("editionDefaults")
|
|
) {
|
|
if (!Array.isArray(message.editionDefaults))
|
|
return "editionDefaults: array expected";
|
|
for (var i = 0; i < message.editionDefaults.length; ++i) {
|
|
var error =
|
|
$root.google.protobuf.FieldOptions.EditionDefault.verify(
|
|
message.editionDefaults[i]
|
|
);
|
|
if (error) return "editionDefaults." + error;
|
|
}
|
|
}
|
|
if (message.features != null && message.hasOwnProperty("features")) {
|
|
var error = $root.google.protobuf.FeatureSet.verify(message.features);
|
|
if (error) return "features." + error;
|
|
}
|
|
if (
|
|
message.featureSupport != null &&
|
|
message.hasOwnProperty("featureSupport")
|
|
) {
|
|
var error = $root.google.protobuf.FieldOptions.FeatureSupport.verify(
|
|
message.featureSupport
|
|
);
|
|
if (error) return "featureSupport." + error;
|
|
}
|
|
if (
|
|
message.uninterpretedOption != null &&
|
|
message.hasOwnProperty("uninterpretedOption")
|
|
) {
|
|
if (!Array.isArray(message.uninterpretedOption))
|
|
return "uninterpretedOption: array expected";
|
|
for (var i = 0; i < message.uninterpretedOption.length; ++i) {
|
|
var error = $root.google.protobuf.UninterpretedOption.verify(
|
|
message.uninterpretedOption[i]
|
|
);
|
|
if (error) return "uninterpretedOption." + error;
|
|
}
|
|
}
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates a FieldOptions message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof google.protobuf.FieldOptions
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {google.protobuf.FieldOptions} FieldOptions
|
|
*/
|
|
FieldOptions.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.google.protobuf.FieldOptions) return object;
|
|
var message = new $root.google.protobuf.FieldOptions();
|
|
switch (object.ctype) {
|
|
default:
|
|
if (typeof object.ctype === "number") {
|
|
message.ctype = object.ctype;
|
|
break;
|
|
}
|
|
break;
|
|
case "STRING":
|
|
case 0:
|
|
message.ctype = 0;
|
|
break;
|
|
case "CORD":
|
|
case 1:
|
|
message.ctype = 1;
|
|
break;
|
|
case "STRING_PIECE":
|
|
case 2:
|
|
message.ctype = 2;
|
|
break;
|
|
}
|
|
if (object.packed != null) message.packed = Boolean(object.packed);
|
|
switch (object.jstype) {
|
|
default:
|
|
if (typeof object.jstype === "number") {
|
|
message.jstype = object.jstype;
|
|
break;
|
|
}
|
|
break;
|
|
case "JS_NORMAL":
|
|
case 0:
|
|
message.jstype = 0;
|
|
break;
|
|
case "JS_STRING":
|
|
case 1:
|
|
message.jstype = 1;
|
|
break;
|
|
case "JS_NUMBER":
|
|
case 2:
|
|
message.jstype = 2;
|
|
break;
|
|
}
|
|
if (object.lazy != null) message.lazy = Boolean(object.lazy);
|
|
if (object.unverifiedLazy != null)
|
|
message.unverifiedLazy = Boolean(object.unverifiedLazy);
|
|
if (object.deprecated != null)
|
|
message.deprecated = Boolean(object.deprecated);
|
|
if (object.weak != null) message.weak = Boolean(object.weak);
|
|
if (object.debugRedact != null)
|
|
message.debugRedact = Boolean(object.debugRedact);
|
|
switch (object.retention) {
|
|
default:
|
|
if (typeof object.retention === "number") {
|
|
message.retention = object.retention;
|
|
break;
|
|
}
|
|
break;
|
|
case "RETENTION_UNKNOWN":
|
|
case 0:
|
|
message.retention = 0;
|
|
break;
|
|
case "RETENTION_RUNTIME":
|
|
case 1:
|
|
message.retention = 1;
|
|
break;
|
|
case "RETENTION_SOURCE":
|
|
case 2:
|
|
message.retention = 2;
|
|
break;
|
|
}
|
|
if (object.targets) {
|
|
if (!Array.isArray(object.targets))
|
|
throw TypeError(
|
|
".google.protobuf.FieldOptions.targets: array expected"
|
|
);
|
|
message.targets = [];
|
|
for (var i = 0; i < object.targets.length; ++i)
|
|
switch (object.targets[i]) {
|
|
default:
|
|
if (typeof object.targets[i] === "number") {
|
|
message.targets[i] = object.targets[i];
|
|
break;
|
|
}
|
|
case "TARGET_TYPE_UNKNOWN":
|
|
case 0:
|
|
message.targets[i] = 0;
|
|
break;
|
|
case "TARGET_TYPE_FILE":
|
|
case 1:
|
|
message.targets[i] = 1;
|
|
break;
|
|
case "TARGET_TYPE_EXTENSION_RANGE":
|
|
case 2:
|
|
message.targets[i] = 2;
|
|
break;
|
|
case "TARGET_TYPE_MESSAGE":
|
|
case 3:
|
|
message.targets[i] = 3;
|
|
break;
|
|
case "TARGET_TYPE_FIELD":
|
|
case 4:
|
|
message.targets[i] = 4;
|
|
break;
|
|
case "TARGET_TYPE_ONEOF":
|
|
case 5:
|
|
message.targets[i] = 5;
|
|
break;
|
|
case "TARGET_TYPE_ENUM":
|
|
case 6:
|
|
message.targets[i] = 6;
|
|
break;
|
|
case "TARGET_TYPE_ENUM_ENTRY":
|
|
case 7:
|
|
message.targets[i] = 7;
|
|
break;
|
|
case "TARGET_TYPE_SERVICE":
|
|
case 8:
|
|
message.targets[i] = 8;
|
|
break;
|
|
case "TARGET_TYPE_METHOD":
|
|
case 9:
|
|
message.targets[i] = 9;
|
|
break;
|
|
}
|
|
}
|
|
if (object.editionDefaults) {
|
|
if (!Array.isArray(object.editionDefaults))
|
|
throw TypeError(
|
|
".google.protobuf.FieldOptions.editionDefaults: array expected"
|
|
);
|
|
message.editionDefaults = [];
|
|
for (var i = 0; i < object.editionDefaults.length; ++i) {
|
|
if (typeof object.editionDefaults[i] !== "object")
|
|
throw TypeError(
|
|
".google.protobuf.FieldOptions.editionDefaults: object expected"
|
|
);
|
|
message.editionDefaults[i] =
|
|
$root.google.protobuf.FieldOptions.EditionDefault.fromObject(
|
|
object.editionDefaults[i]
|
|
);
|
|
}
|
|
}
|
|
if (object.features != null) {
|
|
if (typeof object.features !== "object")
|
|
throw TypeError(
|
|
".google.protobuf.FieldOptions.features: object expected"
|
|
);
|
|
message.features = $root.google.protobuf.FeatureSet.fromObject(
|
|
object.features
|
|
);
|
|
}
|
|
if (object.featureSupport != null) {
|
|
if (typeof object.featureSupport !== "object")
|
|
throw TypeError(
|
|
".google.protobuf.FieldOptions.featureSupport: object expected"
|
|
);
|
|
message.featureSupport =
|
|
$root.google.protobuf.FieldOptions.FeatureSupport.fromObject(
|
|
object.featureSupport
|
|
);
|
|
}
|
|
if (object.uninterpretedOption) {
|
|
if (!Array.isArray(object.uninterpretedOption))
|
|
throw TypeError(
|
|
".google.protobuf.FieldOptions.uninterpretedOption: array expected"
|
|
);
|
|
message.uninterpretedOption = [];
|
|
for (var i = 0; i < object.uninterpretedOption.length; ++i) {
|
|
if (typeof object.uninterpretedOption[i] !== "object")
|
|
throw TypeError(
|
|
".google.protobuf.FieldOptions.uninterpretedOption: object expected"
|
|
);
|
|
message.uninterpretedOption[i] =
|
|
$root.google.protobuf.UninterpretedOption.fromObject(
|
|
object.uninterpretedOption[i]
|
|
);
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from a FieldOptions message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof google.protobuf.FieldOptions
|
|
* @static
|
|
* @param {google.protobuf.FieldOptions} message FieldOptions
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
FieldOptions.toObject = function toObject(message, options) {
|
|
if (!options) options = {};
|
|
var object = {};
|
|
if (options.arrays || options.defaults) {
|
|
object.targets = [];
|
|
object.editionDefaults = [];
|
|
object.uninterpretedOption = [];
|
|
}
|
|
if (options.defaults) {
|
|
object.ctype = options.enums === String ? "STRING" : 0;
|
|
object.packed = false;
|
|
object.deprecated = false;
|
|
object.lazy = false;
|
|
object.jstype = options.enums === String ? "JS_NORMAL" : 0;
|
|
object.weak = false;
|
|
object.unverifiedLazy = false;
|
|
object.debugRedact = false;
|
|
object.retention = options.enums === String ? "RETENTION_UNKNOWN" : 0;
|
|
object.features = null;
|
|
object.featureSupport = null;
|
|
}
|
|
if (message.ctype != null && message.hasOwnProperty("ctype"))
|
|
object.ctype =
|
|
options.enums === String
|
|
? $root.google.protobuf.FieldOptions.CType[message.ctype] ===
|
|
undefined
|
|
? message.ctype
|
|
: $root.google.protobuf.FieldOptions.CType[message.ctype]
|
|
: message.ctype;
|
|
if (message.packed != null && message.hasOwnProperty("packed"))
|
|
object.packed = message.packed;
|
|
if (message.deprecated != null && message.hasOwnProperty("deprecated"))
|
|
object.deprecated = message.deprecated;
|
|
if (message.lazy != null && message.hasOwnProperty("lazy"))
|
|
object.lazy = message.lazy;
|
|
if (message.jstype != null && message.hasOwnProperty("jstype"))
|
|
object.jstype =
|
|
options.enums === String
|
|
? $root.google.protobuf.FieldOptions.JSType[message.jstype] ===
|
|
undefined
|
|
? message.jstype
|
|
: $root.google.protobuf.FieldOptions.JSType[message.jstype]
|
|
: message.jstype;
|
|
if (message.weak != null && message.hasOwnProperty("weak"))
|
|
object.weak = message.weak;
|
|
if (
|
|
message.unverifiedLazy != null &&
|
|
message.hasOwnProperty("unverifiedLazy")
|
|
)
|
|
object.unverifiedLazy = message.unverifiedLazy;
|
|
if (
|
|
message.debugRedact != null &&
|
|
message.hasOwnProperty("debugRedact")
|
|
)
|
|
object.debugRedact = message.debugRedact;
|
|
if (message.retention != null && message.hasOwnProperty("retention"))
|
|
object.retention =
|
|
options.enums === String
|
|
? $root.google.protobuf.FieldOptions.OptionRetention[
|
|
message.retention
|
|
] === undefined
|
|
? message.retention
|
|
: $root.google.protobuf.FieldOptions.OptionRetention[
|
|
message.retention
|
|
]
|
|
: message.retention;
|
|
if (message.targets && message.targets.length) {
|
|
object.targets = [];
|
|
for (var j = 0; j < message.targets.length; ++j)
|
|
object.targets[j] =
|
|
options.enums === String
|
|
? $root.google.protobuf.FieldOptions.OptionTargetType[
|
|
message.targets[j]
|
|
] === undefined
|
|
? message.targets[j]
|
|
: $root.google.protobuf.FieldOptions.OptionTargetType[
|
|
message.targets[j]
|
|
]
|
|
: message.targets[j];
|
|
}
|
|
if (message.editionDefaults && message.editionDefaults.length) {
|
|
object.editionDefaults = [];
|
|
for (var j = 0; j < message.editionDefaults.length; ++j)
|
|
object.editionDefaults[j] =
|
|
$root.google.protobuf.FieldOptions.EditionDefault.toObject(
|
|
message.editionDefaults[j],
|
|
options
|
|
);
|
|
}
|
|
if (message.features != null && message.hasOwnProperty("features"))
|
|
object.features = $root.google.protobuf.FeatureSet.toObject(
|
|
message.features,
|
|
options
|
|
);
|
|
if (
|
|
message.featureSupport != null &&
|
|
message.hasOwnProperty("featureSupport")
|
|
)
|
|
object.featureSupport =
|
|
$root.google.protobuf.FieldOptions.FeatureSupport.toObject(
|
|
message.featureSupport,
|
|
options
|
|
);
|
|
if (message.uninterpretedOption && message.uninterpretedOption.length) {
|
|
object.uninterpretedOption = [];
|
|
for (var j = 0; j < message.uninterpretedOption.length; ++j)
|
|
object.uninterpretedOption[j] =
|
|
$root.google.protobuf.UninterpretedOption.toObject(
|
|
message.uninterpretedOption[j],
|
|
options
|
|
);
|
|
}
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this FieldOptions to JSON.
|
|
* @function toJSON
|
|
* @memberof google.protobuf.FieldOptions
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
FieldOptions.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
/**
|
|
* Gets the default type url for FieldOptions
|
|
* @function getTypeUrl
|
|
* @memberof google.protobuf.FieldOptions
|
|
* @static
|
|
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
|
* @returns {string} The default type url
|
|
*/
|
|
FieldOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
if (typeUrlPrefix === undefined) {
|
|
typeUrlPrefix = "type.googleapis.com";
|
|
}
|
|
return typeUrlPrefix + "/google.protobuf.FieldOptions";
|
|
};
|
|
|
|
/**
|
|
* CType enum.
|
|
* @name google.protobuf.FieldOptions.CType
|
|
* @enum {number}
|
|
* @property {number} STRING=0 STRING value
|
|
* @property {number} CORD=1 CORD value
|
|
* @property {number} STRING_PIECE=2 STRING_PIECE value
|
|
*/
|
|
FieldOptions.CType = (function () {
|
|
var valuesById = {},
|
|
values = Object.create(valuesById);
|
|
values[(valuesById[0] = "STRING")] = 0;
|
|
values[(valuesById[1] = "CORD")] = 1;
|
|
values[(valuesById[2] = "STRING_PIECE")] = 2;
|
|
return values;
|
|
})();
|
|
|
|
/**
|
|
* JSType enum.
|
|
* @name google.protobuf.FieldOptions.JSType
|
|
* @enum {number}
|
|
* @property {number} JS_NORMAL=0 JS_NORMAL value
|
|
* @property {number} JS_STRING=1 JS_STRING value
|
|
* @property {number} JS_NUMBER=2 JS_NUMBER value
|
|
*/
|
|
FieldOptions.JSType = (function () {
|
|
var valuesById = {},
|
|
values = Object.create(valuesById);
|
|
values[(valuesById[0] = "JS_NORMAL")] = 0;
|
|
values[(valuesById[1] = "JS_STRING")] = 1;
|
|
values[(valuesById[2] = "JS_NUMBER")] = 2;
|
|
return values;
|
|
})();
|
|
|
|
/**
|
|
* OptionRetention enum.
|
|
* @name google.protobuf.FieldOptions.OptionRetention
|
|
* @enum {number}
|
|
* @property {number} RETENTION_UNKNOWN=0 RETENTION_UNKNOWN value
|
|
* @property {number} RETENTION_RUNTIME=1 RETENTION_RUNTIME value
|
|
* @property {number} RETENTION_SOURCE=2 RETENTION_SOURCE value
|
|
*/
|
|
FieldOptions.OptionRetention = (function () {
|
|
var valuesById = {},
|
|
values = Object.create(valuesById);
|
|
values[(valuesById[0] = "RETENTION_UNKNOWN")] = 0;
|
|
values[(valuesById[1] = "RETENTION_RUNTIME")] = 1;
|
|
values[(valuesById[2] = "RETENTION_SOURCE")] = 2;
|
|
return values;
|
|
})();
|
|
|
|
/**
|
|
* OptionTargetType enum.
|
|
* @name google.protobuf.FieldOptions.OptionTargetType
|
|
* @enum {number}
|
|
* @property {number} TARGET_TYPE_UNKNOWN=0 TARGET_TYPE_UNKNOWN value
|
|
* @property {number} TARGET_TYPE_FILE=1 TARGET_TYPE_FILE value
|
|
* @property {number} TARGET_TYPE_EXTENSION_RANGE=2 TARGET_TYPE_EXTENSION_RANGE value
|
|
* @property {number} TARGET_TYPE_MESSAGE=3 TARGET_TYPE_MESSAGE value
|
|
* @property {number} TARGET_TYPE_FIELD=4 TARGET_TYPE_FIELD value
|
|
* @property {number} TARGET_TYPE_ONEOF=5 TARGET_TYPE_ONEOF value
|
|
* @property {number} TARGET_TYPE_ENUM=6 TARGET_TYPE_ENUM value
|
|
* @property {number} TARGET_TYPE_ENUM_ENTRY=7 TARGET_TYPE_ENUM_ENTRY value
|
|
* @property {number} TARGET_TYPE_SERVICE=8 TARGET_TYPE_SERVICE value
|
|
* @property {number} TARGET_TYPE_METHOD=9 TARGET_TYPE_METHOD value
|
|
*/
|
|
FieldOptions.OptionTargetType = (function () {
|
|
var valuesById = {},
|
|
values = Object.create(valuesById);
|
|
values[(valuesById[0] = "TARGET_TYPE_UNKNOWN")] = 0;
|
|
values[(valuesById[1] = "TARGET_TYPE_FILE")] = 1;
|
|
values[(valuesById[2] = "TARGET_TYPE_EXTENSION_RANGE")] = 2;
|
|
values[(valuesById[3] = "TARGET_TYPE_MESSAGE")] = 3;
|
|
values[(valuesById[4] = "TARGET_TYPE_FIELD")] = 4;
|
|
values[(valuesById[5] = "TARGET_TYPE_ONEOF")] = 5;
|
|
values[(valuesById[6] = "TARGET_TYPE_ENUM")] = 6;
|
|
values[(valuesById[7] = "TARGET_TYPE_ENUM_ENTRY")] = 7;
|
|
values[(valuesById[8] = "TARGET_TYPE_SERVICE")] = 8;
|
|
values[(valuesById[9] = "TARGET_TYPE_METHOD")] = 9;
|
|
return values;
|
|
})();
|
|
|
|
FieldOptions.EditionDefault = (function () {
|
|
/**
|
|
* Properties of an EditionDefault.
|
|
* @memberof google.protobuf.FieldOptions
|
|
* @interface IEditionDefault
|
|
* @property {google.protobuf.Edition|null} [edition] EditionDefault edition
|
|
* @property {string|null} [value] EditionDefault value
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new EditionDefault.
|
|
* @memberof google.protobuf.FieldOptions
|
|
* @classdesc Represents an EditionDefault.
|
|
* @implements IEditionDefault
|
|
* @constructor
|
|
* @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set
|
|
*/
|
|
function EditionDefault(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]];
|
|
}
|
|
|
|
/**
|
|
* EditionDefault edition.
|
|
* @member {google.protobuf.Edition} edition
|
|
* @memberof google.protobuf.FieldOptions.EditionDefault
|
|
* @instance
|
|
*/
|
|
EditionDefault.prototype.edition = 0;
|
|
|
|
/**
|
|
* EditionDefault value.
|
|
* @member {string} value
|
|
* @memberof google.protobuf.FieldOptions.EditionDefault
|
|
* @instance
|
|
*/
|
|
EditionDefault.prototype.value = "";
|
|
|
|
/**
|
|
* Creates a new EditionDefault instance using the specified properties.
|
|
* @function create
|
|
* @memberof google.protobuf.FieldOptions.EditionDefault
|
|
* @static
|
|
* @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set
|
|
* @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault instance
|
|
*/
|
|
EditionDefault.create = function create(properties) {
|
|
return new EditionDefault(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof google.protobuf.FieldOptions.EditionDefault
|
|
* @static
|
|
* @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
EditionDefault.encode = function encode(message, writer) {
|
|
if (!writer) writer = $Writer.create();
|
|
if (
|
|
message.value != null &&
|
|
Object.hasOwnProperty.call(message, "value")
|
|
)
|
|
writer.uint32(/* id 2, wireType 2 =*/ 18).string(message.value);
|
|
if (
|
|
message.edition != null &&
|
|
Object.hasOwnProperty.call(message, "edition")
|
|
)
|
|
writer.uint32(/* id 3, wireType 0 =*/ 24).int32(message.edition);
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof google.protobuf.FieldOptions.EditionDefault
|
|
* @static
|
|
* @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
EditionDefault.encodeDelimited = function encodeDelimited(
|
|
message,
|
|
writer
|
|
) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes an EditionDefault message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof google.protobuf.FieldOptions.EditionDefault
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
EditionDefault.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.google.protobuf.FieldOptions.EditionDefault();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
if (tag === error) break;
|
|
switch (tag >>> 3) {
|
|
case 3: {
|
|
message.edition = reader.int32();
|
|
break;
|
|
}
|
|
case 2: {
|
|
message.value = reader.string();
|
|
break;
|
|
}
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes an EditionDefault message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof google.protobuf.FieldOptions.EditionDefault
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
EditionDefault.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader)) reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies an EditionDefault message.
|
|
* @function verify
|
|
* @memberof google.protobuf.FieldOptions.EditionDefault
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
EditionDefault.verify = function verify(message) {
|
|
if (typeof message !== "object" || message === null)
|
|
return "object expected";
|
|
if (message.edition != null && message.hasOwnProperty("edition"))
|
|
switch (message.edition) {
|
|
default:
|
|
return "edition: enum value expected";
|
|
case 0:
|
|
case 900:
|
|
case 998:
|
|
case 999:
|
|
case 1000:
|
|
case 1001:
|
|
case 1:
|
|
case 2:
|
|
case 99997:
|
|
case 99998:
|
|
case 99999:
|
|
case 2147483647:
|
|
break;
|
|
}
|
|
if (message.value != null && message.hasOwnProperty("value"))
|
|
if (!$util.isString(message.value)) return "value: string expected";
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates an EditionDefault message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof google.protobuf.FieldOptions.EditionDefault
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault
|
|
*/
|
|
EditionDefault.fromObject = function fromObject(object) {
|
|
if (
|
|
object instanceof $root.google.protobuf.FieldOptions.EditionDefault
|
|
)
|
|
return object;
|
|
var message = new $root.google.protobuf.FieldOptions.EditionDefault();
|
|
switch (object.edition) {
|
|
default:
|
|
if (typeof object.edition === "number") {
|
|
message.edition = object.edition;
|
|
break;
|
|
}
|
|
break;
|
|
case "EDITION_UNKNOWN":
|
|
case 0:
|
|
message.edition = 0;
|
|
break;
|
|
case "EDITION_LEGACY":
|
|
case 900:
|
|
message.edition = 900;
|
|
break;
|
|
case "EDITION_PROTO2":
|
|
case 998:
|
|
message.edition = 998;
|
|
break;
|
|
case "EDITION_PROTO3":
|
|
case 999:
|
|
message.edition = 999;
|
|
break;
|
|
case "EDITION_2023":
|
|
case 1000:
|
|
message.edition = 1000;
|
|
break;
|
|
case "EDITION_2024":
|
|
case 1001:
|
|
message.edition = 1001;
|
|
break;
|
|
case "EDITION_1_TEST_ONLY":
|
|
case 1:
|
|
message.edition = 1;
|
|
break;
|
|
case "EDITION_2_TEST_ONLY":
|
|
case 2:
|
|
message.edition = 2;
|
|
break;
|
|
case "EDITION_99997_TEST_ONLY":
|
|
case 99997:
|
|
message.edition = 99997;
|
|
break;
|
|
case "EDITION_99998_TEST_ONLY":
|
|
case 99998:
|
|
message.edition = 99998;
|
|
break;
|
|
case "EDITION_99999_TEST_ONLY":
|
|
case 99999:
|
|
message.edition = 99999;
|
|
break;
|
|
case "EDITION_MAX":
|
|
case 2147483647:
|
|
message.edition = 2147483647;
|
|
break;
|
|
}
|
|
if (object.value != null) message.value = String(object.value);
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from an EditionDefault message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof google.protobuf.FieldOptions.EditionDefault
|
|
* @static
|
|
* @param {google.protobuf.FieldOptions.EditionDefault} message EditionDefault
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
EditionDefault.toObject = function toObject(message, options) {
|
|
if (!options) options = {};
|
|
var object = {};
|
|
if (options.defaults) {
|
|
object.value = "";
|
|
object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0;
|
|
}
|
|
if (message.value != null && message.hasOwnProperty("value"))
|
|
object.value = message.value;
|
|
if (message.edition != null && message.hasOwnProperty("edition"))
|
|
object.edition =
|
|
options.enums === String
|
|
? $root.google.protobuf.Edition[message.edition] === undefined
|
|
? message.edition
|
|
: $root.google.protobuf.Edition[message.edition]
|
|
: message.edition;
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this EditionDefault to JSON.
|
|
* @function toJSON
|
|
* @memberof google.protobuf.FieldOptions.EditionDefault
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
EditionDefault.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
/**
|
|
* Gets the default type url for EditionDefault
|
|
* @function getTypeUrl
|
|
* @memberof google.protobuf.FieldOptions.EditionDefault
|
|
* @static
|
|
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
|
* @returns {string} The default type url
|
|
*/
|
|
EditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
if (typeUrlPrefix === undefined) {
|
|
typeUrlPrefix = "type.googleapis.com";
|
|
}
|
|
return typeUrlPrefix + "/google.protobuf.FieldOptions.EditionDefault";
|
|
};
|
|
|
|
return EditionDefault;
|
|
})();
|
|
|
|
FieldOptions.FeatureSupport = (function () {
|
|
/**
|
|
* Properties of a FeatureSupport.
|
|
* @memberof google.protobuf.FieldOptions
|
|
* @interface IFeatureSupport
|
|
* @property {google.protobuf.Edition|null} [editionIntroduced] FeatureSupport editionIntroduced
|
|
* @property {google.protobuf.Edition|null} [editionDeprecated] FeatureSupport editionDeprecated
|
|
* @property {string|null} [deprecationWarning] FeatureSupport deprecationWarning
|
|
* @property {google.protobuf.Edition|null} [editionRemoved] FeatureSupport editionRemoved
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new FeatureSupport.
|
|
* @memberof google.protobuf.FieldOptions
|
|
* @classdesc Represents a FeatureSupport.
|
|
* @implements IFeatureSupport
|
|
* @constructor
|
|
* @param {google.protobuf.FieldOptions.IFeatureSupport=} [properties] Properties to set
|
|
*/
|
|
function FeatureSupport(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]];
|
|
}
|
|
|
|
/**
|
|
* FeatureSupport editionIntroduced.
|
|
* @member {google.protobuf.Edition} editionIntroduced
|
|
* @memberof google.protobuf.FieldOptions.FeatureSupport
|
|
* @instance
|
|
*/
|
|
FeatureSupport.prototype.editionIntroduced = 0;
|
|
|
|
/**
|
|
* FeatureSupport editionDeprecated.
|
|
* @member {google.protobuf.Edition} editionDeprecated
|
|
* @memberof google.protobuf.FieldOptions.FeatureSupport
|
|
* @instance
|
|
*/
|
|
FeatureSupport.prototype.editionDeprecated = 0;
|
|
|
|
/**
|
|
* FeatureSupport deprecationWarning.
|
|
* @member {string} deprecationWarning
|
|
* @memberof google.protobuf.FieldOptions.FeatureSupport
|
|
* @instance
|
|
*/
|
|
FeatureSupport.prototype.deprecationWarning = "";
|
|
|
|
/**
|
|
* FeatureSupport editionRemoved.
|
|
* @member {google.protobuf.Edition} editionRemoved
|
|
* @memberof google.protobuf.FieldOptions.FeatureSupport
|
|
* @instance
|
|
*/
|
|
FeatureSupport.prototype.editionRemoved = 0;
|
|
|
|
/**
|
|
* Creates a new FeatureSupport instance using the specified properties.
|
|
* @function create
|
|
* @memberof google.protobuf.FieldOptions.FeatureSupport
|
|
* @static
|
|
* @param {google.protobuf.FieldOptions.IFeatureSupport=} [properties] Properties to set
|
|
* @returns {google.protobuf.FieldOptions.FeatureSupport} FeatureSupport instance
|
|
*/
|
|
FeatureSupport.create = function create(properties) {
|
|
return new FeatureSupport(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified FeatureSupport message. Does not implicitly {@link google.protobuf.FieldOptions.FeatureSupport.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof google.protobuf.FieldOptions.FeatureSupport
|
|
* @static
|
|
* @param {google.protobuf.FieldOptions.IFeatureSupport} message FeatureSupport message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
FeatureSupport.encode = function encode(message, writer) {
|
|
if (!writer) writer = $Writer.create();
|
|
if (
|
|
message.editionIntroduced != null &&
|
|
Object.hasOwnProperty.call(message, "editionIntroduced")
|
|
)
|
|
writer
|
|
.uint32(/* id 1, wireType 0 =*/ 8)
|
|
.int32(message.editionIntroduced);
|
|
if (
|
|
message.editionDeprecated != null &&
|
|
Object.hasOwnProperty.call(message, "editionDeprecated")
|
|
)
|
|
writer
|
|
.uint32(/* id 2, wireType 0 =*/ 16)
|
|
.int32(message.editionDeprecated);
|
|
if (
|
|
message.deprecationWarning != null &&
|
|
Object.hasOwnProperty.call(message, "deprecationWarning")
|
|
)
|
|
writer
|
|
.uint32(/* id 3, wireType 2 =*/ 26)
|
|
.string(message.deprecationWarning);
|
|
if (
|
|
message.editionRemoved != null &&
|
|
Object.hasOwnProperty.call(message, "editionRemoved")
|
|
)
|
|
writer
|
|
.uint32(/* id 4, wireType 0 =*/ 32)
|
|
.int32(message.editionRemoved);
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified FeatureSupport message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.FeatureSupport.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof google.protobuf.FieldOptions.FeatureSupport
|
|
* @static
|
|
* @param {google.protobuf.FieldOptions.IFeatureSupport} message FeatureSupport message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
FeatureSupport.encodeDelimited = function encodeDelimited(
|
|
message,
|
|
writer
|
|
) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes a FeatureSupport message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof google.protobuf.FieldOptions.FeatureSupport
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {google.protobuf.FieldOptions.FeatureSupport} FeatureSupport
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
FeatureSupport.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.google.protobuf.FieldOptions.FeatureSupport();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
if (tag === error) break;
|
|
switch (tag >>> 3) {
|
|
case 1: {
|
|
message.editionIntroduced = reader.int32();
|
|
break;
|
|
}
|
|
case 2: {
|
|
message.editionDeprecated = reader.int32();
|
|
break;
|
|
}
|
|
case 3: {
|
|
message.deprecationWarning = reader.string();
|
|
break;
|
|
}
|
|
case 4: {
|
|
message.editionRemoved = reader.int32();
|
|
break;
|
|
}
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes a FeatureSupport message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof google.protobuf.FieldOptions.FeatureSupport
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {google.protobuf.FieldOptions.FeatureSupport} FeatureSupport
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
FeatureSupport.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader)) reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies a FeatureSupport message.
|
|
* @function verify
|
|
* @memberof google.protobuf.FieldOptions.FeatureSupport
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
FeatureSupport.verify = function verify(message) {
|
|
if (typeof message !== "object" || message === null)
|
|
return "object expected";
|
|
if (
|
|
message.editionIntroduced != null &&
|
|
message.hasOwnProperty("editionIntroduced")
|
|
)
|
|
switch (message.editionIntroduced) {
|
|
default:
|
|
return "editionIntroduced: enum value expected";
|
|
case 0:
|
|
case 900:
|
|
case 998:
|
|
case 999:
|
|
case 1000:
|
|
case 1001:
|
|
case 1:
|
|
case 2:
|
|
case 99997:
|
|
case 99998:
|
|
case 99999:
|
|
case 2147483647:
|
|
break;
|
|
}
|
|
if (
|
|
message.editionDeprecated != null &&
|
|
message.hasOwnProperty("editionDeprecated")
|
|
)
|
|
switch (message.editionDeprecated) {
|
|
default:
|
|
return "editionDeprecated: enum value expected";
|
|
case 0:
|
|
case 900:
|
|
case 998:
|
|
case 999:
|
|
case 1000:
|
|
case 1001:
|
|
case 1:
|
|
case 2:
|
|
case 99997:
|
|
case 99998:
|
|
case 99999:
|
|
case 2147483647:
|
|
break;
|
|
}
|
|
if (
|
|
message.deprecationWarning != null &&
|
|
message.hasOwnProperty("deprecationWarning")
|
|
)
|
|
if (!$util.isString(message.deprecationWarning))
|
|
return "deprecationWarning: string expected";
|
|
if (
|
|
message.editionRemoved != null &&
|
|
message.hasOwnProperty("editionRemoved")
|
|
)
|
|
switch (message.editionRemoved) {
|
|
default:
|
|
return "editionRemoved: enum value expected";
|
|
case 0:
|
|
case 900:
|
|
case 998:
|
|
case 999:
|
|
case 1000:
|
|
case 1001:
|
|
case 1:
|
|
case 2:
|
|
case 99997:
|
|
case 99998:
|
|
case 99999:
|
|
case 2147483647:
|
|
break;
|
|
}
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates a FeatureSupport message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof google.protobuf.FieldOptions.FeatureSupport
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {google.protobuf.FieldOptions.FeatureSupport} FeatureSupport
|
|
*/
|
|
FeatureSupport.fromObject = function fromObject(object) {
|
|
if (
|
|
object instanceof $root.google.protobuf.FieldOptions.FeatureSupport
|
|
)
|
|
return object;
|
|
var message = new $root.google.protobuf.FieldOptions.FeatureSupport();
|
|
switch (object.editionIntroduced) {
|
|
default:
|
|
if (typeof object.editionIntroduced === "number") {
|
|
message.editionIntroduced = object.editionIntroduced;
|
|
break;
|
|
}
|
|
break;
|
|
case "EDITION_UNKNOWN":
|
|
case 0:
|
|
message.editionIntroduced = 0;
|
|
break;
|
|
case "EDITION_LEGACY":
|
|
case 900:
|
|
message.editionIntroduced = 900;
|
|
break;
|
|
case "EDITION_PROTO2":
|
|
case 998:
|
|
message.editionIntroduced = 998;
|
|
break;
|
|
case "EDITION_PROTO3":
|
|
case 999:
|
|
message.editionIntroduced = 999;
|
|
break;
|
|
case "EDITION_2023":
|
|
case 1000:
|
|
message.editionIntroduced = 1000;
|
|
break;
|
|
case "EDITION_2024":
|
|
case 1001:
|
|
message.editionIntroduced = 1001;
|
|
break;
|
|
case "EDITION_1_TEST_ONLY":
|
|
case 1:
|
|
message.editionIntroduced = 1;
|
|
break;
|
|
case "EDITION_2_TEST_ONLY":
|
|
case 2:
|
|
message.editionIntroduced = 2;
|
|
break;
|
|
case "EDITION_99997_TEST_ONLY":
|
|
case 99997:
|
|
message.editionIntroduced = 99997;
|
|
break;
|
|
case "EDITION_99998_TEST_ONLY":
|
|
case 99998:
|
|
message.editionIntroduced = 99998;
|
|
break;
|
|
case "EDITION_99999_TEST_ONLY":
|
|
case 99999:
|
|
message.editionIntroduced = 99999;
|
|
break;
|
|
case "EDITION_MAX":
|
|
case 2147483647:
|
|
message.editionIntroduced = 2147483647;
|
|
break;
|
|
}
|
|
switch (object.editionDeprecated) {
|
|
default:
|
|
if (typeof object.editionDeprecated === "number") {
|
|
message.editionDeprecated = object.editionDeprecated;
|
|
break;
|
|
}
|
|
break;
|
|
case "EDITION_UNKNOWN":
|
|
case 0:
|
|
message.editionDeprecated = 0;
|
|
break;
|
|
case "EDITION_LEGACY":
|
|
case 900:
|
|
message.editionDeprecated = 900;
|
|
break;
|
|
case "EDITION_PROTO2":
|
|
case 998:
|
|
message.editionDeprecated = 998;
|
|
break;
|
|
case "EDITION_PROTO3":
|
|
case 999:
|
|
message.editionDeprecated = 999;
|
|
break;
|
|
case "EDITION_2023":
|
|
case 1000:
|
|
message.editionDeprecated = 1000;
|
|
break;
|
|
case "EDITION_2024":
|
|
case 1001:
|
|
message.editionDeprecated = 1001;
|
|
break;
|
|
case "EDITION_1_TEST_ONLY":
|
|
case 1:
|
|
message.editionDeprecated = 1;
|
|
break;
|
|
case "EDITION_2_TEST_ONLY":
|
|
case 2:
|
|
message.editionDeprecated = 2;
|
|
break;
|
|
case "EDITION_99997_TEST_ONLY":
|
|
case 99997:
|
|
message.editionDeprecated = 99997;
|
|
break;
|
|
case "EDITION_99998_TEST_ONLY":
|
|
case 99998:
|
|
message.editionDeprecated = 99998;
|
|
break;
|
|
case "EDITION_99999_TEST_ONLY":
|
|
case 99999:
|
|
message.editionDeprecated = 99999;
|
|
break;
|
|
case "EDITION_MAX":
|
|
case 2147483647:
|
|
message.editionDeprecated = 2147483647;
|
|
break;
|
|
}
|
|
if (object.deprecationWarning != null)
|
|
message.deprecationWarning = String(object.deprecationWarning);
|
|
switch (object.editionRemoved) {
|
|
default:
|
|
if (typeof object.editionRemoved === "number") {
|
|
message.editionRemoved = object.editionRemoved;
|
|
break;
|
|
}
|
|
break;
|
|
case "EDITION_UNKNOWN":
|
|
case 0:
|
|
message.editionRemoved = 0;
|
|
break;
|
|
case "EDITION_LEGACY":
|
|
case 900:
|
|
message.editionRemoved = 900;
|
|
break;
|
|
case "EDITION_PROTO2":
|
|
case 998:
|
|
message.editionRemoved = 998;
|
|
break;
|
|
case "EDITION_PROTO3":
|
|
case 999:
|
|
message.editionRemoved = 999;
|
|
break;
|
|
case "EDITION_2023":
|
|
case 1000:
|
|
message.editionRemoved = 1000;
|
|
break;
|
|
case "EDITION_2024":
|
|
case 1001:
|
|
message.editionRemoved = 1001;
|
|
break;
|
|
case "EDITION_1_TEST_ONLY":
|
|
case 1:
|
|
message.editionRemoved = 1;
|
|
break;
|
|
case "EDITION_2_TEST_ONLY":
|
|
case 2:
|
|
message.editionRemoved = 2;
|
|
break;
|
|
case "EDITION_99997_TEST_ONLY":
|
|
case 99997:
|
|
message.editionRemoved = 99997;
|
|
break;
|
|
case "EDITION_99998_TEST_ONLY":
|
|
case 99998:
|
|
message.editionRemoved = 99998;
|
|
break;
|
|
case "EDITION_99999_TEST_ONLY":
|
|
case 99999:
|
|
message.editionRemoved = 99999;
|
|
break;
|
|
case "EDITION_MAX":
|
|
case 2147483647:
|
|
message.editionRemoved = 2147483647;
|
|
break;
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from a FeatureSupport message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof google.protobuf.FieldOptions.FeatureSupport
|
|
* @static
|
|
* @param {google.protobuf.FieldOptions.FeatureSupport} message FeatureSupport
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
FeatureSupport.toObject = function toObject(message, options) {
|
|
if (!options) options = {};
|
|
var object = {};
|
|
if (options.defaults) {
|
|
object.editionIntroduced =
|
|
options.enums === String ? "EDITION_UNKNOWN" : 0;
|
|
object.editionDeprecated =
|
|
options.enums === String ? "EDITION_UNKNOWN" : 0;
|
|
object.deprecationWarning = "";
|
|
object.editionRemoved =
|
|
options.enums === String ? "EDITION_UNKNOWN" : 0;
|
|
}
|
|
if (
|
|
message.editionIntroduced != null &&
|
|
message.hasOwnProperty("editionIntroduced")
|
|
)
|
|
object.editionIntroduced =
|
|
options.enums === String
|
|
? $root.google.protobuf.Edition[message.editionIntroduced] ===
|
|
undefined
|
|
? message.editionIntroduced
|
|
: $root.google.protobuf.Edition[message.editionIntroduced]
|
|
: message.editionIntroduced;
|
|
if (
|
|
message.editionDeprecated != null &&
|
|
message.hasOwnProperty("editionDeprecated")
|
|
)
|
|
object.editionDeprecated =
|
|
options.enums === String
|
|
? $root.google.protobuf.Edition[message.editionDeprecated] ===
|
|
undefined
|
|
? message.editionDeprecated
|
|
: $root.google.protobuf.Edition[message.editionDeprecated]
|
|
: message.editionDeprecated;
|
|
if (
|
|
message.deprecationWarning != null &&
|
|
message.hasOwnProperty("deprecationWarning")
|
|
)
|
|
object.deprecationWarning = message.deprecationWarning;
|
|
if (
|
|
message.editionRemoved != null &&
|
|
message.hasOwnProperty("editionRemoved")
|
|
)
|
|
object.editionRemoved =
|
|
options.enums === String
|
|
? $root.google.protobuf.Edition[message.editionRemoved] ===
|
|
undefined
|
|
? message.editionRemoved
|
|
: $root.google.protobuf.Edition[message.editionRemoved]
|
|
: message.editionRemoved;
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this FeatureSupport to JSON.
|
|
* @function toJSON
|
|
* @memberof google.protobuf.FieldOptions.FeatureSupport
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
FeatureSupport.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
/**
|
|
* Gets the default type url for FeatureSupport
|
|
* @function getTypeUrl
|
|
* @memberof google.protobuf.FieldOptions.FeatureSupport
|
|
* @static
|
|
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
|
* @returns {string} The default type url
|
|
*/
|
|
FeatureSupport.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
if (typeUrlPrefix === undefined) {
|
|
typeUrlPrefix = "type.googleapis.com";
|
|
}
|
|
return typeUrlPrefix + "/google.protobuf.FieldOptions.FeatureSupport";
|
|
};
|
|
|
|
return FeatureSupport;
|
|
})();
|
|
|
|
return FieldOptions;
|
|
})();
|
|
|
|
protobuf.OneofOptions = (function () {
|
|
/**
|
|
* Properties of an OneofOptions.
|
|
* @memberof google.protobuf
|
|
* @interface IOneofOptions
|
|
* @property {google.protobuf.IFeatureSet|null} [features] OneofOptions features
|
|
* @property {Array.<google.protobuf.IUninterpretedOption>|null} [uninterpretedOption] OneofOptions uninterpretedOption
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new OneofOptions.
|
|
* @memberof google.protobuf
|
|
* @classdesc Represents an OneofOptions.
|
|
* @implements IOneofOptions
|
|
* @constructor
|
|
* @param {google.protobuf.IOneofOptions=} [properties] Properties to set
|
|
*/
|
|
function OneofOptions(properties) {
|
|
this.uninterpretedOption = [];
|
|
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]];
|
|
}
|
|
|
|
/**
|
|
* OneofOptions features.
|
|
* @member {google.protobuf.IFeatureSet|null|undefined} features
|
|
* @memberof google.protobuf.OneofOptions
|
|
* @instance
|
|
*/
|
|
OneofOptions.prototype.features = null;
|
|
|
|
/**
|
|
* OneofOptions uninterpretedOption.
|
|
* @member {Array.<google.protobuf.IUninterpretedOption>} uninterpretedOption
|
|
* @memberof google.protobuf.OneofOptions
|
|
* @instance
|
|
*/
|
|
OneofOptions.prototype.uninterpretedOption = $util.emptyArray;
|
|
|
|
/**
|
|
* Creates a new OneofOptions instance using the specified properties.
|
|
* @function create
|
|
* @memberof google.protobuf.OneofOptions
|
|
* @static
|
|
* @param {google.protobuf.IOneofOptions=} [properties] Properties to set
|
|
* @returns {google.protobuf.OneofOptions} OneofOptions instance
|
|
*/
|
|
OneofOptions.create = function create(properties) {
|
|
return new OneofOptions(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof google.protobuf.OneofOptions
|
|
* @static
|
|
* @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
OneofOptions.encode = function encode(message, writer) {
|
|
if (!writer) writer = $Writer.create();
|
|
if (
|
|
message.features != null &&
|
|
Object.hasOwnProperty.call(message, "features")
|
|
)
|
|
$root.google.protobuf.FeatureSet.encode(
|
|
message.features,
|
|
writer.uint32(/* id 1, wireType 2 =*/ 10).fork()
|
|
).ldelim();
|
|
if (
|
|
message.uninterpretedOption != null &&
|
|
message.uninterpretedOption.length
|
|
)
|
|
for (var i = 0; i < message.uninterpretedOption.length; ++i)
|
|
$root.google.protobuf.UninterpretedOption.encode(
|
|
message.uninterpretedOption[i],
|
|
writer.uint32(/* id 999, wireType 2 =*/ 7994).fork()
|
|
).ldelim();
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof google.protobuf.OneofOptions
|
|
* @static
|
|
* @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
OneofOptions.encodeDelimited = function encodeDelimited(message, writer) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes an OneofOptions message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof google.protobuf.OneofOptions
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {google.protobuf.OneofOptions} OneofOptions
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
OneofOptions.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.google.protobuf.OneofOptions();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
if (tag === error) break;
|
|
switch (tag >>> 3) {
|
|
case 1: {
|
|
message.features = $root.google.protobuf.FeatureSet.decode(
|
|
reader,
|
|
reader.uint32()
|
|
);
|
|
break;
|
|
}
|
|
case 999: {
|
|
if (
|
|
!(
|
|
message.uninterpretedOption &&
|
|
message.uninterpretedOption.length
|
|
)
|
|
)
|
|
message.uninterpretedOption = [];
|
|
message.uninterpretedOption.push(
|
|
$root.google.protobuf.UninterpretedOption.decode(
|
|
reader,
|
|
reader.uint32()
|
|
)
|
|
);
|
|
break;
|
|
}
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes an OneofOptions message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof google.protobuf.OneofOptions
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {google.protobuf.OneofOptions} OneofOptions
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
OneofOptions.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader)) reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies an OneofOptions message.
|
|
* @function verify
|
|
* @memberof google.protobuf.OneofOptions
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
OneofOptions.verify = function verify(message) {
|
|
if (typeof message !== "object" || message === null)
|
|
return "object expected";
|
|
if (message.features != null && message.hasOwnProperty("features")) {
|
|
var error = $root.google.protobuf.FeatureSet.verify(message.features);
|
|
if (error) return "features." + error;
|
|
}
|
|
if (
|
|
message.uninterpretedOption != null &&
|
|
message.hasOwnProperty("uninterpretedOption")
|
|
) {
|
|
if (!Array.isArray(message.uninterpretedOption))
|
|
return "uninterpretedOption: array expected";
|
|
for (var i = 0; i < message.uninterpretedOption.length; ++i) {
|
|
var error = $root.google.protobuf.UninterpretedOption.verify(
|
|
message.uninterpretedOption[i]
|
|
);
|
|
if (error) return "uninterpretedOption." + error;
|
|
}
|
|
}
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates an OneofOptions message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof google.protobuf.OneofOptions
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {google.protobuf.OneofOptions} OneofOptions
|
|
*/
|
|
OneofOptions.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.google.protobuf.OneofOptions) return object;
|
|
var message = new $root.google.protobuf.OneofOptions();
|
|
if (object.features != null) {
|
|
if (typeof object.features !== "object")
|
|
throw TypeError(
|
|
".google.protobuf.OneofOptions.features: object expected"
|
|
);
|
|
message.features = $root.google.protobuf.FeatureSet.fromObject(
|
|
object.features
|
|
);
|
|
}
|
|
if (object.uninterpretedOption) {
|
|
if (!Array.isArray(object.uninterpretedOption))
|
|
throw TypeError(
|
|
".google.protobuf.OneofOptions.uninterpretedOption: array expected"
|
|
);
|
|
message.uninterpretedOption = [];
|
|
for (var i = 0; i < object.uninterpretedOption.length; ++i) {
|
|
if (typeof object.uninterpretedOption[i] !== "object")
|
|
throw TypeError(
|
|
".google.protobuf.OneofOptions.uninterpretedOption: object expected"
|
|
);
|
|
message.uninterpretedOption[i] =
|
|
$root.google.protobuf.UninterpretedOption.fromObject(
|
|
object.uninterpretedOption[i]
|
|
);
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from an OneofOptions message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof google.protobuf.OneofOptions
|
|
* @static
|
|
* @param {google.protobuf.OneofOptions} message OneofOptions
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
OneofOptions.toObject = function toObject(message, options) {
|
|
if (!options) options = {};
|
|
var object = {};
|
|
if (options.arrays || options.defaults) object.uninterpretedOption = [];
|
|
if (options.defaults) object.features = null;
|
|
if (message.features != null && message.hasOwnProperty("features"))
|
|
object.features = $root.google.protobuf.FeatureSet.toObject(
|
|
message.features,
|
|
options
|
|
);
|
|
if (message.uninterpretedOption && message.uninterpretedOption.length) {
|
|
object.uninterpretedOption = [];
|
|
for (var j = 0; j < message.uninterpretedOption.length; ++j)
|
|
object.uninterpretedOption[j] =
|
|
$root.google.protobuf.UninterpretedOption.toObject(
|
|
message.uninterpretedOption[j],
|
|
options
|
|
);
|
|
}
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this OneofOptions to JSON.
|
|
* @function toJSON
|
|
* @memberof google.protobuf.OneofOptions
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
OneofOptions.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
/**
|
|
* Gets the default type url for OneofOptions
|
|
* @function getTypeUrl
|
|
* @memberof google.protobuf.OneofOptions
|
|
* @static
|
|
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
|
* @returns {string} The default type url
|
|
*/
|
|
OneofOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
if (typeUrlPrefix === undefined) {
|
|
typeUrlPrefix = "type.googleapis.com";
|
|
}
|
|
return typeUrlPrefix + "/google.protobuf.OneofOptions";
|
|
};
|
|
|
|
return OneofOptions;
|
|
})();
|
|
|
|
protobuf.EnumOptions = (function () {
|
|
/**
|
|
* Properties of an EnumOptions.
|
|
* @memberof google.protobuf
|
|
* @interface IEnumOptions
|
|
* @property {boolean|null} [allowAlias] EnumOptions allowAlias
|
|
* @property {boolean|null} [deprecated] EnumOptions deprecated
|
|
* @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] EnumOptions deprecatedLegacyJsonFieldConflicts
|
|
* @property {google.protobuf.IFeatureSet|null} [features] EnumOptions features
|
|
* @property {Array.<google.protobuf.IUninterpretedOption>|null} [uninterpretedOption] EnumOptions uninterpretedOption
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new EnumOptions.
|
|
* @memberof google.protobuf
|
|
* @classdesc Represents an EnumOptions.
|
|
* @implements IEnumOptions
|
|
* @constructor
|
|
* @param {google.protobuf.IEnumOptions=} [properties] Properties to set
|
|
*/
|
|
function EnumOptions(properties) {
|
|
this.uninterpretedOption = [];
|
|
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]];
|
|
}
|
|
|
|
/**
|
|
* EnumOptions allowAlias.
|
|
* @member {boolean} allowAlias
|
|
* @memberof google.protobuf.EnumOptions
|
|
* @instance
|
|
*/
|
|
EnumOptions.prototype.allowAlias = false;
|
|
|
|
/**
|
|
* EnumOptions deprecated.
|
|
* @member {boolean} deprecated
|
|
* @memberof google.protobuf.EnumOptions
|
|
* @instance
|
|
*/
|
|
EnumOptions.prototype.deprecated = false;
|
|
|
|
/**
|
|
* EnumOptions deprecatedLegacyJsonFieldConflicts.
|
|
* @member {boolean} deprecatedLegacyJsonFieldConflicts
|
|
* @memberof google.protobuf.EnumOptions
|
|
* @instance
|
|
*/
|
|
EnumOptions.prototype.deprecatedLegacyJsonFieldConflicts = false;
|
|
|
|
/**
|
|
* EnumOptions features.
|
|
* @member {google.protobuf.IFeatureSet|null|undefined} features
|
|
* @memberof google.protobuf.EnumOptions
|
|
* @instance
|
|
*/
|
|
EnumOptions.prototype.features = null;
|
|
|
|
/**
|
|
* EnumOptions uninterpretedOption.
|
|
* @member {Array.<google.protobuf.IUninterpretedOption>} uninterpretedOption
|
|
* @memberof google.protobuf.EnumOptions
|
|
* @instance
|
|
*/
|
|
EnumOptions.prototype.uninterpretedOption = $util.emptyArray;
|
|
|
|
/**
|
|
* Creates a new EnumOptions instance using the specified properties.
|
|
* @function create
|
|
* @memberof google.protobuf.EnumOptions
|
|
* @static
|
|
* @param {google.protobuf.IEnumOptions=} [properties] Properties to set
|
|
* @returns {google.protobuf.EnumOptions} EnumOptions instance
|
|
*/
|
|
EnumOptions.create = function create(properties) {
|
|
return new EnumOptions(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof google.protobuf.EnumOptions
|
|
* @static
|
|
* @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
EnumOptions.encode = function encode(message, writer) {
|
|
if (!writer) writer = $Writer.create();
|
|
if (
|
|
message.allowAlias != null &&
|
|
Object.hasOwnProperty.call(message, "allowAlias")
|
|
)
|
|
writer.uint32(/* id 2, wireType 0 =*/ 16).bool(message.allowAlias);
|
|
if (
|
|
message.deprecated != null &&
|
|
Object.hasOwnProperty.call(message, "deprecated")
|
|
)
|
|
writer.uint32(/* id 3, wireType 0 =*/ 24).bool(message.deprecated);
|
|
if (
|
|
message.deprecatedLegacyJsonFieldConflicts != null &&
|
|
Object.hasOwnProperty.call(
|
|
message,
|
|
"deprecatedLegacyJsonFieldConflicts"
|
|
)
|
|
)
|
|
writer
|
|
.uint32(/* id 6, wireType 0 =*/ 48)
|
|
.bool(message.deprecatedLegacyJsonFieldConflicts);
|
|
if (
|
|
message.features != null &&
|
|
Object.hasOwnProperty.call(message, "features")
|
|
)
|
|
$root.google.protobuf.FeatureSet.encode(
|
|
message.features,
|
|
writer.uint32(/* id 7, wireType 2 =*/ 58).fork()
|
|
).ldelim();
|
|
if (
|
|
message.uninterpretedOption != null &&
|
|
message.uninterpretedOption.length
|
|
)
|
|
for (var i = 0; i < message.uninterpretedOption.length; ++i)
|
|
$root.google.protobuf.UninterpretedOption.encode(
|
|
message.uninterpretedOption[i],
|
|
writer.uint32(/* id 999, wireType 2 =*/ 7994).fork()
|
|
).ldelim();
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof google.protobuf.EnumOptions
|
|
* @static
|
|
* @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
EnumOptions.encodeDelimited = function encodeDelimited(message, writer) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes an EnumOptions message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof google.protobuf.EnumOptions
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {google.protobuf.EnumOptions} EnumOptions
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
EnumOptions.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.google.protobuf.EnumOptions();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
if (tag === error) break;
|
|
switch (tag >>> 3) {
|
|
case 2: {
|
|
message.allowAlias = reader.bool();
|
|
break;
|
|
}
|
|
case 3: {
|
|
message.deprecated = reader.bool();
|
|
break;
|
|
}
|
|
case 6: {
|
|
message.deprecatedLegacyJsonFieldConflicts = reader.bool();
|
|
break;
|
|
}
|
|
case 7: {
|
|
message.features = $root.google.protobuf.FeatureSet.decode(
|
|
reader,
|
|
reader.uint32()
|
|
);
|
|
break;
|
|
}
|
|
case 999: {
|
|
if (
|
|
!(
|
|
message.uninterpretedOption &&
|
|
message.uninterpretedOption.length
|
|
)
|
|
)
|
|
message.uninterpretedOption = [];
|
|
message.uninterpretedOption.push(
|
|
$root.google.protobuf.UninterpretedOption.decode(
|
|
reader,
|
|
reader.uint32()
|
|
)
|
|
);
|
|
break;
|
|
}
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes an EnumOptions message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof google.protobuf.EnumOptions
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {google.protobuf.EnumOptions} EnumOptions
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
EnumOptions.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader)) reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies an EnumOptions message.
|
|
* @function verify
|
|
* @memberof google.protobuf.EnumOptions
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
EnumOptions.verify = function verify(message) {
|
|
if (typeof message !== "object" || message === null)
|
|
return "object expected";
|
|
if (message.allowAlias != null && message.hasOwnProperty("allowAlias"))
|
|
if (typeof message.allowAlias !== "boolean")
|
|
return "allowAlias: boolean expected";
|
|
if (message.deprecated != null && message.hasOwnProperty("deprecated"))
|
|
if (typeof message.deprecated !== "boolean")
|
|
return "deprecated: boolean expected";
|
|
if (
|
|
message.deprecatedLegacyJsonFieldConflicts != null &&
|
|
message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")
|
|
)
|
|
if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean")
|
|
return "deprecatedLegacyJsonFieldConflicts: boolean expected";
|
|
if (message.features != null && message.hasOwnProperty("features")) {
|
|
var error = $root.google.protobuf.FeatureSet.verify(message.features);
|
|
if (error) return "features." + error;
|
|
}
|
|
if (
|
|
message.uninterpretedOption != null &&
|
|
message.hasOwnProperty("uninterpretedOption")
|
|
) {
|
|
if (!Array.isArray(message.uninterpretedOption))
|
|
return "uninterpretedOption: array expected";
|
|
for (var i = 0; i < message.uninterpretedOption.length; ++i) {
|
|
var error = $root.google.protobuf.UninterpretedOption.verify(
|
|
message.uninterpretedOption[i]
|
|
);
|
|
if (error) return "uninterpretedOption." + error;
|
|
}
|
|
}
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates an EnumOptions message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof google.protobuf.EnumOptions
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {google.protobuf.EnumOptions} EnumOptions
|
|
*/
|
|
EnumOptions.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.google.protobuf.EnumOptions) return object;
|
|
var message = new $root.google.protobuf.EnumOptions();
|
|
if (object.allowAlias != null)
|
|
message.allowAlias = Boolean(object.allowAlias);
|
|
if (object.deprecated != null)
|
|
message.deprecated = Boolean(object.deprecated);
|
|
if (object.deprecatedLegacyJsonFieldConflicts != null)
|
|
message.deprecatedLegacyJsonFieldConflicts = Boolean(
|
|
object.deprecatedLegacyJsonFieldConflicts
|
|
);
|
|
if (object.features != null) {
|
|
if (typeof object.features !== "object")
|
|
throw TypeError(
|
|
".google.protobuf.EnumOptions.features: object expected"
|
|
);
|
|
message.features = $root.google.protobuf.FeatureSet.fromObject(
|
|
object.features
|
|
);
|
|
}
|
|
if (object.uninterpretedOption) {
|
|
if (!Array.isArray(object.uninterpretedOption))
|
|
throw TypeError(
|
|
".google.protobuf.EnumOptions.uninterpretedOption: array expected"
|
|
);
|
|
message.uninterpretedOption = [];
|
|
for (var i = 0; i < object.uninterpretedOption.length; ++i) {
|
|
if (typeof object.uninterpretedOption[i] !== "object")
|
|
throw TypeError(
|
|
".google.protobuf.EnumOptions.uninterpretedOption: object expected"
|
|
);
|
|
message.uninterpretedOption[i] =
|
|
$root.google.protobuf.UninterpretedOption.fromObject(
|
|
object.uninterpretedOption[i]
|
|
);
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from an EnumOptions message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof google.protobuf.EnumOptions
|
|
* @static
|
|
* @param {google.protobuf.EnumOptions} message EnumOptions
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
EnumOptions.toObject = function toObject(message, options) {
|
|
if (!options) options = {};
|
|
var object = {};
|
|
if (options.arrays || options.defaults) object.uninterpretedOption = [];
|
|
if (options.defaults) {
|
|
object.allowAlias = false;
|
|
object.deprecated = false;
|
|
object.deprecatedLegacyJsonFieldConflicts = false;
|
|
object.features = null;
|
|
}
|
|
if (message.allowAlias != null && message.hasOwnProperty("allowAlias"))
|
|
object.allowAlias = message.allowAlias;
|
|
if (message.deprecated != null && message.hasOwnProperty("deprecated"))
|
|
object.deprecated = message.deprecated;
|
|
if (
|
|
message.deprecatedLegacyJsonFieldConflicts != null &&
|
|
message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")
|
|
)
|
|
object.deprecatedLegacyJsonFieldConflicts =
|
|
message.deprecatedLegacyJsonFieldConflicts;
|
|
if (message.features != null && message.hasOwnProperty("features"))
|
|
object.features = $root.google.protobuf.FeatureSet.toObject(
|
|
message.features,
|
|
options
|
|
);
|
|
if (message.uninterpretedOption && message.uninterpretedOption.length) {
|
|
object.uninterpretedOption = [];
|
|
for (var j = 0; j < message.uninterpretedOption.length; ++j)
|
|
object.uninterpretedOption[j] =
|
|
$root.google.protobuf.UninterpretedOption.toObject(
|
|
message.uninterpretedOption[j],
|
|
options
|
|
);
|
|
}
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this EnumOptions to JSON.
|
|
* @function toJSON
|
|
* @memberof google.protobuf.EnumOptions
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
EnumOptions.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
/**
|
|
* Gets the default type url for EnumOptions
|
|
* @function getTypeUrl
|
|
* @memberof google.protobuf.EnumOptions
|
|
* @static
|
|
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
|
* @returns {string} The default type url
|
|
*/
|
|
EnumOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
if (typeUrlPrefix === undefined) {
|
|
typeUrlPrefix = "type.googleapis.com";
|
|
}
|
|
return typeUrlPrefix + "/google.protobuf.EnumOptions";
|
|
};
|
|
|
|
return EnumOptions;
|
|
})();
|
|
|
|
protobuf.EnumValueOptions = (function () {
|
|
/**
|
|
* Properties of an EnumValueOptions.
|
|
* @memberof google.protobuf
|
|
* @interface IEnumValueOptions
|
|
* @property {boolean|null} [deprecated] EnumValueOptions deprecated
|
|
* @property {google.protobuf.IFeatureSet|null} [features] EnumValueOptions features
|
|
* @property {boolean|null} [debugRedact] EnumValueOptions debugRedact
|
|
* @property {google.protobuf.FieldOptions.IFeatureSupport|null} [featureSupport] EnumValueOptions featureSupport
|
|
* @property {Array.<google.protobuf.IUninterpretedOption>|null} [uninterpretedOption] EnumValueOptions uninterpretedOption
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new EnumValueOptions.
|
|
* @memberof google.protobuf
|
|
* @classdesc Represents an EnumValueOptions.
|
|
* @implements IEnumValueOptions
|
|
* @constructor
|
|
* @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set
|
|
*/
|
|
function EnumValueOptions(properties) {
|
|
this.uninterpretedOption = [];
|
|
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]];
|
|
}
|
|
|
|
/**
|
|
* EnumValueOptions deprecated.
|
|
* @member {boolean} deprecated
|
|
* @memberof google.protobuf.EnumValueOptions
|
|
* @instance
|
|
*/
|
|
EnumValueOptions.prototype.deprecated = false;
|
|
|
|
/**
|
|
* EnumValueOptions features.
|
|
* @member {google.protobuf.IFeatureSet|null|undefined} features
|
|
* @memberof google.protobuf.EnumValueOptions
|
|
* @instance
|
|
*/
|
|
EnumValueOptions.prototype.features = null;
|
|
|
|
/**
|
|
* EnumValueOptions debugRedact.
|
|
* @member {boolean} debugRedact
|
|
* @memberof google.protobuf.EnumValueOptions
|
|
* @instance
|
|
*/
|
|
EnumValueOptions.prototype.debugRedact = false;
|
|
|
|
/**
|
|
* EnumValueOptions featureSupport.
|
|
* @member {google.protobuf.FieldOptions.IFeatureSupport|null|undefined} featureSupport
|
|
* @memberof google.protobuf.EnumValueOptions
|
|
* @instance
|
|
*/
|
|
EnumValueOptions.prototype.featureSupport = null;
|
|
|
|
/**
|
|
* EnumValueOptions uninterpretedOption.
|
|
* @member {Array.<google.protobuf.IUninterpretedOption>} uninterpretedOption
|
|
* @memberof google.protobuf.EnumValueOptions
|
|
* @instance
|
|
*/
|
|
EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray;
|
|
|
|
/**
|
|
* Creates a new EnumValueOptions instance using the specified properties.
|
|
* @function create
|
|
* @memberof google.protobuf.EnumValueOptions
|
|
* @static
|
|
* @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set
|
|
* @returns {google.protobuf.EnumValueOptions} EnumValueOptions instance
|
|
*/
|
|
EnumValueOptions.create = function create(properties) {
|
|
return new EnumValueOptions(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof google.protobuf.EnumValueOptions
|
|
* @static
|
|
* @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
EnumValueOptions.encode = function encode(message, writer) {
|
|
if (!writer) writer = $Writer.create();
|
|
if (
|
|
message.deprecated != null &&
|
|
Object.hasOwnProperty.call(message, "deprecated")
|
|
)
|
|
writer.uint32(/* id 1, wireType 0 =*/ 8).bool(message.deprecated);
|
|
if (
|
|
message.features != null &&
|
|
Object.hasOwnProperty.call(message, "features")
|
|
)
|
|
$root.google.protobuf.FeatureSet.encode(
|
|
message.features,
|
|
writer.uint32(/* id 2, wireType 2 =*/ 18).fork()
|
|
).ldelim();
|
|
if (
|
|
message.debugRedact != null &&
|
|
Object.hasOwnProperty.call(message, "debugRedact")
|
|
)
|
|
writer.uint32(/* id 3, wireType 0 =*/ 24).bool(message.debugRedact);
|
|
if (
|
|
message.featureSupport != null &&
|
|
Object.hasOwnProperty.call(message, "featureSupport")
|
|
)
|
|
$root.google.protobuf.FieldOptions.FeatureSupport.encode(
|
|
message.featureSupport,
|
|
writer.uint32(/* id 4, wireType 2 =*/ 34).fork()
|
|
).ldelim();
|
|
if (
|
|
message.uninterpretedOption != null &&
|
|
message.uninterpretedOption.length
|
|
)
|
|
for (var i = 0; i < message.uninterpretedOption.length; ++i)
|
|
$root.google.protobuf.UninterpretedOption.encode(
|
|
message.uninterpretedOption[i],
|
|
writer.uint32(/* id 999, wireType 2 =*/ 7994).fork()
|
|
).ldelim();
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof google.protobuf.EnumValueOptions
|
|
* @static
|
|
* @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
EnumValueOptions.encodeDelimited = function encodeDelimited(
|
|
message,
|
|
writer
|
|
) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes an EnumValueOptions message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof google.protobuf.EnumValueOptions
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {google.protobuf.EnumValueOptions} EnumValueOptions
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
EnumValueOptions.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.google.protobuf.EnumValueOptions();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
if (tag === error) break;
|
|
switch (tag >>> 3) {
|
|
case 1: {
|
|
message.deprecated = reader.bool();
|
|
break;
|
|
}
|
|
case 2: {
|
|
message.features = $root.google.protobuf.FeatureSet.decode(
|
|
reader,
|
|
reader.uint32()
|
|
);
|
|
break;
|
|
}
|
|
case 3: {
|
|
message.debugRedact = reader.bool();
|
|
break;
|
|
}
|
|
case 4: {
|
|
message.featureSupport =
|
|
$root.google.protobuf.FieldOptions.FeatureSupport.decode(
|
|
reader,
|
|
reader.uint32()
|
|
);
|
|
break;
|
|
}
|
|
case 999: {
|
|
if (
|
|
!(
|
|
message.uninterpretedOption &&
|
|
message.uninterpretedOption.length
|
|
)
|
|
)
|
|
message.uninterpretedOption = [];
|
|
message.uninterpretedOption.push(
|
|
$root.google.protobuf.UninterpretedOption.decode(
|
|
reader,
|
|
reader.uint32()
|
|
)
|
|
);
|
|
break;
|
|
}
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes an EnumValueOptions message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof google.protobuf.EnumValueOptions
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {google.protobuf.EnumValueOptions} EnumValueOptions
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
EnumValueOptions.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader)) reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies an EnumValueOptions message.
|
|
* @function verify
|
|
* @memberof google.protobuf.EnumValueOptions
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
EnumValueOptions.verify = function verify(message) {
|
|
if (typeof message !== "object" || message === null)
|
|
return "object expected";
|
|
if (message.deprecated != null && message.hasOwnProperty("deprecated"))
|
|
if (typeof message.deprecated !== "boolean")
|
|
return "deprecated: boolean expected";
|
|
if (message.features != null && message.hasOwnProperty("features")) {
|
|
var error = $root.google.protobuf.FeatureSet.verify(message.features);
|
|
if (error) return "features." + error;
|
|
}
|
|
if (
|
|
message.debugRedact != null &&
|
|
message.hasOwnProperty("debugRedact")
|
|
)
|
|
if (typeof message.debugRedact !== "boolean")
|
|
return "debugRedact: boolean expected";
|
|
if (
|
|
message.featureSupport != null &&
|
|
message.hasOwnProperty("featureSupport")
|
|
) {
|
|
var error = $root.google.protobuf.FieldOptions.FeatureSupport.verify(
|
|
message.featureSupport
|
|
);
|
|
if (error) return "featureSupport." + error;
|
|
}
|
|
if (
|
|
message.uninterpretedOption != null &&
|
|
message.hasOwnProperty("uninterpretedOption")
|
|
) {
|
|
if (!Array.isArray(message.uninterpretedOption))
|
|
return "uninterpretedOption: array expected";
|
|
for (var i = 0; i < message.uninterpretedOption.length; ++i) {
|
|
var error = $root.google.protobuf.UninterpretedOption.verify(
|
|
message.uninterpretedOption[i]
|
|
);
|
|
if (error) return "uninterpretedOption." + error;
|
|
}
|
|
}
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof google.protobuf.EnumValueOptions
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {google.protobuf.EnumValueOptions} EnumValueOptions
|
|
*/
|
|
EnumValueOptions.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.google.protobuf.EnumValueOptions)
|
|
return object;
|
|
var message = new $root.google.protobuf.EnumValueOptions();
|
|
if (object.deprecated != null)
|
|
message.deprecated = Boolean(object.deprecated);
|
|
if (object.features != null) {
|
|
if (typeof object.features !== "object")
|
|
throw TypeError(
|
|
".google.protobuf.EnumValueOptions.features: object expected"
|
|
);
|
|
message.features = $root.google.protobuf.FeatureSet.fromObject(
|
|
object.features
|
|
);
|
|
}
|
|
if (object.debugRedact != null)
|
|
message.debugRedact = Boolean(object.debugRedact);
|
|
if (object.featureSupport != null) {
|
|
if (typeof object.featureSupport !== "object")
|
|
throw TypeError(
|
|
".google.protobuf.EnumValueOptions.featureSupport: object expected"
|
|
);
|
|
message.featureSupport =
|
|
$root.google.protobuf.FieldOptions.FeatureSupport.fromObject(
|
|
object.featureSupport
|
|
);
|
|
}
|
|
if (object.uninterpretedOption) {
|
|
if (!Array.isArray(object.uninterpretedOption))
|
|
throw TypeError(
|
|
".google.protobuf.EnumValueOptions.uninterpretedOption: array expected"
|
|
);
|
|
message.uninterpretedOption = [];
|
|
for (var i = 0; i < object.uninterpretedOption.length; ++i) {
|
|
if (typeof object.uninterpretedOption[i] !== "object")
|
|
throw TypeError(
|
|
".google.protobuf.EnumValueOptions.uninterpretedOption: object expected"
|
|
);
|
|
message.uninterpretedOption[i] =
|
|
$root.google.protobuf.UninterpretedOption.fromObject(
|
|
object.uninterpretedOption[i]
|
|
);
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof google.protobuf.EnumValueOptions
|
|
* @static
|
|
* @param {google.protobuf.EnumValueOptions} message EnumValueOptions
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
EnumValueOptions.toObject = function toObject(message, options) {
|
|
if (!options) options = {};
|
|
var object = {};
|
|
if (options.arrays || options.defaults) object.uninterpretedOption = [];
|
|
if (options.defaults) {
|
|
object.deprecated = false;
|
|
object.features = null;
|
|
object.debugRedact = false;
|
|
object.featureSupport = null;
|
|
}
|
|
if (message.deprecated != null && message.hasOwnProperty("deprecated"))
|
|
object.deprecated = message.deprecated;
|
|
if (message.features != null && message.hasOwnProperty("features"))
|
|
object.features = $root.google.protobuf.FeatureSet.toObject(
|
|
message.features,
|
|
options
|
|
);
|
|
if (
|
|
message.debugRedact != null &&
|
|
message.hasOwnProperty("debugRedact")
|
|
)
|
|
object.debugRedact = message.debugRedact;
|
|
if (
|
|
message.featureSupport != null &&
|
|
message.hasOwnProperty("featureSupport")
|
|
)
|
|
object.featureSupport =
|
|
$root.google.protobuf.FieldOptions.FeatureSupport.toObject(
|
|
message.featureSupport,
|
|
options
|
|
);
|
|
if (message.uninterpretedOption && message.uninterpretedOption.length) {
|
|
object.uninterpretedOption = [];
|
|
for (var j = 0; j < message.uninterpretedOption.length; ++j)
|
|
object.uninterpretedOption[j] =
|
|
$root.google.protobuf.UninterpretedOption.toObject(
|
|
message.uninterpretedOption[j],
|
|
options
|
|
);
|
|
}
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this EnumValueOptions to JSON.
|
|
* @function toJSON
|
|
* @memberof google.protobuf.EnumValueOptions
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
EnumValueOptions.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
/**
|
|
* Gets the default type url for EnumValueOptions
|
|
* @function getTypeUrl
|
|
* @memberof google.protobuf.EnumValueOptions
|
|
* @static
|
|
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
|
* @returns {string} The default type url
|
|
*/
|
|
EnumValueOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
if (typeUrlPrefix === undefined) {
|
|
typeUrlPrefix = "type.googleapis.com";
|
|
}
|
|
return typeUrlPrefix + "/google.protobuf.EnumValueOptions";
|
|
};
|
|
|
|
return EnumValueOptions;
|
|
})();
|
|
|
|
protobuf.ServiceOptions = (function () {
|
|
/**
|
|
* Properties of a ServiceOptions.
|
|
* @memberof google.protobuf
|
|
* @interface IServiceOptions
|
|
* @property {google.protobuf.IFeatureSet|null} [features] ServiceOptions features
|
|
* @property {boolean|null} [deprecated] ServiceOptions deprecated
|
|
* @property {Array.<google.protobuf.IUninterpretedOption>|null} [uninterpretedOption] ServiceOptions uninterpretedOption
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new ServiceOptions.
|
|
* @memberof google.protobuf
|
|
* @classdesc Represents a ServiceOptions.
|
|
* @implements IServiceOptions
|
|
* @constructor
|
|
* @param {google.protobuf.IServiceOptions=} [properties] Properties to set
|
|
*/
|
|
function ServiceOptions(properties) {
|
|
this.uninterpretedOption = [];
|
|
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]];
|
|
}
|
|
|
|
/**
|
|
* ServiceOptions features.
|
|
* @member {google.protobuf.IFeatureSet|null|undefined} features
|
|
* @memberof google.protobuf.ServiceOptions
|
|
* @instance
|
|
*/
|
|
ServiceOptions.prototype.features = null;
|
|
|
|
/**
|
|
* ServiceOptions deprecated.
|
|
* @member {boolean} deprecated
|
|
* @memberof google.protobuf.ServiceOptions
|
|
* @instance
|
|
*/
|
|
ServiceOptions.prototype.deprecated = false;
|
|
|
|
/**
|
|
* ServiceOptions uninterpretedOption.
|
|
* @member {Array.<google.protobuf.IUninterpretedOption>} uninterpretedOption
|
|
* @memberof google.protobuf.ServiceOptions
|
|
* @instance
|
|
*/
|
|
ServiceOptions.prototype.uninterpretedOption = $util.emptyArray;
|
|
|
|
/**
|
|
* Creates a new ServiceOptions instance using the specified properties.
|
|
* @function create
|
|
* @memberof google.protobuf.ServiceOptions
|
|
* @static
|
|
* @param {google.protobuf.IServiceOptions=} [properties] Properties to set
|
|
* @returns {google.protobuf.ServiceOptions} ServiceOptions instance
|
|
*/
|
|
ServiceOptions.create = function create(properties) {
|
|
return new ServiceOptions(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof google.protobuf.ServiceOptions
|
|
* @static
|
|
* @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
ServiceOptions.encode = function encode(message, writer) {
|
|
if (!writer) writer = $Writer.create();
|
|
if (
|
|
message.deprecated != null &&
|
|
Object.hasOwnProperty.call(message, "deprecated")
|
|
)
|
|
writer.uint32(/* id 33, wireType 0 =*/ 264).bool(message.deprecated);
|
|
if (
|
|
message.features != null &&
|
|
Object.hasOwnProperty.call(message, "features")
|
|
)
|
|
$root.google.protobuf.FeatureSet.encode(
|
|
message.features,
|
|
writer.uint32(/* id 34, wireType 2 =*/ 274).fork()
|
|
).ldelim();
|
|
if (
|
|
message.uninterpretedOption != null &&
|
|
message.uninterpretedOption.length
|
|
)
|
|
for (var i = 0; i < message.uninterpretedOption.length; ++i)
|
|
$root.google.protobuf.UninterpretedOption.encode(
|
|
message.uninterpretedOption[i],
|
|
writer.uint32(/* id 999, wireType 2 =*/ 7994).fork()
|
|
).ldelim();
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof google.protobuf.ServiceOptions
|
|
* @static
|
|
* @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
ServiceOptions.encodeDelimited = function encodeDelimited(
|
|
message,
|
|
writer
|
|
) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes a ServiceOptions message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof google.protobuf.ServiceOptions
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {google.protobuf.ServiceOptions} ServiceOptions
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
ServiceOptions.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.google.protobuf.ServiceOptions();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
if (tag === error) break;
|
|
switch (tag >>> 3) {
|
|
case 34: {
|
|
message.features = $root.google.protobuf.FeatureSet.decode(
|
|
reader,
|
|
reader.uint32()
|
|
);
|
|
break;
|
|
}
|
|
case 33: {
|
|
message.deprecated = reader.bool();
|
|
break;
|
|
}
|
|
case 999: {
|
|
if (
|
|
!(
|
|
message.uninterpretedOption &&
|
|
message.uninterpretedOption.length
|
|
)
|
|
)
|
|
message.uninterpretedOption = [];
|
|
message.uninterpretedOption.push(
|
|
$root.google.protobuf.UninterpretedOption.decode(
|
|
reader,
|
|
reader.uint32()
|
|
)
|
|
);
|
|
break;
|
|
}
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes a ServiceOptions message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof google.protobuf.ServiceOptions
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {google.protobuf.ServiceOptions} ServiceOptions
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
ServiceOptions.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader)) reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies a ServiceOptions message.
|
|
* @function verify
|
|
* @memberof google.protobuf.ServiceOptions
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
ServiceOptions.verify = function verify(message) {
|
|
if (typeof message !== "object" || message === null)
|
|
return "object expected";
|
|
if (message.features != null && message.hasOwnProperty("features")) {
|
|
var error = $root.google.protobuf.FeatureSet.verify(message.features);
|
|
if (error) return "features." + error;
|
|
}
|
|
if (message.deprecated != null && message.hasOwnProperty("deprecated"))
|
|
if (typeof message.deprecated !== "boolean")
|
|
return "deprecated: boolean expected";
|
|
if (
|
|
message.uninterpretedOption != null &&
|
|
message.hasOwnProperty("uninterpretedOption")
|
|
) {
|
|
if (!Array.isArray(message.uninterpretedOption))
|
|
return "uninterpretedOption: array expected";
|
|
for (var i = 0; i < message.uninterpretedOption.length; ++i) {
|
|
var error = $root.google.protobuf.UninterpretedOption.verify(
|
|
message.uninterpretedOption[i]
|
|
);
|
|
if (error) return "uninterpretedOption." + error;
|
|
}
|
|
}
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof google.protobuf.ServiceOptions
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {google.protobuf.ServiceOptions} ServiceOptions
|
|
*/
|
|
ServiceOptions.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.google.protobuf.ServiceOptions)
|
|
return object;
|
|
var message = new $root.google.protobuf.ServiceOptions();
|
|
if (object.features != null) {
|
|
if (typeof object.features !== "object")
|
|
throw TypeError(
|
|
".google.protobuf.ServiceOptions.features: object expected"
|
|
);
|
|
message.features = $root.google.protobuf.FeatureSet.fromObject(
|
|
object.features
|
|
);
|
|
}
|
|
if (object.deprecated != null)
|
|
message.deprecated = Boolean(object.deprecated);
|
|
if (object.uninterpretedOption) {
|
|
if (!Array.isArray(object.uninterpretedOption))
|
|
throw TypeError(
|
|
".google.protobuf.ServiceOptions.uninterpretedOption: array expected"
|
|
);
|
|
message.uninterpretedOption = [];
|
|
for (var i = 0; i < object.uninterpretedOption.length; ++i) {
|
|
if (typeof object.uninterpretedOption[i] !== "object")
|
|
throw TypeError(
|
|
".google.protobuf.ServiceOptions.uninterpretedOption: object expected"
|
|
);
|
|
message.uninterpretedOption[i] =
|
|
$root.google.protobuf.UninterpretedOption.fromObject(
|
|
object.uninterpretedOption[i]
|
|
);
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from a ServiceOptions message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof google.protobuf.ServiceOptions
|
|
* @static
|
|
* @param {google.protobuf.ServiceOptions} message ServiceOptions
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
ServiceOptions.toObject = function toObject(message, options) {
|
|
if (!options) options = {};
|
|
var object = {};
|
|
if (options.arrays || options.defaults) object.uninterpretedOption = [];
|
|
if (options.defaults) {
|
|
object.deprecated = false;
|
|
object.features = null;
|
|
}
|
|
if (message.deprecated != null && message.hasOwnProperty("deprecated"))
|
|
object.deprecated = message.deprecated;
|
|
if (message.features != null && message.hasOwnProperty("features"))
|
|
object.features = $root.google.protobuf.FeatureSet.toObject(
|
|
message.features,
|
|
options
|
|
);
|
|
if (message.uninterpretedOption && message.uninterpretedOption.length) {
|
|
object.uninterpretedOption = [];
|
|
for (var j = 0; j < message.uninterpretedOption.length; ++j)
|
|
object.uninterpretedOption[j] =
|
|
$root.google.protobuf.UninterpretedOption.toObject(
|
|
message.uninterpretedOption[j],
|
|
options
|
|
);
|
|
}
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this ServiceOptions to JSON.
|
|
* @function toJSON
|
|
* @memberof google.protobuf.ServiceOptions
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
ServiceOptions.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
/**
|
|
* Gets the default type url for ServiceOptions
|
|
* @function getTypeUrl
|
|
* @memberof google.protobuf.ServiceOptions
|
|
* @static
|
|
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
|
* @returns {string} The default type url
|
|
*/
|
|
ServiceOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
if (typeUrlPrefix === undefined) {
|
|
typeUrlPrefix = "type.googleapis.com";
|
|
}
|
|
return typeUrlPrefix + "/google.protobuf.ServiceOptions";
|
|
};
|
|
|
|
return ServiceOptions;
|
|
})();
|
|
|
|
protobuf.MethodOptions = (function () {
|
|
/**
|
|
* Properties of a MethodOptions.
|
|
* @memberof google.protobuf
|
|
* @interface IMethodOptions
|
|
* @property {boolean|null} [deprecated] MethodOptions deprecated
|
|
* @property {google.protobuf.MethodOptions.IdempotencyLevel|null} [idempotencyLevel] MethodOptions idempotencyLevel
|
|
* @property {google.protobuf.IFeatureSet|null} [features] MethodOptions features
|
|
* @property {Array.<google.protobuf.IUninterpretedOption>|null} [uninterpretedOption] MethodOptions uninterpretedOption
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new MethodOptions.
|
|
* @memberof google.protobuf
|
|
* @classdesc Represents a MethodOptions.
|
|
* @implements IMethodOptions
|
|
* @constructor
|
|
* @param {google.protobuf.IMethodOptions=} [properties] Properties to set
|
|
*/
|
|
function MethodOptions(properties) {
|
|
this.uninterpretedOption = [];
|
|
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]];
|
|
}
|
|
|
|
/**
|
|
* MethodOptions deprecated.
|
|
* @member {boolean} deprecated
|
|
* @memberof google.protobuf.MethodOptions
|
|
* @instance
|
|
*/
|
|
MethodOptions.prototype.deprecated = false;
|
|
|
|
/**
|
|
* MethodOptions idempotencyLevel.
|
|
* @member {google.protobuf.MethodOptions.IdempotencyLevel} idempotencyLevel
|
|
* @memberof google.protobuf.MethodOptions
|
|
* @instance
|
|
*/
|
|
MethodOptions.prototype.idempotencyLevel = 0;
|
|
|
|
/**
|
|
* MethodOptions features.
|
|
* @member {google.protobuf.IFeatureSet|null|undefined} features
|
|
* @memberof google.protobuf.MethodOptions
|
|
* @instance
|
|
*/
|
|
MethodOptions.prototype.features = null;
|
|
|
|
/**
|
|
* MethodOptions uninterpretedOption.
|
|
* @member {Array.<google.protobuf.IUninterpretedOption>} uninterpretedOption
|
|
* @memberof google.protobuf.MethodOptions
|
|
* @instance
|
|
*/
|
|
MethodOptions.prototype.uninterpretedOption = $util.emptyArray;
|
|
|
|
/**
|
|
* Creates a new MethodOptions instance using the specified properties.
|
|
* @function create
|
|
* @memberof google.protobuf.MethodOptions
|
|
* @static
|
|
* @param {google.protobuf.IMethodOptions=} [properties] Properties to set
|
|
* @returns {google.protobuf.MethodOptions} MethodOptions instance
|
|
*/
|
|
MethodOptions.create = function create(properties) {
|
|
return new MethodOptions(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof google.protobuf.MethodOptions
|
|
* @static
|
|
* @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
MethodOptions.encode = function encode(message, writer) {
|
|
if (!writer) writer = $Writer.create();
|
|
if (
|
|
message.deprecated != null &&
|
|
Object.hasOwnProperty.call(message, "deprecated")
|
|
)
|
|
writer.uint32(/* id 33, wireType 0 =*/ 264).bool(message.deprecated);
|
|
if (
|
|
message.idempotencyLevel != null &&
|
|
Object.hasOwnProperty.call(message, "idempotencyLevel")
|
|
)
|
|
writer
|
|
.uint32(/* id 34, wireType 0 =*/ 272)
|
|
.int32(message.idempotencyLevel);
|
|
if (
|
|
message.features != null &&
|
|
Object.hasOwnProperty.call(message, "features")
|
|
)
|
|
$root.google.protobuf.FeatureSet.encode(
|
|
message.features,
|
|
writer.uint32(/* id 35, wireType 2 =*/ 282).fork()
|
|
).ldelim();
|
|
if (
|
|
message.uninterpretedOption != null &&
|
|
message.uninterpretedOption.length
|
|
)
|
|
for (var i = 0; i < message.uninterpretedOption.length; ++i)
|
|
$root.google.protobuf.UninterpretedOption.encode(
|
|
message.uninterpretedOption[i],
|
|
writer.uint32(/* id 999, wireType 2 =*/ 7994).fork()
|
|
).ldelim();
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof google.protobuf.MethodOptions
|
|
* @static
|
|
* @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
MethodOptions.encodeDelimited = function encodeDelimited(
|
|
message,
|
|
writer
|
|
) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes a MethodOptions message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof google.protobuf.MethodOptions
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {google.protobuf.MethodOptions} MethodOptions
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
MethodOptions.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.google.protobuf.MethodOptions();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
if (tag === error) break;
|
|
switch (tag >>> 3) {
|
|
case 33: {
|
|
message.deprecated = reader.bool();
|
|
break;
|
|
}
|
|
case 34: {
|
|
message.idempotencyLevel = reader.int32();
|
|
break;
|
|
}
|
|
case 35: {
|
|
message.features = $root.google.protobuf.FeatureSet.decode(
|
|
reader,
|
|
reader.uint32()
|
|
);
|
|
break;
|
|
}
|
|
case 999: {
|
|
if (
|
|
!(
|
|
message.uninterpretedOption &&
|
|
message.uninterpretedOption.length
|
|
)
|
|
)
|
|
message.uninterpretedOption = [];
|
|
message.uninterpretedOption.push(
|
|
$root.google.protobuf.UninterpretedOption.decode(
|
|
reader,
|
|
reader.uint32()
|
|
)
|
|
);
|
|
break;
|
|
}
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes a MethodOptions message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof google.protobuf.MethodOptions
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {google.protobuf.MethodOptions} MethodOptions
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
MethodOptions.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader)) reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies a MethodOptions message.
|
|
* @function verify
|
|
* @memberof google.protobuf.MethodOptions
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
MethodOptions.verify = function verify(message) {
|
|
if (typeof message !== "object" || message === null)
|
|
return "object expected";
|
|
if (message.deprecated != null && message.hasOwnProperty("deprecated"))
|
|
if (typeof message.deprecated !== "boolean")
|
|
return "deprecated: boolean expected";
|
|
if (
|
|
message.idempotencyLevel != null &&
|
|
message.hasOwnProperty("idempotencyLevel")
|
|
)
|
|
switch (message.idempotencyLevel) {
|
|
default:
|
|
return "idempotencyLevel: enum value expected";
|
|
case 0:
|
|
case 1:
|
|
case 2:
|
|
break;
|
|
}
|
|
if (message.features != null && message.hasOwnProperty("features")) {
|
|
var error = $root.google.protobuf.FeatureSet.verify(message.features);
|
|
if (error) return "features." + error;
|
|
}
|
|
if (
|
|
message.uninterpretedOption != null &&
|
|
message.hasOwnProperty("uninterpretedOption")
|
|
) {
|
|
if (!Array.isArray(message.uninterpretedOption))
|
|
return "uninterpretedOption: array expected";
|
|
for (var i = 0; i < message.uninterpretedOption.length; ++i) {
|
|
var error = $root.google.protobuf.UninterpretedOption.verify(
|
|
message.uninterpretedOption[i]
|
|
);
|
|
if (error) return "uninterpretedOption." + error;
|
|
}
|
|
}
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates a MethodOptions message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof google.protobuf.MethodOptions
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {google.protobuf.MethodOptions} MethodOptions
|
|
*/
|
|
MethodOptions.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.google.protobuf.MethodOptions)
|
|
return object;
|
|
var message = new $root.google.protobuf.MethodOptions();
|
|
if (object.deprecated != null)
|
|
message.deprecated = Boolean(object.deprecated);
|
|
switch (object.idempotencyLevel) {
|
|
default:
|
|
if (typeof object.idempotencyLevel === "number") {
|
|
message.idempotencyLevel = object.idempotencyLevel;
|
|
break;
|
|
}
|
|
break;
|
|
case "IDEMPOTENCY_UNKNOWN":
|
|
case 0:
|
|
message.idempotencyLevel = 0;
|
|
break;
|
|
case "NO_SIDE_EFFECTS":
|
|
case 1:
|
|
message.idempotencyLevel = 1;
|
|
break;
|
|
case "IDEMPOTENT":
|
|
case 2:
|
|
message.idempotencyLevel = 2;
|
|
break;
|
|
}
|
|
if (object.features != null) {
|
|
if (typeof object.features !== "object")
|
|
throw TypeError(
|
|
".google.protobuf.MethodOptions.features: object expected"
|
|
);
|
|
message.features = $root.google.protobuf.FeatureSet.fromObject(
|
|
object.features
|
|
);
|
|
}
|
|
if (object.uninterpretedOption) {
|
|
if (!Array.isArray(object.uninterpretedOption))
|
|
throw TypeError(
|
|
".google.protobuf.MethodOptions.uninterpretedOption: array expected"
|
|
);
|
|
message.uninterpretedOption = [];
|
|
for (var i = 0; i < object.uninterpretedOption.length; ++i) {
|
|
if (typeof object.uninterpretedOption[i] !== "object")
|
|
throw TypeError(
|
|
".google.protobuf.MethodOptions.uninterpretedOption: object expected"
|
|
);
|
|
message.uninterpretedOption[i] =
|
|
$root.google.protobuf.UninterpretedOption.fromObject(
|
|
object.uninterpretedOption[i]
|
|
);
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from a MethodOptions message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof google.protobuf.MethodOptions
|
|
* @static
|
|
* @param {google.protobuf.MethodOptions} message MethodOptions
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
MethodOptions.toObject = function toObject(message, options) {
|
|
if (!options) options = {};
|
|
var object = {};
|
|
if (options.arrays || options.defaults) object.uninterpretedOption = [];
|
|
if (options.defaults) {
|
|
object.deprecated = false;
|
|
object.idempotencyLevel =
|
|
options.enums === String ? "IDEMPOTENCY_UNKNOWN" : 0;
|
|
object.features = null;
|
|
}
|
|
if (message.deprecated != null && message.hasOwnProperty("deprecated"))
|
|
object.deprecated = message.deprecated;
|
|
if (
|
|
message.idempotencyLevel != null &&
|
|
message.hasOwnProperty("idempotencyLevel")
|
|
)
|
|
object.idempotencyLevel =
|
|
options.enums === String
|
|
? $root.google.protobuf.MethodOptions.IdempotencyLevel[
|
|
message.idempotencyLevel
|
|
] === undefined
|
|
? message.idempotencyLevel
|
|
: $root.google.protobuf.MethodOptions.IdempotencyLevel[
|
|
message.idempotencyLevel
|
|
]
|
|
: message.idempotencyLevel;
|
|
if (message.features != null && message.hasOwnProperty("features"))
|
|
object.features = $root.google.protobuf.FeatureSet.toObject(
|
|
message.features,
|
|
options
|
|
);
|
|
if (message.uninterpretedOption && message.uninterpretedOption.length) {
|
|
object.uninterpretedOption = [];
|
|
for (var j = 0; j < message.uninterpretedOption.length; ++j)
|
|
object.uninterpretedOption[j] =
|
|
$root.google.protobuf.UninterpretedOption.toObject(
|
|
message.uninterpretedOption[j],
|
|
options
|
|
);
|
|
}
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this MethodOptions to JSON.
|
|
* @function toJSON
|
|
* @memberof google.protobuf.MethodOptions
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
MethodOptions.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
/**
|
|
* Gets the default type url for MethodOptions
|
|
* @function getTypeUrl
|
|
* @memberof google.protobuf.MethodOptions
|
|
* @static
|
|
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
|
* @returns {string} The default type url
|
|
*/
|
|
MethodOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
if (typeUrlPrefix === undefined) {
|
|
typeUrlPrefix = "type.googleapis.com";
|
|
}
|
|
return typeUrlPrefix + "/google.protobuf.MethodOptions";
|
|
};
|
|
|
|
/**
|
|
* IdempotencyLevel enum.
|
|
* @name google.protobuf.MethodOptions.IdempotencyLevel
|
|
* @enum {number}
|
|
* @property {number} IDEMPOTENCY_UNKNOWN=0 IDEMPOTENCY_UNKNOWN value
|
|
* @property {number} NO_SIDE_EFFECTS=1 NO_SIDE_EFFECTS value
|
|
* @property {number} IDEMPOTENT=2 IDEMPOTENT value
|
|
*/
|
|
MethodOptions.IdempotencyLevel = (function () {
|
|
var valuesById = {},
|
|
values = Object.create(valuesById);
|
|
values[(valuesById[0] = "IDEMPOTENCY_UNKNOWN")] = 0;
|
|
values[(valuesById[1] = "NO_SIDE_EFFECTS")] = 1;
|
|
values[(valuesById[2] = "IDEMPOTENT")] = 2;
|
|
return values;
|
|
})();
|
|
|
|
return MethodOptions;
|
|
})();
|
|
|
|
protobuf.UninterpretedOption = (function () {
|
|
/**
|
|
* Properties of an UninterpretedOption.
|
|
* @memberof google.protobuf
|
|
* @interface IUninterpretedOption
|
|
* @property {Array.<google.protobuf.UninterpretedOption.INamePart>|null} [name] UninterpretedOption name
|
|
* @property {string|null} [identifierValue] UninterpretedOption identifierValue
|
|
* @property {number|Long|null} [positiveIntValue] UninterpretedOption positiveIntValue
|
|
* @property {number|Long|null} [negativeIntValue] UninterpretedOption negativeIntValue
|
|
* @property {number|null} [doubleValue] UninterpretedOption doubleValue
|
|
* @property {Uint8Array|null} [stringValue] UninterpretedOption stringValue
|
|
* @property {string|null} [aggregateValue] UninterpretedOption aggregateValue
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new UninterpretedOption.
|
|
* @memberof google.protobuf
|
|
* @classdesc Represents an UninterpretedOption.
|
|
* @implements IUninterpretedOption
|
|
* @constructor
|
|
* @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set
|
|
*/
|
|
function UninterpretedOption(properties) {
|
|
this.name = [];
|
|
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]];
|
|
}
|
|
|
|
/**
|
|
* UninterpretedOption name.
|
|
* @member {Array.<google.protobuf.UninterpretedOption.INamePart>} name
|
|
* @memberof google.protobuf.UninterpretedOption
|
|
* @instance
|
|
*/
|
|
UninterpretedOption.prototype.name = $util.emptyArray;
|
|
|
|
/**
|
|
* UninterpretedOption identifierValue.
|
|
* @member {string} identifierValue
|
|
* @memberof google.protobuf.UninterpretedOption
|
|
* @instance
|
|
*/
|
|
UninterpretedOption.prototype.identifierValue = "";
|
|
|
|
/**
|
|
* UninterpretedOption positiveIntValue.
|
|
* @member {number|Long} positiveIntValue
|
|
* @memberof google.protobuf.UninterpretedOption
|
|
* @instance
|
|
*/
|
|
UninterpretedOption.prototype.positiveIntValue = $util.Long
|
|
? $util.Long.fromBits(0, 0, true)
|
|
: 0;
|
|
|
|
/**
|
|
* UninterpretedOption negativeIntValue.
|
|
* @member {number|Long} negativeIntValue
|
|
* @memberof google.protobuf.UninterpretedOption
|
|
* @instance
|
|
*/
|
|
UninterpretedOption.prototype.negativeIntValue = $util.Long
|
|
? $util.Long.fromBits(0, 0, false)
|
|
: 0;
|
|
|
|
/**
|
|
* UninterpretedOption doubleValue.
|
|
* @member {number} doubleValue
|
|
* @memberof google.protobuf.UninterpretedOption
|
|
* @instance
|
|
*/
|
|
UninterpretedOption.prototype.doubleValue = 0;
|
|
|
|
/**
|
|
* UninterpretedOption stringValue.
|
|
* @member {Uint8Array} stringValue
|
|
* @memberof google.protobuf.UninterpretedOption
|
|
* @instance
|
|
*/
|
|
UninterpretedOption.prototype.stringValue = $util.newBuffer([]);
|
|
|
|
/**
|
|
* UninterpretedOption aggregateValue.
|
|
* @member {string} aggregateValue
|
|
* @memberof google.protobuf.UninterpretedOption
|
|
* @instance
|
|
*/
|
|
UninterpretedOption.prototype.aggregateValue = "";
|
|
|
|
/**
|
|
* Creates a new UninterpretedOption instance using the specified properties.
|
|
* @function create
|
|
* @memberof google.protobuf.UninterpretedOption
|
|
* @static
|
|
* @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set
|
|
* @returns {google.protobuf.UninterpretedOption} UninterpretedOption instance
|
|
*/
|
|
UninterpretedOption.create = function create(properties) {
|
|
return new UninterpretedOption(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof google.protobuf.UninterpretedOption
|
|
* @static
|
|
* @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
UninterpretedOption.encode = function encode(message, writer) {
|
|
if (!writer) writer = $Writer.create();
|
|
if (message.name != null && message.name.length)
|
|
for (var i = 0; i < message.name.length; ++i)
|
|
$root.google.protobuf.UninterpretedOption.NamePart.encode(
|
|
message.name[i],
|
|
writer.uint32(/* id 2, wireType 2 =*/ 18).fork()
|
|
).ldelim();
|
|
if (
|
|
message.identifierValue != null &&
|
|
Object.hasOwnProperty.call(message, "identifierValue")
|
|
)
|
|
writer
|
|
.uint32(/* id 3, wireType 2 =*/ 26)
|
|
.string(message.identifierValue);
|
|
if (
|
|
message.positiveIntValue != null &&
|
|
Object.hasOwnProperty.call(message, "positiveIntValue")
|
|
)
|
|
writer
|
|
.uint32(/* id 4, wireType 0 =*/ 32)
|
|
.uint64(message.positiveIntValue);
|
|
if (
|
|
message.negativeIntValue != null &&
|
|
Object.hasOwnProperty.call(message, "negativeIntValue")
|
|
)
|
|
writer
|
|
.uint32(/* id 5, wireType 0 =*/ 40)
|
|
.int64(message.negativeIntValue);
|
|
if (
|
|
message.doubleValue != null &&
|
|
Object.hasOwnProperty.call(message, "doubleValue")
|
|
)
|
|
writer.uint32(/* id 6, wireType 1 =*/ 49).double(message.doubleValue);
|
|
if (
|
|
message.stringValue != null &&
|
|
Object.hasOwnProperty.call(message, "stringValue")
|
|
)
|
|
writer.uint32(/* id 7, wireType 2 =*/ 58).bytes(message.stringValue);
|
|
if (
|
|
message.aggregateValue != null &&
|
|
Object.hasOwnProperty.call(message, "aggregateValue")
|
|
)
|
|
writer
|
|
.uint32(/* id 8, wireType 2 =*/ 66)
|
|
.string(message.aggregateValue);
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof google.protobuf.UninterpretedOption
|
|
* @static
|
|
* @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
UninterpretedOption.encodeDelimited = function encodeDelimited(
|
|
message,
|
|
writer
|
|
) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes an UninterpretedOption message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof google.protobuf.UninterpretedOption
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {google.protobuf.UninterpretedOption} UninterpretedOption
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
UninterpretedOption.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.google.protobuf.UninterpretedOption();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
if (tag === error) break;
|
|
switch (tag >>> 3) {
|
|
case 2: {
|
|
if (!(message.name && message.name.length)) message.name = [];
|
|
message.name.push(
|
|
$root.google.protobuf.UninterpretedOption.NamePart.decode(
|
|
reader,
|
|
reader.uint32()
|
|
)
|
|
);
|
|
break;
|
|
}
|
|
case 3: {
|
|
message.identifierValue = reader.string();
|
|
break;
|
|
}
|
|
case 4: {
|
|
message.positiveIntValue = reader.uint64();
|
|
break;
|
|
}
|
|
case 5: {
|
|
message.negativeIntValue = reader.int64();
|
|
break;
|
|
}
|
|
case 6: {
|
|
message.doubleValue = reader.double();
|
|
break;
|
|
}
|
|
case 7: {
|
|
message.stringValue = reader.bytes();
|
|
break;
|
|
}
|
|
case 8: {
|
|
message.aggregateValue = reader.string();
|
|
break;
|
|
}
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes an UninterpretedOption message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof google.protobuf.UninterpretedOption
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {google.protobuf.UninterpretedOption} UninterpretedOption
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
UninterpretedOption.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader)) reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies an UninterpretedOption message.
|
|
* @function verify
|
|
* @memberof google.protobuf.UninterpretedOption
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
UninterpretedOption.verify = function verify(message) {
|
|
if (typeof message !== "object" || message === null)
|
|
return "object expected";
|
|
if (message.name != null && message.hasOwnProperty("name")) {
|
|
if (!Array.isArray(message.name)) return "name: array expected";
|
|
for (var i = 0; i < message.name.length; ++i) {
|
|
var error =
|
|
$root.google.protobuf.UninterpretedOption.NamePart.verify(
|
|
message.name[i]
|
|
);
|
|
if (error) return "name." + error;
|
|
}
|
|
}
|
|
if (
|
|
message.identifierValue != null &&
|
|
message.hasOwnProperty("identifierValue")
|
|
)
|
|
if (!$util.isString(message.identifierValue))
|
|
return "identifierValue: string expected";
|
|
if (
|
|
message.positiveIntValue != null &&
|
|
message.hasOwnProperty("positiveIntValue")
|
|
)
|
|
if (
|
|
!$util.isInteger(message.positiveIntValue) &&
|
|
!(
|
|
message.positiveIntValue &&
|
|
$util.isInteger(message.positiveIntValue.low) &&
|
|
$util.isInteger(message.positiveIntValue.high)
|
|
)
|
|
)
|
|
return "positiveIntValue: integer|Long expected";
|
|
if (
|
|
message.negativeIntValue != null &&
|
|
message.hasOwnProperty("negativeIntValue")
|
|
)
|
|
if (
|
|
!$util.isInteger(message.negativeIntValue) &&
|
|
!(
|
|
message.negativeIntValue &&
|
|
$util.isInteger(message.negativeIntValue.low) &&
|
|
$util.isInteger(message.negativeIntValue.high)
|
|
)
|
|
)
|
|
return "negativeIntValue: integer|Long expected";
|
|
if (
|
|
message.doubleValue != null &&
|
|
message.hasOwnProperty("doubleValue")
|
|
)
|
|
if (typeof message.doubleValue !== "number")
|
|
return "doubleValue: number expected";
|
|
if (
|
|
message.stringValue != null &&
|
|
message.hasOwnProperty("stringValue")
|
|
)
|
|
if (
|
|
!(
|
|
(message.stringValue &&
|
|
typeof message.stringValue.length === "number") ||
|
|
$util.isString(message.stringValue)
|
|
)
|
|
)
|
|
return "stringValue: buffer expected";
|
|
if (
|
|
message.aggregateValue != null &&
|
|
message.hasOwnProperty("aggregateValue")
|
|
)
|
|
if (!$util.isString(message.aggregateValue))
|
|
return "aggregateValue: string expected";
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof google.protobuf.UninterpretedOption
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {google.protobuf.UninterpretedOption} UninterpretedOption
|
|
*/
|
|
UninterpretedOption.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.google.protobuf.UninterpretedOption)
|
|
return object;
|
|
var message = new $root.google.protobuf.UninterpretedOption();
|
|
if (object.name) {
|
|
if (!Array.isArray(object.name))
|
|
throw TypeError(
|
|
".google.protobuf.UninterpretedOption.name: array expected"
|
|
);
|
|
message.name = [];
|
|
for (var i = 0; i < object.name.length; ++i) {
|
|
if (typeof object.name[i] !== "object")
|
|
throw TypeError(
|
|
".google.protobuf.UninterpretedOption.name: object expected"
|
|
);
|
|
message.name[i] =
|
|
$root.google.protobuf.UninterpretedOption.NamePart.fromObject(
|
|
object.name[i]
|
|
);
|
|
}
|
|
}
|
|
if (object.identifierValue != null)
|
|
message.identifierValue = String(object.identifierValue);
|
|
if (object.positiveIntValue != null)
|
|
if ($util.Long)
|
|
(message.positiveIntValue = $util.Long.fromValue(
|
|
object.positiveIntValue
|
|
)).unsigned = true;
|
|
else if (typeof object.positiveIntValue === "string")
|
|
message.positiveIntValue = parseInt(object.positiveIntValue, 10);
|
|
else if (typeof object.positiveIntValue === "number")
|
|
message.positiveIntValue = object.positiveIntValue;
|
|
else if (typeof object.positiveIntValue === "object")
|
|
message.positiveIntValue = new $util.LongBits(
|
|
object.positiveIntValue.low >>> 0,
|
|
object.positiveIntValue.high >>> 0
|
|
).toNumber(true);
|
|
if (object.negativeIntValue != null)
|
|
if ($util.Long)
|
|
(message.negativeIntValue = $util.Long.fromValue(
|
|
object.negativeIntValue
|
|
)).unsigned = false;
|
|
else if (typeof object.negativeIntValue === "string")
|
|
message.negativeIntValue = parseInt(object.negativeIntValue, 10);
|
|
else if (typeof object.negativeIntValue === "number")
|
|
message.negativeIntValue = object.negativeIntValue;
|
|
else if (typeof object.negativeIntValue === "object")
|
|
message.negativeIntValue = new $util.LongBits(
|
|
object.negativeIntValue.low >>> 0,
|
|
object.negativeIntValue.high >>> 0
|
|
).toNumber();
|
|
if (object.doubleValue != null)
|
|
message.doubleValue = Number(object.doubleValue);
|
|
if (object.stringValue != null)
|
|
if (typeof object.stringValue === "string")
|
|
$util.base64.decode(
|
|
object.stringValue,
|
|
(message.stringValue = $util.newBuffer(
|
|
$util.base64.length(object.stringValue)
|
|
)),
|
|
0
|
|
);
|
|
else if (object.stringValue.length >= 0)
|
|
message.stringValue = object.stringValue;
|
|
if (object.aggregateValue != null)
|
|
message.aggregateValue = String(object.aggregateValue);
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof google.protobuf.UninterpretedOption
|
|
* @static
|
|
* @param {google.protobuf.UninterpretedOption} message UninterpretedOption
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
UninterpretedOption.toObject = function toObject(message, options) {
|
|
if (!options) options = {};
|
|
var object = {};
|
|
if (options.arrays || options.defaults) object.name = [];
|
|
if (options.defaults) {
|
|
object.identifierValue = "";
|
|
if ($util.Long) {
|
|
var long = new $util.Long(0, 0, true);
|
|
object.positiveIntValue =
|
|
options.longs === String
|
|
? long.toString()
|
|
: options.longs === Number
|
|
? long.toNumber()
|
|
: long;
|
|
} else object.positiveIntValue = options.longs === String ? "0" : 0;
|
|
if ($util.Long) {
|
|
var long = new $util.Long(0, 0, false);
|
|
object.negativeIntValue =
|
|
options.longs === String
|
|
? long.toString()
|
|
: options.longs === Number
|
|
? long.toNumber()
|
|
: long;
|
|
} else object.negativeIntValue = options.longs === String ? "0" : 0;
|
|
object.doubleValue = 0;
|
|
if (options.bytes === String) object.stringValue = "";
|
|
else {
|
|
object.stringValue = [];
|
|
if (options.bytes !== Array)
|
|
object.stringValue = $util.newBuffer(object.stringValue);
|
|
}
|
|
object.aggregateValue = "";
|
|
}
|
|
if (message.name && message.name.length) {
|
|
object.name = [];
|
|
for (var j = 0; j < message.name.length; ++j)
|
|
object.name[j] =
|
|
$root.google.protobuf.UninterpretedOption.NamePart.toObject(
|
|
message.name[j],
|
|
options
|
|
);
|
|
}
|
|
if (
|
|
message.identifierValue != null &&
|
|
message.hasOwnProperty("identifierValue")
|
|
)
|
|
object.identifierValue = message.identifierValue;
|
|
if (
|
|
message.positiveIntValue != null &&
|
|
message.hasOwnProperty("positiveIntValue")
|
|
)
|
|
if (typeof message.positiveIntValue === "number")
|
|
object.positiveIntValue =
|
|
options.longs === String
|
|
? String(message.positiveIntValue)
|
|
: message.positiveIntValue;
|
|
else
|
|
object.positiveIntValue =
|
|
options.longs === String
|
|
? $util.Long.prototype.toString.call(message.positiveIntValue)
|
|
: options.longs === Number
|
|
? new $util.LongBits(
|
|
message.positiveIntValue.low >>> 0,
|
|
message.positiveIntValue.high >>> 0
|
|
).toNumber(true)
|
|
: message.positiveIntValue;
|
|
if (
|
|
message.negativeIntValue != null &&
|
|
message.hasOwnProperty("negativeIntValue")
|
|
)
|
|
if (typeof message.negativeIntValue === "number")
|
|
object.negativeIntValue =
|
|
options.longs === String
|
|
? String(message.negativeIntValue)
|
|
: message.negativeIntValue;
|
|
else
|
|
object.negativeIntValue =
|
|
options.longs === String
|
|
? $util.Long.prototype.toString.call(message.negativeIntValue)
|
|
: options.longs === Number
|
|
? new $util.LongBits(
|
|
message.negativeIntValue.low >>> 0,
|
|
message.negativeIntValue.high >>> 0
|
|
).toNumber()
|
|
: message.negativeIntValue;
|
|
if (
|
|
message.doubleValue != null &&
|
|
message.hasOwnProperty("doubleValue")
|
|
)
|
|
object.doubleValue =
|
|
options.json && !isFinite(message.doubleValue)
|
|
? String(message.doubleValue)
|
|
: message.doubleValue;
|
|
if (
|
|
message.stringValue != null &&
|
|
message.hasOwnProperty("stringValue")
|
|
)
|
|
object.stringValue =
|
|
options.bytes === String
|
|
? $util.base64.encode(
|
|
message.stringValue,
|
|
0,
|
|
message.stringValue.length
|
|
)
|
|
: options.bytes === Array
|
|
? Array.prototype.slice.call(message.stringValue)
|
|
: message.stringValue;
|
|
if (
|
|
message.aggregateValue != null &&
|
|
message.hasOwnProperty("aggregateValue")
|
|
)
|
|
object.aggregateValue = message.aggregateValue;
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this UninterpretedOption to JSON.
|
|
* @function toJSON
|
|
* @memberof google.protobuf.UninterpretedOption
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
UninterpretedOption.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
/**
|
|
* Gets the default type url for UninterpretedOption
|
|
* @function getTypeUrl
|
|
* @memberof google.protobuf.UninterpretedOption
|
|
* @static
|
|
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
|
* @returns {string} The default type url
|
|
*/
|
|
UninterpretedOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
if (typeUrlPrefix === undefined) {
|
|
typeUrlPrefix = "type.googleapis.com";
|
|
}
|
|
return typeUrlPrefix + "/google.protobuf.UninterpretedOption";
|
|
};
|
|
|
|
UninterpretedOption.NamePart = (function () {
|
|
/**
|
|
* Properties of a NamePart.
|
|
* @memberof google.protobuf.UninterpretedOption
|
|
* @interface INamePart
|
|
* @property {string} namePart NamePart namePart
|
|
* @property {boolean} isExtension NamePart isExtension
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new NamePart.
|
|
* @memberof google.protobuf.UninterpretedOption
|
|
* @classdesc Represents a NamePart.
|
|
* @implements INamePart
|
|
* @constructor
|
|
* @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set
|
|
*/
|
|
function NamePart(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]];
|
|
}
|
|
|
|
/**
|
|
* NamePart namePart.
|
|
* @member {string} namePart
|
|
* @memberof google.protobuf.UninterpretedOption.NamePart
|
|
* @instance
|
|
*/
|
|
NamePart.prototype.namePart = "";
|
|
|
|
/**
|
|
* NamePart isExtension.
|
|
* @member {boolean} isExtension
|
|
* @memberof google.protobuf.UninterpretedOption.NamePart
|
|
* @instance
|
|
*/
|
|
NamePart.prototype.isExtension = false;
|
|
|
|
/**
|
|
* Creates a new NamePart instance using the specified properties.
|
|
* @function create
|
|
* @memberof google.protobuf.UninterpretedOption.NamePart
|
|
* @static
|
|
* @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set
|
|
* @returns {google.protobuf.UninterpretedOption.NamePart} NamePart instance
|
|
*/
|
|
NamePart.create = function create(properties) {
|
|
return new NamePart(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof google.protobuf.UninterpretedOption.NamePart
|
|
* @static
|
|
* @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
NamePart.encode = function encode(message, writer) {
|
|
if (!writer) writer = $Writer.create();
|
|
writer.uint32(/* id 1, wireType 2 =*/ 10).string(message.namePart);
|
|
writer.uint32(/* id 2, wireType 0 =*/ 16).bool(message.isExtension);
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof google.protobuf.UninterpretedOption.NamePart
|
|
* @static
|
|
* @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
NamePart.encodeDelimited = function encodeDelimited(message, writer) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes a NamePart message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof google.protobuf.UninterpretedOption.NamePart
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {google.protobuf.UninterpretedOption.NamePart} NamePart
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
NamePart.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.google.protobuf.UninterpretedOption.NamePart();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
if (tag === error) break;
|
|
switch (tag >>> 3) {
|
|
case 1: {
|
|
message.namePart = reader.string();
|
|
break;
|
|
}
|
|
case 2: {
|
|
message.isExtension = reader.bool();
|
|
break;
|
|
}
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
if (!message.hasOwnProperty("namePart"))
|
|
throw $util.ProtocolError("missing required 'namePart'", {
|
|
instance: message,
|
|
});
|
|
if (!message.hasOwnProperty("isExtension"))
|
|
throw $util.ProtocolError("missing required 'isExtension'", {
|
|
instance: message,
|
|
});
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes a NamePart message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof google.protobuf.UninterpretedOption.NamePart
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {google.protobuf.UninterpretedOption.NamePart} NamePart
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
NamePart.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader)) reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies a NamePart message.
|
|
* @function verify
|
|
* @memberof google.protobuf.UninterpretedOption.NamePart
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
NamePart.verify = function verify(message) {
|
|
if (typeof message !== "object" || message === null)
|
|
return "object expected";
|
|
if (!$util.isString(message.namePart))
|
|
return "namePart: string expected";
|
|
if (typeof message.isExtension !== "boolean")
|
|
return "isExtension: boolean expected";
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates a NamePart message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof google.protobuf.UninterpretedOption.NamePart
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {google.protobuf.UninterpretedOption.NamePart} NamePart
|
|
*/
|
|
NamePart.fromObject = function fromObject(object) {
|
|
if (
|
|
object instanceof $root.google.protobuf.UninterpretedOption.NamePart
|
|
)
|
|
return object;
|
|
var message =
|
|
new $root.google.protobuf.UninterpretedOption.NamePart();
|
|
if (object.namePart != null)
|
|
message.namePart = String(object.namePart);
|
|
if (object.isExtension != null)
|
|
message.isExtension = Boolean(object.isExtension);
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from a NamePart message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof google.protobuf.UninterpretedOption.NamePart
|
|
* @static
|
|
* @param {google.protobuf.UninterpretedOption.NamePart} message NamePart
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
NamePart.toObject = function toObject(message, options) {
|
|
if (!options) options = {};
|
|
var object = {};
|
|
if (options.defaults) {
|
|
object.namePart = "";
|
|
object.isExtension = false;
|
|
}
|
|
if (message.namePart != null && message.hasOwnProperty("namePart"))
|
|
object.namePart = message.namePart;
|
|
if (
|
|
message.isExtension != null &&
|
|
message.hasOwnProperty("isExtension")
|
|
)
|
|
object.isExtension = message.isExtension;
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this NamePart to JSON.
|
|
* @function toJSON
|
|
* @memberof google.protobuf.UninterpretedOption.NamePart
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
NamePart.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
/**
|
|
* Gets the default type url for NamePart
|
|
* @function getTypeUrl
|
|
* @memberof google.protobuf.UninterpretedOption.NamePart
|
|
* @static
|
|
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
|
* @returns {string} The default type url
|
|
*/
|
|
NamePart.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
if (typeUrlPrefix === undefined) {
|
|
typeUrlPrefix = "type.googleapis.com";
|
|
}
|
|
return (
|
|
typeUrlPrefix + "/google.protobuf.UninterpretedOption.NamePart"
|
|
);
|
|
};
|
|
|
|
return NamePart;
|
|
})();
|
|
|
|
return UninterpretedOption;
|
|
})();
|
|
|
|
protobuf.FeatureSet = (function () {
|
|
/**
|
|
* Properties of a FeatureSet.
|
|
* @memberof google.protobuf
|
|
* @interface IFeatureSet
|
|
* @property {google.protobuf.FeatureSet.FieldPresence|null} [fieldPresence] FeatureSet fieldPresence
|
|
* @property {google.protobuf.FeatureSet.EnumType|null} [enumType] FeatureSet enumType
|
|
* @property {google.protobuf.FeatureSet.RepeatedFieldEncoding|null} [repeatedFieldEncoding] FeatureSet repeatedFieldEncoding
|
|
* @property {google.protobuf.FeatureSet.Utf8Validation|null} [utf8Validation] FeatureSet utf8Validation
|
|
* @property {google.protobuf.FeatureSet.MessageEncoding|null} [messageEncoding] FeatureSet messageEncoding
|
|
* @property {google.protobuf.FeatureSet.JsonFormat|null} [jsonFormat] FeatureSet jsonFormat
|
|
* @property {google.protobuf.FeatureSet.EnforceNamingStyle|null} [enforceNamingStyle] FeatureSet enforceNamingStyle
|
|
* @property {google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility|null} [defaultSymbolVisibility] FeatureSet defaultSymbolVisibility
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new FeatureSet.
|
|
* @memberof google.protobuf
|
|
* @classdesc Represents a FeatureSet.
|
|
* @implements IFeatureSet
|
|
* @constructor
|
|
* @param {google.protobuf.IFeatureSet=} [properties] Properties to set
|
|
*/
|
|
function FeatureSet(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]];
|
|
}
|
|
|
|
/**
|
|
* FeatureSet fieldPresence.
|
|
* @member {google.protobuf.FeatureSet.FieldPresence} fieldPresence
|
|
* @memberof google.protobuf.FeatureSet
|
|
* @instance
|
|
*/
|
|
FeatureSet.prototype.fieldPresence = 0;
|
|
|
|
/**
|
|
* FeatureSet enumType.
|
|
* @member {google.protobuf.FeatureSet.EnumType} enumType
|
|
* @memberof google.protobuf.FeatureSet
|
|
* @instance
|
|
*/
|
|
FeatureSet.prototype.enumType = 0;
|
|
|
|
/**
|
|
* FeatureSet repeatedFieldEncoding.
|
|
* @member {google.protobuf.FeatureSet.RepeatedFieldEncoding} repeatedFieldEncoding
|
|
* @memberof google.protobuf.FeatureSet
|
|
* @instance
|
|
*/
|
|
FeatureSet.prototype.repeatedFieldEncoding = 0;
|
|
|
|
/**
|
|
* FeatureSet utf8Validation.
|
|
* @member {google.protobuf.FeatureSet.Utf8Validation} utf8Validation
|
|
* @memberof google.protobuf.FeatureSet
|
|
* @instance
|
|
*/
|
|
FeatureSet.prototype.utf8Validation = 0;
|
|
|
|
/**
|
|
* FeatureSet messageEncoding.
|
|
* @member {google.protobuf.FeatureSet.MessageEncoding} messageEncoding
|
|
* @memberof google.protobuf.FeatureSet
|
|
* @instance
|
|
*/
|
|
FeatureSet.prototype.messageEncoding = 0;
|
|
|
|
/**
|
|
* FeatureSet jsonFormat.
|
|
* @member {google.protobuf.FeatureSet.JsonFormat} jsonFormat
|
|
* @memberof google.protobuf.FeatureSet
|
|
* @instance
|
|
*/
|
|
FeatureSet.prototype.jsonFormat = 0;
|
|
|
|
/**
|
|
* FeatureSet enforceNamingStyle.
|
|
* @member {google.protobuf.FeatureSet.EnforceNamingStyle} enforceNamingStyle
|
|
* @memberof google.protobuf.FeatureSet
|
|
* @instance
|
|
*/
|
|
FeatureSet.prototype.enforceNamingStyle = 0;
|
|
|
|
/**
|
|
* FeatureSet defaultSymbolVisibility.
|
|
* @member {google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility} defaultSymbolVisibility
|
|
* @memberof google.protobuf.FeatureSet
|
|
* @instance
|
|
*/
|
|
FeatureSet.prototype.defaultSymbolVisibility = 0;
|
|
|
|
/**
|
|
* Creates a new FeatureSet instance using the specified properties.
|
|
* @function create
|
|
* @memberof google.protobuf.FeatureSet
|
|
* @static
|
|
* @param {google.protobuf.IFeatureSet=} [properties] Properties to set
|
|
* @returns {google.protobuf.FeatureSet} FeatureSet instance
|
|
*/
|
|
FeatureSet.create = function create(properties) {
|
|
return new FeatureSet(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof google.protobuf.FeatureSet
|
|
* @static
|
|
* @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
FeatureSet.encode = function encode(message, writer) {
|
|
if (!writer) writer = $Writer.create();
|
|
if (
|
|
message.fieldPresence != null &&
|
|
Object.hasOwnProperty.call(message, "fieldPresence")
|
|
)
|
|
writer.uint32(/* id 1, wireType 0 =*/ 8).int32(message.fieldPresence);
|
|
if (
|
|
message.enumType != null &&
|
|
Object.hasOwnProperty.call(message, "enumType")
|
|
)
|
|
writer.uint32(/* id 2, wireType 0 =*/ 16).int32(message.enumType);
|
|
if (
|
|
message.repeatedFieldEncoding != null &&
|
|
Object.hasOwnProperty.call(message, "repeatedFieldEncoding")
|
|
)
|
|
writer
|
|
.uint32(/* id 3, wireType 0 =*/ 24)
|
|
.int32(message.repeatedFieldEncoding);
|
|
if (
|
|
message.utf8Validation != null &&
|
|
Object.hasOwnProperty.call(message, "utf8Validation")
|
|
)
|
|
writer
|
|
.uint32(/* id 4, wireType 0 =*/ 32)
|
|
.int32(message.utf8Validation);
|
|
if (
|
|
message.messageEncoding != null &&
|
|
Object.hasOwnProperty.call(message, "messageEncoding")
|
|
)
|
|
writer
|
|
.uint32(/* id 5, wireType 0 =*/ 40)
|
|
.int32(message.messageEncoding);
|
|
if (
|
|
message.jsonFormat != null &&
|
|
Object.hasOwnProperty.call(message, "jsonFormat")
|
|
)
|
|
writer.uint32(/* id 6, wireType 0 =*/ 48).int32(message.jsonFormat);
|
|
if (
|
|
message.enforceNamingStyle != null &&
|
|
Object.hasOwnProperty.call(message, "enforceNamingStyle")
|
|
)
|
|
writer
|
|
.uint32(/* id 7, wireType 0 =*/ 56)
|
|
.int32(message.enforceNamingStyle);
|
|
if (
|
|
message.defaultSymbolVisibility != null &&
|
|
Object.hasOwnProperty.call(message, "defaultSymbolVisibility")
|
|
)
|
|
writer
|
|
.uint32(/* id 8, wireType 0 =*/ 64)
|
|
.int32(message.defaultSymbolVisibility);
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof google.protobuf.FeatureSet
|
|
* @static
|
|
* @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
FeatureSet.encodeDelimited = function encodeDelimited(message, writer) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes a FeatureSet message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof google.protobuf.FeatureSet
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {google.protobuf.FeatureSet} FeatureSet
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
FeatureSet.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.google.protobuf.FeatureSet();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
if (tag === error) break;
|
|
switch (tag >>> 3) {
|
|
case 1: {
|
|
message.fieldPresence = reader.int32();
|
|
break;
|
|
}
|
|
case 2: {
|
|
message.enumType = reader.int32();
|
|
break;
|
|
}
|
|
case 3: {
|
|
message.repeatedFieldEncoding = reader.int32();
|
|
break;
|
|
}
|
|
case 4: {
|
|
message.utf8Validation = reader.int32();
|
|
break;
|
|
}
|
|
case 5: {
|
|
message.messageEncoding = reader.int32();
|
|
break;
|
|
}
|
|
case 6: {
|
|
message.jsonFormat = reader.int32();
|
|
break;
|
|
}
|
|
case 7: {
|
|
message.enforceNamingStyle = reader.int32();
|
|
break;
|
|
}
|
|
case 8: {
|
|
message.defaultSymbolVisibility = reader.int32();
|
|
break;
|
|
}
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes a FeatureSet message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof google.protobuf.FeatureSet
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {google.protobuf.FeatureSet} FeatureSet
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
FeatureSet.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader)) reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies a FeatureSet message.
|
|
* @function verify
|
|
* @memberof google.protobuf.FeatureSet
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
FeatureSet.verify = function verify(message) {
|
|
if (typeof message !== "object" || message === null)
|
|
return "object expected";
|
|
if (
|
|
message.fieldPresence != null &&
|
|
message.hasOwnProperty("fieldPresence")
|
|
)
|
|
switch (message.fieldPresence) {
|
|
default:
|
|
return "fieldPresence: enum value expected";
|
|
case 0:
|
|
case 1:
|
|
case 2:
|
|
case 3:
|
|
break;
|
|
}
|
|
if (message.enumType != null && message.hasOwnProperty("enumType"))
|
|
switch (message.enumType) {
|
|
default:
|
|
return "enumType: enum value expected";
|
|
case 0:
|
|
case 1:
|
|
case 2:
|
|
break;
|
|
}
|
|
if (
|
|
message.repeatedFieldEncoding != null &&
|
|
message.hasOwnProperty("repeatedFieldEncoding")
|
|
)
|
|
switch (message.repeatedFieldEncoding) {
|
|
default:
|
|
return "repeatedFieldEncoding: enum value expected";
|
|
case 0:
|
|
case 1:
|
|
case 2:
|
|
break;
|
|
}
|
|
if (
|
|
message.utf8Validation != null &&
|
|
message.hasOwnProperty("utf8Validation")
|
|
)
|
|
switch (message.utf8Validation) {
|
|
default:
|
|
return "utf8Validation: enum value expected";
|
|
case 0:
|
|
case 2:
|
|
case 3:
|
|
break;
|
|
}
|
|
if (
|
|
message.messageEncoding != null &&
|
|
message.hasOwnProperty("messageEncoding")
|
|
)
|
|
switch (message.messageEncoding) {
|
|
default:
|
|
return "messageEncoding: enum value expected";
|
|
case 0:
|
|
case 1:
|
|
case 2:
|
|
break;
|
|
}
|
|
if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat"))
|
|
switch (message.jsonFormat) {
|
|
default:
|
|
return "jsonFormat: enum value expected";
|
|
case 0:
|
|
case 1:
|
|
case 2:
|
|
break;
|
|
}
|
|
if (
|
|
message.enforceNamingStyle != null &&
|
|
message.hasOwnProperty("enforceNamingStyle")
|
|
)
|
|
switch (message.enforceNamingStyle) {
|
|
default:
|
|
return "enforceNamingStyle: enum value expected";
|
|
case 0:
|
|
case 1:
|
|
case 2:
|
|
break;
|
|
}
|
|
if (
|
|
message.defaultSymbolVisibility != null &&
|
|
message.hasOwnProperty("defaultSymbolVisibility")
|
|
)
|
|
switch (message.defaultSymbolVisibility) {
|
|
default:
|
|
return "defaultSymbolVisibility: enum value expected";
|
|
case 0:
|
|
case 1:
|
|
case 2:
|
|
case 3:
|
|
case 4:
|
|
break;
|
|
}
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates a FeatureSet message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof google.protobuf.FeatureSet
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {google.protobuf.FeatureSet} FeatureSet
|
|
*/
|
|
FeatureSet.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.google.protobuf.FeatureSet) return object;
|
|
var message = new $root.google.protobuf.FeatureSet();
|
|
switch (object.fieldPresence) {
|
|
default:
|
|
if (typeof object.fieldPresence === "number") {
|
|
message.fieldPresence = object.fieldPresence;
|
|
break;
|
|
}
|
|
break;
|
|
case "FIELD_PRESENCE_UNKNOWN":
|
|
case 0:
|
|
message.fieldPresence = 0;
|
|
break;
|
|
case "EXPLICIT":
|
|
case 1:
|
|
message.fieldPresence = 1;
|
|
break;
|
|
case "IMPLICIT":
|
|
case 2:
|
|
message.fieldPresence = 2;
|
|
break;
|
|
case "LEGACY_REQUIRED":
|
|
case 3:
|
|
message.fieldPresence = 3;
|
|
break;
|
|
}
|
|
switch (object.enumType) {
|
|
default:
|
|
if (typeof object.enumType === "number") {
|
|
message.enumType = object.enumType;
|
|
break;
|
|
}
|
|
break;
|
|
case "ENUM_TYPE_UNKNOWN":
|
|
case 0:
|
|
message.enumType = 0;
|
|
break;
|
|
case "OPEN":
|
|
case 1:
|
|
message.enumType = 1;
|
|
break;
|
|
case "CLOSED":
|
|
case 2:
|
|
message.enumType = 2;
|
|
break;
|
|
}
|
|
switch (object.repeatedFieldEncoding) {
|
|
default:
|
|
if (typeof object.repeatedFieldEncoding === "number") {
|
|
message.repeatedFieldEncoding = object.repeatedFieldEncoding;
|
|
break;
|
|
}
|
|
break;
|
|
case "REPEATED_FIELD_ENCODING_UNKNOWN":
|
|
case 0:
|
|
message.repeatedFieldEncoding = 0;
|
|
break;
|
|
case "PACKED":
|
|
case 1:
|
|
message.repeatedFieldEncoding = 1;
|
|
break;
|
|
case "EXPANDED":
|
|
case 2:
|
|
message.repeatedFieldEncoding = 2;
|
|
break;
|
|
}
|
|
switch (object.utf8Validation) {
|
|
default:
|
|
if (typeof object.utf8Validation === "number") {
|
|
message.utf8Validation = object.utf8Validation;
|
|
break;
|
|
}
|
|
break;
|
|
case "UTF8_VALIDATION_UNKNOWN":
|
|
case 0:
|
|
message.utf8Validation = 0;
|
|
break;
|
|
case "VERIFY":
|
|
case 2:
|
|
message.utf8Validation = 2;
|
|
break;
|
|
case "NONE":
|
|
case 3:
|
|
message.utf8Validation = 3;
|
|
break;
|
|
}
|
|
switch (object.messageEncoding) {
|
|
default:
|
|
if (typeof object.messageEncoding === "number") {
|
|
message.messageEncoding = object.messageEncoding;
|
|
break;
|
|
}
|
|
break;
|
|
case "MESSAGE_ENCODING_UNKNOWN":
|
|
case 0:
|
|
message.messageEncoding = 0;
|
|
break;
|
|
case "LENGTH_PREFIXED":
|
|
case 1:
|
|
message.messageEncoding = 1;
|
|
break;
|
|
case "DELIMITED":
|
|
case 2:
|
|
message.messageEncoding = 2;
|
|
break;
|
|
}
|
|
switch (object.jsonFormat) {
|
|
default:
|
|
if (typeof object.jsonFormat === "number") {
|
|
message.jsonFormat = object.jsonFormat;
|
|
break;
|
|
}
|
|
break;
|
|
case "JSON_FORMAT_UNKNOWN":
|
|
case 0:
|
|
message.jsonFormat = 0;
|
|
break;
|
|
case "ALLOW":
|
|
case 1:
|
|
message.jsonFormat = 1;
|
|
break;
|
|
case "LEGACY_BEST_EFFORT":
|
|
case 2:
|
|
message.jsonFormat = 2;
|
|
break;
|
|
}
|
|
switch (object.enforceNamingStyle) {
|
|
default:
|
|
if (typeof object.enforceNamingStyle === "number") {
|
|
message.enforceNamingStyle = object.enforceNamingStyle;
|
|
break;
|
|
}
|
|
break;
|
|
case "ENFORCE_NAMING_STYLE_UNKNOWN":
|
|
case 0:
|
|
message.enforceNamingStyle = 0;
|
|
break;
|
|
case "STYLE2024":
|
|
case 1:
|
|
message.enforceNamingStyle = 1;
|
|
break;
|
|
case "STYLE_LEGACY":
|
|
case 2:
|
|
message.enforceNamingStyle = 2;
|
|
break;
|
|
}
|
|
switch (object.defaultSymbolVisibility) {
|
|
default:
|
|
if (typeof object.defaultSymbolVisibility === "number") {
|
|
message.defaultSymbolVisibility = object.defaultSymbolVisibility;
|
|
break;
|
|
}
|
|
break;
|
|
case "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN":
|
|
case 0:
|
|
message.defaultSymbolVisibility = 0;
|
|
break;
|
|
case "EXPORT_ALL":
|
|
case 1:
|
|
message.defaultSymbolVisibility = 1;
|
|
break;
|
|
case "EXPORT_TOP_LEVEL":
|
|
case 2:
|
|
message.defaultSymbolVisibility = 2;
|
|
break;
|
|
case "LOCAL_ALL":
|
|
case 3:
|
|
message.defaultSymbolVisibility = 3;
|
|
break;
|
|
case "STRICT":
|
|
case 4:
|
|
message.defaultSymbolVisibility = 4;
|
|
break;
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from a FeatureSet message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof google.protobuf.FeatureSet
|
|
* @static
|
|
* @param {google.protobuf.FeatureSet} message FeatureSet
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
FeatureSet.toObject = function toObject(message, options) {
|
|
if (!options) options = {};
|
|
var object = {};
|
|
if (options.defaults) {
|
|
object.fieldPresence =
|
|
options.enums === String ? "FIELD_PRESENCE_UNKNOWN" : 0;
|
|
object.enumType = options.enums === String ? "ENUM_TYPE_UNKNOWN" : 0;
|
|
object.repeatedFieldEncoding =
|
|
options.enums === String ? "REPEATED_FIELD_ENCODING_UNKNOWN" : 0;
|
|
object.utf8Validation =
|
|
options.enums === String ? "UTF8_VALIDATION_UNKNOWN" : 0;
|
|
object.messageEncoding =
|
|
options.enums === String ? "MESSAGE_ENCODING_UNKNOWN" : 0;
|
|
object.jsonFormat =
|
|
options.enums === String ? "JSON_FORMAT_UNKNOWN" : 0;
|
|
object.enforceNamingStyle =
|
|
options.enums === String ? "ENFORCE_NAMING_STYLE_UNKNOWN" : 0;
|
|
object.defaultSymbolVisibility =
|
|
options.enums === String ? "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN" : 0;
|
|
}
|
|
if (
|
|
message.fieldPresence != null &&
|
|
message.hasOwnProperty("fieldPresence")
|
|
)
|
|
object.fieldPresence =
|
|
options.enums === String
|
|
? $root.google.protobuf.FeatureSet.FieldPresence[
|
|
message.fieldPresence
|
|
] === undefined
|
|
? message.fieldPresence
|
|
: $root.google.protobuf.FeatureSet.FieldPresence[
|
|
message.fieldPresence
|
|
]
|
|
: message.fieldPresence;
|
|
if (message.enumType != null && message.hasOwnProperty("enumType"))
|
|
object.enumType =
|
|
options.enums === String
|
|
? $root.google.protobuf.FeatureSet.EnumType[message.enumType] ===
|
|
undefined
|
|
? message.enumType
|
|
: $root.google.protobuf.FeatureSet.EnumType[message.enumType]
|
|
: message.enumType;
|
|
if (
|
|
message.repeatedFieldEncoding != null &&
|
|
message.hasOwnProperty("repeatedFieldEncoding")
|
|
)
|
|
object.repeatedFieldEncoding =
|
|
options.enums === String
|
|
? $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[
|
|
message.repeatedFieldEncoding
|
|
] === undefined
|
|
? message.repeatedFieldEncoding
|
|
: $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[
|
|
message.repeatedFieldEncoding
|
|
]
|
|
: message.repeatedFieldEncoding;
|
|
if (
|
|
message.utf8Validation != null &&
|
|
message.hasOwnProperty("utf8Validation")
|
|
)
|
|
object.utf8Validation =
|
|
options.enums === String
|
|
? $root.google.protobuf.FeatureSet.Utf8Validation[
|
|
message.utf8Validation
|
|
] === undefined
|
|
? message.utf8Validation
|
|
: $root.google.protobuf.FeatureSet.Utf8Validation[
|
|
message.utf8Validation
|
|
]
|
|
: message.utf8Validation;
|
|
if (
|
|
message.messageEncoding != null &&
|
|
message.hasOwnProperty("messageEncoding")
|
|
)
|
|
object.messageEncoding =
|
|
options.enums === String
|
|
? $root.google.protobuf.FeatureSet.MessageEncoding[
|
|
message.messageEncoding
|
|
] === undefined
|
|
? message.messageEncoding
|
|
: $root.google.protobuf.FeatureSet.MessageEncoding[
|
|
message.messageEncoding
|
|
]
|
|
: message.messageEncoding;
|
|
if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat"))
|
|
object.jsonFormat =
|
|
options.enums === String
|
|
? $root.google.protobuf.FeatureSet.JsonFormat[
|
|
message.jsonFormat
|
|
] === undefined
|
|
? message.jsonFormat
|
|
: $root.google.protobuf.FeatureSet.JsonFormat[
|
|
message.jsonFormat
|
|
]
|
|
: message.jsonFormat;
|
|
if (
|
|
message.enforceNamingStyle != null &&
|
|
message.hasOwnProperty("enforceNamingStyle")
|
|
)
|
|
object.enforceNamingStyle =
|
|
options.enums === String
|
|
? $root.google.protobuf.FeatureSet.EnforceNamingStyle[
|
|
message.enforceNamingStyle
|
|
] === undefined
|
|
? message.enforceNamingStyle
|
|
: $root.google.protobuf.FeatureSet.EnforceNamingStyle[
|
|
message.enforceNamingStyle
|
|
]
|
|
: message.enforceNamingStyle;
|
|
if (
|
|
message.defaultSymbolVisibility != null &&
|
|
message.hasOwnProperty("defaultSymbolVisibility")
|
|
)
|
|
object.defaultSymbolVisibility =
|
|
options.enums === String
|
|
? $root.google.protobuf.FeatureSet.VisibilityFeature
|
|
.DefaultSymbolVisibility[message.defaultSymbolVisibility] ===
|
|
undefined
|
|
? message.defaultSymbolVisibility
|
|
: $root.google.protobuf.FeatureSet.VisibilityFeature
|
|
.DefaultSymbolVisibility[message.defaultSymbolVisibility]
|
|
: message.defaultSymbolVisibility;
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this FeatureSet to JSON.
|
|
* @function toJSON
|
|
* @memberof google.protobuf.FeatureSet
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
FeatureSet.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
/**
|
|
* Gets the default type url for FeatureSet
|
|
* @function getTypeUrl
|
|
* @memberof google.protobuf.FeatureSet
|
|
* @static
|
|
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
|
* @returns {string} The default type url
|
|
*/
|
|
FeatureSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
if (typeUrlPrefix === undefined) {
|
|
typeUrlPrefix = "type.googleapis.com";
|
|
}
|
|
return typeUrlPrefix + "/google.protobuf.FeatureSet";
|
|
};
|
|
|
|
/**
|
|
* FieldPresence enum.
|
|
* @name google.protobuf.FeatureSet.FieldPresence
|
|
* @enum {number}
|
|
* @property {number} FIELD_PRESENCE_UNKNOWN=0 FIELD_PRESENCE_UNKNOWN value
|
|
* @property {number} EXPLICIT=1 EXPLICIT value
|
|
* @property {number} IMPLICIT=2 IMPLICIT value
|
|
* @property {number} LEGACY_REQUIRED=3 LEGACY_REQUIRED value
|
|
*/
|
|
FeatureSet.FieldPresence = (function () {
|
|
var valuesById = {},
|
|
values = Object.create(valuesById);
|
|
values[(valuesById[0] = "FIELD_PRESENCE_UNKNOWN")] = 0;
|
|
values[(valuesById[1] = "EXPLICIT")] = 1;
|
|
values[(valuesById[2] = "IMPLICIT")] = 2;
|
|
values[(valuesById[3] = "LEGACY_REQUIRED")] = 3;
|
|
return values;
|
|
})();
|
|
|
|
/**
|
|
* EnumType enum.
|
|
* @name google.protobuf.FeatureSet.EnumType
|
|
* @enum {number}
|
|
* @property {number} ENUM_TYPE_UNKNOWN=0 ENUM_TYPE_UNKNOWN value
|
|
* @property {number} OPEN=1 OPEN value
|
|
* @property {number} CLOSED=2 CLOSED value
|
|
*/
|
|
FeatureSet.EnumType = (function () {
|
|
var valuesById = {},
|
|
values = Object.create(valuesById);
|
|
values[(valuesById[0] = "ENUM_TYPE_UNKNOWN")] = 0;
|
|
values[(valuesById[1] = "OPEN")] = 1;
|
|
values[(valuesById[2] = "CLOSED")] = 2;
|
|
return values;
|
|
})();
|
|
|
|
/**
|
|
* RepeatedFieldEncoding enum.
|
|
* @name google.protobuf.FeatureSet.RepeatedFieldEncoding
|
|
* @enum {number}
|
|
* @property {number} REPEATED_FIELD_ENCODING_UNKNOWN=0 REPEATED_FIELD_ENCODING_UNKNOWN value
|
|
* @property {number} PACKED=1 PACKED value
|
|
* @property {number} EXPANDED=2 EXPANDED value
|
|
*/
|
|
FeatureSet.RepeatedFieldEncoding = (function () {
|
|
var valuesById = {},
|
|
values = Object.create(valuesById);
|
|
values[(valuesById[0] = "REPEATED_FIELD_ENCODING_UNKNOWN")] = 0;
|
|
values[(valuesById[1] = "PACKED")] = 1;
|
|
values[(valuesById[2] = "EXPANDED")] = 2;
|
|
return values;
|
|
})();
|
|
|
|
/**
|
|
* Utf8Validation enum.
|
|
* @name google.protobuf.FeatureSet.Utf8Validation
|
|
* @enum {number}
|
|
* @property {number} UTF8_VALIDATION_UNKNOWN=0 UTF8_VALIDATION_UNKNOWN value
|
|
* @property {number} VERIFY=2 VERIFY value
|
|
* @property {number} NONE=3 NONE value
|
|
*/
|
|
FeatureSet.Utf8Validation = (function () {
|
|
var valuesById = {},
|
|
values = Object.create(valuesById);
|
|
values[(valuesById[0] = "UTF8_VALIDATION_UNKNOWN")] = 0;
|
|
values[(valuesById[2] = "VERIFY")] = 2;
|
|
values[(valuesById[3] = "NONE")] = 3;
|
|
return values;
|
|
})();
|
|
|
|
/**
|
|
* MessageEncoding enum.
|
|
* @name google.protobuf.FeatureSet.MessageEncoding
|
|
* @enum {number}
|
|
* @property {number} MESSAGE_ENCODING_UNKNOWN=0 MESSAGE_ENCODING_UNKNOWN value
|
|
* @property {number} LENGTH_PREFIXED=1 LENGTH_PREFIXED value
|
|
* @property {number} DELIMITED=2 DELIMITED value
|
|
*/
|
|
FeatureSet.MessageEncoding = (function () {
|
|
var valuesById = {},
|
|
values = Object.create(valuesById);
|
|
values[(valuesById[0] = "MESSAGE_ENCODING_UNKNOWN")] = 0;
|
|
values[(valuesById[1] = "LENGTH_PREFIXED")] = 1;
|
|
values[(valuesById[2] = "DELIMITED")] = 2;
|
|
return values;
|
|
})();
|
|
|
|
/**
|
|
* JsonFormat enum.
|
|
* @name google.protobuf.FeatureSet.JsonFormat
|
|
* @enum {number}
|
|
* @property {number} JSON_FORMAT_UNKNOWN=0 JSON_FORMAT_UNKNOWN value
|
|
* @property {number} ALLOW=1 ALLOW value
|
|
* @property {number} LEGACY_BEST_EFFORT=2 LEGACY_BEST_EFFORT value
|
|
*/
|
|
FeatureSet.JsonFormat = (function () {
|
|
var valuesById = {},
|
|
values = Object.create(valuesById);
|
|
values[(valuesById[0] = "JSON_FORMAT_UNKNOWN")] = 0;
|
|
values[(valuesById[1] = "ALLOW")] = 1;
|
|
values[(valuesById[2] = "LEGACY_BEST_EFFORT")] = 2;
|
|
return values;
|
|
})();
|
|
|
|
/**
|
|
* EnforceNamingStyle enum.
|
|
* @name google.protobuf.FeatureSet.EnforceNamingStyle
|
|
* @enum {number}
|
|
* @property {number} ENFORCE_NAMING_STYLE_UNKNOWN=0 ENFORCE_NAMING_STYLE_UNKNOWN value
|
|
* @property {number} STYLE2024=1 STYLE2024 value
|
|
* @property {number} STYLE_LEGACY=2 STYLE_LEGACY value
|
|
*/
|
|
FeatureSet.EnforceNamingStyle = (function () {
|
|
var valuesById = {},
|
|
values = Object.create(valuesById);
|
|
values[(valuesById[0] = "ENFORCE_NAMING_STYLE_UNKNOWN")] = 0;
|
|
values[(valuesById[1] = "STYLE2024")] = 1;
|
|
values[(valuesById[2] = "STYLE_LEGACY")] = 2;
|
|
return values;
|
|
})();
|
|
|
|
FeatureSet.VisibilityFeature = (function () {
|
|
/**
|
|
* Properties of a VisibilityFeature.
|
|
* @memberof google.protobuf.FeatureSet
|
|
* @interface IVisibilityFeature
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new VisibilityFeature.
|
|
* @memberof google.protobuf.FeatureSet
|
|
* @classdesc Represents a VisibilityFeature.
|
|
* @implements IVisibilityFeature
|
|
* @constructor
|
|
* @param {google.protobuf.FeatureSet.IVisibilityFeature=} [properties] Properties to set
|
|
*/
|
|
function VisibilityFeature(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]];
|
|
}
|
|
|
|
/**
|
|
* Creates a new VisibilityFeature instance using the specified properties.
|
|
* @function create
|
|
* @memberof google.protobuf.FeatureSet.VisibilityFeature
|
|
* @static
|
|
* @param {google.protobuf.FeatureSet.IVisibilityFeature=} [properties] Properties to set
|
|
* @returns {google.protobuf.FeatureSet.VisibilityFeature} VisibilityFeature instance
|
|
*/
|
|
VisibilityFeature.create = function create(properties) {
|
|
return new VisibilityFeature(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified VisibilityFeature message. Does not implicitly {@link google.protobuf.FeatureSet.VisibilityFeature.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof google.protobuf.FeatureSet.VisibilityFeature
|
|
* @static
|
|
* @param {google.protobuf.FeatureSet.IVisibilityFeature} message VisibilityFeature message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
VisibilityFeature.encode = function encode(message, writer) {
|
|
if (!writer) writer = $Writer.create();
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified VisibilityFeature message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.VisibilityFeature.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof google.protobuf.FeatureSet.VisibilityFeature
|
|
* @static
|
|
* @param {google.protobuf.FeatureSet.IVisibilityFeature} message VisibilityFeature message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
VisibilityFeature.encodeDelimited = function encodeDelimited(
|
|
message,
|
|
writer
|
|
) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes a VisibilityFeature message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof google.protobuf.FeatureSet.VisibilityFeature
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {google.protobuf.FeatureSet.VisibilityFeature} VisibilityFeature
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
VisibilityFeature.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.google.protobuf.FeatureSet.VisibilityFeature();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
if (tag === error) break;
|
|
switch (tag >>> 3) {
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes a VisibilityFeature message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof google.protobuf.FeatureSet.VisibilityFeature
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {google.protobuf.FeatureSet.VisibilityFeature} VisibilityFeature
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
VisibilityFeature.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader)) reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies a VisibilityFeature message.
|
|
* @function verify
|
|
* @memberof google.protobuf.FeatureSet.VisibilityFeature
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
VisibilityFeature.verify = function verify(message) {
|
|
if (typeof message !== "object" || message === null)
|
|
return "object expected";
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates a VisibilityFeature message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof google.protobuf.FeatureSet.VisibilityFeature
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {google.protobuf.FeatureSet.VisibilityFeature} VisibilityFeature
|
|
*/
|
|
VisibilityFeature.fromObject = function fromObject(object) {
|
|
if (
|
|
object instanceof $root.google.protobuf.FeatureSet.VisibilityFeature
|
|
)
|
|
return object;
|
|
return new $root.google.protobuf.FeatureSet.VisibilityFeature();
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from a VisibilityFeature message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof google.protobuf.FeatureSet.VisibilityFeature
|
|
* @static
|
|
* @param {google.protobuf.FeatureSet.VisibilityFeature} message VisibilityFeature
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
VisibilityFeature.toObject = function toObject() {
|
|
return {};
|
|
};
|
|
|
|
/**
|
|
* Converts this VisibilityFeature to JSON.
|
|
* @function toJSON
|
|
* @memberof google.protobuf.FeatureSet.VisibilityFeature
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
VisibilityFeature.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
/**
|
|
* Gets the default type url for VisibilityFeature
|
|
* @function getTypeUrl
|
|
* @memberof google.protobuf.FeatureSet.VisibilityFeature
|
|
* @static
|
|
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
|
* @returns {string} The default type url
|
|
*/
|
|
VisibilityFeature.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
if (typeUrlPrefix === undefined) {
|
|
typeUrlPrefix = "type.googleapis.com";
|
|
}
|
|
return (
|
|
typeUrlPrefix + "/google.protobuf.FeatureSet.VisibilityFeature"
|
|
);
|
|
};
|
|
|
|
/**
|
|
* DefaultSymbolVisibility enum.
|
|
* @name google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility
|
|
* @enum {number}
|
|
* @property {number} DEFAULT_SYMBOL_VISIBILITY_UNKNOWN=0 DEFAULT_SYMBOL_VISIBILITY_UNKNOWN value
|
|
* @property {number} EXPORT_ALL=1 EXPORT_ALL value
|
|
* @property {number} EXPORT_TOP_LEVEL=2 EXPORT_TOP_LEVEL value
|
|
* @property {number} LOCAL_ALL=3 LOCAL_ALL value
|
|
* @property {number} STRICT=4 STRICT value
|
|
*/
|
|
VisibilityFeature.DefaultSymbolVisibility = (function () {
|
|
var valuesById = {},
|
|
values = Object.create(valuesById);
|
|
values[(valuesById[0] = "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN")] = 0;
|
|
values[(valuesById[1] = "EXPORT_ALL")] = 1;
|
|
values[(valuesById[2] = "EXPORT_TOP_LEVEL")] = 2;
|
|
values[(valuesById[3] = "LOCAL_ALL")] = 3;
|
|
values[(valuesById[4] = "STRICT")] = 4;
|
|
return values;
|
|
})();
|
|
|
|
return VisibilityFeature;
|
|
})();
|
|
|
|
return FeatureSet;
|
|
})();
|
|
|
|
protobuf.FeatureSetDefaults = (function () {
|
|
/**
|
|
* Properties of a FeatureSetDefaults.
|
|
* @memberof google.protobuf
|
|
* @interface IFeatureSetDefaults
|
|
* @property {Array.<google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault>|null} [defaults] FeatureSetDefaults defaults
|
|
* @property {google.protobuf.Edition|null} [minimumEdition] FeatureSetDefaults minimumEdition
|
|
* @property {google.protobuf.Edition|null} [maximumEdition] FeatureSetDefaults maximumEdition
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new FeatureSetDefaults.
|
|
* @memberof google.protobuf
|
|
* @classdesc Represents a FeatureSetDefaults.
|
|
* @implements IFeatureSetDefaults
|
|
* @constructor
|
|
* @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set
|
|
*/
|
|
function FeatureSetDefaults(properties) {
|
|
this.defaults = [];
|
|
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]];
|
|
}
|
|
|
|
/**
|
|
* FeatureSetDefaults defaults.
|
|
* @member {Array.<google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault>} defaults
|
|
* @memberof google.protobuf.FeatureSetDefaults
|
|
* @instance
|
|
*/
|
|
FeatureSetDefaults.prototype.defaults = $util.emptyArray;
|
|
|
|
/**
|
|
* FeatureSetDefaults minimumEdition.
|
|
* @member {google.protobuf.Edition} minimumEdition
|
|
* @memberof google.protobuf.FeatureSetDefaults
|
|
* @instance
|
|
*/
|
|
FeatureSetDefaults.prototype.minimumEdition = 0;
|
|
|
|
/**
|
|
* FeatureSetDefaults maximumEdition.
|
|
* @member {google.protobuf.Edition} maximumEdition
|
|
* @memberof google.protobuf.FeatureSetDefaults
|
|
* @instance
|
|
*/
|
|
FeatureSetDefaults.prototype.maximumEdition = 0;
|
|
|
|
/**
|
|
* Creates a new FeatureSetDefaults instance using the specified properties.
|
|
* @function create
|
|
* @memberof google.protobuf.FeatureSetDefaults
|
|
* @static
|
|
* @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set
|
|
* @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults instance
|
|
*/
|
|
FeatureSetDefaults.create = function create(properties) {
|
|
return new FeatureSetDefaults(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof google.protobuf.FeatureSetDefaults
|
|
* @static
|
|
* @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
FeatureSetDefaults.encode = function encode(message, writer) {
|
|
if (!writer) writer = $Writer.create();
|
|
if (message.defaults != null && message.defaults.length)
|
|
for (var i = 0; i < message.defaults.length; ++i)
|
|
$root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.encode(
|
|
message.defaults[i],
|
|
writer.uint32(/* id 1, wireType 2 =*/ 10).fork()
|
|
).ldelim();
|
|
if (
|
|
message.minimumEdition != null &&
|
|
Object.hasOwnProperty.call(message, "minimumEdition")
|
|
)
|
|
writer
|
|
.uint32(/* id 4, wireType 0 =*/ 32)
|
|
.int32(message.minimumEdition);
|
|
if (
|
|
message.maximumEdition != null &&
|
|
Object.hasOwnProperty.call(message, "maximumEdition")
|
|
)
|
|
writer
|
|
.uint32(/* id 5, wireType 0 =*/ 40)
|
|
.int32(message.maximumEdition);
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof google.protobuf.FeatureSetDefaults
|
|
* @static
|
|
* @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
FeatureSetDefaults.encodeDelimited = function encodeDelimited(
|
|
message,
|
|
writer
|
|
) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes a FeatureSetDefaults message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof google.protobuf.FeatureSetDefaults
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
FeatureSetDefaults.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.google.protobuf.FeatureSetDefaults();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
if (tag === error) break;
|
|
switch (tag >>> 3) {
|
|
case 1: {
|
|
if (!(message.defaults && message.defaults.length))
|
|
message.defaults = [];
|
|
message.defaults.push(
|
|
$root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.decode(
|
|
reader,
|
|
reader.uint32()
|
|
)
|
|
);
|
|
break;
|
|
}
|
|
case 4: {
|
|
message.minimumEdition = reader.int32();
|
|
break;
|
|
}
|
|
case 5: {
|
|
message.maximumEdition = reader.int32();
|
|
break;
|
|
}
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof google.protobuf.FeatureSetDefaults
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
FeatureSetDefaults.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader)) reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies a FeatureSetDefaults message.
|
|
* @function verify
|
|
* @memberof google.protobuf.FeatureSetDefaults
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
FeatureSetDefaults.verify = function verify(message) {
|
|
if (typeof message !== "object" || message === null)
|
|
return "object expected";
|
|
if (message.defaults != null && message.hasOwnProperty("defaults")) {
|
|
if (!Array.isArray(message.defaults))
|
|
return "defaults: array expected";
|
|
for (var i = 0; i < message.defaults.length; ++i) {
|
|
var error =
|
|
$root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify(
|
|
message.defaults[i]
|
|
);
|
|
if (error) return "defaults." + error;
|
|
}
|
|
}
|
|
if (
|
|
message.minimumEdition != null &&
|
|
message.hasOwnProperty("minimumEdition")
|
|
)
|
|
switch (message.minimumEdition) {
|
|
default:
|
|
return "minimumEdition: enum value expected";
|
|
case 0:
|
|
case 900:
|
|
case 998:
|
|
case 999:
|
|
case 1000:
|
|
case 1001:
|
|
case 1:
|
|
case 2:
|
|
case 99997:
|
|
case 99998:
|
|
case 99999:
|
|
case 2147483647:
|
|
break;
|
|
}
|
|
if (
|
|
message.maximumEdition != null &&
|
|
message.hasOwnProperty("maximumEdition")
|
|
)
|
|
switch (message.maximumEdition) {
|
|
default:
|
|
return "maximumEdition: enum value expected";
|
|
case 0:
|
|
case 900:
|
|
case 998:
|
|
case 999:
|
|
case 1000:
|
|
case 1001:
|
|
case 1:
|
|
case 2:
|
|
case 99997:
|
|
case 99998:
|
|
case 99999:
|
|
case 2147483647:
|
|
break;
|
|
}
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates a FeatureSetDefaults message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof google.protobuf.FeatureSetDefaults
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults
|
|
*/
|
|
FeatureSetDefaults.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.google.protobuf.FeatureSetDefaults)
|
|
return object;
|
|
var message = new $root.google.protobuf.FeatureSetDefaults();
|
|
if (object.defaults) {
|
|
if (!Array.isArray(object.defaults))
|
|
throw TypeError(
|
|
".google.protobuf.FeatureSetDefaults.defaults: array expected"
|
|
);
|
|
message.defaults = [];
|
|
for (var i = 0; i < object.defaults.length; ++i) {
|
|
if (typeof object.defaults[i] !== "object")
|
|
throw TypeError(
|
|
".google.protobuf.FeatureSetDefaults.defaults: object expected"
|
|
);
|
|
message.defaults[i] =
|
|
$root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.fromObject(
|
|
object.defaults[i]
|
|
);
|
|
}
|
|
}
|
|
switch (object.minimumEdition) {
|
|
default:
|
|
if (typeof object.minimumEdition === "number") {
|
|
message.minimumEdition = object.minimumEdition;
|
|
break;
|
|
}
|
|
break;
|
|
case "EDITION_UNKNOWN":
|
|
case 0:
|
|
message.minimumEdition = 0;
|
|
break;
|
|
case "EDITION_LEGACY":
|
|
case 900:
|
|
message.minimumEdition = 900;
|
|
break;
|
|
case "EDITION_PROTO2":
|
|
case 998:
|
|
message.minimumEdition = 998;
|
|
break;
|
|
case "EDITION_PROTO3":
|
|
case 999:
|
|
message.minimumEdition = 999;
|
|
break;
|
|
case "EDITION_2023":
|
|
case 1000:
|
|
message.minimumEdition = 1000;
|
|
break;
|
|
case "EDITION_2024":
|
|
case 1001:
|
|
message.minimumEdition = 1001;
|
|
break;
|
|
case "EDITION_1_TEST_ONLY":
|
|
case 1:
|
|
message.minimumEdition = 1;
|
|
break;
|
|
case "EDITION_2_TEST_ONLY":
|
|
case 2:
|
|
message.minimumEdition = 2;
|
|
break;
|
|
case "EDITION_99997_TEST_ONLY":
|
|
case 99997:
|
|
message.minimumEdition = 99997;
|
|
break;
|
|
case "EDITION_99998_TEST_ONLY":
|
|
case 99998:
|
|
message.minimumEdition = 99998;
|
|
break;
|
|
case "EDITION_99999_TEST_ONLY":
|
|
case 99999:
|
|
message.minimumEdition = 99999;
|
|
break;
|
|
case "EDITION_MAX":
|
|
case 2147483647:
|
|
message.minimumEdition = 2147483647;
|
|
break;
|
|
}
|
|
switch (object.maximumEdition) {
|
|
default:
|
|
if (typeof object.maximumEdition === "number") {
|
|
message.maximumEdition = object.maximumEdition;
|
|
break;
|
|
}
|
|
break;
|
|
case "EDITION_UNKNOWN":
|
|
case 0:
|
|
message.maximumEdition = 0;
|
|
break;
|
|
case "EDITION_LEGACY":
|
|
case 900:
|
|
message.maximumEdition = 900;
|
|
break;
|
|
case "EDITION_PROTO2":
|
|
case 998:
|
|
message.maximumEdition = 998;
|
|
break;
|
|
case "EDITION_PROTO3":
|
|
case 999:
|
|
message.maximumEdition = 999;
|
|
break;
|
|
case "EDITION_2023":
|
|
case 1000:
|
|
message.maximumEdition = 1000;
|
|
break;
|
|
case "EDITION_2024":
|
|
case 1001:
|
|
message.maximumEdition = 1001;
|
|
break;
|
|
case "EDITION_1_TEST_ONLY":
|
|
case 1:
|
|
message.maximumEdition = 1;
|
|
break;
|
|
case "EDITION_2_TEST_ONLY":
|
|
case 2:
|
|
message.maximumEdition = 2;
|
|
break;
|
|
case "EDITION_99997_TEST_ONLY":
|
|
case 99997:
|
|
message.maximumEdition = 99997;
|
|
break;
|
|
case "EDITION_99998_TEST_ONLY":
|
|
case 99998:
|
|
message.maximumEdition = 99998;
|
|
break;
|
|
case "EDITION_99999_TEST_ONLY":
|
|
case 99999:
|
|
message.maximumEdition = 99999;
|
|
break;
|
|
case "EDITION_MAX":
|
|
case 2147483647:
|
|
message.maximumEdition = 2147483647;
|
|
break;
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof google.protobuf.FeatureSetDefaults
|
|
* @static
|
|
* @param {google.protobuf.FeatureSetDefaults} message FeatureSetDefaults
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
FeatureSetDefaults.toObject = function toObject(message, options) {
|
|
if (!options) options = {};
|
|
var object = {};
|
|
if (options.arrays || options.defaults) object.defaults = [];
|
|
if (options.defaults) {
|
|
object.minimumEdition =
|
|
options.enums === String ? "EDITION_UNKNOWN" : 0;
|
|
object.maximumEdition =
|
|
options.enums === String ? "EDITION_UNKNOWN" : 0;
|
|
}
|
|
if (message.defaults && message.defaults.length) {
|
|
object.defaults = [];
|
|
for (var j = 0; j < message.defaults.length; ++j)
|
|
object.defaults[j] =
|
|
$root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.toObject(
|
|
message.defaults[j],
|
|
options
|
|
);
|
|
}
|
|
if (
|
|
message.minimumEdition != null &&
|
|
message.hasOwnProperty("minimumEdition")
|
|
)
|
|
object.minimumEdition =
|
|
options.enums === String
|
|
? $root.google.protobuf.Edition[message.minimumEdition] ===
|
|
undefined
|
|
? message.minimumEdition
|
|
: $root.google.protobuf.Edition[message.minimumEdition]
|
|
: message.minimumEdition;
|
|
if (
|
|
message.maximumEdition != null &&
|
|
message.hasOwnProperty("maximumEdition")
|
|
)
|
|
object.maximumEdition =
|
|
options.enums === String
|
|
? $root.google.protobuf.Edition[message.maximumEdition] ===
|
|
undefined
|
|
? message.maximumEdition
|
|
: $root.google.protobuf.Edition[message.maximumEdition]
|
|
: message.maximumEdition;
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this FeatureSetDefaults to JSON.
|
|
* @function toJSON
|
|
* @memberof google.protobuf.FeatureSetDefaults
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
FeatureSetDefaults.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
/**
|
|
* Gets the default type url for FeatureSetDefaults
|
|
* @function getTypeUrl
|
|
* @memberof google.protobuf.FeatureSetDefaults
|
|
* @static
|
|
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
|
* @returns {string} The default type url
|
|
*/
|
|
FeatureSetDefaults.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
if (typeUrlPrefix === undefined) {
|
|
typeUrlPrefix = "type.googleapis.com";
|
|
}
|
|
return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults";
|
|
};
|
|
|
|
FeatureSetDefaults.FeatureSetEditionDefault = (function () {
|
|
/**
|
|
* Properties of a FeatureSetEditionDefault.
|
|
* @memberof google.protobuf.FeatureSetDefaults
|
|
* @interface IFeatureSetEditionDefault
|
|
* @property {google.protobuf.Edition|null} [edition] FeatureSetEditionDefault edition
|
|
* @property {google.protobuf.IFeatureSet|null} [overridableFeatures] FeatureSetEditionDefault overridableFeatures
|
|
* @property {google.protobuf.IFeatureSet|null} [fixedFeatures] FeatureSetEditionDefault fixedFeatures
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new FeatureSetEditionDefault.
|
|
* @memberof google.protobuf.FeatureSetDefaults
|
|
* @classdesc Represents a FeatureSetEditionDefault.
|
|
* @implements IFeatureSetEditionDefault
|
|
* @constructor
|
|
* @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set
|
|
*/
|
|
function FeatureSetEditionDefault(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]];
|
|
}
|
|
|
|
/**
|
|
* FeatureSetEditionDefault edition.
|
|
* @member {google.protobuf.Edition} edition
|
|
* @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault
|
|
* @instance
|
|
*/
|
|
FeatureSetEditionDefault.prototype.edition = 0;
|
|
|
|
/**
|
|
* FeatureSetEditionDefault overridableFeatures.
|
|
* @member {google.protobuf.IFeatureSet|null|undefined} overridableFeatures
|
|
* @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault
|
|
* @instance
|
|
*/
|
|
FeatureSetEditionDefault.prototype.overridableFeatures = null;
|
|
|
|
/**
|
|
* FeatureSetEditionDefault fixedFeatures.
|
|
* @member {google.protobuf.IFeatureSet|null|undefined} fixedFeatures
|
|
* @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault
|
|
* @instance
|
|
*/
|
|
FeatureSetEditionDefault.prototype.fixedFeatures = null;
|
|
|
|
/**
|
|
* Creates a new FeatureSetEditionDefault instance using the specified properties.
|
|
* @function create
|
|
* @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault
|
|
* @static
|
|
* @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set
|
|
* @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault instance
|
|
*/
|
|
FeatureSetEditionDefault.create = function create(properties) {
|
|
return new FeatureSetEditionDefault(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault
|
|
* @static
|
|
* @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
FeatureSetEditionDefault.encode = function encode(message, writer) {
|
|
if (!writer) writer = $Writer.create();
|
|
if (
|
|
message.edition != null &&
|
|
Object.hasOwnProperty.call(message, "edition")
|
|
)
|
|
writer.uint32(/* id 3, wireType 0 =*/ 24).int32(message.edition);
|
|
if (
|
|
message.overridableFeatures != null &&
|
|
Object.hasOwnProperty.call(message, "overridableFeatures")
|
|
)
|
|
$root.google.protobuf.FeatureSet.encode(
|
|
message.overridableFeatures,
|
|
writer.uint32(/* id 4, wireType 2 =*/ 34).fork()
|
|
).ldelim();
|
|
if (
|
|
message.fixedFeatures != null &&
|
|
Object.hasOwnProperty.call(message, "fixedFeatures")
|
|
)
|
|
$root.google.protobuf.FeatureSet.encode(
|
|
message.fixedFeatures,
|
|
writer.uint32(/* id 5, wireType 2 =*/ 42).fork()
|
|
).ldelim();
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault
|
|
* @static
|
|
* @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
FeatureSetEditionDefault.encodeDelimited = function encodeDelimited(
|
|
message,
|
|
writer
|
|
) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes a FeatureSetEditionDefault message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
FeatureSetEditionDefault.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.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
if (tag === error) break;
|
|
switch (tag >>> 3) {
|
|
case 3: {
|
|
message.edition = reader.int32();
|
|
break;
|
|
}
|
|
case 4: {
|
|
message.overridableFeatures =
|
|
$root.google.protobuf.FeatureSet.decode(
|
|
reader,
|
|
reader.uint32()
|
|
);
|
|
break;
|
|
}
|
|
case 5: {
|
|
message.fixedFeatures = $root.google.protobuf.FeatureSet.decode(
|
|
reader,
|
|
reader.uint32()
|
|
);
|
|
break;
|
|
}
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
FeatureSetEditionDefault.decodeDelimited = function decodeDelimited(
|
|
reader
|
|
) {
|
|
if (!(reader instanceof $Reader)) reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies a FeatureSetEditionDefault message.
|
|
* @function verify
|
|
* @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
FeatureSetEditionDefault.verify = function verify(message) {
|
|
if (typeof message !== "object" || message === null)
|
|
return "object expected";
|
|
if (message.edition != null && message.hasOwnProperty("edition"))
|
|
switch (message.edition) {
|
|
default:
|
|
return "edition: enum value expected";
|
|
case 0:
|
|
case 900:
|
|
case 998:
|
|
case 999:
|
|
case 1000:
|
|
case 1001:
|
|
case 1:
|
|
case 2:
|
|
case 99997:
|
|
case 99998:
|
|
case 99999:
|
|
case 2147483647:
|
|
break;
|
|
}
|
|
if (
|
|
message.overridableFeatures != null &&
|
|
message.hasOwnProperty("overridableFeatures")
|
|
) {
|
|
var error = $root.google.protobuf.FeatureSet.verify(
|
|
message.overridableFeatures
|
|
);
|
|
if (error) return "overridableFeatures." + error;
|
|
}
|
|
if (
|
|
message.fixedFeatures != null &&
|
|
message.hasOwnProperty("fixedFeatures")
|
|
) {
|
|
var error = $root.google.protobuf.FeatureSet.verify(
|
|
message.fixedFeatures
|
|
);
|
|
if (error) return "fixedFeatures." + error;
|
|
}
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates a FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault
|
|
*/
|
|
FeatureSetEditionDefault.fromObject = function fromObject(object) {
|
|
if (
|
|
object instanceof
|
|
$root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault
|
|
)
|
|
return object;
|
|
var message =
|
|
new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault();
|
|
switch (object.edition) {
|
|
default:
|
|
if (typeof object.edition === "number") {
|
|
message.edition = object.edition;
|
|
break;
|
|
}
|
|
break;
|
|
case "EDITION_UNKNOWN":
|
|
case 0:
|
|
message.edition = 0;
|
|
break;
|
|
case "EDITION_LEGACY":
|
|
case 900:
|
|
message.edition = 900;
|
|
break;
|
|
case "EDITION_PROTO2":
|
|
case 998:
|
|
message.edition = 998;
|
|
break;
|
|
case "EDITION_PROTO3":
|
|
case 999:
|
|
message.edition = 999;
|
|
break;
|
|
case "EDITION_2023":
|
|
case 1000:
|
|
message.edition = 1000;
|
|
break;
|
|
case "EDITION_2024":
|
|
case 1001:
|
|
message.edition = 1001;
|
|
break;
|
|
case "EDITION_1_TEST_ONLY":
|
|
case 1:
|
|
message.edition = 1;
|
|
break;
|
|
case "EDITION_2_TEST_ONLY":
|
|
case 2:
|
|
message.edition = 2;
|
|
break;
|
|
case "EDITION_99997_TEST_ONLY":
|
|
case 99997:
|
|
message.edition = 99997;
|
|
break;
|
|
case "EDITION_99998_TEST_ONLY":
|
|
case 99998:
|
|
message.edition = 99998;
|
|
break;
|
|
case "EDITION_99999_TEST_ONLY":
|
|
case 99999:
|
|
message.edition = 99999;
|
|
break;
|
|
case "EDITION_MAX":
|
|
case 2147483647:
|
|
message.edition = 2147483647;
|
|
break;
|
|
}
|
|
if (object.overridableFeatures != null) {
|
|
if (typeof object.overridableFeatures !== "object")
|
|
throw TypeError(
|
|
".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.overridableFeatures: object expected"
|
|
);
|
|
message.overridableFeatures =
|
|
$root.google.protobuf.FeatureSet.fromObject(
|
|
object.overridableFeatures
|
|
);
|
|
}
|
|
if (object.fixedFeatures != null) {
|
|
if (typeof object.fixedFeatures !== "object")
|
|
throw TypeError(
|
|
".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.fixedFeatures: object expected"
|
|
);
|
|
message.fixedFeatures = $root.google.protobuf.FeatureSet.fromObject(
|
|
object.fixedFeatures
|
|
);
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault
|
|
* @static
|
|
* @param {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} message FeatureSetEditionDefault
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
FeatureSetEditionDefault.toObject = function toObject(
|
|
message,
|
|
options
|
|
) {
|
|
if (!options) options = {};
|
|
var object = {};
|
|
if (options.defaults) {
|
|
object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0;
|
|
object.overridableFeatures = null;
|
|
object.fixedFeatures = null;
|
|
}
|
|
if (message.edition != null && message.hasOwnProperty("edition"))
|
|
object.edition =
|
|
options.enums === String
|
|
? $root.google.protobuf.Edition[message.edition] === undefined
|
|
? message.edition
|
|
: $root.google.protobuf.Edition[message.edition]
|
|
: message.edition;
|
|
if (
|
|
message.overridableFeatures != null &&
|
|
message.hasOwnProperty("overridableFeatures")
|
|
)
|
|
object.overridableFeatures =
|
|
$root.google.protobuf.FeatureSet.toObject(
|
|
message.overridableFeatures,
|
|
options
|
|
);
|
|
if (
|
|
message.fixedFeatures != null &&
|
|
message.hasOwnProperty("fixedFeatures")
|
|
)
|
|
object.fixedFeatures = $root.google.protobuf.FeatureSet.toObject(
|
|
message.fixedFeatures,
|
|
options
|
|
);
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this FeatureSetEditionDefault to JSON.
|
|
* @function toJSON
|
|
* @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
FeatureSetEditionDefault.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
/**
|
|
* Gets the default type url for FeatureSetEditionDefault
|
|
* @function getTypeUrl
|
|
* @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault
|
|
* @static
|
|
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
|
* @returns {string} The default type url
|
|
*/
|
|
FeatureSetEditionDefault.getTypeUrl = function getTypeUrl(
|
|
typeUrlPrefix
|
|
) {
|
|
if (typeUrlPrefix === undefined) {
|
|
typeUrlPrefix = "type.googleapis.com";
|
|
}
|
|
return (
|
|
typeUrlPrefix +
|
|
"/google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault"
|
|
);
|
|
};
|
|
|
|
return FeatureSetEditionDefault;
|
|
})();
|
|
|
|
return FeatureSetDefaults;
|
|
})();
|
|
|
|
protobuf.SourceCodeInfo = (function () {
|
|
/**
|
|
* Properties of a SourceCodeInfo.
|
|
* @memberof google.protobuf
|
|
* @interface ISourceCodeInfo
|
|
* @property {Array.<google.protobuf.SourceCodeInfo.ILocation>|null} [location] SourceCodeInfo location
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new SourceCodeInfo.
|
|
* @memberof google.protobuf
|
|
* @classdesc Represents a SourceCodeInfo.
|
|
* @implements ISourceCodeInfo
|
|
* @constructor
|
|
* @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set
|
|
*/
|
|
function SourceCodeInfo(properties) {
|
|
this.location = [];
|
|
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]];
|
|
}
|
|
|
|
/**
|
|
* SourceCodeInfo location.
|
|
* @member {Array.<google.protobuf.SourceCodeInfo.ILocation>} location
|
|
* @memberof google.protobuf.SourceCodeInfo
|
|
* @instance
|
|
*/
|
|
SourceCodeInfo.prototype.location = $util.emptyArray;
|
|
|
|
/**
|
|
* Creates a new SourceCodeInfo instance using the specified properties.
|
|
* @function create
|
|
* @memberof google.protobuf.SourceCodeInfo
|
|
* @static
|
|
* @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set
|
|
* @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo instance
|
|
*/
|
|
SourceCodeInfo.create = function create(properties) {
|
|
return new SourceCodeInfo(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof google.protobuf.SourceCodeInfo
|
|
* @static
|
|
* @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
SourceCodeInfo.encode = function encode(message, writer) {
|
|
if (!writer) writer = $Writer.create();
|
|
if (message.location != null && message.location.length)
|
|
for (var i = 0; i < message.location.length; ++i)
|
|
$root.google.protobuf.SourceCodeInfo.Location.encode(
|
|
message.location[i],
|
|
writer.uint32(/* id 1, wireType 2 =*/ 10).fork()
|
|
).ldelim();
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof google.protobuf.SourceCodeInfo
|
|
* @static
|
|
* @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
SourceCodeInfo.encodeDelimited = function encodeDelimited(
|
|
message,
|
|
writer
|
|
) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes a SourceCodeInfo message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof google.protobuf.SourceCodeInfo
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
SourceCodeInfo.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.google.protobuf.SourceCodeInfo();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
if (tag === error) break;
|
|
switch (tag >>> 3) {
|
|
case 1: {
|
|
if (!(message.location && message.location.length))
|
|
message.location = [];
|
|
message.location.push(
|
|
$root.google.protobuf.SourceCodeInfo.Location.decode(
|
|
reader,
|
|
reader.uint32()
|
|
)
|
|
);
|
|
break;
|
|
}
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof google.protobuf.SourceCodeInfo
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
SourceCodeInfo.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader)) reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies a SourceCodeInfo message.
|
|
* @function verify
|
|
* @memberof google.protobuf.SourceCodeInfo
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
SourceCodeInfo.verify = function verify(message) {
|
|
if (typeof message !== "object" || message === null)
|
|
return "object expected";
|
|
if (message.location != null && message.hasOwnProperty("location")) {
|
|
if (!Array.isArray(message.location))
|
|
return "location: array expected";
|
|
for (var i = 0; i < message.location.length; ++i) {
|
|
var error = $root.google.protobuf.SourceCodeInfo.Location.verify(
|
|
message.location[i]
|
|
);
|
|
if (error) return "location." + error;
|
|
}
|
|
}
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof google.protobuf.SourceCodeInfo
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo
|
|
*/
|
|
SourceCodeInfo.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.google.protobuf.SourceCodeInfo)
|
|
return object;
|
|
var message = new $root.google.protobuf.SourceCodeInfo();
|
|
if (object.location) {
|
|
if (!Array.isArray(object.location))
|
|
throw TypeError(
|
|
".google.protobuf.SourceCodeInfo.location: array expected"
|
|
);
|
|
message.location = [];
|
|
for (var i = 0; i < object.location.length; ++i) {
|
|
if (typeof object.location[i] !== "object")
|
|
throw TypeError(
|
|
".google.protobuf.SourceCodeInfo.location: object expected"
|
|
);
|
|
message.location[i] =
|
|
$root.google.protobuf.SourceCodeInfo.Location.fromObject(
|
|
object.location[i]
|
|
);
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof google.protobuf.SourceCodeInfo
|
|
* @static
|
|
* @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
SourceCodeInfo.toObject = function toObject(message, options) {
|
|
if (!options) options = {};
|
|
var object = {};
|
|
if (options.arrays || options.defaults) object.location = [];
|
|
if (message.location && message.location.length) {
|
|
object.location = [];
|
|
for (var j = 0; j < message.location.length; ++j)
|
|
object.location[j] =
|
|
$root.google.protobuf.SourceCodeInfo.Location.toObject(
|
|
message.location[j],
|
|
options
|
|
);
|
|
}
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this SourceCodeInfo to JSON.
|
|
* @function toJSON
|
|
* @memberof google.protobuf.SourceCodeInfo
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
SourceCodeInfo.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
/**
|
|
* Gets the default type url for SourceCodeInfo
|
|
* @function getTypeUrl
|
|
* @memberof google.protobuf.SourceCodeInfo
|
|
* @static
|
|
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
|
* @returns {string} The default type url
|
|
*/
|
|
SourceCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
if (typeUrlPrefix === undefined) {
|
|
typeUrlPrefix = "type.googleapis.com";
|
|
}
|
|
return typeUrlPrefix + "/google.protobuf.SourceCodeInfo";
|
|
};
|
|
|
|
SourceCodeInfo.Location = (function () {
|
|
/**
|
|
* Properties of a Location.
|
|
* @memberof google.protobuf.SourceCodeInfo
|
|
* @interface ILocation
|
|
* @property {Array.<number>|null} [path] Location path
|
|
* @property {Array.<number>|null} [span] Location span
|
|
* @property {string|null} [leadingComments] Location leadingComments
|
|
* @property {string|null} [trailingComments] Location trailingComments
|
|
* @property {Array.<string>|null} [leadingDetachedComments] Location leadingDetachedComments
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new Location.
|
|
* @memberof google.protobuf.SourceCodeInfo
|
|
* @classdesc Represents a Location.
|
|
* @implements ILocation
|
|
* @constructor
|
|
* @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set
|
|
*/
|
|
function Location(properties) {
|
|
this.path = [];
|
|
this.span = [];
|
|
this.leadingDetachedComments = [];
|
|
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]];
|
|
}
|
|
|
|
/**
|
|
* Location path.
|
|
* @member {Array.<number>} path
|
|
* @memberof google.protobuf.SourceCodeInfo.Location
|
|
* @instance
|
|
*/
|
|
Location.prototype.path = $util.emptyArray;
|
|
|
|
/**
|
|
* Location span.
|
|
* @member {Array.<number>} span
|
|
* @memberof google.protobuf.SourceCodeInfo.Location
|
|
* @instance
|
|
*/
|
|
Location.prototype.span = $util.emptyArray;
|
|
|
|
/**
|
|
* Location leadingComments.
|
|
* @member {string} leadingComments
|
|
* @memberof google.protobuf.SourceCodeInfo.Location
|
|
* @instance
|
|
*/
|
|
Location.prototype.leadingComments = "";
|
|
|
|
/**
|
|
* Location trailingComments.
|
|
* @member {string} trailingComments
|
|
* @memberof google.protobuf.SourceCodeInfo.Location
|
|
* @instance
|
|
*/
|
|
Location.prototype.trailingComments = "";
|
|
|
|
/**
|
|
* Location leadingDetachedComments.
|
|
* @member {Array.<string>} leadingDetachedComments
|
|
* @memberof google.protobuf.SourceCodeInfo.Location
|
|
* @instance
|
|
*/
|
|
Location.prototype.leadingDetachedComments = $util.emptyArray;
|
|
|
|
/**
|
|
* Creates a new Location instance using the specified properties.
|
|
* @function create
|
|
* @memberof google.protobuf.SourceCodeInfo.Location
|
|
* @static
|
|
* @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set
|
|
* @returns {google.protobuf.SourceCodeInfo.Location} Location instance
|
|
*/
|
|
Location.create = function create(properties) {
|
|
return new Location(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof google.protobuf.SourceCodeInfo.Location
|
|
* @static
|
|
* @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
Location.encode = function encode(message, writer) {
|
|
if (!writer) writer = $Writer.create();
|
|
if (message.path != null && message.path.length) {
|
|
writer.uint32(/* id 1, wireType 2 =*/ 10).fork();
|
|
for (var i = 0; i < message.path.length; ++i)
|
|
writer.int32(message.path[i]);
|
|
writer.ldelim();
|
|
}
|
|
if (message.span != null && message.span.length) {
|
|
writer.uint32(/* id 2, wireType 2 =*/ 18).fork();
|
|
for (var i = 0; i < message.span.length; ++i)
|
|
writer.int32(message.span[i]);
|
|
writer.ldelim();
|
|
}
|
|
if (
|
|
message.leadingComments != null &&
|
|
Object.hasOwnProperty.call(message, "leadingComments")
|
|
)
|
|
writer
|
|
.uint32(/* id 3, wireType 2 =*/ 26)
|
|
.string(message.leadingComments);
|
|
if (
|
|
message.trailingComments != null &&
|
|
Object.hasOwnProperty.call(message, "trailingComments")
|
|
)
|
|
writer
|
|
.uint32(/* id 4, wireType 2 =*/ 34)
|
|
.string(message.trailingComments);
|
|
if (
|
|
message.leadingDetachedComments != null &&
|
|
message.leadingDetachedComments.length
|
|
)
|
|
for (var i = 0; i < message.leadingDetachedComments.length; ++i)
|
|
writer
|
|
.uint32(/* id 6, wireType 2 =*/ 50)
|
|
.string(message.leadingDetachedComments[i]);
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof google.protobuf.SourceCodeInfo.Location
|
|
* @static
|
|
* @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
Location.encodeDelimited = function encodeDelimited(message, writer) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes a Location message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof google.protobuf.SourceCodeInfo.Location
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {google.protobuf.SourceCodeInfo.Location} Location
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
Location.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.google.protobuf.SourceCodeInfo.Location();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
if (tag === error) break;
|
|
switch (tag >>> 3) {
|
|
case 1: {
|
|
if (!(message.path && message.path.length)) message.path = [];
|
|
if ((tag & 7) === 2) {
|
|
var end2 = reader.uint32() + reader.pos;
|
|
while (reader.pos < end2) message.path.push(reader.int32());
|
|
} else message.path.push(reader.int32());
|
|
break;
|
|
}
|
|
case 2: {
|
|
if (!(message.span && message.span.length)) message.span = [];
|
|
if ((tag & 7) === 2) {
|
|
var end2 = reader.uint32() + reader.pos;
|
|
while (reader.pos < end2) message.span.push(reader.int32());
|
|
} else message.span.push(reader.int32());
|
|
break;
|
|
}
|
|
case 3: {
|
|
message.leadingComments = reader.string();
|
|
break;
|
|
}
|
|
case 4: {
|
|
message.trailingComments = reader.string();
|
|
break;
|
|
}
|
|
case 6: {
|
|
if (
|
|
!(
|
|
message.leadingDetachedComments &&
|
|
message.leadingDetachedComments.length
|
|
)
|
|
)
|
|
message.leadingDetachedComments = [];
|
|
message.leadingDetachedComments.push(reader.string());
|
|
break;
|
|
}
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes a Location message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof google.protobuf.SourceCodeInfo.Location
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {google.protobuf.SourceCodeInfo.Location} Location
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
Location.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader)) reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies a Location message.
|
|
* @function verify
|
|
* @memberof google.protobuf.SourceCodeInfo.Location
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
Location.verify = function verify(message) {
|
|
if (typeof message !== "object" || message === null)
|
|
return "object expected";
|
|
if (message.path != null && message.hasOwnProperty("path")) {
|
|
if (!Array.isArray(message.path)) return "path: array expected";
|
|
for (var i = 0; i < message.path.length; ++i)
|
|
if (!$util.isInteger(message.path[i]))
|
|
return "path: integer[] expected";
|
|
}
|
|
if (message.span != null && message.hasOwnProperty("span")) {
|
|
if (!Array.isArray(message.span)) return "span: array expected";
|
|
for (var i = 0; i < message.span.length; ++i)
|
|
if (!$util.isInteger(message.span[i]))
|
|
return "span: integer[] expected";
|
|
}
|
|
if (
|
|
message.leadingComments != null &&
|
|
message.hasOwnProperty("leadingComments")
|
|
)
|
|
if (!$util.isString(message.leadingComments))
|
|
return "leadingComments: string expected";
|
|
if (
|
|
message.trailingComments != null &&
|
|
message.hasOwnProperty("trailingComments")
|
|
)
|
|
if (!$util.isString(message.trailingComments))
|
|
return "trailingComments: string expected";
|
|
if (
|
|
message.leadingDetachedComments != null &&
|
|
message.hasOwnProperty("leadingDetachedComments")
|
|
) {
|
|
if (!Array.isArray(message.leadingDetachedComments))
|
|
return "leadingDetachedComments: array expected";
|
|
for (var i = 0; i < message.leadingDetachedComments.length; ++i)
|
|
if (!$util.isString(message.leadingDetachedComments[i]))
|
|
return "leadingDetachedComments: string[] expected";
|
|
}
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates a Location message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof google.protobuf.SourceCodeInfo.Location
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {google.protobuf.SourceCodeInfo.Location} Location
|
|
*/
|
|
Location.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.google.protobuf.SourceCodeInfo.Location)
|
|
return object;
|
|
var message = new $root.google.protobuf.SourceCodeInfo.Location();
|
|
if (object.path) {
|
|
if (!Array.isArray(object.path))
|
|
throw TypeError(
|
|
".google.protobuf.SourceCodeInfo.Location.path: array expected"
|
|
);
|
|
message.path = [];
|
|
for (var i = 0; i < object.path.length; ++i)
|
|
message.path[i] = object.path[i] | 0;
|
|
}
|
|
if (object.span) {
|
|
if (!Array.isArray(object.span))
|
|
throw TypeError(
|
|
".google.protobuf.SourceCodeInfo.Location.span: array expected"
|
|
);
|
|
message.span = [];
|
|
for (var i = 0; i < object.span.length; ++i)
|
|
message.span[i] = object.span[i] | 0;
|
|
}
|
|
if (object.leadingComments != null)
|
|
message.leadingComments = String(object.leadingComments);
|
|
if (object.trailingComments != null)
|
|
message.trailingComments = String(object.trailingComments);
|
|
if (object.leadingDetachedComments) {
|
|
if (!Array.isArray(object.leadingDetachedComments))
|
|
throw TypeError(
|
|
".google.protobuf.SourceCodeInfo.Location.leadingDetachedComments: array expected"
|
|
);
|
|
message.leadingDetachedComments = [];
|
|
for (var i = 0; i < object.leadingDetachedComments.length; ++i)
|
|
message.leadingDetachedComments[i] = String(
|
|
object.leadingDetachedComments[i]
|
|
);
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from a Location message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof google.protobuf.SourceCodeInfo.Location
|
|
* @static
|
|
* @param {google.protobuf.SourceCodeInfo.Location} message Location
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
Location.toObject = function toObject(message, options) {
|
|
if (!options) options = {};
|
|
var object = {};
|
|
if (options.arrays || options.defaults) {
|
|
object.path = [];
|
|
object.span = [];
|
|
object.leadingDetachedComments = [];
|
|
}
|
|
if (options.defaults) {
|
|
object.leadingComments = "";
|
|
object.trailingComments = "";
|
|
}
|
|
if (message.path && message.path.length) {
|
|
object.path = [];
|
|
for (var j = 0; j < message.path.length; ++j)
|
|
object.path[j] = message.path[j];
|
|
}
|
|
if (message.span && message.span.length) {
|
|
object.span = [];
|
|
for (var j = 0; j < message.span.length; ++j)
|
|
object.span[j] = message.span[j];
|
|
}
|
|
if (
|
|
message.leadingComments != null &&
|
|
message.hasOwnProperty("leadingComments")
|
|
)
|
|
object.leadingComments = message.leadingComments;
|
|
if (
|
|
message.trailingComments != null &&
|
|
message.hasOwnProperty("trailingComments")
|
|
)
|
|
object.trailingComments = message.trailingComments;
|
|
if (
|
|
message.leadingDetachedComments &&
|
|
message.leadingDetachedComments.length
|
|
) {
|
|
object.leadingDetachedComments = [];
|
|
for (var j = 0; j < message.leadingDetachedComments.length; ++j)
|
|
object.leadingDetachedComments[j] =
|
|
message.leadingDetachedComments[j];
|
|
}
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this Location to JSON.
|
|
* @function toJSON
|
|
* @memberof google.protobuf.SourceCodeInfo.Location
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
Location.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
/**
|
|
* Gets the default type url for Location
|
|
* @function getTypeUrl
|
|
* @memberof google.protobuf.SourceCodeInfo.Location
|
|
* @static
|
|
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
|
* @returns {string} The default type url
|
|
*/
|
|
Location.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
if (typeUrlPrefix === undefined) {
|
|
typeUrlPrefix = "type.googleapis.com";
|
|
}
|
|
return typeUrlPrefix + "/google.protobuf.SourceCodeInfo.Location";
|
|
};
|
|
|
|
return Location;
|
|
})();
|
|
|
|
return SourceCodeInfo;
|
|
})();
|
|
|
|
protobuf.GeneratedCodeInfo = (function () {
|
|
/**
|
|
* Properties of a GeneratedCodeInfo.
|
|
* @memberof google.protobuf
|
|
* @interface IGeneratedCodeInfo
|
|
* @property {Array.<google.protobuf.GeneratedCodeInfo.IAnnotation>|null} [annotation] GeneratedCodeInfo annotation
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new GeneratedCodeInfo.
|
|
* @memberof google.protobuf
|
|
* @classdesc Represents a GeneratedCodeInfo.
|
|
* @implements IGeneratedCodeInfo
|
|
* @constructor
|
|
* @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set
|
|
*/
|
|
function GeneratedCodeInfo(properties) {
|
|
this.annotation = [];
|
|
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]];
|
|
}
|
|
|
|
/**
|
|
* GeneratedCodeInfo annotation.
|
|
* @member {Array.<google.protobuf.GeneratedCodeInfo.IAnnotation>} annotation
|
|
* @memberof google.protobuf.GeneratedCodeInfo
|
|
* @instance
|
|
*/
|
|
GeneratedCodeInfo.prototype.annotation = $util.emptyArray;
|
|
|
|
/**
|
|
* Creates a new GeneratedCodeInfo instance using the specified properties.
|
|
* @function create
|
|
* @memberof google.protobuf.GeneratedCodeInfo
|
|
* @static
|
|
* @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set
|
|
* @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo instance
|
|
*/
|
|
GeneratedCodeInfo.create = function create(properties) {
|
|
return new GeneratedCodeInfo(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof google.protobuf.GeneratedCodeInfo
|
|
* @static
|
|
* @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
GeneratedCodeInfo.encode = function encode(message, writer) {
|
|
if (!writer) writer = $Writer.create();
|
|
if (message.annotation != null && message.annotation.length)
|
|
for (var i = 0; i < message.annotation.length; ++i)
|
|
$root.google.protobuf.GeneratedCodeInfo.Annotation.encode(
|
|
message.annotation[i],
|
|
writer.uint32(/* id 1, wireType 2 =*/ 10).fork()
|
|
).ldelim();
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof google.protobuf.GeneratedCodeInfo
|
|
* @static
|
|
* @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
GeneratedCodeInfo.encodeDelimited = function encodeDelimited(
|
|
message,
|
|
writer
|
|
) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes a GeneratedCodeInfo message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof google.protobuf.GeneratedCodeInfo
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
GeneratedCodeInfo.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.google.protobuf.GeneratedCodeInfo();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
if (tag === error) break;
|
|
switch (tag >>> 3) {
|
|
case 1: {
|
|
if (!(message.annotation && message.annotation.length))
|
|
message.annotation = [];
|
|
message.annotation.push(
|
|
$root.google.protobuf.GeneratedCodeInfo.Annotation.decode(
|
|
reader,
|
|
reader.uint32()
|
|
)
|
|
);
|
|
break;
|
|
}
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof google.protobuf.GeneratedCodeInfo
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
GeneratedCodeInfo.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader)) reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies a GeneratedCodeInfo message.
|
|
* @function verify
|
|
* @memberof google.protobuf.GeneratedCodeInfo
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
GeneratedCodeInfo.verify = function verify(message) {
|
|
if (typeof message !== "object" || message === null)
|
|
return "object expected";
|
|
if (
|
|
message.annotation != null &&
|
|
message.hasOwnProperty("annotation")
|
|
) {
|
|
if (!Array.isArray(message.annotation))
|
|
return "annotation: array expected";
|
|
for (var i = 0; i < message.annotation.length; ++i) {
|
|
var error =
|
|
$root.google.protobuf.GeneratedCodeInfo.Annotation.verify(
|
|
message.annotation[i]
|
|
);
|
|
if (error) return "annotation." + error;
|
|
}
|
|
}
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof google.protobuf.GeneratedCodeInfo
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo
|
|
*/
|
|
GeneratedCodeInfo.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.google.protobuf.GeneratedCodeInfo)
|
|
return object;
|
|
var message = new $root.google.protobuf.GeneratedCodeInfo();
|
|
if (object.annotation) {
|
|
if (!Array.isArray(object.annotation))
|
|
throw TypeError(
|
|
".google.protobuf.GeneratedCodeInfo.annotation: array expected"
|
|
);
|
|
message.annotation = [];
|
|
for (var i = 0; i < object.annotation.length; ++i) {
|
|
if (typeof object.annotation[i] !== "object")
|
|
throw TypeError(
|
|
".google.protobuf.GeneratedCodeInfo.annotation: object expected"
|
|
);
|
|
message.annotation[i] =
|
|
$root.google.protobuf.GeneratedCodeInfo.Annotation.fromObject(
|
|
object.annotation[i]
|
|
);
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof google.protobuf.GeneratedCodeInfo
|
|
* @static
|
|
* @param {google.protobuf.GeneratedCodeInfo} message GeneratedCodeInfo
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
GeneratedCodeInfo.toObject = function toObject(message, options) {
|
|
if (!options) options = {};
|
|
var object = {};
|
|
if (options.arrays || options.defaults) object.annotation = [];
|
|
if (message.annotation && message.annotation.length) {
|
|
object.annotation = [];
|
|
for (var j = 0; j < message.annotation.length; ++j)
|
|
object.annotation[j] =
|
|
$root.google.protobuf.GeneratedCodeInfo.Annotation.toObject(
|
|
message.annotation[j],
|
|
options
|
|
);
|
|
}
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this GeneratedCodeInfo to JSON.
|
|
* @function toJSON
|
|
* @memberof google.protobuf.GeneratedCodeInfo
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
GeneratedCodeInfo.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
/**
|
|
* Gets the default type url for GeneratedCodeInfo
|
|
* @function getTypeUrl
|
|
* @memberof google.protobuf.GeneratedCodeInfo
|
|
* @static
|
|
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
|
* @returns {string} The default type url
|
|
*/
|
|
GeneratedCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
if (typeUrlPrefix === undefined) {
|
|
typeUrlPrefix = "type.googleapis.com";
|
|
}
|
|
return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo";
|
|
};
|
|
|
|
GeneratedCodeInfo.Annotation = (function () {
|
|
/**
|
|
* Properties of an Annotation.
|
|
* @memberof google.protobuf.GeneratedCodeInfo
|
|
* @interface IAnnotation
|
|
* @property {Array.<number>|null} [path] Annotation path
|
|
* @property {string|null} [sourceFile] Annotation sourceFile
|
|
* @property {number|null} [begin] Annotation begin
|
|
* @property {number|null} [end] Annotation end
|
|
* @property {google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null} [semantic] Annotation semantic
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new Annotation.
|
|
* @memberof google.protobuf.GeneratedCodeInfo
|
|
* @classdesc Represents an Annotation.
|
|
* @implements IAnnotation
|
|
* @constructor
|
|
* @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set
|
|
*/
|
|
function Annotation(properties) {
|
|
this.path = [];
|
|
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]];
|
|
}
|
|
|
|
/**
|
|
* Annotation path.
|
|
* @member {Array.<number>} path
|
|
* @memberof google.protobuf.GeneratedCodeInfo.Annotation
|
|
* @instance
|
|
*/
|
|
Annotation.prototype.path = $util.emptyArray;
|
|
|
|
/**
|
|
* Annotation sourceFile.
|
|
* @member {string} sourceFile
|
|
* @memberof google.protobuf.GeneratedCodeInfo.Annotation
|
|
* @instance
|
|
*/
|
|
Annotation.prototype.sourceFile = "";
|
|
|
|
/**
|
|
* Annotation begin.
|
|
* @member {number} begin
|
|
* @memberof google.protobuf.GeneratedCodeInfo.Annotation
|
|
* @instance
|
|
*/
|
|
Annotation.prototype.begin = 0;
|
|
|
|
/**
|
|
* Annotation end.
|
|
* @member {number} end
|
|
* @memberof google.protobuf.GeneratedCodeInfo.Annotation
|
|
* @instance
|
|
*/
|
|
Annotation.prototype.end = 0;
|
|
|
|
/**
|
|
* Annotation semantic.
|
|
* @member {google.protobuf.GeneratedCodeInfo.Annotation.Semantic} semantic
|
|
* @memberof google.protobuf.GeneratedCodeInfo.Annotation
|
|
* @instance
|
|
*/
|
|
Annotation.prototype.semantic = 0;
|
|
|
|
/**
|
|
* Creates a new Annotation instance using the specified properties.
|
|
* @function create
|
|
* @memberof google.protobuf.GeneratedCodeInfo.Annotation
|
|
* @static
|
|
* @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set
|
|
* @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation instance
|
|
*/
|
|
Annotation.create = function create(properties) {
|
|
return new Annotation(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof google.protobuf.GeneratedCodeInfo.Annotation
|
|
* @static
|
|
* @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
Annotation.encode = function encode(message, writer) {
|
|
if (!writer) writer = $Writer.create();
|
|
if (message.path != null && message.path.length) {
|
|
writer.uint32(/* id 1, wireType 2 =*/ 10).fork();
|
|
for (var i = 0; i < message.path.length; ++i)
|
|
writer.int32(message.path[i]);
|
|
writer.ldelim();
|
|
}
|
|
if (
|
|
message.sourceFile != null &&
|
|
Object.hasOwnProperty.call(message, "sourceFile")
|
|
)
|
|
writer
|
|
.uint32(/* id 2, wireType 2 =*/ 18)
|
|
.string(message.sourceFile);
|
|
if (
|
|
message.begin != null &&
|
|
Object.hasOwnProperty.call(message, "begin")
|
|
)
|
|
writer.uint32(/* id 3, wireType 0 =*/ 24).int32(message.begin);
|
|
if (message.end != null && Object.hasOwnProperty.call(message, "end"))
|
|
writer.uint32(/* id 4, wireType 0 =*/ 32).int32(message.end);
|
|
if (
|
|
message.semantic != null &&
|
|
Object.hasOwnProperty.call(message, "semantic")
|
|
)
|
|
writer.uint32(/* id 5, wireType 0 =*/ 40).int32(message.semantic);
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof google.protobuf.GeneratedCodeInfo.Annotation
|
|
* @static
|
|
* @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
Annotation.encodeDelimited = function encodeDelimited(message, writer) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes an Annotation message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof google.protobuf.GeneratedCodeInfo.Annotation
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
Annotation.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.google.protobuf.GeneratedCodeInfo.Annotation();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
if (tag === error) break;
|
|
switch (tag >>> 3) {
|
|
case 1: {
|
|
if (!(message.path && message.path.length)) message.path = [];
|
|
if ((tag & 7) === 2) {
|
|
var end2 = reader.uint32() + reader.pos;
|
|
while (reader.pos < end2) message.path.push(reader.int32());
|
|
} else message.path.push(reader.int32());
|
|
break;
|
|
}
|
|
case 2: {
|
|
message.sourceFile = reader.string();
|
|
break;
|
|
}
|
|
case 3: {
|
|
message.begin = reader.int32();
|
|
break;
|
|
}
|
|
case 4: {
|
|
message.end = reader.int32();
|
|
break;
|
|
}
|
|
case 5: {
|
|
message.semantic = reader.int32();
|
|
break;
|
|
}
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes an Annotation message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof google.protobuf.GeneratedCodeInfo.Annotation
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
Annotation.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader)) reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies an Annotation message.
|
|
* @function verify
|
|
* @memberof google.protobuf.GeneratedCodeInfo.Annotation
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
Annotation.verify = function verify(message) {
|
|
if (typeof message !== "object" || message === null)
|
|
return "object expected";
|
|
if (message.path != null && message.hasOwnProperty("path")) {
|
|
if (!Array.isArray(message.path)) return "path: array expected";
|
|
for (var i = 0; i < message.path.length; ++i)
|
|
if (!$util.isInteger(message.path[i]))
|
|
return "path: integer[] expected";
|
|
}
|
|
if (
|
|
message.sourceFile != null &&
|
|
message.hasOwnProperty("sourceFile")
|
|
)
|
|
if (!$util.isString(message.sourceFile))
|
|
return "sourceFile: string expected";
|
|
if (message.begin != null && message.hasOwnProperty("begin"))
|
|
if (!$util.isInteger(message.begin))
|
|
return "begin: integer expected";
|
|
if (message.end != null && message.hasOwnProperty("end"))
|
|
if (!$util.isInteger(message.end)) return "end: integer expected";
|
|
if (message.semantic != null && message.hasOwnProperty("semantic"))
|
|
switch (message.semantic) {
|
|
default:
|
|
return "semantic: enum value expected";
|
|
case 0:
|
|
case 1:
|
|
case 2:
|
|
break;
|
|
}
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates an Annotation message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof google.protobuf.GeneratedCodeInfo.Annotation
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation
|
|
*/
|
|
Annotation.fromObject = function fromObject(object) {
|
|
if (
|
|
object instanceof $root.google.protobuf.GeneratedCodeInfo.Annotation
|
|
)
|
|
return object;
|
|
var message =
|
|
new $root.google.protobuf.GeneratedCodeInfo.Annotation();
|
|
if (object.path) {
|
|
if (!Array.isArray(object.path))
|
|
throw TypeError(
|
|
".google.protobuf.GeneratedCodeInfo.Annotation.path: array expected"
|
|
);
|
|
message.path = [];
|
|
for (var i = 0; i < object.path.length; ++i)
|
|
message.path[i] = object.path[i] | 0;
|
|
}
|
|
if (object.sourceFile != null)
|
|
message.sourceFile = String(object.sourceFile);
|
|
if (object.begin != null) message.begin = object.begin | 0;
|
|
if (object.end != null) message.end = object.end | 0;
|
|
switch (object.semantic) {
|
|
default:
|
|
if (typeof object.semantic === "number") {
|
|
message.semantic = object.semantic;
|
|
break;
|
|
}
|
|
break;
|
|
case "NONE":
|
|
case 0:
|
|
message.semantic = 0;
|
|
break;
|
|
case "SET":
|
|
case 1:
|
|
message.semantic = 1;
|
|
break;
|
|
case "ALIAS":
|
|
case 2:
|
|
message.semantic = 2;
|
|
break;
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from an Annotation message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof google.protobuf.GeneratedCodeInfo.Annotation
|
|
* @static
|
|
* @param {google.protobuf.GeneratedCodeInfo.Annotation} message Annotation
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
Annotation.toObject = function toObject(message, options) {
|
|
if (!options) options = {};
|
|
var object = {};
|
|
if (options.arrays || options.defaults) object.path = [];
|
|
if (options.defaults) {
|
|
object.sourceFile = "";
|
|
object.begin = 0;
|
|
object.end = 0;
|
|
object.semantic = options.enums === String ? "NONE" : 0;
|
|
}
|
|
if (message.path && message.path.length) {
|
|
object.path = [];
|
|
for (var j = 0; j < message.path.length; ++j)
|
|
object.path[j] = message.path[j];
|
|
}
|
|
if (
|
|
message.sourceFile != null &&
|
|
message.hasOwnProperty("sourceFile")
|
|
)
|
|
object.sourceFile = message.sourceFile;
|
|
if (message.begin != null && message.hasOwnProperty("begin"))
|
|
object.begin = message.begin;
|
|
if (message.end != null && message.hasOwnProperty("end"))
|
|
object.end = message.end;
|
|
if (message.semantic != null && message.hasOwnProperty("semantic"))
|
|
object.semantic =
|
|
options.enums === String
|
|
? $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[
|
|
message.semantic
|
|
] === undefined
|
|
? message.semantic
|
|
: $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[
|
|
message.semantic
|
|
]
|
|
: message.semantic;
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this Annotation to JSON.
|
|
* @function toJSON
|
|
* @memberof google.protobuf.GeneratedCodeInfo.Annotation
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
Annotation.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
/**
|
|
* Gets the default type url for Annotation
|
|
* @function getTypeUrl
|
|
* @memberof google.protobuf.GeneratedCodeInfo.Annotation
|
|
* @static
|
|
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
|
* @returns {string} The default type url
|
|
*/
|
|
Annotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
if (typeUrlPrefix === undefined) {
|
|
typeUrlPrefix = "type.googleapis.com";
|
|
}
|
|
return (
|
|
typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo.Annotation"
|
|
);
|
|
};
|
|
|
|
/**
|
|
* Semantic enum.
|
|
* @name google.protobuf.GeneratedCodeInfo.Annotation.Semantic
|
|
* @enum {number}
|
|
* @property {number} NONE=0 NONE value
|
|
* @property {number} SET=1 SET value
|
|
* @property {number} ALIAS=2 ALIAS value
|
|
*/
|
|
Annotation.Semantic = (function () {
|
|
var valuesById = {},
|
|
values = Object.create(valuesById);
|
|
values[(valuesById[0] = "NONE")] = 0;
|
|
values[(valuesById[1] = "SET")] = 1;
|
|
values[(valuesById[2] = "ALIAS")] = 2;
|
|
return values;
|
|
})();
|
|
|
|
return Annotation;
|
|
})();
|
|
|
|
return GeneratedCodeInfo;
|
|
})();
|
|
|
|
/**
|
|
* SymbolVisibility enum.
|
|
* @name google.protobuf.SymbolVisibility
|
|
* @enum {number}
|
|
* @property {number} VISIBILITY_UNSET=0 VISIBILITY_UNSET value
|
|
* @property {number} VISIBILITY_LOCAL=1 VISIBILITY_LOCAL value
|
|
* @property {number} VISIBILITY_EXPORT=2 VISIBILITY_EXPORT value
|
|
*/
|
|
protobuf.SymbolVisibility = (function () {
|
|
var valuesById = {},
|
|
values = Object.create(valuesById);
|
|
values[(valuesById[0] = "VISIBILITY_UNSET")] = 0;
|
|
values[(valuesById[1] = "VISIBILITY_LOCAL")] = 1;
|
|
values[(valuesById[2] = "VISIBILITY_EXPORT")] = 2;
|
|
return values;
|
|
})();
|
|
|
|
return protobuf;
|
|
})();
|
|
|
|
return google;
|
|
})();
|
|
|
|
module.exports = $root;
|
|
|
|
module.exports.default = module.exports;
|