@google-apps/chat
Version:
Google Chat API client for Node.js
1,018 lines (938 loc) • 3.95 MB
JavaScript
// Copyright 2025 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/
(function(global, factory) { /* global define, require, module */
/* AMD */ if (typeof define === 'function' && define.amd)
define(["protobufjs/minimal"], factory);
/* CommonJS */ else if (typeof require === 'function' && typeof module === 'object' && module && module.exports)
module.exports = factory(require("google-gax/build/src/protobuf").protobufMinimal);
})(this, function($protobuf) {
"use strict";
// Common aliases
var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util;
// Exported root namespace
var $root = $protobuf.roots._google_apps_chat_protos || ($protobuf.roots._google_apps_chat_protos = {});
$root.google = (function() {
/**
* Namespace google.
* @exports google
* @namespace
*/
var google = {};
google.protobuf = (function() {
/**
* Namespace protobuf.
* @memberof google
* @namespace
*/
var protobuf = {};
protobuf.DoubleValue = (function() {
/**
* Properties of a DoubleValue.
* @memberof google.protobuf
* @interface IDoubleValue
* @property {number|null} [value] DoubleValue value
*/
/**
* Constructs a new DoubleValue.
* @memberof google.protobuf
* @classdesc Represents a DoubleValue.
* @implements IDoubleValue
* @constructor
* @param {google.protobuf.IDoubleValue=} [properties] Properties to set
*/
function DoubleValue(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]];
}
/**
* DoubleValue value.
* @member {number} value
* @memberof google.protobuf.DoubleValue
* @instance
*/
DoubleValue.prototype.value = 0;
/**
* Creates a new DoubleValue instance using the specified properties.
* @function create
* @memberof google.protobuf.DoubleValue
* @static
* @param {google.protobuf.IDoubleValue=} [properties] Properties to set
* @returns {google.protobuf.DoubleValue} DoubleValue instance
*/
DoubleValue.create = function create(properties) {
return new DoubleValue(properties);
};
/**
* Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages.
* @function encode
* @memberof google.protobuf.DoubleValue
* @static
* @param {google.protobuf.IDoubleValue} message DoubleValue message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
DoubleValue.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.value != null && Object.hasOwnProperty.call(message, "value"))
writer.uint32(/* id 1, wireType 1 =*/9).double(message.value);
return writer;
};
/**
* Encodes the specified DoubleValue message, length delimited. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages.
* @function encodeDelimited
* @memberof google.protobuf.DoubleValue
* @static
* @param {google.protobuf.IDoubleValue} message DoubleValue message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
DoubleValue.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a DoubleValue message from the specified reader or buffer.
* @function decode
* @memberof google.protobuf.DoubleValue
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {google.protobuf.DoubleValue} DoubleValue
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
DoubleValue.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.DoubleValue();
while (reader.pos < end) {
var tag = reader.uint32();
if (tag === error)
break;
switch (tag >>> 3) {
case 1: {
message.value = reader.double();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a DoubleValue message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof google.protobuf.DoubleValue
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {google.protobuf.DoubleValue} DoubleValue
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
DoubleValue.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a DoubleValue message.
* @function verify
* @memberof google.protobuf.DoubleValue
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
DoubleValue.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.value != null && message.hasOwnProperty("value"))
if (typeof message.value !== "number")
return "value: number expected";
return null;
};
/**
* Creates a DoubleValue message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof google.protobuf.DoubleValue
* @static
* @param {Object.<string,*>} object Plain object
* @returns {google.protobuf.DoubleValue} DoubleValue
*/
DoubleValue.fromObject = function fromObject(object) {
if (object instanceof $root.google.protobuf.DoubleValue)
return object;
var message = new $root.google.protobuf.DoubleValue();
if (object.value != null)
message.value = Number(object.value);
return message;
};
/**
* Creates a plain object from a DoubleValue message. Also converts values to other types if specified.
* @function toObject
* @memberof google.protobuf.DoubleValue
* @static
* @param {google.protobuf.DoubleValue} message DoubleValue
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
DoubleValue.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults)
object.value = 0;
if (message.value != null && message.hasOwnProperty("value"))
object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value;
return object;
};
/**
* Converts this DoubleValue to JSON.
* @function toJSON
* @memberof google.protobuf.DoubleValue
* @instance
* @returns {Object.<string,*>} JSON object
*/
DoubleValue.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for DoubleValue
* @function getTypeUrl
* @memberof google.protobuf.DoubleValue
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
DoubleValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/google.protobuf.DoubleValue";
};
return DoubleValue;
})();
protobuf.FloatValue = (function() {
/**
* Properties of a FloatValue.
* @memberof google.protobuf
* @interface IFloatValue
* @property {number|null} [value] FloatValue value
*/
/**
* Constructs a new FloatValue.
* @memberof google.protobuf
* @classdesc Represents a FloatValue.
* @implements IFloatValue
* @constructor
* @param {google.protobuf.IFloatValue=} [properties] Properties to set
*/
function FloatValue(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]];
}
/**
* FloatValue value.
* @member {number} value
* @memberof google.protobuf.FloatValue
* @instance
*/
FloatValue.prototype.value = 0;
/**
* Creates a new FloatValue instance using the specified properties.
* @function create
* @memberof google.protobuf.FloatValue
* @static
* @param {google.protobuf.IFloatValue=} [properties] Properties to set
* @returns {google.protobuf.FloatValue} FloatValue instance
*/
FloatValue.create = function create(properties) {
return new FloatValue(properties);
};
/**
* Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages.
* @function encode
* @memberof google.protobuf.FloatValue
* @static
* @param {google.protobuf.IFloatValue} message FloatValue message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
FloatValue.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.value != null && Object.hasOwnProperty.call(message, "value"))
writer.uint32(/* id 1, wireType 5 =*/13).float(message.value);
return writer;
};
/**
* Encodes the specified FloatValue message, length delimited. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages.
* @function encodeDelimited
* @memberof google.protobuf.FloatValue
* @static
* @param {google.protobuf.IFloatValue} message FloatValue message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
FloatValue.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a FloatValue message from the specified reader or buffer.
* @function decode
* @memberof google.protobuf.FloatValue
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {google.protobuf.FloatValue} FloatValue
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
FloatValue.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.FloatValue();
while (reader.pos < end) {
var tag = reader.uint32();
if (tag === error)
break;
switch (tag >>> 3) {
case 1: {
message.value = reader.float();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a FloatValue message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof google.protobuf.FloatValue
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {google.protobuf.FloatValue} FloatValue
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
FloatValue.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a FloatValue message.
* @function verify
* @memberof google.protobuf.FloatValue
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
FloatValue.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.value != null && message.hasOwnProperty("value"))
if (typeof message.value !== "number")
return "value: number expected";
return null;
};
/**
* Creates a FloatValue message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof google.protobuf.FloatValue
* @static
* @param {Object.<string,*>} object Plain object
* @returns {google.protobuf.FloatValue} FloatValue
*/
FloatValue.fromObject = function fromObject(object) {
if (object instanceof $root.google.protobuf.FloatValue)
return object;
var message = new $root.google.protobuf.FloatValue();
if (object.value != null)
message.value = Number(object.value);
return message;
};
/**
* Creates a plain object from a FloatValue message. Also converts values to other types if specified.
* @function toObject
* @memberof google.protobuf.FloatValue
* @static
* @param {google.protobuf.FloatValue} message FloatValue
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
FloatValue.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults)
object.value = 0;
if (message.value != null && message.hasOwnProperty("value"))
object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value;
return object;
};
/**
* Converts this FloatValue to JSON.
* @function toJSON
* @memberof google.protobuf.FloatValue
* @instance
* @returns {Object.<string,*>} JSON object
*/
FloatValue.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for FloatValue
* @function getTypeUrl
* @memberof google.protobuf.FloatValue
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
FloatValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/google.protobuf.FloatValue";
};
return FloatValue;
})();
protobuf.Int64Value = (function() {
/**
* Properties of an Int64Value.
* @memberof google.protobuf
* @interface IInt64Value
* @property {number|Long|null} [value] Int64Value value
*/
/**
* Constructs a new Int64Value.
* @memberof google.protobuf
* @classdesc Represents an Int64Value.
* @implements IInt64Value
* @constructor
* @param {google.protobuf.IInt64Value=} [properties] Properties to set
*/
function Int64Value(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]];
}
/**
* Int64Value value.
* @member {number|Long} value
* @memberof google.protobuf.Int64Value
* @instance
*/
Int64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
/**
* Creates a new Int64Value instance using the specified properties.
* @function create
* @memberof google.protobuf.Int64Value
* @static
* @param {google.protobuf.IInt64Value=} [properties] Properties to set
* @returns {google.protobuf.Int64Value} Int64Value instance
*/
Int64Value.create = function create(properties) {
return new Int64Value(properties);
};
/**
* Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages.
* @function encode
* @memberof google.protobuf.Int64Value
* @static
* @param {google.protobuf.IInt64Value} message Int64Value message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
Int64Value.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.value != null && Object.hasOwnProperty.call(message, "value"))
writer.uint32(/* id 1, wireType 0 =*/8).int64(message.value);
return writer;
};
/**
* Encodes the specified Int64Value message, length delimited. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages.
* @function encodeDelimited
* @memberof google.protobuf.Int64Value
* @static
* @param {google.protobuf.IInt64Value} message Int64Value message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
Int64Value.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes an Int64Value message from the specified reader or buffer.
* @function decode
* @memberof google.protobuf.Int64Value
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {google.protobuf.Int64Value} Int64Value
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
Int64Value.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.Int64Value();
while (reader.pos < end) {
var tag = reader.uint32();
if (tag === error)
break;
switch (tag >>> 3) {
case 1: {
message.value = reader.int64();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes an Int64Value message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof google.protobuf.Int64Value
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {google.protobuf.Int64Value} Int64Value
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
Int64Value.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies an Int64Value message.
* @function verify
* @memberof google.protobuf.Int64Value
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
Int64Value.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.value != null && message.hasOwnProperty("value"))
if (!$util.isInteger(message.value) && !(message.value && $util.isInteger(message.value.low) && $util.isInteger(message.value.high)))
return "value: integer|Long expected";
return null;
};
/**
* Creates an Int64Value message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof google.protobuf.Int64Value
* @static
* @param {Object.<string,*>} object Plain object
* @returns {google.protobuf.Int64Value} Int64Value
*/
Int64Value.fromObject = function fromObject(object) {
if (object instanceof $root.google.protobuf.Int64Value)
return object;
var message = new $root.google.protobuf.Int64Value();
if (object.value != null)
if ($util.Long)
(message.value = $util.Long.fromValue(object.value)).unsigned = false;
else if (typeof object.value === "string")
message.value = parseInt(object.value, 10);
else if (typeof object.value === "number")
message.value = object.value;
else if (typeof object.value === "object")
message.value = new $util.LongBits(object.value.low >>> 0, object.value.high >>> 0).toNumber();
return message;
};
/**
* Creates a plain object from an Int64Value message. Also converts values to other types if specified.
* @function toObject
* @memberof google.protobuf.Int64Value
* @static
* @param {google.protobuf.Int64Value} message Int64Value
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
Int64Value.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults)
if ($util.Long) {
var long = new $util.Long(0, 0, false);
object.value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
} else
object.value = options.longs === String ? "0" : 0;
if (message.value != null && message.hasOwnProperty("value"))
if (typeof message.value === "number")
object.value = options.longs === String ? String(message.value) : message.value;
else
object.value = options.longs === String ? $util.Long.prototype.toString.call(message.value) : options.longs === Number ? new $util.LongBits(message.value.low >>> 0, message.value.high >>> 0).toNumber() : message.value;
return object;
};
/**
* Converts this Int64Value to JSON.
* @function toJSON
* @memberof google.protobuf.Int64Value
* @instance
* @returns {Object.<string,*>} JSON object
*/
Int64Value.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for Int64Value
* @function getTypeUrl
* @memberof google.protobuf.Int64Value
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
Int64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/google.protobuf.Int64Value";
};
return Int64Value;
})();
protobuf.UInt64Value = (function() {
/**
* Properties of a UInt64Value.
* @memberof google.protobuf
* @interface IUInt64Value
* @property {number|Long|null} [value] UInt64Value value
*/
/**
* Constructs a new UInt64Value.
* @memberof google.protobuf
* @classdesc Represents a UInt64Value.
* @implements IUInt64Value
* @constructor
* @param {google.protobuf.IUInt64Value=} [properties] Properties to set
*/
function UInt64Value(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]];
}
/**
* UInt64Value value.
* @member {number|Long} value
* @memberof google.protobuf.UInt64Value
* @instance
*/
UInt64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
/**
* Creates a new UInt64Value instance using the specified properties.
* @function create
* @memberof google.protobuf.UInt64Value
* @static
* @param {google.protobuf.IUInt64Value=} [properties] Properties to set
* @returns {google.protobuf.UInt64Value} UInt64Value instance
*/
UInt64Value.create = function create(properties) {
return new UInt64Value(properties);
};
/**
* Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages.
* @function encode
* @memberof google.protobuf.UInt64Value
* @static
* @param {google.protobuf.IUInt64Value} message UInt64Value message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
UInt64Value.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.value != null && Object.hasOwnProperty.call(message, "value"))
writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.value);
return writer;
};
/**
* Encodes the specified UInt64Value message, length delimited. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages.
* @function encodeDelimited
* @memberof google.protobuf.UInt64Value
* @static
* @param {google.protobuf.IUInt64Value} message UInt64Value message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
UInt64Value.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a UInt64Value message from the specified reader or buffer.
* @function decode
* @memberof google.protobuf.UInt64Value
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {google.protobuf.UInt64Value} UInt64Value
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
UInt64Value.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.UInt64Value();
while (reader.pos < end) {
var tag = reader.uint32();
if (tag === error)
break;
switch (tag >>> 3) {
case 1: {
message.value = reader.uint64();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a UInt64Value message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof google.protobuf.UInt64Value
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {google.protobuf.UInt64Value} UInt64Value
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
UInt64Value.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a UInt64Value message.
* @function verify
* @memberof google.protobuf.UInt64Value
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
UInt64Value.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.value != null && message.hasOwnProperty("value"))
if (!$util.isInteger(message.value) && !(message.value && $util.isInteger(message.value.low) && $util.isInteger(message.value.high)))
return "value: integer|Long expected";
return null;
};
/**
* Creates a UInt64Value message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof google.protobuf.UInt64Value
* @static
* @param {Object.<string,*>} object Plain object
* @returns {google.protobuf.UInt64Value} UInt64Value
*/
UInt64Value.fromObject = function fromObject(object) {
if (object instanceof $root.google.protobuf.UInt64Value)
return object;
var message = new $root.google.protobuf.UInt64Value();
if (object.value != null)
if ($util.Long)
(message.value = $util.Long.fromValue(object.value)).unsigned = true;
else if (typeof object.value === "string")
message.value = parseInt(object.value, 10);
else if (typeof object.value === "number")
message.value = object.value;
else if (typeof object.value === "object")
message.value = new $util.LongBits(object.value.low >>> 0, object.value.high >>> 0).toNumber(true);
return message;
};
/**
* Creates a plain object from a UInt64Value message. Also converts values to other types if specified.
* @function toObject
* @memberof google.protobuf.UInt64Value
* @static
* @param {google.protobuf.UInt64Value} message UInt64Value
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
UInt64Value.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults)
if ($util.Long) {
var long = new $util.Long(0, 0, true);
object.value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
} else
object.value = options.longs === String ? "0" : 0;
if (message.value != null && message.hasOwnProperty("value"))
if (typeof message.value === "number")
object.value = options.longs === String ? String(message.value) : message.value;
else
object.value = options.longs === String ? $util.Long.prototype.toString.call(message.value) : options.longs === Number ? new $util.LongBits(message.value.low >>> 0, message.value.high >>> 0).toNumber(true) : message.value;
return object;
};
/**
* Converts this UInt64Value to JSON.
* @function toJSON
* @memberof google.protobuf.UInt64Value
* @instance
* @returns {Object.<string,*>} JSON object
*/
UInt64Value.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for UInt64Value
* @function getTypeUrl
* @memberof google.protobuf.UInt64Value
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
UInt64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/google.protobuf.UInt64Value";
};
return UInt64Value;
})();
protobuf.Int32Value = (function() {
/**
* Properties of an Int32Value.
* @memberof google.protobuf
* @interface IInt32Value
* @property {number|null} [value] Int32Value value
*/
/**
* Constructs a new Int32Value.
* @memberof google.protobuf
* @classdesc Represents an Int32Value.
* @implements IInt32Value
* @constructor
* @param {google.protobuf.IInt32Value=} [properties] Properties to set
*/
function Int32Value(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]];
}
/**
* Int32Value value.
* @member {number} value
* @memberof google.protobuf.Int32Value
* @instance
*/
Int32Value.prototype.value = 0;
/**
* Creates a new Int32Value instance using the specified properties.
* @function create
* @memberof google.protobuf.Int32Value
* @static
* @param {google.protobuf.IInt32Value=} [properties] Properties to set
* @returns {google.protobuf.Int32Value} Int32Value instance
*/
Int32Value.create = function create(properties) {
return new Int32Value(properties);
};
/**
* Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages.
* @function encode
* @memberof google.protobuf.Int32Value
* @static
* @param {google.protobuf.IInt32Value} message Int32Value message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
Int32Value.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.value != null && Object.hasOwnProperty.call(message, "value"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.value);
return writer;
};
/**
* Encodes the specified Int32Value message, length delimited. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages.
* @function encodeDelimited
* @memberof google.protobuf.Int32Value
* @static
* @param {google.protobuf.IInt32Value} message Int32Value message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
Int32Value.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes an Int32Value message from the specified reader or buffer.
* @function decode
* @memberof google.protobuf.Int32Value
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {google.protobuf.Int32Value} Int32Value
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
Int32Value.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.Int32Value();
while (reader.pos < end) {
var tag = reader.uint32();
if (tag === error)
break;
switch (tag >>> 3) {
case 1: {
message.value = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes an Int32Value message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof google.protobuf.Int32Value
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {google.protobuf.Int32Value} Int32Value
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
Int32Value.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);