From 5685b37ff14e13009e22af6e9f84178580dae796 Mon Sep 17 00:00:00 2001 From: Ehsan Nasiri Date: Wed, 18 Oct 2023 14:29:27 -0700 Subject: [PATCH 01/19] Add QueryMode protos. --- dev/protos/firestore_v1_proto_api.d.ts | 130 +++++++ dev/protos/firestore_v1_proto_api.js | 340 +++++++++++++++++- .../google/firestore/v1/firestore.proto | 44 ++- .../google/firestore/v1/query_profile.proto | 76 ++++ dev/protos/v1.json | 49 +++ 5 files changed, 635 insertions(+), 4 deletions(-) create mode 100644 dev/protos/google/firestore/v1/query_profile.proto diff --git a/dev/protos/firestore_v1_proto_api.d.ts b/dev/protos/firestore_v1_proto_api.d.ts index 293e4fa51..db64f3937 100644 --- a/dev/protos/firestore_v1_proto_api.d.ts +++ b/dev/protos/firestore_v1_proto_api.d.ts @@ -4914,6 +4914,9 @@ export namespace google { /** RunQueryRequest readTime */ readTime?: (google.protobuf.ITimestamp|null); + + /** RunQueryRequest mode */ + mode?: (google.firestore.v1.QueryMode|null); } /** Represents a RunQueryRequest. */ @@ -4940,6 +4943,9 @@ export namespace google { /** RunQueryRequest readTime. */ public readTime?: (google.protobuf.ITimestamp|null); + /** RunQueryRequest mode. */ + public mode: google.firestore.v1.QueryMode; + /** RunQueryRequest queryType. */ public queryType?: "structuredQuery"; @@ -4992,6 +4998,9 @@ export namespace google { /** RunQueryResponse done */ done?: (boolean|null); + + /** RunQueryResponse stats */ + stats?: (google.firestore.v1.IResultSetStats|null); } /** Represents a RunQueryResponse. */ @@ -5018,6 +5027,9 @@ export namespace google { /** RunQueryResponse done. */ public done?: (boolean|null); + /** RunQueryResponse stats. */ + public stats?: (google.firestore.v1.IResultSetStats|null); + /** RunQueryResponse continuationSelector. */ public continuationSelector?: "done"; @@ -5067,6 +5079,9 @@ export namespace google { /** RunAggregationQueryRequest readTime */ readTime?: (google.protobuf.ITimestamp|null); + + /** RunAggregationQueryRequest mode */ + mode?: (google.firestore.v1.QueryMode|null); } /** Represents a RunAggregationQueryRequest. */ @@ -5093,6 +5108,9 @@ export namespace google { /** RunAggregationQueryRequest readTime. */ public readTime?: (google.protobuf.ITimestamp|null); + /** RunAggregationQueryRequest mode. */ + public mode: google.firestore.v1.QueryMode; + /** RunAggregationQueryRequest queryType. */ public queryType?: "structuredAggregationQuery"; @@ -5139,6 +5157,9 @@ export namespace google { /** RunAggregationQueryResponse readTime */ readTime?: (google.protobuf.ITimestamp|null); + + /** RunAggregationQueryResponse stats */ + stats?: (google.firestore.v1.IResultSetStats|null); } /** Represents a RunAggregationQueryResponse. */ @@ -5159,6 +5180,9 @@ export namespace google { /** RunAggregationQueryResponse readTime. */ public readTime?: (google.protobuf.ITimestamp|null); + /** RunAggregationQueryResponse stats. */ + public stats?: (google.firestore.v1.IResultSetStats|null); + /** * Creates a RunAggregationQueryResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object @@ -6122,6 +6146,112 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** QueryMode enum. */ + type QueryMode = + "NORMAL"| "PLAN"| "PROFILE"; + + /** Properties of a QueryPlan. */ + interface IQueryPlan { + + /** QueryPlan planInfo */ + planInfo?: (google.protobuf.IStruct|null); + } + + /** Represents a QueryPlan. */ + class QueryPlan implements IQueryPlan { + + /** + * Constructs a new QueryPlan. + * @param [properties] Properties to set + */ + constructor(properties?: google.firestore.v1.IQueryPlan); + + /** QueryPlan planInfo. */ + public planInfo?: (google.protobuf.IStruct|null); + + /** + * Creates a QueryPlan message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns QueryPlan + */ + public static fromObject(object: { [k: string]: any }): google.firestore.v1.QueryPlan; + + /** + * Creates a plain object from a QueryPlan message. Also converts values to other types if specified. + * @param message QueryPlan + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.firestore.v1.QueryPlan, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this QueryPlan to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for QueryPlan + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ResultSetStats. */ + interface IResultSetStats { + + /** ResultSetStats queryPlan */ + queryPlan?: (google.firestore.v1.IQueryPlan|null); + + /** ResultSetStats queryStats */ + queryStats?: (google.protobuf.IStruct|null); + } + + /** Represents a ResultSetStats. */ + class ResultSetStats implements IResultSetStats { + + /** + * Constructs a new ResultSetStats. + * @param [properties] Properties to set + */ + constructor(properties?: google.firestore.v1.IResultSetStats); + + /** ResultSetStats queryPlan. */ + public queryPlan?: (google.firestore.v1.IQueryPlan|null); + + /** ResultSetStats queryStats. */ + public queryStats?: (google.protobuf.IStruct|null); + + /** + * Creates a ResultSetStats message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResultSetStats + */ + public static fromObject(object: { [k: string]: any }): google.firestore.v1.ResultSetStats; + + /** + * Creates a plain object from a ResultSetStats message. Also converts values to other types if specified. + * @param message ResultSetStats + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.firestore.v1.ResultSetStats, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResultSetStats to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResultSetStats + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of a StructuredQuery. */ interface IStructuredQuery { diff --git a/dev/protos/firestore_v1_proto_api.js b/dev/protos/firestore_v1_proto_api.js index 0fe6356c0..c23ad4cee 100644 --- a/dev/protos/firestore_v1_proto_api.js +++ b/dev/protos/firestore_v1_proto_api.js @@ -11572,6 +11572,7 @@ * @property {Uint8Array|null} [transaction] RunQueryRequest transaction * @property {google.firestore.v1.ITransactionOptions|null} [newTransaction] RunQueryRequest newTransaction * @property {google.protobuf.ITimestamp|null} [readTime] RunQueryRequest readTime + * @property {google.firestore.v1.QueryMode|null} [mode] RunQueryRequest mode */ /** @@ -11629,6 +11630,14 @@ */ RunQueryRequest.prototype.readTime = null; + /** + * RunQueryRequest mode. + * @member {google.firestore.v1.QueryMode} mode + * @memberof google.firestore.v1.RunQueryRequest + * @instance + */ + RunQueryRequest.prototype.mode = 0; + // OneOf field names bound to virtual getters and setters var $oneOfFields; @@ -11688,6 +11697,26 @@ throw TypeError(".google.firestore.v1.RunQueryRequest.readTime: object expected"); message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); } + switch (object.mode) { + default: + if (typeof object.mode === "number") { + message.mode = object.mode; + break; + } + break; + case "NORMAL": + case 0: + message.mode = 0; + break; + case "PLAN": + case 1: + message.mode = 1; + break; + case "PROFILE": + case 2: + message.mode = 2; + break; + } return message; }; @@ -11704,8 +11733,10 @@ if (!options) options = {}; var object = {}; - if (options.defaults) + if (options.defaults) { object.parent = ""; + object.mode = options.enums === String ? "NORMAL" : 0; + } if (message.parent != null && message.hasOwnProperty("parent")) object.parent = message.parent; if (message.structuredQuery != null && message.hasOwnProperty("structuredQuery")) { @@ -11728,6 +11759,8 @@ if (options.oneofs) object.consistencySelector = "readTime"; } + if (message.mode != null && message.hasOwnProperty("mode")) + object.mode = options.enums === String ? $root.google.firestore.v1.QueryMode[message.mode] === undefined ? message.mode : $root.google.firestore.v1.QueryMode[message.mode] : message.mode; return object; }; @@ -11771,6 +11804,7 @@ * @property {google.protobuf.ITimestamp|null} [readTime] RunQueryResponse readTime * @property {number|null} [skippedResults] RunQueryResponse skippedResults * @property {boolean|null} [done] RunQueryResponse done + * @property {google.firestore.v1.IResultSetStats|null} [stats] RunQueryResponse stats */ /** @@ -11828,6 +11862,14 @@ */ RunQueryResponse.prototype.done = null; + /** + * RunQueryResponse stats. + * @member {google.firestore.v1.IResultSetStats|null|undefined} stats + * @memberof google.firestore.v1.RunQueryResponse + * @instance + */ + RunQueryResponse.prototype.stats = null; + // OneOf field names bound to virtual getters and setters var $oneOfFields; @@ -11873,6 +11915,11 @@ message.skippedResults = object.skippedResults | 0; if (object.done != null) message.done = Boolean(object.done); + if (object.stats != null) { + if (typeof object.stats !== "object") + throw TypeError(".google.firestore.v1.RunQueryResponse.stats: object expected"); + message.stats = $root.google.firestore.v1.ResultSetStats.fromObject(object.stats); + } return message; }; @@ -11900,6 +11947,7 @@ } object.readTime = null; object.skippedResults = 0; + object.stats = null; } if (message.document != null && message.hasOwnProperty("document")) object.document = $root.google.firestore.v1.Document.toObject(message.document, options); @@ -11914,6 +11962,8 @@ if (options.oneofs) object.continuationSelector = "done"; } + if (message.stats != null && message.hasOwnProperty("stats")) + object.stats = $root.google.firestore.v1.ResultSetStats.toObject(message.stats, options); return object; }; @@ -11957,6 +12007,7 @@ * @property {Uint8Array|null} [transaction] RunAggregationQueryRequest transaction * @property {google.firestore.v1.ITransactionOptions|null} [newTransaction] RunAggregationQueryRequest newTransaction * @property {google.protobuf.ITimestamp|null} [readTime] RunAggregationQueryRequest readTime + * @property {google.firestore.v1.QueryMode|null} [mode] RunAggregationQueryRequest mode */ /** @@ -12014,6 +12065,14 @@ */ RunAggregationQueryRequest.prototype.readTime = null; + /** + * RunAggregationQueryRequest mode. + * @member {google.firestore.v1.QueryMode} mode + * @memberof google.firestore.v1.RunAggregationQueryRequest + * @instance + */ + RunAggregationQueryRequest.prototype.mode = 0; + // OneOf field names bound to virtual getters and setters var $oneOfFields; @@ -12073,6 +12132,26 @@ throw TypeError(".google.firestore.v1.RunAggregationQueryRequest.readTime: object expected"); message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); } + switch (object.mode) { + default: + if (typeof object.mode === "number") { + message.mode = object.mode; + break; + } + break; + case "NORMAL": + case 0: + message.mode = 0; + break; + case "PLAN": + case 1: + message.mode = 1; + break; + case "PROFILE": + case 2: + message.mode = 2; + break; + } return message; }; @@ -12089,8 +12168,10 @@ if (!options) options = {}; var object = {}; - if (options.defaults) + if (options.defaults) { object.parent = ""; + object.mode = options.enums === String ? "NORMAL" : 0; + } if (message.parent != null && message.hasOwnProperty("parent")) object.parent = message.parent; if (message.structuredAggregationQuery != null && message.hasOwnProperty("structuredAggregationQuery")) { @@ -12113,6 +12194,8 @@ if (options.oneofs) object.consistencySelector = "readTime"; } + if (message.mode != null && message.hasOwnProperty("mode")) + object.mode = options.enums === String ? $root.google.firestore.v1.QueryMode[message.mode] === undefined ? message.mode : $root.google.firestore.v1.QueryMode[message.mode] : message.mode; return object; }; @@ -12154,6 +12237,7 @@ * @property {google.firestore.v1.IAggregationResult|null} [result] RunAggregationQueryResponse result * @property {Uint8Array|null} [transaction] RunAggregationQueryResponse transaction * @property {google.protobuf.ITimestamp|null} [readTime] RunAggregationQueryResponse readTime + * @property {google.firestore.v1.IResultSetStats|null} [stats] RunAggregationQueryResponse stats */ /** @@ -12195,6 +12279,14 @@ */ RunAggregationQueryResponse.prototype.readTime = null; + /** + * RunAggregationQueryResponse stats. + * @member {google.firestore.v1.IResultSetStats|null|undefined} stats + * @memberof google.firestore.v1.RunAggregationQueryResponse + * @instance + */ + RunAggregationQueryResponse.prototype.stats = null; + /** * Creates a RunAggregationQueryResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject @@ -12222,6 +12314,11 @@ throw TypeError(".google.firestore.v1.RunAggregationQueryResponse.readTime: object expected"); message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); } + if (object.stats != null) { + if (typeof object.stats !== "object") + throw TypeError(".google.firestore.v1.RunAggregationQueryResponse.stats: object expected"); + message.stats = $root.google.firestore.v1.ResultSetStats.fromObject(object.stats); + } return message; }; @@ -12248,6 +12345,7 @@ object.transaction = $util.newBuffer(object.transaction); } object.readTime = null; + object.stats = null; } if (message.result != null && message.hasOwnProperty("result")) object.result = $root.google.firestore.v1.AggregationResult.toObject(message.result, options); @@ -12255,6 +12353,8 @@ object.transaction = options.bytes === String ? $util.base64.encode(message.transaction, 0, message.transaction.length) : options.bytes === Array ? Array.prototype.slice.call(message.transaction) : message.transaction; if (message.readTime != null && message.hasOwnProperty("readTime")) object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + if (message.stats != null && message.hasOwnProperty("stats")) + object.stats = $root.google.firestore.v1.ResultSetStats.toObject(message.stats, options); return object; }; @@ -14612,6 +14712,242 @@ return BatchWriteResponse; })(); + /** + * QueryMode enum. + * @name google.firestore.v1.QueryMode + * @enum {string} + * @property {string} NORMAL=NORMAL NORMAL value + * @property {string} PLAN=PLAN PLAN value + * @property {string} PROFILE=PROFILE PROFILE value + */ + v1.QueryMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NORMAL"] = "NORMAL"; + values[valuesById[1] = "PLAN"] = "PLAN"; + values[valuesById[2] = "PROFILE"] = "PROFILE"; + return values; + })(); + + v1.QueryPlan = (function() { + + /** + * Properties of a QueryPlan. + * @memberof google.firestore.v1 + * @interface IQueryPlan + * @property {google.protobuf.IStruct|null} [planInfo] QueryPlan planInfo + */ + + /** + * Constructs a new QueryPlan. + * @memberof google.firestore.v1 + * @classdesc Represents a QueryPlan. + * @implements IQueryPlan + * @constructor + * @param {google.firestore.v1.IQueryPlan=} [properties] Properties to set + */ + function QueryPlan(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]]; + } + + /** + * QueryPlan planInfo. + * @member {google.protobuf.IStruct|null|undefined} planInfo + * @memberof google.firestore.v1.QueryPlan + * @instance + */ + QueryPlan.prototype.planInfo = null; + + /** + * Creates a QueryPlan message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.firestore.v1.QueryPlan + * @static + * @param {Object.} object Plain object + * @returns {google.firestore.v1.QueryPlan} QueryPlan + */ + QueryPlan.fromObject = function fromObject(object) { + if (object instanceof $root.google.firestore.v1.QueryPlan) + return object; + var message = new $root.google.firestore.v1.QueryPlan(); + if (object.planInfo != null) { + if (typeof object.planInfo !== "object") + throw TypeError(".google.firestore.v1.QueryPlan.planInfo: object expected"); + message.planInfo = $root.google.protobuf.Struct.fromObject(object.planInfo); + } + return message; + }; + + /** + * Creates a plain object from a QueryPlan message. Also converts values to other types if specified. + * @function toObject + * @memberof google.firestore.v1.QueryPlan + * @static + * @param {google.firestore.v1.QueryPlan} message QueryPlan + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryPlan.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.planInfo = null; + if (message.planInfo != null && message.hasOwnProperty("planInfo")) + object.planInfo = $root.google.protobuf.Struct.toObject(message.planInfo, options); + return object; + }; + + /** + * Converts this QueryPlan to JSON. + * @function toJSON + * @memberof google.firestore.v1.QueryPlan + * @instance + * @returns {Object.} JSON object + */ + QueryPlan.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for QueryPlan + * @function getTypeUrl + * @memberof google.firestore.v1.QueryPlan + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + QueryPlan.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.firestore.v1.QueryPlan"; + }; + + return QueryPlan; + })(); + + v1.ResultSetStats = (function() { + + /** + * Properties of a ResultSetStats. + * @memberof google.firestore.v1 + * @interface IResultSetStats + * @property {google.firestore.v1.IQueryPlan|null} [queryPlan] ResultSetStats queryPlan + * @property {google.protobuf.IStruct|null} [queryStats] ResultSetStats queryStats + */ + + /** + * Constructs a new ResultSetStats. + * @memberof google.firestore.v1 + * @classdesc Represents a ResultSetStats. + * @implements IResultSetStats + * @constructor + * @param {google.firestore.v1.IResultSetStats=} [properties] Properties to set + */ + function ResultSetStats(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]]; + } + + /** + * ResultSetStats queryPlan. + * @member {google.firestore.v1.IQueryPlan|null|undefined} queryPlan + * @memberof google.firestore.v1.ResultSetStats + * @instance + */ + ResultSetStats.prototype.queryPlan = null; + + /** + * ResultSetStats queryStats. + * @member {google.protobuf.IStruct|null|undefined} queryStats + * @memberof google.firestore.v1.ResultSetStats + * @instance + */ + ResultSetStats.prototype.queryStats = null; + + /** + * Creates a ResultSetStats message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.firestore.v1.ResultSetStats + * @static + * @param {Object.} object Plain object + * @returns {google.firestore.v1.ResultSetStats} ResultSetStats + */ + ResultSetStats.fromObject = function fromObject(object) { + if (object instanceof $root.google.firestore.v1.ResultSetStats) + return object; + var message = new $root.google.firestore.v1.ResultSetStats(); + if (object.queryPlan != null) { + if (typeof object.queryPlan !== "object") + throw TypeError(".google.firestore.v1.ResultSetStats.queryPlan: object expected"); + message.queryPlan = $root.google.firestore.v1.QueryPlan.fromObject(object.queryPlan); + } + if (object.queryStats != null) { + if (typeof object.queryStats !== "object") + throw TypeError(".google.firestore.v1.ResultSetStats.queryStats: object expected"); + message.queryStats = $root.google.protobuf.Struct.fromObject(object.queryStats); + } + return message; + }; + + /** + * Creates a plain object from a ResultSetStats message. Also converts values to other types if specified. + * @function toObject + * @memberof google.firestore.v1.ResultSetStats + * @static + * @param {google.firestore.v1.ResultSetStats} message ResultSetStats + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResultSetStats.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.queryPlan = null; + object.queryStats = null; + } + if (message.queryPlan != null && message.hasOwnProperty("queryPlan")) + object.queryPlan = $root.google.firestore.v1.QueryPlan.toObject(message.queryPlan, options); + if (message.queryStats != null && message.hasOwnProperty("queryStats")) + object.queryStats = $root.google.protobuf.Struct.toObject(message.queryStats, options); + return object; + }; + + /** + * Converts this ResultSetStats to JSON. + * @function toJSON + * @memberof google.firestore.v1.ResultSetStats + * @instance + * @returns {Object.} JSON object + */ + ResultSetStats.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResultSetStats + * @function getTypeUrl + * @memberof google.firestore.v1.ResultSetStats + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResultSetStats.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.firestore.v1.ResultSetStats"; + }; + + return ResultSetStats; + })(); + v1.StructuredQuery = (function() { /** diff --git a/dev/protos/google/firestore/v1/firestore.proto b/dev/protos/google/firestore/v1/firestore.proto index a4447d167..cda945ff1 100644 --- a/dev/protos/google/firestore/v1/firestore.proto +++ b/dev/protos/google/firestore/v1/firestore.proto @@ -23,6 +23,7 @@ import "google/firestore/v1/aggregation_result.proto"; import "google/firestore/v1/common.proto"; import "google/firestore/v1/document.proto"; import "google/firestore/v1/query.proto"; +import "google/firestore/v1/query_profile.proto"; import "google/firestore/v1/write.proto"; import "google/protobuf/empty.proto"; import "google/protobuf/timestamp.proto"; @@ -50,7 +51,7 @@ option ruby_package = "Google::Cloud::Firestore::V1"; service Firestore { option (google.api.default_host) = "firestore.googleapis.com"; option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/cloud-platform," "https://www.googleapis.com/auth/datastore"; // Gets a single document. @@ -576,6 +577,11 @@ message RunQueryRequest { // minute timestamp within the past 7 days. google.protobuf.Timestamp read_time = 7; } + + // Optional. The mode in which the query request is processed. This field is + // optional, and when not provided, it defaults to `NORMAL` mode where no + // additional statistics will be returned with the query results. + QueryMode mode = 9 [(google.api.field_behavior) = OPTIONAL]; } // The response for @@ -612,6 +618,13 @@ message RunQueryResponse { // documents will be returned. bool done = 6; } + + // Query plan and execution statistics. Note that the returned stats are + // subject to change as Firestore evolves. + // + // This is only present when the request specifies a mode other than `NORMAL` + // and is sent only once with the last response in the stream. + ResultSetStats stats = 7; } // The request for @@ -651,6 +664,11 @@ message RunAggregationQueryRequest { // minute timestamp within the past 7 days. google.protobuf.Timestamp read_time = 6; } + + // Optional. The mode in which the query request is processed. This field is + // optional, and when not provided, it defaults to `NORMAL` mode where no + // additional statistics will be returned with the query results. + QueryMode mode = 7 [(google.api.field_behavior) = OPTIONAL]; } // The response for @@ -676,6 +694,13 @@ message RunAggregationQueryResponse { // `result` will be sent, and this represents the time at which the query // was run. google.protobuf.Timestamp read_time = 3; + + // Query plan and execution statistics. Note that the returned stats are + // subject to change as Firestore evolves. + // + // This is only present when the request specifies a mode other than `NORMAL` + // and is sent only once with the last response in the stream. + ResultSetStats stats = 6; } // The request for @@ -761,7 +786,7 @@ message PartitionQueryResponse { // * query, start_at B // // An empty result may indicate that the query has too few results to be - // partitioned. + // partitioned, or that the query is not yet supported for partitioning. repeated Cursor partitions = 1; // A page token that may be used to request an additional set of results, up @@ -944,6 +969,21 @@ message Target { // The target ID that identifies the target on the stream. Must be a positive // number and non-zero. + // + // If `target_id` is 0 (or unspecified), the server will assign an ID for this + // target and return that in a `TargetChange::ADD` event. Once a target with + // `target_id=0` is added, all subsequent targets must also have + // `target_id=0`. If an `AddTarget` request with `target_id != 0` is + // sent to the server after a target with `target_id=0` is added, the server + // will immediately send a response with a `TargetChange::Remove` event. + // + // Note that if the client sends multiple `AddTarget` requests + // without an ID, the order of IDs returned in `TargetChage.target_ids` are + // undefined. Therefore, clients should provide a target ID instead of relying + // on the server to assign one. + // + // If `target_id` is non-zero, there must not be an existing active target on + // this stream with the same ID. int32 target_id = 5; // If the target should be removed once it is current and consistent. diff --git a/dev/protos/google/firestore/v1/query_profile.proto b/dev/protos/google/firestore/v1/query_profile.proto new file mode 100644 index 000000000..67d489045 --- /dev/null +++ b/dev/protos/google/firestore/v1/query_profile.proto @@ -0,0 +1,76 @@ +// Copyright 2023 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. + +syntax = "proto3"; + +package google.firestore.v1; + +import "google/protobuf/struct.proto"; + +option csharp_namespace = "Google.Cloud.Firestore.V1"; +option go_package = "cloud.google.com/go/firestore/apiv1/firestorepb;firestorepb"; +option java_multiple_files = true; +option java_outer_classname = "QueryProfileProto"; +option java_package = "com.google.firestore.v1"; +option objc_class_prefix = "GCFS"; +option php_namespace = "Google\\Cloud\\Firestore\\V1"; +option ruby_package = "Google::Cloud::Firestore::V1"; + +// Specification of the Firestore Query Profile fields. + +// The mode in which the query request must be processed. +enum QueryMode { + // The default mode. Only the query results are returned. + NORMAL = 0; + + // This mode returns only the query plan, without any results or execution + // statistics information. + PLAN = 1; + + // This mode returns both the query plan and the execution statistics along + // with the results. + PROFILE = 2; +} + +// Plan for the query. +message QueryPlan { + // Planning phase information for the query. It will include: + // + // { + // "indexes_used": [ + // {"query_scope": "Collection", "fields": "(foo ASC, __name__ ASC)"}, + // {"query_scope": "Collection", "fields": "(bar ASC, __name__ ASC)"} + // ] + // } + google.protobuf.Struct plan_info = 1; +} + +// Planning and execution statistics for the query. +message ResultSetStats { + // Plan for the query. + QueryPlan query_plan = 1; + + // Aggregated statistics from the execution of the query. + // + // This will only be present when the request specifies `PROFILE` mode. + // For example, a query will return the statistics including: + // + // { + // "results_returned": "20", + // "documents_scanned": "20", + // "indexes_entries_scanned": "10050", + // "total_execution_time": "100.7 msecs" + // } + google.protobuf.Struct query_stats = 2; +} diff --git a/dev/protos/v1.json b/dev/protos/v1.json index 863777736..0b8938c6b 100644 --- a/dev/protos/v1.json +++ b/dev/protos/v1.json @@ -1829,6 +1829,13 @@ "readTime": { "type": "google.protobuf.Timestamp", "id": 7 + }, + "mode": { + "type": "QueryMode", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, @@ -1860,6 +1867,10 @@ "done": { "type": "bool", "id": 6 + }, + "stats": { + "type": "ResultSetStats", + "id": 7 } } }, @@ -1901,6 +1912,13 @@ "readTime": { "type": "google.protobuf.Timestamp", "id": 6 + }, + "mode": { + "type": "QueryMode", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, @@ -1917,6 +1935,10 @@ "readTime": { "type": "google.protobuf.Timestamp", "id": 3 + }, + "stats": { + "type": "ResultSetStats", + "id": 6 } } }, @@ -2283,6 +2305,33 @@ } } }, + "QueryMode": { + "values": { + "NORMAL": 0, + "PLAN": 1, + "PROFILE": 2 + } + }, + "QueryPlan": { + "fields": { + "planInfo": { + "type": "google.protobuf.Struct", + "id": 1 + } + } + }, + "ResultSetStats": { + "fields": { + "queryPlan": { + "type": "QueryPlan", + "id": 1 + }, + "queryStats": { + "type": "google.protobuf.Struct", + "id": 2 + } + } + }, "StructuredQuery": { "fields": { "select": { From 16fcd2897bdb70c72447f9321a63d76f48df116a Mon Sep 17 00:00:00 2001 From: Ehsan Nasiri Date: Mon, 24 Jul 2023 23:33:51 -0700 Subject: [PATCH 02/19] WIP: Query profiling APIs. --- dev/src/profiling.ts | 49 +++++++++++++++++++ dev/src/reference.ts | 60 +++++++++++++++++++++++ dev/system-test/firestore.ts | 24 +++++++++ types/firestore.d.ts | 95 ++++++++++++++++++++++++++++++++++++ 4 files changed, 228 insertions(+) create mode 100644 dev/src/profiling.ts diff --git a/dev/src/profiling.ts b/dev/src/profiling.ts new file mode 100644 index 000000000..f6f35b731 --- /dev/null +++ b/dev/src/profiling.ts @@ -0,0 +1,49 @@ +/** A QueryProfileInfo contains information about planning, execution, and results of a query. */ +import { + AggregateQuerySnapshot, + AggregateSpec, + DocumentData, + QuerySnapshot, +} from '@google-cloud/firestore'; + +export interface QueryProfileInfo { + /** + * A Map that contains information about the query plan. + * Contents are subject to change. + */ + readonly plan: Record; + + /** + * A Map that contains statistics about the execution of the query. + * Contents are subject to change. + */ + readonly stats: Record; + + /** + * The snapshot that contains the results of executing the query. + */ + readonly snapshot: QuerySnapshot; +} + +/** + * An AggregateQueryProfileInfo contains information about planning, + * execution, and results of an aggregate query. + */ +export interface AggregateQueryProfileInfo { + /** + * A Map that contains information about the query plan. + * Contents are subject to change. + */ + readonly plan: Record; + + /** + * A Map that contains statistics about the execution of the aggregate query. + * Contents are subject to change. + */ + readonly stats: Record; + + /** + * The snapshot that contains the results of executing the aggregate query. + */ + readonly snapshot: AggregateQuerySnapshot; +} diff --git a/dev/src/reference.ts b/dev/src/reference.ts index 79626b479..3e80cd819 100644 --- a/dev/src/reference.ts +++ b/dev/src/reference.ts @@ -61,6 +61,7 @@ import {validateDocumentData, WriteBatch, WriteResult} from './write-batch'; import api = protos.google.firestore.v1; import {CompositeFilter, Filter, UnaryFilter} from './filter'; import {AggregateField, Aggregate, AggregateSpec} from './aggregate'; +import {QueryProfileInfo, AggregateQueryProfileInfo} from './profiling'; /** * The direction of a `Query.orderBy()` clause is specified as 'desc' or 'asc' @@ -2311,6 +2312,48 @@ export class Query< return this._get(); } + /** + * Performs the planning stage of this query, without actually executing the + * query. Returns a Promise that will be resolved with the result of the + * query planning information. + * + * Note: the information included in the output of this function is subject + * to change. + * + * @return A Promise that will be resolved with the results of the query + * planning information. + */ + plan(): Promise> { + return Promise.resolve({foo: 'bar'}); + } + + /** + * Plans and executes this query. Returns a Promise that will be resolved + * with the planning information, statistics from the query execution, and + * the query results. + * + * Note: the information included in the output of this function is subject + * to change. + * + * @return A Promise that will be resolved with the planning information, + * statistics from the query execution, and the query results. + */ + profile(): Promise> { + const mock = { + plan: {foo: 'bar'}, + stats: {cpu: '3ms'}, + snapshot: new QuerySnapshot( + this, + new Timestamp(0, 0), + 0, + () => [], + () => [] + ), + }; + + return Promise.resolve(mock); + } + /** * Internal get() method that accepts an optional transaction id. * @@ -3463,6 +3506,23 @@ export class AggregateQuery< } return deepEqual(this._aggregates, other._aggregates); } + + plan(): Promise> { + return Promise.resolve({foo: 'bar'}); + } + + profile(): Promise> { + const mock = { + plan: {foo: 'bar'}, + stats: {cpu: '3ms'}, + snapshot: new AggregateQuerySnapshot( + this, + new Timestamp(0, 0), + this.decodeResult({}) + ), + }; + return Promise.resolve(mock); + } } /** diff --git a/dev/system-test/firestore.ts b/dev/system-test/firestore.ts index 57161a433..07e0fa84d 100644 --- a/dev/system-test/firestore.ts +++ b/dev/system-test/firestore.ts @@ -144,6 +144,30 @@ describe('Firestore class', () => { }); }); + it.only('can plan a query', async () => { + const plan = await randomCol.where('a', '>', 10).plan(); + console.log(plan); + }); + + it.only('can profile a query', async () => { + const profile = await randomCol.where('a', '>', 10).profile(); + console.log(profile.plan); + console.log(profile.stats); + console.log(profile.snapshot.size); + }); + + it.only('can plan an aggregate query', async () => { + const plan = await randomCol.where('a', '>', 10).count().plan(); + console.log(plan); + }); + + it.only('can profile an aggregate query', async () => { + const profile = await randomCol.where('a', '>', 10).count().profile(); + console.log(profile.plan); + console.log(profile.stats); + console.log(profile.snapshot.data()); + }); + it('getAll() supports array destructuring', () => { const ref1 = randomCol.doc('doc1'); const ref2 = randomCol.doc('doc2'); diff --git a/types/firestore.d.ts b/types/firestore.d.ts index ce6c9adb2..30dc93ca8 100644 --- a/types/firestore.d.ts +++ b/types/firestore.d.ts @@ -1756,6 +1756,32 @@ declare namespace FirebaseFirestore { */ get(): Promise>; + /** + * Performs the planning stage of this query, without actually executing the + * query. Returns a Promise that will be resolved with the result of the + * query planning information. + * + * Note: the information included in the output of this function is subject + * to change. + * + * @return A Promise that will be resolved with the results of the query + * planning information. + */ + plan(): Promise>; + + /** + * Plans and executes this query. Returns a Promise that will be resolved + * with the planning information, statistics from the query execution, and + * the query results. + * + * Note: the information included in the output of this function is subject + * to change. + * + * @return A Promise that will be resolved with the planning information, + * statistics from the query execution, and the query results. + */ + profile(): Promise>; + /* * Executes the query and returns the results as Node Stream. * @@ -2287,6 +2313,32 @@ declare namespace FirebaseFirestore { AggregateQuerySnapshot >; + /** + * Performs the planning stage of this query, without actually executing the + * query. Returns a Promise that will be resolved with the result of the + * query planning information. + * + * Note: the information included in the output of this function is subject + * to change. + * + * @return A Promise that will be resolved with the results of the query + * planning information. + */ + plan(): Promise>; + + /** + * Plans and executes this query. Returns a Promise that will be resolved + * with the planning information, statistics from the query execution, and + * the query results. + * + * Note: the information included in the output of this function is subject + * to change. + * + * @return A Promise that will be resolved with the planning information, + * statistics from the query execution, and the query results. + */ + profile(): Promise>; + /** * Compares this object with the given object for equality. * @@ -2739,6 +2791,49 @@ declare namespace FirebaseFirestore { */ static and(...filters: Filter[]): Filter; } + + /** A QueryProfileInfo contains information about planning, execution, and results of a query. */ + export interface QueryProfileInfo { + /** + * A Map that contains information about the query plan. + * Contents are subject to change. + */ + readonly plan: Record; + + /** + * A Map that contains statistics about the execution of the query. + * Contents are subject to change. + */ + readonly stats: Record; + + /** + * The snapshot that contains the results of executing the query. + */ + readonly snapshot: QuerySnapshot; + } + + /** + * An AggregateQueryProfileInfo contains information about planning, + * execution, and results of an aggregate query. + */ + export interface AggregateQueryProfileInfo { + /** + * A Map that contains information about the query plan. + * Contents are subject to change. + */ + readonly plan: Record; + + /** + * A Map that contains statistics about the execution of the aggregate query. + * Contents are subject to change. + */ + readonly stats: Record; + + /** + * The snapshot that contains the results of executing the aggregate query. + */ + readonly snapshot: AggregateQuerySnapshot; + } } declare module '@google-cloud/firestore' { From e80688303b02671c18d0b29cec1483d9db5a0010 Mon Sep 17 00:00:00 2001 From: Ehsan Nasiri Date: Mon, 31 Jul 2023 14:33:35 -0700 Subject: [PATCH 03/19] Use generic type. --- dev/src/profiling.ts | 49 ------------------------------- dev/src/reference.ts | 9 +++--- dev/system-test/firestore.ts | 8 +++--- types/firestore.d.ts | 56 ++++++++++++++++-------------------- 4 files changed, 32 insertions(+), 90 deletions(-) delete mode 100644 dev/src/profiling.ts diff --git a/dev/src/profiling.ts b/dev/src/profiling.ts deleted file mode 100644 index f6f35b731..000000000 --- a/dev/src/profiling.ts +++ /dev/null @@ -1,49 +0,0 @@ -/** A QueryProfileInfo contains information about planning, execution, and results of a query. */ -import { - AggregateQuerySnapshot, - AggregateSpec, - DocumentData, - QuerySnapshot, -} from '@google-cloud/firestore'; - -export interface QueryProfileInfo { - /** - * A Map that contains information about the query plan. - * Contents are subject to change. - */ - readonly plan: Record; - - /** - * A Map that contains statistics about the execution of the query. - * Contents are subject to change. - */ - readonly stats: Record; - - /** - * The snapshot that contains the results of executing the query. - */ - readonly snapshot: QuerySnapshot; -} - -/** - * An AggregateQueryProfileInfo contains information about planning, - * execution, and results of an aggregate query. - */ -export interface AggregateQueryProfileInfo { - /** - * A Map that contains information about the query plan. - * Contents are subject to change. - */ - readonly plan: Record; - - /** - * A Map that contains statistics about the execution of the aggregate query. - * Contents are subject to change. - */ - readonly stats: Record; - - /** - * The snapshot that contains the results of executing the aggregate query. - */ - readonly snapshot: AggregateQuerySnapshot; -} diff --git a/dev/src/reference.ts b/dev/src/reference.ts index 3e80cd819..66853cf5b 100644 --- a/dev/src/reference.ts +++ b/dev/src/reference.ts @@ -61,7 +61,6 @@ import {validateDocumentData, WriteBatch, WriteResult} from './write-batch'; import api = protos.google.firestore.v1; import {CompositeFilter, Filter, UnaryFilter} from './filter'; import {AggregateField, Aggregate, AggregateSpec} from './aggregate'; -import {QueryProfileInfo, AggregateQueryProfileInfo} from './profiling'; /** * The direction of a `Query.orderBy()` clause is specified as 'desc' or 'asc' @@ -2323,7 +2322,7 @@ export class Query< * @return A Promise that will be resolved with the results of the query * planning information. */ - plan(): Promise> { + explain(): Promise> { return Promise.resolve({foo: 'bar'}); } @@ -2338,7 +2337,7 @@ export class Query< * @return A Promise that will be resolved with the planning information, * statistics from the query execution, and the query results. */ - profile(): Promise> { + explainAnalyze(): Promise>> { const mock = { plan: {foo: 'bar'}, stats: {cpu: '3ms'}, @@ -3507,11 +3506,11 @@ export class AggregateQuery< return deepEqual(this._aggregates, other._aggregates); } - plan(): Promise> { + explain(): Promise> { return Promise.resolve({foo: 'bar'}); } - profile(): Promise> { + explainAnalyze(): Promise>> { const mock = { plan: {foo: 'bar'}, stats: {cpu: '3ms'}, diff --git a/dev/system-test/firestore.ts b/dev/system-test/firestore.ts index 07e0fa84d..3e7411dcf 100644 --- a/dev/system-test/firestore.ts +++ b/dev/system-test/firestore.ts @@ -145,24 +145,24 @@ describe('Firestore class', () => { }); it.only('can plan a query', async () => { - const plan = await randomCol.where('a', '>', 10).plan(); + const plan = await randomCol.where('a', '>', 10).explain(); console.log(plan); }); it.only('can profile a query', async () => { - const profile = await randomCol.where('a', '>', 10).profile(); + const profile = await randomCol.where('a', '>', 10).explainAnalyze(); console.log(profile.plan); console.log(profile.stats); console.log(profile.snapshot.size); }); it.only('can plan an aggregate query', async () => { - const plan = await randomCol.where('a', '>', 10).count().plan(); + const plan = await randomCol.where('a', '>', 10).count().explain(); console.log(plan); }); it.only('can profile an aggregate query', async () => { - const profile = await randomCol.where('a', '>', 10).count().profile(); + const profile = await randomCol.where('a', '>', 10).count().explainAnalyze(); console.log(profile.plan); console.log(profile.stats); console.log(profile.snapshot.data()); diff --git a/types/firestore.d.ts b/types/firestore.d.ts index 30dc93ca8..318c9c644 100644 --- a/types/firestore.d.ts +++ b/types/firestore.d.ts @@ -1533,6 +1533,18 @@ declare namespace FirebaseFirestore { | 'not-in' | 'array-contains-any'; + /** + * InformationalQueryPlan contains information about the query plan. + * Contents are subject to change. + */ + export type InformationalQueryPlan = Record; + + /** + * InformationalQueryExecutionStats contains statistics about the + * execution of the query. Contents are subject to change. + */ + export type InformationalQueryExecutionStats = Record; + /** * A `Query` refers to a Query which you can read or listen to. You can also * construct refined `Query` objects by adding filters and ordering. @@ -1767,7 +1779,7 @@ declare namespace FirebaseFirestore { * @return A Promise that will be resolved with the results of the query * planning information. */ - plan(): Promise>; + explain(): Promise; /** * Plans and executes this query. Returns a Promise that will be resolved @@ -1780,7 +1792,7 @@ declare namespace FirebaseFirestore { * @return A Promise that will be resolved with the planning information, * statistics from the query execution, and the query results. */ - profile(): Promise>; + explainAnalyze(): Promise>>; /* * Executes the query and returns the results as Node Stream. @@ -2324,7 +2336,7 @@ declare namespace FirebaseFirestore { * @return A Promise that will be resolved with the results of the query * planning information. */ - plan(): Promise>; + explain(): Promise; /** * Plans and executes this query. Returns a Promise that will be resolved @@ -2337,7 +2349,7 @@ declare namespace FirebaseFirestore { * @return A Promise that will be resolved with the planning information, * statistics from the query execution, and the query results. */ - profile(): Promise>; + explainAnalyze(): Promise>>; /** * Compares this object with the given object for equality. @@ -2792,47 +2804,27 @@ declare namespace FirebaseFirestore { static and(...filters: Filter[]): Filter; } - /** A QueryProfileInfo contains information about planning, execution, and results of a query. */ - export interface QueryProfileInfo { - /** - * A Map that contains information about the query plan. - * Contents are subject to change. - */ - readonly plan: Record; - - /** - * A Map that contains statistics about the execution of the query. - * Contents are subject to change. - */ - readonly stats: Record; - - /** - * The snapshot that contains the results of executing the query. - */ - readonly snapshot: QuerySnapshot; - } - /** - * An AggregateQueryProfileInfo contains information about planning, - * execution, and results of an aggregate query. + * A QueryProfileInfo contains information about planning, execution, and results of a query. + * All informational content are subject to change. */ - export interface AggregateQueryProfileInfo { + export interface QueryProfileInfo { /** * A Map that contains information about the query plan. * Contents are subject to change. */ - readonly plan: Record; + readonly plan: InformationalQueryPlan; /** - * A Map that contains statistics about the execution of the aggregate query. + * A Map that contains statistics about the execution of the query. * Contents are subject to change. */ - readonly stats: Record; + readonly stats: InformationalQueryExecutionStats; /** - * The snapshot that contains the results of executing the aggregate query. + * The snapshot that contains the results of executing the query. */ - readonly snapshot: AggregateQuerySnapshot; + readonly snapshot: T; } } From 0d1febb2fe8f4b4e54d9f53748d5e7d993f7a78a Mon Sep 17 00:00:00 2001 From: Ehsan Nasiri Date: Fri, 20 Oct 2023 13:35:21 -0700 Subject: [PATCH 04/19] WIP WIP. --- dev/src/convert.ts | 40 ++++++++++ dev/src/profile.ts | 26 ++++++ dev/src/reference.ts | 150 +++++++++++++++++++++++++++++++---- dev/src/serializer.ts | 75 +++++++++++++++++- dev/src/types.ts | 1 + dev/system-test/firestore.ts | 20 ++++- 6 files changed, 291 insertions(+), 21 deletions(-) create mode 100644 dev/src/profile.ts diff --git a/dev/src/convert.ts b/dev/src/convert.ts index 954fcbce0..18084ce1f 100644 --- a/dev/src/convert.ts +++ b/dev/src/convert.ts @@ -20,6 +20,7 @@ import {ApiMapValue, ProtobufJsValue} from './types'; import {validateObject} from './validate'; import api = google.firestore.v1; +import IValue = google.protobuf.IValue; /*! * @module firestore/convert @@ -161,6 +162,45 @@ export function detectValueType(proto: ProtobufJsValue): string { return detectedValues[0]; } +/** + * Detects the value kind from a Proto3 JSON `google.protobuf.Value` proto. + * + * @private + * @internal + * @param proto The `firestore.v1.Value` proto. + * @return The string value for 'valueType'. + */ +export function detectGoogleProtobufValueKind(proto: IValue): string { + const detectedValues: string[] = []; + + if (proto.nullValue !== undefined) { + detectedValues.push('nullValue'); + } + if (proto.numberValue !== undefined) { + detectedValues.push('numberValue'); + } + if (proto.stringValue !== undefined) { + detectedValues.push('stringValue'); + } + if (proto.boolValue !== undefined) { + detectedValues.push('boolValue'); + } + if (proto.structValue !== undefined) { + detectedValues.push('structValue'); + } + if (proto.listValue !== undefined) { + detectedValues.push('listValue'); + } + + if (detectedValues.length !== 1) { + throw new Error( + `Unable to infer type value from '${JSON.stringify(proto)}'.` + ); + } + + return detectedValues[0]; +} + /** * Converts a `firestore.v1.Value` in Proto3 JSON encoding into the * Protobuf JS format expected by this client. diff --git a/dev/src/profile.ts b/dev/src/profile.ts new file mode 100644 index 000000000..4b62fcb66 --- /dev/null +++ b/dev/src/profile.ts @@ -0,0 +1,26 @@ +/** + * @license + * Copyright 2023 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. + */ + +import * as firestore from '@google-cloud/firestore'; + +export class QueryProfileInfo implements firestore.QueryProfileInfo { + constructor( + readonly plan: FirebaseFirestore.InformationalQueryPlan, + readonly stats: FirebaseFirestore.InformationalQueryExecutionStats, + readonly snapshot: T + ) {} +} diff --git a/dev/src/reference.ts b/dev/src/reference.ts index 66853cf5b..4cfbca5ea 100644 --- a/dev/src/reference.ts +++ b/dev/src/reference.ts @@ -18,7 +18,7 @@ import * as firestore from '@google-cloud/firestore'; import * as assert from 'assert'; import {Duplex, Readable, Transform} from 'stream'; import * as deepEqual from 'fast-deep-equal'; -import {GoogleError} from 'google-gax'; +import {GoogleError, serializer} from 'google-gax'; import * as protos from '../protos/firestore_v1_proto_api'; @@ -61,6 +61,11 @@ import {validateDocumentData, WriteBatch, WriteResult} from './write-batch'; import api = protos.google.firestore.v1; import {CompositeFilter, Filter, UnaryFilter} from './filter'; import {AggregateField, Aggregate, AggregateSpec} from './aggregate'; +import {google} from "../protos/firestore_v1_proto_api"; +import QueryMode = google.firestore.v1.QueryMode; +import {QueryProfileInfo} from './profile'; +import IStruct = google.protobuf.IStruct; +import {InformationalQueryExecutionStats, InformationalQueryPlan} from "@google-cloud/firestore"; /** * The direction of a `Query.orderBy()` clause is specified as 'desc' or 'asc' @@ -2322,8 +2327,8 @@ export class Query< * @return A Promise that will be resolved with the results of the query * planning information. */ - explain(): Promise> { - return Promise.resolve({foo: 'bar'}); + explain(): Promise { + return this._getQueryProfileInfo("PLAN").then(info => info.plan); } /** @@ -2338,19 +2343,7 @@ export class Query< * statistics from the query execution, and the query results. */ explainAnalyze(): Promise>> { - const mock = { - plan: {foo: 'bar'}, - stats: {cpu: '3ms'}, - snapshot: new QuerySnapshot( - this, - new Timestamp(0, 0), - 0, - () => [], - () => [] - ), - }; - - return Promise.resolve(mock); + return this._getQueryProfileInfo("PROFILE"); } /** @@ -2741,6 +2734,131 @@ export class Query< return stream; } + /** + * Internal streaming method for query profiling. + * + * @param queryMode The query profiling mode. + * @private + * @internal + * @returns A QueryProfileInfo object containing the results of the profiling. + */ + _getQueryProfileInfo(queryMode: QueryMode): + Promise>> { + const docs: Array> = []; + let planInfo : InformationalQueryPlan = {}; + let executionStats : InformationalQueryExecutionStats = {}; + let readTime: Timestamp; + + // Capture the error stack to preserve stack tracing across async calls. + const stack = Error().stack!; + + const tag = requestTag(); + let backendStream: Duplex; + const stream = new Transform({ + objectMode: true, + transform: (proto, enc, callback) => { + if (proto === NOOP_MESSAGE) { + callback(undefined); + return; + } + readTime = Timestamp.fromProto(proto.readTime); + if (proto.document) { + const document = this.firestore.snapshot_( + proto.document, + proto.readTime + ); + const doc = new DocumentSnapshotBuilder< + AppModelType, + DbModelType + >(document.ref.withConverter(this._queryOptions.converter)); + // Recreate the QueryDocumentSnapshot with the DocumentReference + // containing the original converter. + doc.fieldsProto = document._fieldsProto; + doc.readTime = document.readTime; + doc.createTime = document.createTime; + doc.updateTime = document.updateTime; + docs.push(doc.build() as QueryDocumentSnapshot); + } + + if (proto.stats?.queryPlan?.planInfo) { + planInfo = this.firestore._serializer!.decodeGoogleProtobufStruct(proto.stats.queryPlan.planInfo); + } + + if (proto.stats?.queryStats) { + executionStats = this.firestore._serializer!.decodeGoogleProtobufStruct(proto.stats.queryStats); + } + }, + }); + + this.firestore + .initializeIfNeeded(tag) + .then(async () => { + // `toProto()` might throw an exception. We rely on the behavior of an + // async function to convert this exception into the rejected Promise we + // catch below. + let request = this.toProto(); + + // Apply the profiling mode. + request.mode = queryMode; + + let streamActive: Deferred; + do { + streamActive = new Deferred(); + backendStream = await this._firestore.requestStream( + 'runQuery', + /* bidirectional= */ false, + request, + tag + ); + backendStream.on('error', err => { + backendStream.unpipe(stream); + logger( + 'Query._stream', + tag, + 'Query Profiling failed with stream error:', + err + ); + stream.destroy(err); + streamActive.resolve(/* active= */ false); + }); + backendStream.on('end', () => { + streamActive.resolve(/* active= */ false); + }); + backendStream.resume(); + backendStream.pipe(stream); + } while (await streamActive.promise); + }) + .catch(e => stream.destroy(e)); + + return new Promise((resolve, reject) => { + let readTime: Timestamp; + stream.on('error', err => { + reject(wrapError(err, stack)); + }) + .on('end', () => { + const querySnapshot = + new QuerySnapshot( + this, + readTime, + docs.length, + () => docs, + () => { + const changes: Array< + DocumentChange + > = []; + for (let i = 0; i < docs.length; ++i) { + changes.push(new DocumentChange('added', docs[i], -1, i)); + } + return changes; + } + ); + resolve( + new QueryProfileInfo>( + planInfo, executionStats, querySnapshot)); + }); + }); + } + /** * Attaches a listener for QuerySnapshot events. * diff --git a/dev/src/serializer.ts b/dev/src/serializer.ts index dae07e8a3..8f18301d4 100644 --- a/dev/src/serializer.ts +++ b/dev/src/serializer.ts @@ -18,7 +18,7 @@ import {DocumentData} from '@google-cloud/firestore'; import * as proto from '../protos/firestore_v1_proto_api'; -import {detectValueType} from './convert'; +import {detectGoogleProtobufValueKind, detectValueType} from './convert'; import {DeleteTransform, FieldTransform} from './field-value'; import {GeoPoint} from './geo-point'; import {DocumentReference, Firestore} from './index'; @@ -29,6 +29,10 @@ import {isEmpty, isObject, isPlainObject} from './util'; import {customObjectMessage, invalidArgumentMessage} from './validate'; import api = proto.google.firestore.v1; +import {google} from "../protos/firestore_v1_proto_api"; +import Value = google.protobuf.Value; +import IValue = google.protobuf.IValue; +import IStruct = google.protobuf.IStruct; /** * The maximum depth of a Firestore object. @@ -286,6 +290,75 @@ export class Serializer { } } } + + + /** + * Decodes a google.protobuf.Value + * + * @private + * @internal + * @param proto A Google Protobuf 'Value'. + * @returns The converted JS type. + */ + decodeGoogleProtobufValue(proto: IValue): unknown { + switch (detectGoogleProtobufValueKind(proto)) { + case 'nullValue': { + return null; + } + case 'numberValue': { + return proto.numberValue; + } + case 'stringValue': { + return proto.stringValue; + } + case 'boolValue': { + return proto.boolValue; + } + case 'listValue': { + const array: unknown[] = []; + if (Array.isArray(proto.listValue?.values)) { + for (const value of proto.listValue?.values!) { + array.push(this.decodeGoogleProtobufValue(value)); + } + } + return array; + } + case 'structValue': { + const obj: DocumentData = {}; + const fields = proto.structValue?.fields; + if (fields) { + for (const prop of Object.keys(fields)) { + obj[prop] = this.decodeGoogleProtobufValue(fields[prop]); + } + } + + return obj; + } + default: { + throw new Error( + 'Cannot decode type from google.protobuf.Value: ' + JSON.stringify(proto) + ); + } + } + } + + /** + * Decodes a google.protobuf.Struct + * + * @private + * @internal + * @param proto A Google Protobuf 'Struct'. + * @returns The converted JS type. + */ + decodeGoogleProtobufStruct(proto: IStruct): Record { + let result : Record = {}; + if(proto.fields) { + for (const prop of Object.keys(proto.fields)) { + result[prop] = this.decodeGoogleProtobufValue(proto.fields[prop]); + } + } + return result; + } } /** diff --git a/dev/src/types.ts b/dev/src/types.ts index ac7a62d22..d698d1a2b 100644 --- a/dev/src/types.ts +++ b/dev/src/types.ts @@ -28,6 +28,7 @@ import {google} from '../protos/firestore_v1_proto_api'; import {FieldPath} from './path'; import api = google.firestore.v1; +import IValue = google.protobuf.IValue; /** * A map in the format of the Proto API diff --git a/dev/system-test/firestore.ts b/dev/system-test/firestore.ts index 3e7411dcf..aa9bbcbc7 100644 --- a/dev/system-test/firestore.ts +++ b/dev/system-test/firestore.ts @@ -145,24 +145,36 @@ describe('Firestore class', () => { }); it.only('can plan a query', async () => { - const plan = await randomCol.where('a', '>', 10).explain(); + await randomCol.doc('doc1').set({'foo': 1}); + await randomCol.doc('doc2').set({'foo': 2}); + await randomCol.doc('doc3').set({'foo': 1}); + const plan = await randomCol.where('foo', '>', 1).explain(); console.log(plan); }); it.only('can profile a query', async () => { - const profile = await randomCol.where('a', '>', 10).explainAnalyze(); + await randomCol.doc('doc1').set({foo: 1}); + await randomCol.doc('doc2').set({foo: 2}); + await randomCol.doc('doc3').set({foo: 1}); + const profile = await randomCol.where('foo', '==', 1).explainAnalyze(); console.log(profile.plan); console.log(profile.stats); console.log(profile.snapshot.size); }); it.only('can plan an aggregate query', async () => { - const plan = await randomCol.where('a', '>', 10).count().explain(); + await randomCol.doc('doc1').set({foo: 1}); + await randomCol.doc('doc2').set({foo: 2}); + await randomCol.doc('doc3').set({foo: 1}); + const plan = await randomCol.where('foo', '>', 0).count().explain(); console.log(plan); }); it.only('can profile an aggregate query', async () => { - const profile = await randomCol.where('a', '>', 10).count().explainAnalyze(); + await randomCol.doc('doc1').set({foo: 1}); + await randomCol.doc('doc2').set({foo: 2}); + await randomCol.doc('doc3').set({foo: 1}); + const profile = await randomCol.where('foo', '<', 3).count().explainAnalyze(); console.log(profile.plan); console.log(profile.stats); console.log(profile.snapshot.data()); From 265f1ffcc20951c29698238593d8dc3967ed5cff Mon Sep 17 00:00:00 2001 From: Ehsan Nasiri Date: Wed, 25 Oct 2023 16:45:43 -0700 Subject: [PATCH 05/19] WIP WIP WIP. --- dev/src/reference.ts | 210 ++++++++++++++++++----------------- dev/system-test/firestore.ts | 2 +- 2 files changed, 110 insertions(+), 102 deletions(-) diff --git a/dev/src/reference.ts b/dev/src/reference.ts index 4cfbca5ea..125edc234 100644 --- a/dev/src/reference.ts +++ b/dev/src/reference.ts @@ -2473,7 +2473,8 @@ export class Query< * @returns Serialized JSON for the query. */ toProto( - transactionIdOrReadTime?: Uint8Array | Timestamp + transactionIdOrReadTime?: Uint8Array | Timestamp, + queryMode?: QueryMode ): api.IRunQueryRequest { const projectId = this.firestore.projectId; const databaseId = this.firestore.databaseId; @@ -2527,6 +2528,10 @@ export class Query< transactionIdOrReadTime.toProto().timestampValue; } + if (queryMode) { + runQueryRequest.mode = queryMode; + } + return runQueryRequest; } @@ -2612,7 +2617,7 @@ export class Query< * @internal * @returns A stream of document results. */ - _stream(transactionId?: Uint8Array): NodeJS.ReadableStream { + _stream(transactionId?: Uint8Array, queryMode?: QueryMode): NodeJS.ReadableStream { const tag = requestTag(); let lastReceivedDocument: QueryDocumentSnapshot< @@ -2656,6 +2661,17 @@ export class Query< backendStream.end(); stream.end(); } + } else if (proto.stats) { + if (proto.stats.queryPlan?.planInfo) { + callback(undefined, { + planInfo: this.firestore._serializer!.decodeGoogleProtobufStruct(proto.stats.queryPlan.planInfo) + }); + } + if (proto.stats.queryStats) { + callback(undefined, { + executionStats: this.firestore._serializer!.decodeGoogleProtobufStruct(proto.stats.queryStats) + }); + } } else { callback(undefined, {readTime}); } @@ -2668,7 +2684,7 @@ export class Query< // `toProto()` might throw an exception. We rely on the behavior of an // async function to convert this exception into the rejected Promise we // catch below. - let request = this.toProto(transactionId); + let request = this.toProto(transactionId, queryMode); let streamActive: Deferred; do { @@ -2682,9 +2698,10 @@ export class Query< backendStream.on('error', err => { backendStream.unpipe(stream); - // If a non-transactional query failed, attempt to restart. + // If a non-transactional NORMAL query failed, attempt to restart. // Transactional queries are retried via the transaction runner. - if (!transactionId && !this._isPermanentRpcError(err, 'runQuery')) { + const isNormalQueryMode = queryMode === undefined || queryMode === "NORMAL"; + if (isNormalQueryMode && !transactionId && !this._isPermanentRpcError(err, 'runQuery')) { logger( 'Query._stream', tag, @@ -2747,95 +2764,36 @@ export class Query< const docs: Array> = []; let planInfo : InformationalQueryPlan = {}; let executionStats : InformationalQueryExecutionStats = {}; - let readTime: Timestamp; // Capture the error stack to preserve stack tracing across async calls. const stack = Error().stack!; - const tag = requestTag(); - let backendStream: Duplex; - const stream = new Transform({ - objectMode: true, - transform: (proto, enc, callback) => { - if (proto === NOOP_MESSAGE) { - callback(undefined); - return; - } - readTime = Timestamp.fromProto(proto.readTime); - if (proto.document) { - const document = this.firestore.snapshot_( - proto.document, - proto.readTime - ); - const doc = new DocumentSnapshotBuilder< - AppModelType, - DbModelType - >(document.ref.withConverter(this._queryOptions.converter)); - // Recreate the QueryDocumentSnapshot with the DocumentReference - // containing the original converter. - doc.fieldsProto = document._fieldsProto; - doc.readTime = document.readTime; - doc.createTime = document.createTime; - doc.updateTime = document.updateTime; - docs.push(doc.build() as QueryDocumentSnapshot); - } - - if (proto.stats?.queryPlan?.planInfo) { - planInfo = this.firestore._serializer!.decodeGoogleProtobufStruct(proto.stats.queryPlan.planInfo); - } - - if (proto.stats?.queryStats) { - executionStats = this.firestore._serializer!.decodeGoogleProtobufStruct(proto.stats.queryStats); - } - }, - }); - - this.firestore - .initializeIfNeeded(tag) - .then(async () => { - // `toProto()` might throw an exception. We rely on the behavior of an - // async function to convert this exception into the rejected Promise we - // catch below. - let request = this.toProto(); - - // Apply the profiling mode. - request.mode = queryMode; - - let streamActive: Deferred; - do { - streamActive = new Deferred(); - backendStream = await this._firestore.requestStream( - 'runQuery', - /* bidirectional= */ false, - request, - tag - ); - backendStream.on('error', err => { - backendStream.unpipe(stream); - logger( - 'Query._stream', - tag, - 'Query Profiling failed with stream error:', - err - ); - stream.destroy(err); - streamActive.resolve(/* active= */ false); - }); - backendStream.on('end', () => { - streamActive.resolve(/* active= */ false); - }); - backendStream.resume(); - backendStream.pipe(stream); - } while (await streamActive.promise); - }) - .catch(e => stream.destroy(e)); - return new Promise((resolve, reject) => { let readTime: Timestamp; - stream.on('error', err => { + + this._stream(/* transactionId */ undefined, /* QueryMode */ queryMode) + .on('error', err => { reject(wrapError(err, stack)); }) + .on('data', result => { + readTime = result.readTime; + if (result.document) { + docs.push(result.document); + } + if (result.planInfo) { + planInfo = result.planInfo; + } + if (result.executionStats) { + executionStats = result.executionStats; + } + }) .on('end', () => { + if (this._queryOptions.limitType === LimitType.Last) { + // The results for limitToLast queries need to be flipped since + // we reversed the ordering constraints before sending the query + // to the backend. + docs.reverse(); + } const querySnapshot = new QuerySnapshot( this, @@ -3447,6 +3405,47 @@ export class AggregateQuery< }); } + /** + * TODO. + * + * @private + * @internal + */ + _getQueryProfileInfo(queryMode: QueryMode): Promise< + QueryProfileInfo> + > { + // Capture the error stack to preserve stack tracing across async calls. + const stack = Error().stack!; + + let aggregationResult: AggregateQuerySnapshot; + let planInfo : InformationalQueryPlan = {}; + let executionStats : InformationalQueryExecutionStats = {}; + + return new Promise((resolve, reject) => { + const stream = this._stream(undefined, queryMode); + stream.on('error', err => { + reject(wrapError(err, stack)); + }); + stream.on('data', result => { + if (result.aggregationResult) { + aggregationResult = result.aggregationResult; + } + if (result.planInfo) { + planInfo = result.planInfo; + } + if (result.executionStats) { + executionStats = result.executionStats; + } + }); + stream.on('end', () => { + //stream.destroy(); + resolve( + new QueryProfileInfo>( + planInfo, executionStats, aggregationResult)); + }); + }); + } + /** * Internal streaming method that accepts an optional transaction ID. * @@ -3455,7 +3454,7 @@ export class AggregateQuery< * @param transactionId A transaction ID. * @returns A stream of document results. */ - _stream(transactionId?: Uint8Array): Readable { + _stream(transactionId?: Uint8Array, queryMode?: QueryMode): Readable { const tag = requestTag(); const firestore = this._query.firestore; @@ -3465,8 +3464,22 @@ export class AggregateQuery< if (proto.result) { const readTime = Timestamp.fromProto(proto.readTime!); const data = this.decodeResult(proto.result); - callback(undefined, new AggregateQuerySnapshot(this, readTime, data)); - } else { + callback(undefined, { + aggregationResult: new AggregateQuerySnapshot(this, readTime, data) + }); + } else if (proto.stats) { + if (proto.stats.queryPlan?.planInfo) { + callback(undefined, { + planInfo: this._query.firestore._serializer!.decodeGoogleProtobufStruct(proto.stats.queryPlan.planInfo) + }); + } + if (proto.stats.queryStats) { + callback(undefined, { + executionStats: this._query.firestore._serializer!.decodeGoogleProtobufStruct(proto.stats.queryStats) + }); + } + } + else { callback(Error('RunAggregationQueryResponse is missing result')); } }, @@ -3478,7 +3491,7 @@ export class AggregateQuery< // `toProto()` might throw an exception. We rely on the behavior of an // async function to convert this exception into the rejected Promise we // catch below. - const request = this.toProto(transactionId); + const request = this.toProto(transactionId, queryMode); let streamActive: Deferred; do { @@ -3565,7 +3578,7 @@ export class AggregateQuery< * @internal * @returns Serialized JSON for the query. */ - toProto(transactionId?: Uint8Array): api.IRunAggregationQueryRequest { + toProto(transactionId?: Uint8Array, queryMode?: QueryMode): api.IRunAggregationQueryRequest { const queryProto = this._query.toProto(); const runQueryRequest: api.IRunAggregationQueryRequest = { parent: queryProto.parent, @@ -3590,6 +3603,10 @@ export class AggregateQuery< runQueryRequest.transaction = transactionId; } + if (queryMode) { + runQueryRequest.mode = queryMode; + } + return runQueryRequest; } @@ -3625,20 +3642,11 @@ export class AggregateQuery< } explain(): Promise> { - return Promise.resolve({foo: 'bar'}); + return this._getQueryProfileInfo("PLAN").then(info => info.plan); } explainAnalyze(): Promise>> { - const mock = { - plan: {foo: 'bar'}, - stats: {cpu: '3ms'}, - snapshot: new AggregateQuerySnapshot( - this, - new Timestamp(0, 0), - this.decodeResult({}) - ), - }; - return Promise.resolve(mock); + return this._getQueryProfileInfo("PROFILE"); } } diff --git a/dev/system-test/firestore.ts b/dev/system-test/firestore.ts index aa9bbcbc7..31a4f404d 100644 --- a/dev/system-test/firestore.ts +++ b/dev/system-test/firestore.ts @@ -166,7 +166,7 @@ describe('Firestore class', () => { await randomCol.doc('doc1').set({foo: 1}); await randomCol.doc('doc2').set({foo: 2}); await randomCol.doc('doc3').set({foo: 1}); - const plan = await randomCol.where('foo', '>', 0).count().explain(); + const plan = await randomCol.where('foo', '>', 0).count().get(); console.log(plan); }); From af54637f3fb22ca67a85ce4540629858f8251380 Mon Sep 17 00:00:00 2001 From: Ehsan Nasiri Date: Thu, 26 Oct 2023 13:37:38 -0700 Subject: [PATCH 06/19] Update integration tests. --- dev/system-test/firestore.ts | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/dev/system-test/firestore.ts b/dev/system-test/firestore.ts index 31a4f404d..791143538 100644 --- a/dev/system-test/firestore.ts +++ b/dev/system-test/firestore.ts @@ -149,7 +149,7 @@ describe('Firestore class', () => { await randomCol.doc('doc2').set({'foo': 2}); await randomCol.doc('doc3').set({'foo': 1}); const plan = await randomCol.where('foo', '>', 1).explain(); - console.log(plan); + expect(Object.keys(plan).length).to.be.greaterThan(0); }); it.only('can profile a query', async () => { @@ -157,17 +157,17 @@ describe('Firestore class', () => { await randomCol.doc('doc2').set({foo: 2}); await randomCol.doc('doc3').set({foo: 1}); const profile = await randomCol.where('foo', '==', 1).explainAnalyze(); - console.log(profile.plan); - console.log(profile.stats); - console.log(profile.snapshot.size); + expect(Object.keys(profile.plan).length).to.be.greaterThan(0); + expect(Object.keys(profile.stats).length).to.be.greaterThan(0); + expect(profile.snapshot.size).to.equal(2); }); it.only('can plan an aggregate query', async () => { await randomCol.doc('doc1').set({foo: 1}); await randomCol.doc('doc2').set({foo: 2}); await randomCol.doc('doc3').set({foo: 1}); - const plan = await randomCol.where('foo', '>', 0).count().get(); - console.log(plan); + const plan = await randomCol.where('foo', '>', 0).count().explain(); + expect(Object.keys(plan).length).to.be.greaterThan(0); }); it.only('can profile an aggregate query', async () => { @@ -175,9 +175,10 @@ describe('Firestore class', () => { await randomCol.doc('doc2').set({foo: 2}); await randomCol.doc('doc3').set({foo: 1}); const profile = await randomCol.where('foo', '<', 3).count().explainAnalyze(); - console.log(profile.plan); - console.log(profile.stats); console.log(profile.snapshot.data()); + expect(Object.keys(profile.plan).length).to.be.greaterThan(0); + expect(Object.keys(profile.stats).length).to.be.greaterThan(0); + expect(profile.snapshot.data().count).to.equal(3); }); it('getAll() supports array destructuring', () => { From 8cb527d3dadb811121740a4a1171c66396f5ff10 Mon Sep 17 00:00:00 2001 From: Ehsan Nasiri Date: Thu, 26 Oct 2023 13:54:27 -0700 Subject: [PATCH 07/19] clean up. --- dev/src/reference.ts | 10 +++++----- dev/src/serializer.ts | 1 - dev/src/types.ts | 1 - dev/system-test/firestore.ts | 8 ++++---- 4 files changed, 9 insertions(+), 11 deletions(-) diff --git a/dev/src/reference.ts b/dev/src/reference.ts index 125edc234..644c86af8 100644 --- a/dev/src/reference.ts +++ b/dev/src/reference.ts @@ -18,7 +18,7 @@ import * as firestore from '@google-cloud/firestore'; import * as assert from 'assert'; import {Duplex, Readable, Transform} from 'stream'; import * as deepEqual from 'fast-deep-equal'; -import {GoogleError, serializer} from 'google-gax'; +import {GoogleError} from 'google-gax'; import * as protos from '../protos/firestore_v1_proto_api'; @@ -64,7 +64,6 @@ import {AggregateField, Aggregate, AggregateSpec} from './aggregate'; import {google} from "../protos/firestore_v1_proto_api"; import QueryMode = google.firestore.v1.QueryMode; import {QueryProfileInfo} from './profile'; -import IStruct = google.protobuf.IStruct; import {InformationalQueryExecutionStats, InformationalQueryPlan} from "@google-cloud/firestore"; /** @@ -2698,7 +2697,7 @@ export class Query< backendStream.on('error', err => { backendStream.unpipe(stream); - // If a non-transactional NORMAL query failed, attempt to restart. + // If a non-transactional 'NORMAL' query failed, attempt to restart. // Transactional queries are retried via the transaction runner. const isNormalQueryMode = queryMode === undefined || queryMode === "NORMAL"; if (isNormalQueryMode && !transactionId && !this._isPermanentRpcError(err, 'runQuery')) { @@ -3406,10 +3405,12 @@ export class AggregateQuery< } /** - * TODO. + * Internal streaming method for aggregate query profiling. * + * @param queryMode The query profiling mode. * @private * @internal + * @returns A QueryProfileInfo object containing the results of the profiling. */ _getQueryProfileInfo(queryMode: QueryMode): Promise< QueryProfileInfo> @@ -3438,7 +3439,6 @@ export class AggregateQuery< } }); stream.on('end', () => { - //stream.destroy(); resolve( new QueryProfileInfo>( planInfo, executionStats, aggregationResult)); diff --git a/dev/src/serializer.ts b/dev/src/serializer.ts index 8f18301d4..954fea850 100644 --- a/dev/src/serializer.ts +++ b/dev/src/serializer.ts @@ -30,7 +30,6 @@ import {customObjectMessage, invalidArgumentMessage} from './validate'; import api = proto.google.firestore.v1; import {google} from "../protos/firestore_v1_proto_api"; -import Value = google.protobuf.Value; import IValue = google.protobuf.IValue; import IStruct = google.protobuf.IStruct; diff --git a/dev/src/types.ts b/dev/src/types.ts index d698d1a2b..ac7a62d22 100644 --- a/dev/src/types.ts +++ b/dev/src/types.ts @@ -28,7 +28,6 @@ import {google} from '../protos/firestore_v1_proto_api'; import {FieldPath} from './path'; import api = google.firestore.v1; -import IValue = google.protobuf.IValue; /** * A map in the format of the Proto API diff --git a/dev/system-test/firestore.ts b/dev/system-test/firestore.ts index 791143538..8568f1a40 100644 --- a/dev/system-test/firestore.ts +++ b/dev/system-test/firestore.ts @@ -144,7 +144,7 @@ describe('Firestore class', () => { }); }); - it.only('can plan a query', async () => { + it('can plan a query', async () => { await randomCol.doc('doc1').set({'foo': 1}); await randomCol.doc('doc2').set({'foo': 2}); await randomCol.doc('doc3').set({'foo': 1}); @@ -152,7 +152,7 @@ describe('Firestore class', () => { expect(Object.keys(plan).length).to.be.greaterThan(0); }); - it.only('can profile a query', async () => { + it('can profile a query', async () => { await randomCol.doc('doc1').set({foo: 1}); await randomCol.doc('doc2').set({foo: 2}); await randomCol.doc('doc3').set({foo: 1}); @@ -162,7 +162,7 @@ describe('Firestore class', () => { expect(profile.snapshot.size).to.equal(2); }); - it.only('can plan an aggregate query', async () => { + it('can plan an aggregate query', async () => { await randomCol.doc('doc1').set({foo: 1}); await randomCol.doc('doc2').set({foo: 2}); await randomCol.doc('doc3').set({foo: 1}); @@ -170,7 +170,7 @@ describe('Firestore class', () => { expect(Object.keys(plan).length).to.be.greaterThan(0); }); - it.only('can profile an aggregate query', async () => { + it('can profile an aggregate query', async () => { await randomCol.doc('doc1').set({foo: 1}); await randomCol.doc('doc2').set({foo: 2}); await randomCol.doc('doc3').set({foo: 1}); From 69da27365c5b01cf7fd1daabd2dc3a13870e8402 Mon Sep 17 00:00:00 2001 From: Ehsan Nasiri Date: Thu, 26 Oct 2023 16:57:18 -0700 Subject: [PATCH 08/19] lint. --- dev/src/convert.ts | 2 +- dev/src/profile.ts | 10 +- dev/src/reference.ts | 187 ++++++++++++++++++++++------------- dev/src/serializer.ts | 14 +-- dev/system-test/firestore.ts | 11 ++- types/firestore.d.ts | 12 ++- 6 files changed, 145 insertions(+), 91 deletions(-) diff --git a/dev/src/convert.ts b/dev/src/convert.ts index 18084ce1f..214dfe507 100644 --- a/dev/src/convert.ts +++ b/dev/src/convert.ts @@ -194,7 +194,7 @@ export function detectGoogleProtobufValueKind(proto: IValue): string { if (detectedValues.length !== 1) { throw new Error( - `Unable to infer type value from '${JSON.stringify(proto)}'.` + `Unable to infer type value from '${JSON.stringify(proto)}'.` ); } diff --git a/dev/src/profile.ts b/dev/src/profile.ts index 4b62fcb66..3d033d505 100644 --- a/dev/src/profile.ts +++ b/dev/src/profile.ts @@ -18,9 +18,9 @@ import * as firestore from '@google-cloud/firestore'; export class QueryProfileInfo implements firestore.QueryProfileInfo { - constructor( - readonly plan: FirebaseFirestore.InformationalQueryPlan, - readonly stats: FirebaseFirestore.InformationalQueryExecutionStats, - readonly snapshot: T - ) {} + constructor( + readonly plan: FirebaseFirestore.InformationalQueryPlan, + readonly stats: FirebaseFirestore.InformationalQueryExecutionStats, + readonly snapshot: T + ) {} } diff --git a/dev/src/reference.ts b/dev/src/reference.ts index 644c86af8..95c2dad3e 100644 --- a/dev/src/reference.ts +++ b/dev/src/reference.ts @@ -61,10 +61,13 @@ import {validateDocumentData, WriteBatch, WriteResult} from './write-batch'; import api = protos.google.firestore.v1; import {CompositeFilter, Filter, UnaryFilter} from './filter'; import {AggregateField, Aggregate, AggregateSpec} from './aggregate'; -import {google} from "../protos/firestore_v1_proto_api"; +import {google} from '../protos/firestore_v1_proto_api'; import QueryMode = google.firestore.v1.QueryMode; import {QueryProfileInfo} from './profile'; -import {InformationalQueryExecutionStats, InformationalQueryPlan} from "@google-cloud/firestore"; +import { + InformationalQueryExecutionStats, + InformationalQueryPlan, +} from '@google-cloud/firestore'; /** * The direction of a `Query.orderBy()` clause is specified as 'desc' or 'asc' @@ -2327,7 +2330,7 @@ export class Query< * planning information. */ explain(): Promise { - return this._getQueryProfileInfo("PLAN").then(info => info.plan); + return this._getQueryProfileInfo('PLAN').then(info => info.plan); } /** @@ -2341,8 +2344,10 @@ export class Query< * @return A Promise that will be resolved with the planning information, * statistics from the query execution, and the query results. */ - explainAnalyze(): Promise>> { - return this._getQueryProfileInfo("PROFILE"); + explainAnalyze(): Promise< + firestore.QueryProfileInfo> + > { + return this._getQueryProfileInfo('PROFILE'); } /** @@ -2616,7 +2621,10 @@ export class Query< * @internal * @returns A stream of document results. */ - _stream(transactionId?: Uint8Array, queryMode?: QueryMode): NodeJS.ReadableStream { + _stream( + transactionId?: Uint8Array, + queryMode?: QueryMode + ): NodeJS.ReadableStream { const tag = requestTag(); let lastReceivedDocument: QueryDocumentSnapshot< @@ -2663,12 +2671,17 @@ export class Query< } else if (proto.stats) { if (proto.stats.queryPlan?.planInfo) { callback(undefined, { - planInfo: this.firestore._serializer!.decodeGoogleProtobufStruct(proto.stats.queryPlan.planInfo) + planInfo: this.firestore._serializer!.decodeGoogleProtobufStruct( + proto.stats.queryPlan.planInfo + ), }); } if (proto.stats.queryStats) { callback(undefined, { - executionStats: this.firestore._serializer!.decodeGoogleProtobufStruct(proto.stats.queryStats) + executionStats: + this.firestore._serializer!.decodeGoogleProtobufStruct( + proto.stats.queryStats + ), }); } } else { @@ -2699,8 +2712,13 @@ export class Query< // If a non-transactional 'NORMAL' query failed, attempt to restart. // Transactional queries are retried via the transaction runner. - const isNormalQueryMode = queryMode === undefined || queryMode === "NORMAL"; - if (isNormalQueryMode && !transactionId && !this._isPermanentRpcError(err, 'runQuery')) { + const isNormalQueryMode = + queryMode === undefined || queryMode === 'NORMAL'; + if ( + isNormalQueryMode && + !transactionId && + !this._isPermanentRpcError(err, 'runQuery') + ) { logger( 'Query._stream', tag, @@ -2758,11 +2776,14 @@ export class Query< * @internal * @returns A QueryProfileInfo object containing the results of the profiling. */ - _getQueryProfileInfo(queryMode: QueryMode): - Promise>> { + _getQueryProfileInfo( + queryMode: QueryMode + ): Promise< + firestore.QueryProfileInfo> + > { const docs: Array> = []; - let planInfo : InformationalQueryPlan = {}; - let executionStats : InformationalQueryExecutionStats = {}; + let planInfo: InformationalQueryPlan = {}; + let executionStats: InformationalQueryExecutionStats = {}; // Capture the error stack to preserve stack tracing across async calls. const stack = Error().stack!; @@ -2771,48 +2792,50 @@ export class Query< let readTime: Timestamp; this._stream(/* transactionId */ undefined, /* QueryMode */ queryMode) - .on('error', err => { - reject(wrapError(err, stack)); - }) - .on('data', result => { - readTime = result.readTime; - if (result.document) { - docs.push(result.document); - } - if (result.planInfo) { - planInfo = result.planInfo; - } - if (result.executionStats) { - executionStats = result.executionStats; - } - }) - .on('end', () => { - if (this._queryOptions.limitType === LimitType.Last) { - // The results for limitToLast queries need to be flipped since - // we reversed the ordering constraints before sending the query - // to the backend. - docs.reverse(); + .on('error', err => { + reject(wrapError(err, stack)); + }) + .on('data', result => { + readTime = result.readTime; + if (result.document) { + docs.push(result.document); + } + if (result.planInfo) { + planInfo = result.planInfo; + } + if (result.executionStats) { + executionStats = result.executionStats; + } + }) + .on('end', () => { + if (this._queryOptions.limitType === LimitType.Last) { + // The results for limitToLast queries need to be flipped since + // we reversed the ordering constraints before sending the query + // to the backend. + docs.reverse(); + } + const querySnapshot = new QuerySnapshot( + this, + readTime, + docs.length, + () => docs, + () => { + const changes: Array> = + []; + for (let i = 0; i < docs.length; ++i) { + changes.push(new DocumentChange('added', docs[i], -1, i)); + } + return changes; } - const querySnapshot = - new QuerySnapshot( - this, - readTime, - docs.length, - () => docs, - () => { - const changes: Array< - DocumentChange - > = []; - for (let i = 0; i < docs.length; ++i) { - changes.push(new DocumentChange('added', docs[i], -1, i)); - } - return changes; - } - ); - resolve( - new QueryProfileInfo>( - planInfo, executionStats, querySnapshot)); - }); + ); + resolve( + new QueryProfileInfo>( + planInfo, + executionStats, + querySnapshot + ) + ); + }); }); } @@ -3412,15 +3435,23 @@ export class AggregateQuery< * @internal * @returns A QueryProfileInfo object containing the results of the profiling. */ - _getQueryProfileInfo(queryMode: QueryMode): Promise< - QueryProfileInfo> + _getQueryProfileInfo( + queryMode: QueryMode + ): Promise< + QueryProfileInfo< + AggregateQuerySnapshot + > > { // Capture the error stack to preserve stack tracing across async calls. const stack = Error().stack!; - let aggregationResult: AggregateQuerySnapshot; - let planInfo : InformationalQueryPlan = {}; - let executionStats : InformationalQueryExecutionStats = {}; + let aggregationResult: AggregateQuerySnapshot< + AggregateSpecType, + AppModelType, + DbModelType + >; + let planInfo: InformationalQueryPlan = {}; + let executionStats: InformationalQueryExecutionStats = {}; return new Promise((resolve, reject) => { const stream = this._stream(undefined, queryMode); @@ -3440,8 +3471,10 @@ export class AggregateQuery< }); stream.on('end', () => { resolve( - new QueryProfileInfo>( - planInfo, executionStats, aggregationResult)); + new QueryProfileInfo< + AggregateQuerySnapshot + >(planInfo, executionStats, aggregationResult) + ); }); }); } @@ -3465,21 +3498,26 @@ export class AggregateQuery< const readTime = Timestamp.fromProto(proto.readTime!); const data = this.decodeResult(proto.result); callback(undefined, { - aggregationResult: new AggregateQuerySnapshot(this, readTime, data) + aggregationResult: new AggregateQuerySnapshot(this, readTime, data), }); } else if (proto.stats) { if (proto.stats.queryPlan?.planInfo) { callback(undefined, { - planInfo: this._query.firestore._serializer!.decodeGoogleProtobufStruct(proto.stats.queryPlan.planInfo) + planInfo: + this._query.firestore._serializer!.decodeGoogleProtobufStruct( + proto.stats.queryPlan.planInfo + ), }); } if (proto.stats.queryStats) { callback(undefined, { - executionStats: this._query.firestore._serializer!.decodeGoogleProtobufStruct(proto.stats.queryStats) + executionStats: + this._query.firestore._serializer!.decodeGoogleProtobufStruct( + proto.stats.queryStats + ), }); } - } - else { + } else { callback(Error('RunAggregationQueryResponse is missing result')); } }, @@ -3578,7 +3616,10 @@ export class AggregateQuery< * @internal * @returns Serialized JSON for the query. */ - toProto(transactionId?: Uint8Array, queryMode?: QueryMode): api.IRunAggregationQueryRequest { + toProto( + transactionId?: Uint8Array, + queryMode?: QueryMode + ): api.IRunAggregationQueryRequest { const queryProto = this._query.toProto(); const runQueryRequest: api.IRunAggregationQueryRequest = { parent: queryProto.parent, @@ -3642,11 +3683,15 @@ export class AggregateQuery< } explain(): Promise> { - return this._getQueryProfileInfo("PLAN").then(info => info.plan); + return this._getQueryProfileInfo('PLAN').then(info => info.plan); } - explainAnalyze(): Promise>> { - return this._getQueryProfileInfo("PROFILE"); + explainAnalyze(): Promise< + firestore.QueryProfileInfo< + AggregateQuerySnapshot + > + > { + return this._getQueryProfileInfo('PROFILE'); } } diff --git a/dev/src/serializer.ts b/dev/src/serializer.ts index 954fea850..a95821cf5 100644 --- a/dev/src/serializer.ts +++ b/dev/src/serializer.ts @@ -29,7 +29,7 @@ import {isEmpty, isObject, isPlainObject} from './util'; import {customObjectMessage, invalidArgumentMessage} from './validate'; import api = proto.google.firestore.v1; -import {google} from "../protos/firestore_v1_proto_api"; +import {google} from '../protos/firestore_v1_proto_api'; import IValue = google.protobuf.IValue; import IStruct = google.protobuf.IStruct; @@ -290,7 +290,6 @@ export class Serializer { } } - /** * Decodes a google.protobuf.Value * @@ -315,8 +314,8 @@ export class Serializer { } case 'listValue': { const array: unknown[] = []; - if (Array.isArray(proto.listValue?.values)) { - for (const value of proto.listValue?.values!) { + if (Array.isArray(proto.listValue!.values)) { + for (const value of proto.listValue!.values!) { array.push(this.decodeGoogleProtobufValue(value)); } } @@ -335,7 +334,8 @@ export class Serializer { } default: { throw new Error( - 'Cannot decode type from google.protobuf.Value: ' + JSON.stringify(proto) + 'Cannot decode type from google.protobuf.Value: ' + + JSON.stringify(proto) ); } } @@ -350,8 +350,8 @@ export class Serializer { * @returns The converted JS type. */ decodeGoogleProtobufStruct(proto: IStruct): Record { - let result : Record = {}; - if(proto.fields) { + const result: Record = {}; + if (proto.fields) { for (const prop of Object.keys(proto.fields)) { result[prop] = this.decodeGoogleProtobufValue(proto.fields[prop]); } diff --git a/dev/system-test/firestore.ts b/dev/system-test/firestore.ts index 8568f1a40..684b2ff25 100644 --- a/dev/system-test/firestore.ts +++ b/dev/system-test/firestore.ts @@ -145,9 +145,9 @@ describe('Firestore class', () => { }); it('can plan a query', async () => { - await randomCol.doc('doc1').set({'foo': 1}); - await randomCol.doc('doc2').set({'foo': 2}); - await randomCol.doc('doc3').set({'foo': 1}); + await randomCol.doc('doc1').set({foo: 1}); + await randomCol.doc('doc2').set({foo: 2}); + await randomCol.doc('doc3').set({foo: 1}); const plan = await randomCol.where('foo', '>', 1).explain(); expect(Object.keys(plan).length).to.be.greaterThan(0); }); @@ -174,7 +174,10 @@ describe('Firestore class', () => { await randomCol.doc('doc1').set({foo: 1}); await randomCol.doc('doc2').set({foo: 2}); await randomCol.doc('doc3').set({foo: 1}); - const profile = await randomCol.where('foo', '<', 3).count().explainAnalyze(); + const profile = await randomCol + .where('foo', '<', 3) + .count() + .explainAnalyze(); console.log(profile.snapshot.data()); expect(Object.keys(profile.plan).length).to.be.greaterThan(0); expect(Object.keys(profile.stats).length).to.be.greaterThan(0); diff --git a/types/firestore.d.ts b/types/firestore.d.ts index 318c9c644..7b66c59ce 100644 --- a/types/firestore.d.ts +++ b/types/firestore.d.ts @@ -1537,7 +1537,7 @@ declare namespace FirebaseFirestore { * InformationalQueryPlan contains information about the query plan. * Contents are subject to change. */ - export type InformationalQueryPlan = Record; + export type InformationalQueryPlan = Record; /** * InformationalQueryExecutionStats contains statistics about the @@ -1792,7 +1792,9 @@ declare namespace FirebaseFirestore { * @return A Promise that will be resolved with the planning information, * statistics from the query execution, and the query results. */ - explainAnalyze(): Promise>>; + explainAnalyze(): Promise< + QueryProfileInfo> + >; /* * Executes the query and returns the results as Node Stream. @@ -2349,7 +2351,11 @@ declare namespace FirebaseFirestore { * @return A Promise that will be resolved with the planning information, * statistics from the query execution, and the query results. */ - explainAnalyze(): Promise>>; + explainAnalyze(): Promise< + QueryProfileInfo< + AggregateQuerySnapshot + > + >; /** * Compares this object with the given object for equality. From cc35f56f5b1aaf886c63e3a1f1b30c3779dee981 Mon Sep 17 00:00:00 2001 From: Ehsan Nasiri Date: Tue, 21 Nov 2023 11:46:16 -0800 Subject: [PATCH 09/19] Fix: Do not re-use _stream(). --- dev/src/reference.ts | 246 ++++++++++++++++++----------------- dev/system-test/firestore.ts | 7 +- 2 files changed, 133 insertions(+), 120 deletions(-) diff --git a/dev/src/reference.ts b/dev/src/reference.ts index 95c2dad3e..14605f578 100644 --- a/dev/src/reference.ts +++ b/dev/src/reference.ts @@ -2621,10 +2621,7 @@ export class Query< * @internal * @returns A stream of document results. */ - _stream( - transactionId?: Uint8Array, - queryMode?: QueryMode - ): NodeJS.ReadableStream { + _stream(transactionId?: Uint8Array): NodeJS.ReadableStream { const tag = requestTag(); let lastReceivedDocument: QueryDocumentSnapshot< @@ -2668,22 +2665,6 @@ export class Query< backendStream.end(); stream.end(); } - } else if (proto.stats) { - if (proto.stats.queryPlan?.planInfo) { - callback(undefined, { - planInfo: this.firestore._serializer!.decodeGoogleProtobufStruct( - proto.stats.queryPlan.planInfo - ), - }); - } - if (proto.stats.queryStats) { - callback(undefined, { - executionStats: - this.firestore._serializer!.decodeGoogleProtobufStruct( - proto.stats.queryStats - ), - }); - } } else { callback(undefined, {readTime}); } @@ -2696,7 +2677,7 @@ export class Query< // `toProto()` might throw an exception. We rely on the behavior of an // async function to convert this exception into the rejected Promise we // catch below. - let request = this.toProto(transactionId, queryMode); + let request = this.toProto(transactionId); let streamActive: Deferred; do { @@ -2710,15 +2691,9 @@ export class Query< backendStream.on('error', err => { backendStream.unpipe(stream); - // If a non-transactional 'NORMAL' query failed, attempt to restart. + // If a non-transactional query failed, attempt to restart. // Transactional queries are retried via the transaction runner. - const isNormalQueryMode = - queryMode === undefined || queryMode === 'NORMAL'; - if ( - isNormalQueryMode && - !transactionId && - !this._isPermanentRpcError(err, 'runQuery') - ) { + if (!transactionId && !this._isPermanentRpcError(err, 'runQuery')) { logger( 'Query._stream', tag, @@ -2781,6 +2756,7 @@ export class Query< ): Promise< firestore.QueryProfileInfo> > { + let readTime: Timestamp; const docs: Array> = []; let planInfo: InformationalQueryPlan = {}; let executionStats: InformationalQueryExecutionStats = {}; @@ -2789,53 +2765,88 @@ export class Query< const stack = Error().stack!; return new Promise((resolve, reject) => { - let readTime: Timestamp; - - this._stream(/* transactionId */ undefined, /* QueryMode */ queryMode) - .on('error', err => { - reject(wrapError(err, stack)); - }) - .on('data', result => { - readTime = result.readTime; - if (result.document) { - docs.push(result.document); - } - if (result.planInfo) { - planInfo = result.planInfo; - } - if (result.executionStats) { - executionStats = result.executionStats; - } - }) - .on('end', () => { - if (this._queryOptions.limitType === LimitType.Last) { - // The results for limitToLast queries need to be flipped since - // we reversed the ordering constraints before sending the query - // to the backend. - docs.reverse(); - } - const querySnapshot = new QuerySnapshot( - this, - readTime, - docs.length, - () => docs, - () => { - const changes: Array> = - []; - for (let i = 0; i < docs.length; ++i) { - changes.push(new DocumentChange('added', docs[i], -1, i)); + const tag = requestTag(); + this.firestore.initializeIfNeeded(tag).then(() => { + const request = this.toProto(/* transactionId */ undefined, queryMode); + this._firestore.requestStream( + 'runQuery', + /* bidirectional= */ false, + request, + tag + ).then(stream => { + stream.on('error', err => { + reject(wrapError(err, stack)); + }); + stream.on('data', response => { + if (response.document) { + readTime = Timestamp.fromProto(response.readTime); + const document = this.firestore.snapshot_( + response.document, + response.readTime + ); + const finalDoc = new DocumentSnapshotBuilder< + AppModelType, + DbModelType + >(document.ref.withConverter(this._queryOptions.converter)); + // Recreate the QueryDocumentSnapshot with the DocumentReference + // containing the original converter. + finalDoc.fieldsProto = document._fieldsProto; + finalDoc.readTime = document.readTime; + finalDoc.createTime = document.createTime; + finalDoc.updateTime = document.updateTime; + docs.push( + finalDoc.build() as QueryDocumentSnapshot + ); + } + if (response.stats) { + if (response.stats.queryPlan?.planInfo) { + planInfo = this.firestore._serializer!.decodeGoogleProtobufStruct( + response.stats.queryPlan.planInfo + ); + } + if (response.stats.queryStats) { + executionStats = + this.firestore._serializer!.decodeGoogleProtobufStruct( + response.stats.queryStats + ); } - return changes; } - ); - resolve( - new QueryProfileInfo>( - planInfo, - executionStats, - querySnapshot - ) - ); + if (response.done) { + stream.end(); + } + }); + stream.on('end', () => { + if (this._queryOptions.limitType === LimitType.Last) { + // The results for limitToLast queries need to be flipped since + // we reversed the ordering constraints before sending the query + // to the backend. + docs.reverse(); + } + const querySnapshot = new QuerySnapshot( + this, + readTime, + docs.length, + () => docs, + () => { + const changes: Array> = + []; + for (let i = 0; i < docs.length; ++i) { + changes.push(new DocumentChange('added', docs[i], -1, i)); + } + return changes; + } + ); + resolve( + new QueryProfileInfo>( + planInfo, + executionStats, + querySnapshot + ) + ); + }); + stream.resume(); }); + }); }); } @@ -3454,27 +3465,49 @@ export class AggregateQuery< let executionStats: InformationalQueryExecutionStats = {}; return new Promise((resolve, reject) => { - const stream = this._stream(undefined, queryMode); - stream.on('error', err => { - reject(wrapError(err, stack)); - }); - stream.on('data', result => { - if (result.aggregationResult) { - aggregationResult = result.aggregationResult; - } - if (result.planInfo) { - planInfo = result.planInfo; - } - if (result.executionStats) { - executionStats = result.executionStats; - } - }); - stream.on('end', () => { - resolve( - new QueryProfileInfo< - AggregateQuerySnapshot - >(planInfo, executionStats, aggregationResult) - ); + const tag = requestTag(); + const firestore = this._query.firestore; + firestore.initializeIfNeeded(tag).then(()=>{ + const request = this.toProto(/* transactionId */ undefined, queryMode); + firestore.requestStream( + 'runAggregationQuery', + /* bidirectional= */ false, + request, + tag + ).then(stream => { + stream.on('error', err => { + reject(wrapError(err, stack)); + }); + stream.on('data', response => { + if (response.result) { + const readTime = Timestamp.fromProto(response.readTime!); + const data = this.decodeResult(response.result); + aggregationResult = new AggregateQuerySnapshot(this, readTime, data); + } + if (response.stats) { + if (response.stats.queryPlan?.planInfo) { + planInfo = + this._query.firestore._serializer!.decodeGoogleProtobufStruct( + response.stats.queryPlan.planInfo + ); + } + if (response.stats.queryStats) { + executionStats = + this._query.firestore._serializer!.decodeGoogleProtobufStruct( + response.stats.queryStats + ); + } + } + }); + stream.on('end', () => { + resolve( + new QueryProfileInfo< + AggregateQuerySnapshot + >(planInfo, executionStats, aggregationResult) + ); + }); + stream.resume(); + }); }); }); } @@ -3487,7 +3520,7 @@ export class AggregateQuery< * @param transactionId A transaction ID. * @returns A stream of document results. */ - _stream(transactionId?: Uint8Array, queryMode?: QueryMode): Readable { + _stream(transactionId?: Uint8Array): Readable { const tag = requestTag(); const firestore = this._query.firestore; @@ -3497,26 +3530,7 @@ export class AggregateQuery< if (proto.result) { const readTime = Timestamp.fromProto(proto.readTime!); const data = this.decodeResult(proto.result); - callback(undefined, { - aggregationResult: new AggregateQuerySnapshot(this, readTime, data), - }); - } else if (proto.stats) { - if (proto.stats.queryPlan?.planInfo) { - callback(undefined, { - planInfo: - this._query.firestore._serializer!.decodeGoogleProtobufStruct( - proto.stats.queryPlan.planInfo - ), - }); - } - if (proto.stats.queryStats) { - callback(undefined, { - executionStats: - this._query.firestore._serializer!.decodeGoogleProtobufStruct( - proto.stats.queryStats - ), - }); - } + callback(undefined, new AggregateQuerySnapshot(this, readTime, data)); } else { callback(Error('RunAggregationQueryResponse is missing result')); } @@ -3529,7 +3543,7 @@ export class AggregateQuery< // `toProto()` might throw an exception. We rely on the behavior of an // async function to convert this exception into the rejected Promise we // catch below. - const request = this.toProto(transactionId, queryMode); + const request = this.toProto(transactionId); let streamActive: Deferred; do { diff --git a/dev/system-test/firestore.ts b/dev/system-test/firestore.ts index 684b2ff25..71d382167 100644 --- a/dev/system-test/firestore.ts +++ b/dev/system-test/firestore.ts @@ -153,9 +153,9 @@ describe('Firestore class', () => { }); it('can profile a query', async () => { - await randomCol.doc('doc1').set({foo: 1}); - await randomCol.doc('doc2').set({foo: 2}); - await randomCol.doc('doc3').set({foo: 1}); + await randomCol.doc('doc1').set({foo: 1, bar: 0}); + await randomCol.doc('doc2').set({foo: 2, bar: 1}); + await randomCol.doc('doc3').set({foo: 1, bar: 2}); const profile = await randomCol.where('foo', '==', 1).explainAnalyze(); expect(Object.keys(profile.plan).length).to.be.greaterThan(0); expect(Object.keys(profile.stats).length).to.be.greaterThan(0); @@ -178,7 +178,6 @@ describe('Firestore class', () => { .where('foo', '<', 3) .count() .explainAnalyze(); - console.log(profile.snapshot.data()); expect(Object.keys(profile.plan).length).to.be.greaterThan(0); expect(Object.keys(profile.stats).length).to.be.greaterThan(0); expect(profile.snapshot.data().count).to.equal(3); From 9f987dd78cf6889e41d0b4f262c01b18790a66d8 Mon Sep 17 00:00:00 2001 From: Ehsan Nasiri Date: Tue, 21 Nov 2023 14:15:15 -0800 Subject: [PATCH 10/19] Address more feedback. --- dev/src/convert.ts | 2 +- dev/src/reference.ts | 180 ++++++++++++++++++++++-------------------- dev/src/serializer.ts | 4 +- types/firestore.d.ts | 4 +- 4 files changed, 101 insertions(+), 89 deletions(-) diff --git a/dev/src/convert.ts b/dev/src/convert.ts index 214dfe507..cab9fc7ec 100644 --- a/dev/src/convert.ts +++ b/dev/src/convert.ts @@ -170,7 +170,7 @@ export function detectValueType(proto: ProtobufJsValue): string { * @param proto The `firestore.v1.Value` proto. * @return The string value for 'valueType'. */ -export function detectGoogleProtobufValueKind(proto: IValue): string { +export function detectGoogleProtobufValueType(proto: IValue): string { const detectedValues: string[] = []; if (proto.nullValue !== undefined) { diff --git a/dev/src/reference.ts b/dev/src/reference.ts index 14605f578..b062318b8 100644 --- a/dev/src/reference.ts +++ b/dev/src/reference.ts @@ -2768,84 +2768,86 @@ export class Query< const tag = requestTag(); this.firestore.initializeIfNeeded(tag).then(() => { const request = this.toProto(/* transactionId */ undefined, queryMode); - this._firestore.requestStream( - 'runQuery', - /* bidirectional= */ false, - request, - tag - ).then(stream => { - stream.on('error', err => { - reject(wrapError(err, stack)); - }); - stream.on('data', response => { - if (response.document) { - readTime = Timestamp.fromProto(response.readTime); - const document = this.firestore.snapshot_( + this._firestore + .requestStream('runQuery', /* bidirectional= */ false, request, tag) + .then(stream => { + stream.on('error', err => { + reject(wrapError(err, stack)); + }); + stream.on('data', response => { + if (response.document) { + readTime = Timestamp.fromProto(response.readTime); + const document = this.firestore.snapshot_( response.document, response.readTime - ); - const finalDoc = new DocumentSnapshotBuilder< + ); + const finalDoc = new DocumentSnapshotBuilder< AppModelType, DbModelType - >(document.ref.withConverter(this._queryOptions.converter)); - // Recreate the QueryDocumentSnapshot with the DocumentReference - // containing the original converter. - finalDoc.fieldsProto = document._fieldsProto; - finalDoc.readTime = document.readTime; - finalDoc.createTime = document.createTime; - finalDoc.updateTime = document.updateTime; - docs.push( - finalDoc.build() as QueryDocumentSnapshot - ); - } - if (response.stats) { - if (response.stats.queryPlan?.planInfo) { - planInfo = this.firestore._serializer!.decodeGoogleProtobufStruct( - response.stats.queryPlan.planInfo + >(document.ref.withConverter(this._queryOptions.converter)); + // Recreate the QueryDocumentSnapshot with the DocumentReference + // containing the original converter. + finalDoc.fieldsProto = document._fieldsProto; + finalDoc.readTime = document.readTime; + finalDoc.createTime = document.createTime; + finalDoc.updateTime = document.updateTime; + docs.push( + finalDoc.build() as QueryDocumentSnapshot< + AppModelType, + DbModelType + > ); } - if (response.stats.queryStats) { - executionStats = + if (response.stats) { + if (response.stats.queryPlan?.planInfo) { + planInfo = this.firestore._serializer!.decodeGoogleProtobufStruct( - response.stats.queryStats + response.stats.queryPlan.planInfo ); + } + if (response.stats.queryStats) { + executionStats = + this.firestore._serializer!.decodeGoogleProtobufStruct( + response.stats.queryStats + ); + } } - } - if (response.done) { - stream.end(); - } - }); - stream.on('end', () => { - if (this._queryOptions.limitType === LimitType.Last) { - // The results for limitToLast queries need to be flipped since - // we reversed the ordering constraints before sending the query - // to the backend. - docs.reverse(); - } - const querySnapshot = new QuerySnapshot( + if (response.done) { + stream.end(); + } + }); + stream.on('end', () => { + if (this._queryOptions.limitType === LimitType.Last) { + // The results for limitToLast queries need to be flipped since + // we reversed the ordering constraints before sending the query + // to the backend. + docs.reverse(); + } + const querySnapshot = new QuerySnapshot( this, readTime, docs.length, () => docs, () => { - const changes: Array> = - []; + const changes: Array< + DocumentChange + > = []; for (let i = 0; i < docs.length; ++i) { changes.push(new DocumentChange('added', docs[i], -1, i)); } return changes; } - ); - resolve( + ); + resolve( new QueryProfileInfo>( - planInfo, - executionStats, - querySnapshot + planInfo, + executionStats, + querySnapshot ) - ); + ); + }); + stream.resume(); }); - stream.resume(); - }); }); }); } @@ -3467,47 +3469,57 @@ export class AggregateQuery< return new Promise((resolve, reject) => { const tag = requestTag(); const firestore = this._query.firestore; - firestore.initializeIfNeeded(tag).then(()=>{ + firestore.initializeIfNeeded(tag).then(() => { const request = this.toProto(/* transactionId */ undefined, queryMode); - firestore.requestStream( + firestore + .requestStream( 'runAggregationQuery', /* bidirectional= */ false, request, tag - ).then(stream => { - stream.on('error', err => { - reject(wrapError(err, stack)); - }); - stream.on('data', response => { - if (response.result) { - const readTime = Timestamp.fromProto(response.readTime!); - const data = this.decodeResult(response.result); - aggregationResult = new AggregateQuerySnapshot(this, readTime, data); - } - if (response.stats) { - if (response.stats.queryPlan?.planInfo) { - planInfo = + ) + .then(stream => { + stream.on('error', err => { + reject(wrapError(err, stack)); + }); + stream.on('data', response => { + if (response.result) { + const readTime = Timestamp.fromProto(response.readTime!); + const data = this.decodeResult(response.result); + aggregationResult = new AggregateQuerySnapshot( + this, + readTime, + data + ); + } + if (response.stats) { + if (response.stats.queryPlan?.planInfo) { + planInfo = this._query.firestore._serializer!.decodeGoogleProtobufStruct( - response.stats.queryPlan.planInfo + response.stats.queryPlan.planInfo ); - } - if (response.stats.queryStats) { - executionStats = + } + if (response.stats.queryStats) { + executionStats = this._query.firestore._serializer!.decodeGoogleProtobufStruct( - response.stats.queryStats + response.stats.queryStats ); + } } - } - }); - stream.on('end', () => { - resolve( + }); + stream.on('end', () => { + resolve( new QueryProfileInfo< - AggregateQuerySnapshot + AggregateQuerySnapshot< + AggregateSpecType, + AppModelType, + DbModelType + > >(planInfo, executionStats, aggregationResult) - ); + ); + }); + stream.resume(); }); - stream.resume(); - }); }); }); } diff --git a/dev/src/serializer.ts b/dev/src/serializer.ts index a95821cf5..38565fe0d 100644 --- a/dev/src/serializer.ts +++ b/dev/src/serializer.ts @@ -18,7 +18,7 @@ import {DocumentData} from '@google-cloud/firestore'; import * as proto from '../protos/firestore_v1_proto_api'; -import {detectGoogleProtobufValueKind, detectValueType} from './convert'; +import {detectGoogleProtobufValueType, detectValueType} from './convert'; import {DeleteTransform, FieldTransform} from './field-value'; import {GeoPoint} from './geo-point'; import {DocumentReference, Firestore} from './index'; @@ -299,7 +299,7 @@ export class Serializer { * @returns The converted JS type. */ decodeGoogleProtobufValue(proto: IValue): unknown { - switch (detectGoogleProtobufValueKind(proto)) { + switch (detectGoogleProtobufValueType(proto)) { case 'nullValue': { return null; } diff --git a/types/firestore.d.ts b/types/firestore.d.ts index 7b66c59ce..f82568c68 100644 --- a/types/firestore.d.ts +++ b/types/firestore.d.ts @@ -2816,13 +2816,13 @@ declare namespace FirebaseFirestore { */ export interface QueryProfileInfo { /** - * A Map that contains information about the query plan. + * An `InformationalQueryPlan` object that contains information about the query plan. * Contents are subject to change. */ readonly plan: InformationalQueryPlan; /** - * A Map that contains statistics about the execution of the query. + * An `InformationalQueryExecutionStats` that contains statistics about the execution of the query. * Contents are subject to change. */ readonly stats: InformationalQueryExecutionStats; From 40ded3afaf6cd024b913a6fc2d92f7dea61c440f Mon Sep 17 00:00:00 2001 From: Ehsan Nasiri Date: Wed, 3 Jan 2024 23:18:34 -0800 Subject: [PATCH 11/19] introduce QueryPlan class to make it possible to add node-level info in future. --- dev/src/query-plan.ts | 22 ++++++++++ dev/src/{profile.ts => query-profile.ts} | 4 +- dev/src/reference.ts | 45 +++++++++++---------- dev/src/serializer.ts | 14 ++----- dev/system-test/firestore.ts | 12 +++--- types/firestore.d.ts | 51 +++++++++++++++++------- 6 files changed, 94 insertions(+), 54 deletions(-) create mode 100644 dev/src/query-plan.ts rename dev/src/{profile.ts => query-profile.ts} (85%) diff --git a/dev/src/query-plan.ts b/dev/src/query-plan.ts new file mode 100644 index 000000000..81df71982 --- /dev/null +++ b/dev/src/query-plan.ts @@ -0,0 +1,22 @@ +/** + * @license + * Copyright 2023 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. + */ + +import * as firestore from '@google-cloud/firestore'; + +export class QueryPlan implements firestore.QueryPlan { + constructor(readonly planInfo: FirebaseFirestore.InformationalQueryPlan) {} +} diff --git a/dev/src/profile.ts b/dev/src/query-profile.ts similarity index 85% rename from dev/src/profile.ts rename to dev/src/query-profile.ts index 3d033d505..76a1b9170 100644 --- a/dev/src/profile.ts +++ b/dev/src/query-profile.ts @@ -17,9 +17,9 @@ import * as firestore from '@google-cloud/firestore'; -export class QueryProfileInfo implements firestore.QueryProfileInfo { +export class QueryProfile implements firestore.QueryProfile { constructor( - readonly plan: FirebaseFirestore.InformationalQueryPlan, + readonly plan: FirebaseFirestore.QueryPlan, readonly stats: FirebaseFirestore.InformationalQueryExecutionStats, readonly snapshot: T ) {} diff --git a/dev/src/reference.ts b/dev/src/reference.ts index b062318b8..ddad5730c 100644 --- a/dev/src/reference.ts +++ b/dev/src/reference.ts @@ -63,11 +63,12 @@ import {CompositeFilter, Filter, UnaryFilter} from './filter'; import {AggregateField, Aggregate, AggregateSpec} from './aggregate'; import {google} from '../protos/firestore_v1_proto_api'; import QueryMode = google.firestore.v1.QueryMode; -import {QueryProfileInfo} from './profile'; +import {QueryProfile} from './query-profile'; import { InformationalQueryExecutionStats, InformationalQueryPlan, } from '@google-cloud/firestore'; +import {QueryPlan} from './query-plan'; /** * The direction of a `Query.orderBy()` clause is specified as 'desc' or 'asc' @@ -2329,7 +2330,7 @@ export class Query< * @return A Promise that will be resolved with the results of the query * planning information. */ - explain(): Promise { + explain(): Promise { return this._getQueryProfileInfo('PLAN').then(info => info.plan); } @@ -2345,7 +2346,7 @@ export class Query< * statistics from the query execution, and the query results. */ explainAnalyze(): Promise< - firestore.QueryProfileInfo> + firestore.QueryProfile> > { return this._getQueryProfileInfo('PROFILE'); } @@ -2749,16 +2750,14 @@ export class Query< * @param queryMode The query profiling mode. * @private * @internal - * @returns A QueryProfileInfo object containing the results of the profiling. + * @returns A QueryProfile object containing the results of the profiling. */ _getQueryProfileInfo( queryMode: QueryMode - ): Promise< - firestore.QueryProfileInfo> - > { + ): Promise>> { let readTime: Timestamp; const docs: Array> = []; - let planInfo: InformationalQueryPlan = {}; + let queryPlan: QueryPlan = {planInfo: {}}; let executionStats: InformationalQueryExecutionStats = {}; // Capture the error stack to preserve stack tracing across async calls. @@ -2799,11 +2798,12 @@ export class Query< ); } if (response.stats) { - if (response.stats.queryPlan?.planInfo) { - planInfo = + if (response.stats.queryPlan) { + queryPlan = new QueryPlan( this.firestore._serializer!.decodeGoogleProtobufStruct( response.stats.queryPlan.planInfo - ); + ) + ); } if (response.stats.queryStats) { executionStats = @@ -2839,8 +2839,8 @@ export class Query< } ); resolve( - new QueryProfileInfo>( - planInfo, + new QueryProfile>( + queryPlan, executionStats, querySnapshot ) @@ -3446,12 +3446,12 @@ export class AggregateQuery< * @param queryMode The query profiling mode. * @private * @internal - * @returns A QueryProfileInfo object containing the results of the profiling. + * @returns A QueryProfile object containing the results of the profiling. */ _getQueryProfileInfo( queryMode: QueryMode ): Promise< - QueryProfileInfo< + QueryProfile< AggregateQuerySnapshot > > { @@ -3463,7 +3463,7 @@ export class AggregateQuery< AppModelType, DbModelType >; - let planInfo: InformationalQueryPlan = {}; + let planInfo: QueryPlan = {planInfo: {}}; let executionStats: InformationalQueryExecutionStats = {}; return new Promise((resolve, reject) => { @@ -3493,11 +3493,12 @@ export class AggregateQuery< ); } if (response.stats) { - if (response.stats.queryPlan?.planInfo) { - planInfo = + if (response.stats.queryPlan) { + planInfo = new QueryPlan( this._query.firestore._serializer!.decodeGoogleProtobufStruct( response.stats.queryPlan.planInfo - ); + ) + ); } if (response.stats.queryStats) { executionStats = @@ -3509,7 +3510,7 @@ export class AggregateQuery< }); stream.on('end', () => { resolve( - new QueryProfileInfo< + new QueryProfile< AggregateQuerySnapshot< AggregateSpecType, AppModelType, @@ -3708,12 +3709,12 @@ export class AggregateQuery< return deepEqual(this._aggregates, other._aggregates); } - explain(): Promise> { + explain(): Promise { return this._getQueryProfileInfo('PLAN').then(info => info.plan); } explainAnalyze(): Promise< - firestore.QueryProfileInfo< + firestore.QueryProfile< AggregateQuerySnapshot > > { diff --git a/dev/src/serializer.ts b/dev/src/serializer.ts index 38565fe0d..e79198557 100644 --- a/dev/src/serializer.ts +++ b/dev/src/serializer.ts @@ -322,15 +322,7 @@ export class Serializer { return array; } case 'structValue': { - const obj: DocumentData = {}; - const fields = proto.structValue?.fields; - if (fields) { - for (const prop of Object.keys(fields)) { - obj[prop] = this.decodeGoogleProtobufValue(fields[prop]); - } - } - - return obj; + return this.decodeGoogleProtobufStruct(proto.structValue!); } default: { throw new Error( @@ -349,9 +341,9 @@ export class Serializer { * @param proto A Google Protobuf 'Struct'. * @returns The converted JS type. */ - decodeGoogleProtobufStruct(proto: IStruct): Record { + decodeGoogleProtobufStruct(proto: IStruct | null): Record { const result: Record = {}; - if (proto.fields) { + if (proto !== null && proto.fields) { for (const prop of Object.keys(proto.fields)) { result[prop] = this.decodeGoogleProtobufValue(proto.fields[prop]); } diff --git a/dev/system-test/firestore.ts b/dev/system-test/firestore.ts index 71d382167..b222cdaa4 100644 --- a/dev/system-test/firestore.ts +++ b/dev/system-test/firestore.ts @@ -99,7 +99,9 @@ if (process.env.NODE_ENV === 'DEBUG') { } function getTestRoot(settings: Settings = {}): CollectionReference { - const internalSettings: Settings = {}; + const internalSettings: Settings = { + host: 'test-firestore.sandbox.googleapis.com' + }; if (process.env.FIRESTORE_NAMED_DATABASE) { internalSettings.databaseId = process.env.FIRESTORE_NAMED_DATABASE; } @@ -149,7 +151,7 @@ describe('Firestore class', () => { await randomCol.doc('doc2').set({foo: 2}); await randomCol.doc('doc3').set({foo: 1}); const plan = await randomCol.where('foo', '>', 1).explain(); - expect(Object.keys(plan).length).to.be.greaterThan(0); + expect(Object.keys(plan.planInfo).length).to.be.greaterThan(0); }); it('can profile a query', async () => { @@ -157,7 +159,7 @@ describe('Firestore class', () => { await randomCol.doc('doc2').set({foo: 2, bar: 1}); await randomCol.doc('doc3').set({foo: 1, bar: 2}); const profile = await randomCol.where('foo', '==', 1).explainAnalyze(); - expect(Object.keys(profile.plan).length).to.be.greaterThan(0); + expect(Object.keys(profile.plan.planInfo).length).to.be.greaterThan(0); expect(Object.keys(profile.stats).length).to.be.greaterThan(0); expect(profile.snapshot.size).to.equal(2); }); @@ -167,7 +169,7 @@ describe('Firestore class', () => { await randomCol.doc('doc2').set({foo: 2}); await randomCol.doc('doc3').set({foo: 1}); const plan = await randomCol.where('foo', '>', 0).count().explain(); - expect(Object.keys(plan).length).to.be.greaterThan(0); + expect(Object.keys(plan.planInfo).length).to.be.greaterThan(0); }); it('can profile an aggregate query', async () => { @@ -178,7 +180,7 @@ describe('Firestore class', () => { .where('foo', '<', 3) .count() .explainAnalyze(); - expect(Object.keys(profile.plan).length).to.be.greaterThan(0); + expect(Object.keys(profile.plan.planInfo).length).to.be.greaterThan(0); expect(Object.keys(profile.stats).length).to.be.greaterThan(0); expect(profile.snapshot.data().count).to.equal(3); }); diff --git a/types/firestore.d.ts b/types/firestore.d.ts index f82568c68..a67653550 100644 --- a/types/firestore.d.ts +++ b/types/firestore.d.ts @@ -1535,13 +1535,18 @@ declare namespace FirebaseFirestore { /** * InformationalQueryPlan contains information about the query plan. - * Contents are subject to change. + * This should be inspected or logged, because the contents are intended to be + * human-readable. Contents are subject to change, and it is advised to not + * program against this object. */ export type InformationalQueryPlan = Record; /** * InformationalQueryExecutionStats contains statistics about the - * execution of the query. Contents are subject to change. + * execution of the query. + * This should be inspected or logged, because the contents are intended to be + * human-readable. Contents are subject to change, and it is advised to not + * program against this object. */ export type InformationalQueryExecutionStats = Record; @@ -1779,7 +1784,7 @@ declare namespace FirebaseFirestore { * @return A Promise that will be resolved with the results of the query * planning information. */ - explain(): Promise; + explain(): Promise; /** * Plans and executes this query. Returns a Promise that will be resolved @@ -1789,11 +1794,15 @@ declare namespace FirebaseFirestore { * Note: the information included in the output of this function is subject * to change. * + * Note: `explainAnalyze()` will get query results like the `get()` function, + * however, `explainAnalyze()` uses a different retry strategy than `get()`, + * so it is recommended to only use `get()` in production code. + * * @return A Promise that will be resolved with the planning information, * statistics from the query execution, and the query results. */ explainAnalyze(): Promise< - QueryProfileInfo> + QueryProfile> >; /* @@ -2338,7 +2347,7 @@ declare namespace FirebaseFirestore { * @return A Promise that will be resolved with the results of the query * planning information. */ - explain(): Promise; + explain(): Promise; /** * Plans and executes this query. Returns a Promise that will be resolved @@ -2352,7 +2361,7 @@ declare namespace FirebaseFirestore { * statistics from the query execution, and the query results. */ explainAnalyze(): Promise< - QueryProfileInfo< + QueryProfile< AggregateQuerySnapshot > >; @@ -2811,19 +2820,33 @@ declare namespace FirebaseFirestore { } /** - * A QueryProfileInfo contains information about planning, execution, and results of a query. - * All informational content are subject to change. + * A QueryPlan contains information about the planning stage of a query. + * All informational content are subject to change, and it is advised to not + * program against them. + */ + export interface QueryPlan { + /** + * An `InformationalQueryPlan` object that contains information about the + * query plan. Contents are subject to change. + */ + readonly planInfo: InformationalQueryPlan; + } + + /** + * A QueryProfile contains information about planning, execution, and results + * of a query. + * All informational content are subject to change, and it is advised to not + * program against them. */ - export interface QueryProfileInfo { + export interface QueryProfile { /** - * An `InformationalQueryPlan` object that contains information about the query plan. - * Contents are subject to change. + * A `QueryPlan` object that contains information about the query plan. */ - readonly plan: InformationalQueryPlan; + readonly plan: QueryPlan; /** - * An `InformationalQueryExecutionStats` that contains statistics about the execution of the query. - * Contents are subject to change. + * An `InformationalQueryExecutionStats` that contains statistics about the + * execution of the query. Contents are subject to change. */ readonly stats: InformationalQueryExecutionStats; From 9819c5e0aee00fce2ff52c99d8ea1f4275132d97 Mon Sep 17 00:00:00 2001 From: Ehsan Nasiri Date: Thu, 4 Jan 2024 00:44:28 -0800 Subject: [PATCH 12/19] fix lint errors. --- dev/src/query-plan.ts | 2 +- dev/src/query-profile.ts | 6 +++--- dev/src/reference.ts | 8 ++------ 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/dev/src/query-plan.ts b/dev/src/query-plan.ts index 81df71982..cf71c7938 100644 --- a/dev/src/query-plan.ts +++ b/dev/src/query-plan.ts @@ -1,6 +1,6 @@ /** * @license - * Copyright 2023 Google LLC + * Copyright 2024 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dev/src/query-profile.ts b/dev/src/query-profile.ts index 76a1b9170..72e93e04b 100644 --- a/dev/src/query-profile.ts +++ b/dev/src/query-profile.ts @@ -1,6 +1,6 @@ /** * @license - * Copyright 2023 Google LLC + * Copyright 2024 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,8 +19,8 @@ import * as firestore from '@google-cloud/firestore'; export class QueryProfile implements firestore.QueryProfile { constructor( - readonly plan: FirebaseFirestore.QueryPlan, - readonly stats: FirebaseFirestore.InformationalQueryExecutionStats, + readonly plan: firestore.QueryPlan, + readonly stats: firestore.InformationalQueryExecutionStats, readonly snapshot: T ) {} } diff --git a/dev/src/reference.ts b/dev/src/reference.ts index c6c516497..86cf22515 100644 --- a/dev/src/reference.ts +++ b/dev/src/reference.ts @@ -65,10 +65,6 @@ import {AggregateField, Aggregate, AggregateSpec} from './aggregate'; import {google} from '../protos/firestore_v1_proto_api'; import QueryMode = google.firestore.v1.QueryMode; import {QueryProfile} from './query-profile'; -import { - InformationalQueryExecutionStats, - InformationalQueryPlan, -} from '@google-cloud/firestore'; import {QueryPlan} from './query-plan'; /** @@ -2799,7 +2795,7 @@ export class Query< let readTime: Timestamp; const docs: Array> = []; let queryPlan: QueryPlan = {planInfo: {}}; - let executionStats: InformationalQueryExecutionStats = {}; + let executionStats: firestore.InformationalQueryExecutionStats = {}; // Capture the error stack to preserve stack tracing across async calls. const stack = Error().stack!; @@ -3505,7 +3501,7 @@ export class AggregateQuery< DbModelType >; let planInfo: QueryPlan = {planInfo: {}}; - let executionStats: InformationalQueryExecutionStats = {}; + let executionStats: firestore.InformationalQueryExecutionStats = {}; return new Promise((resolve, reject) => { const tag = requestTag(); From ccaad870dbfe64d5903cd51388781a9bf22081ee Mon Sep 17 00:00:00 2001 From: Ehsan Nasiri Date: Thu, 4 Jan 2024 00:57:23 -0800 Subject: [PATCH 13/19] Revert host setting. --- dev/system-test/firestore.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/dev/system-test/firestore.ts b/dev/system-test/firestore.ts index ce7f3833a..35ad8b2ab 100644 --- a/dev/system-test/firestore.ts +++ b/dev/system-test/firestore.ts @@ -99,9 +99,7 @@ if (process.env.NODE_ENV === 'DEBUG') { } function getTestRoot(settings: Settings = {}): CollectionReference { - const internalSettings: Settings = { - host: 'test-firestore.sandbox.googleapis.com' - }; + const internalSettings: Settings = {}; if (process.env.FIRESTORE_NAMED_DATABASE) { internalSettings.databaseId = process.env.FIRESTORE_NAMED_DATABASE; } From 834ddc91e52e6a46a71dae53bd270737d1f12491 Mon Sep 17 00:00:00 2001 From: Ehsan Nasiri Date: Wed, 10 Jan 2024 13:46:38 -0800 Subject: [PATCH 14/19] undo manual proto updates. --- dev/protos/firestore_v1_proto_api.d.ts | 130 ------- dev/protos/firestore_v1_proto_api.js | 340 +----------------- .../google/firestore/v1/firestore.proto | 44 +-- .../google/firestore/v1/query_profile.proto | 76 ---- dev/protos/v1.json | 49 --- 5 files changed, 4 insertions(+), 635 deletions(-) delete mode 100644 dev/protos/google/firestore/v1/query_profile.proto diff --git a/dev/protos/firestore_v1_proto_api.d.ts b/dev/protos/firestore_v1_proto_api.d.ts index db64f3937..293e4fa51 100644 --- a/dev/protos/firestore_v1_proto_api.d.ts +++ b/dev/protos/firestore_v1_proto_api.d.ts @@ -4914,9 +4914,6 @@ export namespace google { /** RunQueryRequest readTime */ readTime?: (google.protobuf.ITimestamp|null); - - /** RunQueryRequest mode */ - mode?: (google.firestore.v1.QueryMode|null); } /** Represents a RunQueryRequest. */ @@ -4943,9 +4940,6 @@ export namespace google { /** RunQueryRequest readTime. */ public readTime?: (google.protobuf.ITimestamp|null); - /** RunQueryRequest mode. */ - public mode: google.firestore.v1.QueryMode; - /** RunQueryRequest queryType. */ public queryType?: "structuredQuery"; @@ -4998,9 +4992,6 @@ export namespace google { /** RunQueryResponse done */ done?: (boolean|null); - - /** RunQueryResponse stats */ - stats?: (google.firestore.v1.IResultSetStats|null); } /** Represents a RunQueryResponse. */ @@ -5027,9 +5018,6 @@ export namespace google { /** RunQueryResponse done. */ public done?: (boolean|null); - /** RunQueryResponse stats. */ - public stats?: (google.firestore.v1.IResultSetStats|null); - /** RunQueryResponse continuationSelector. */ public continuationSelector?: "done"; @@ -5079,9 +5067,6 @@ export namespace google { /** RunAggregationQueryRequest readTime */ readTime?: (google.protobuf.ITimestamp|null); - - /** RunAggregationQueryRequest mode */ - mode?: (google.firestore.v1.QueryMode|null); } /** Represents a RunAggregationQueryRequest. */ @@ -5108,9 +5093,6 @@ export namespace google { /** RunAggregationQueryRequest readTime. */ public readTime?: (google.protobuf.ITimestamp|null); - /** RunAggregationQueryRequest mode. */ - public mode: google.firestore.v1.QueryMode; - /** RunAggregationQueryRequest queryType. */ public queryType?: "structuredAggregationQuery"; @@ -5157,9 +5139,6 @@ export namespace google { /** RunAggregationQueryResponse readTime */ readTime?: (google.protobuf.ITimestamp|null); - - /** RunAggregationQueryResponse stats */ - stats?: (google.firestore.v1.IResultSetStats|null); } /** Represents a RunAggregationQueryResponse. */ @@ -5180,9 +5159,6 @@ export namespace google { /** RunAggregationQueryResponse readTime. */ public readTime?: (google.protobuf.ITimestamp|null); - /** RunAggregationQueryResponse stats. */ - public stats?: (google.firestore.v1.IResultSetStats|null); - /** * Creates a RunAggregationQueryResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object @@ -6146,112 +6122,6 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } - /** QueryMode enum. */ - type QueryMode = - "NORMAL"| "PLAN"| "PROFILE"; - - /** Properties of a QueryPlan. */ - interface IQueryPlan { - - /** QueryPlan planInfo */ - planInfo?: (google.protobuf.IStruct|null); - } - - /** Represents a QueryPlan. */ - class QueryPlan implements IQueryPlan { - - /** - * Constructs a new QueryPlan. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1.IQueryPlan); - - /** QueryPlan planInfo. */ - public planInfo?: (google.protobuf.IStruct|null); - - /** - * Creates a QueryPlan message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryPlan - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1.QueryPlan; - - /** - * Creates a plain object from a QueryPlan message. Also converts values to other types if specified. - * @param message QueryPlan - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1.QueryPlan, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryPlan to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for QueryPlan - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ResultSetStats. */ - interface IResultSetStats { - - /** ResultSetStats queryPlan */ - queryPlan?: (google.firestore.v1.IQueryPlan|null); - - /** ResultSetStats queryStats */ - queryStats?: (google.protobuf.IStruct|null); - } - - /** Represents a ResultSetStats. */ - class ResultSetStats implements IResultSetStats { - - /** - * Constructs a new ResultSetStats. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1.IResultSetStats); - - /** ResultSetStats queryPlan. */ - public queryPlan?: (google.firestore.v1.IQueryPlan|null); - - /** ResultSetStats queryStats. */ - public queryStats?: (google.protobuf.IStruct|null); - - /** - * Creates a ResultSetStats message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ResultSetStats - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1.ResultSetStats; - - /** - * Creates a plain object from a ResultSetStats message. Also converts values to other types if specified. - * @param message ResultSetStats - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1.ResultSetStats, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ResultSetStats to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ResultSetStats - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - /** Properties of a StructuredQuery. */ interface IStructuredQuery { diff --git a/dev/protos/firestore_v1_proto_api.js b/dev/protos/firestore_v1_proto_api.js index c23ad4cee..0fe6356c0 100644 --- a/dev/protos/firestore_v1_proto_api.js +++ b/dev/protos/firestore_v1_proto_api.js @@ -11572,7 +11572,6 @@ * @property {Uint8Array|null} [transaction] RunQueryRequest transaction * @property {google.firestore.v1.ITransactionOptions|null} [newTransaction] RunQueryRequest newTransaction * @property {google.protobuf.ITimestamp|null} [readTime] RunQueryRequest readTime - * @property {google.firestore.v1.QueryMode|null} [mode] RunQueryRequest mode */ /** @@ -11630,14 +11629,6 @@ */ RunQueryRequest.prototype.readTime = null; - /** - * RunQueryRequest mode. - * @member {google.firestore.v1.QueryMode} mode - * @memberof google.firestore.v1.RunQueryRequest - * @instance - */ - RunQueryRequest.prototype.mode = 0; - // OneOf field names bound to virtual getters and setters var $oneOfFields; @@ -11697,26 +11688,6 @@ throw TypeError(".google.firestore.v1.RunQueryRequest.readTime: object expected"); message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); } - switch (object.mode) { - default: - if (typeof object.mode === "number") { - message.mode = object.mode; - break; - } - break; - case "NORMAL": - case 0: - message.mode = 0; - break; - case "PLAN": - case 1: - message.mode = 1; - break; - case "PROFILE": - case 2: - message.mode = 2; - break; - } return message; }; @@ -11733,10 +11704,8 @@ if (!options) options = {}; var object = {}; - if (options.defaults) { + if (options.defaults) object.parent = ""; - object.mode = options.enums === String ? "NORMAL" : 0; - } if (message.parent != null && message.hasOwnProperty("parent")) object.parent = message.parent; if (message.structuredQuery != null && message.hasOwnProperty("structuredQuery")) { @@ -11759,8 +11728,6 @@ if (options.oneofs) object.consistencySelector = "readTime"; } - if (message.mode != null && message.hasOwnProperty("mode")) - object.mode = options.enums === String ? $root.google.firestore.v1.QueryMode[message.mode] === undefined ? message.mode : $root.google.firestore.v1.QueryMode[message.mode] : message.mode; return object; }; @@ -11804,7 +11771,6 @@ * @property {google.protobuf.ITimestamp|null} [readTime] RunQueryResponse readTime * @property {number|null} [skippedResults] RunQueryResponse skippedResults * @property {boolean|null} [done] RunQueryResponse done - * @property {google.firestore.v1.IResultSetStats|null} [stats] RunQueryResponse stats */ /** @@ -11862,14 +11828,6 @@ */ RunQueryResponse.prototype.done = null; - /** - * RunQueryResponse stats. - * @member {google.firestore.v1.IResultSetStats|null|undefined} stats - * @memberof google.firestore.v1.RunQueryResponse - * @instance - */ - RunQueryResponse.prototype.stats = null; - // OneOf field names bound to virtual getters and setters var $oneOfFields; @@ -11915,11 +11873,6 @@ message.skippedResults = object.skippedResults | 0; if (object.done != null) message.done = Boolean(object.done); - if (object.stats != null) { - if (typeof object.stats !== "object") - throw TypeError(".google.firestore.v1.RunQueryResponse.stats: object expected"); - message.stats = $root.google.firestore.v1.ResultSetStats.fromObject(object.stats); - } return message; }; @@ -11947,7 +11900,6 @@ } object.readTime = null; object.skippedResults = 0; - object.stats = null; } if (message.document != null && message.hasOwnProperty("document")) object.document = $root.google.firestore.v1.Document.toObject(message.document, options); @@ -11962,8 +11914,6 @@ if (options.oneofs) object.continuationSelector = "done"; } - if (message.stats != null && message.hasOwnProperty("stats")) - object.stats = $root.google.firestore.v1.ResultSetStats.toObject(message.stats, options); return object; }; @@ -12007,7 +11957,6 @@ * @property {Uint8Array|null} [transaction] RunAggregationQueryRequest transaction * @property {google.firestore.v1.ITransactionOptions|null} [newTransaction] RunAggregationQueryRequest newTransaction * @property {google.protobuf.ITimestamp|null} [readTime] RunAggregationQueryRequest readTime - * @property {google.firestore.v1.QueryMode|null} [mode] RunAggregationQueryRequest mode */ /** @@ -12065,14 +12014,6 @@ */ RunAggregationQueryRequest.prototype.readTime = null; - /** - * RunAggregationQueryRequest mode. - * @member {google.firestore.v1.QueryMode} mode - * @memberof google.firestore.v1.RunAggregationQueryRequest - * @instance - */ - RunAggregationQueryRequest.prototype.mode = 0; - // OneOf field names bound to virtual getters and setters var $oneOfFields; @@ -12132,26 +12073,6 @@ throw TypeError(".google.firestore.v1.RunAggregationQueryRequest.readTime: object expected"); message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); } - switch (object.mode) { - default: - if (typeof object.mode === "number") { - message.mode = object.mode; - break; - } - break; - case "NORMAL": - case 0: - message.mode = 0; - break; - case "PLAN": - case 1: - message.mode = 1; - break; - case "PROFILE": - case 2: - message.mode = 2; - break; - } return message; }; @@ -12168,10 +12089,8 @@ if (!options) options = {}; var object = {}; - if (options.defaults) { + if (options.defaults) object.parent = ""; - object.mode = options.enums === String ? "NORMAL" : 0; - } if (message.parent != null && message.hasOwnProperty("parent")) object.parent = message.parent; if (message.structuredAggregationQuery != null && message.hasOwnProperty("structuredAggregationQuery")) { @@ -12194,8 +12113,6 @@ if (options.oneofs) object.consistencySelector = "readTime"; } - if (message.mode != null && message.hasOwnProperty("mode")) - object.mode = options.enums === String ? $root.google.firestore.v1.QueryMode[message.mode] === undefined ? message.mode : $root.google.firestore.v1.QueryMode[message.mode] : message.mode; return object; }; @@ -12237,7 +12154,6 @@ * @property {google.firestore.v1.IAggregationResult|null} [result] RunAggregationQueryResponse result * @property {Uint8Array|null} [transaction] RunAggregationQueryResponse transaction * @property {google.protobuf.ITimestamp|null} [readTime] RunAggregationQueryResponse readTime - * @property {google.firestore.v1.IResultSetStats|null} [stats] RunAggregationQueryResponse stats */ /** @@ -12279,14 +12195,6 @@ */ RunAggregationQueryResponse.prototype.readTime = null; - /** - * RunAggregationQueryResponse stats. - * @member {google.firestore.v1.IResultSetStats|null|undefined} stats - * @memberof google.firestore.v1.RunAggregationQueryResponse - * @instance - */ - RunAggregationQueryResponse.prototype.stats = null; - /** * Creates a RunAggregationQueryResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject @@ -12314,11 +12222,6 @@ throw TypeError(".google.firestore.v1.RunAggregationQueryResponse.readTime: object expected"); message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); } - if (object.stats != null) { - if (typeof object.stats !== "object") - throw TypeError(".google.firestore.v1.RunAggregationQueryResponse.stats: object expected"); - message.stats = $root.google.firestore.v1.ResultSetStats.fromObject(object.stats); - } return message; }; @@ -12345,7 +12248,6 @@ object.transaction = $util.newBuffer(object.transaction); } object.readTime = null; - object.stats = null; } if (message.result != null && message.hasOwnProperty("result")) object.result = $root.google.firestore.v1.AggregationResult.toObject(message.result, options); @@ -12353,8 +12255,6 @@ object.transaction = options.bytes === String ? $util.base64.encode(message.transaction, 0, message.transaction.length) : options.bytes === Array ? Array.prototype.slice.call(message.transaction) : message.transaction; if (message.readTime != null && message.hasOwnProperty("readTime")) object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); - if (message.stats != null && message.hasOwnProperty("stats")) - object.stats = $root.google.firestore.v1.ResultSetStats.toObject(message.stats, options); return object; }; @@ -14712,242 +14612,6 @@ return BatchWriteResponse; })(); - /** - * QueryMode enum. - * @name google.firestore.v1.QueryMode - * @enum {string} - * @property {string} NORMAL=NORMAL NORMAL value - * @property {string} PLAN=PLAN PLAN value - * @property {string} PROFILE=PROFILE PROFILE value - */ - v1.QueryMode = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "NORMAL"] = "NORMAL"; - values[valuesById[1] = "PLAN"] = "PLAN"; - values[valuesById[2] = "PROFILE"] = "PROFILE"; - return values; - })(); - - v1.QueryPlan = (function() { - - /** - * Properties of a QueryPlan. - * @memberof google.firestore.v1 - * @interface IQueryPlan - * @property {google.protobuf.IStruct|null} [planInfo] QueryPlan planInfo - */ - - /** - * Constructs a new QueryPlan. - * @memberof google.firestore.v1 - * @classdesc Represents a QueryPlan. - * @implements IQueryPlan - * @constructor - * @param {google.firestore.v1.IQueryPlan=} [properties] Properties to set - */ - function QueryPlan(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]]; - } - - /** - * QueryPlan planInfo. - * @member {google.protobuf.IStruct|null|undefined} planInfo - * @memberof google.firestore.v1.QueryPlan - * @instance - */ - QueryPlan.prototype.planInfo = null; - - /** - * Creates a QueryPlan message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.firestore.v1.QueryPlan - * @static - * @param {Object.} object Plain object - * @returns {google.firestore.v1.QueryPlan} QueryPlan - */ - QueryPlan.fromObject = function fromObject(object) { - if (object instanceof $root.google.firestore.v1.QueryPlan) - return object; - var message = new $root.google.firestore.v1.QueryPlan(); - if (object.planInfo != null) { - if (typeof object.planInfo !== "object") - throw TypeError(".google.firestore.v1.QueryPlan.planInfo: object expected"); - message.planInfo = $root.google.protobuf.Struct.fromObject(object.planInfo); - } - return message; - }; - - /** - * Creates a plain object from a QueryPlan message. Also converts values to other types if specified. - * @function toObject - * @memberof google.firestore.v1.QueryPlan - * @static - * @param {google.firestore.v1.QueryPlan} message QueryPlan - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryPlan.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.planInfo = null; - if (message.planInfo != null && message.hasOwnProperty("planInfo")) - object.planInfo = $root.google.protobuf.Struct.toObject(message.planInfo, options); - return object; - }; - - /** - * Converts this QueryPlan to JSON. - * @function toJSON - * @memberof google.firestore.v1.QueryPlan - * @instance - * @returns {Object.} JSON object - */ - QueryPlan.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for QueryPlan - * @function getTypeUrl - * @memberof google.firestore.v1.QueryPlan - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - QueryPlan.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.firestore.v1.QueryPlan"; - }; - - return QueryPlan; - })(); - - v1.ResultSetStats = (function() { - - /** - * Properties of a ResultSetStats. - * @memberof google.firestore.v1 - * @interface IResultSetStats - * @property {google.firestore.v1.IQueryPlan|null} [queryPlan] ResultSetStats queryPlan - * @property {google.protobuf.IStruct|null} [queryStats] ResultSetStats queryStats - */ - - /** - * Constructs a new ResultSetStats. - * @memberof google.firestore.v1 - * @classdesc Represents a ResultSetStats. - * @implements IResultSetStats - * @constructor - * @param {google.firestore.v1.IResultSetStats=} [properties] Properties to set - */ - function ResultSetStats(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]]; - } - - /** - * ResultSetStats queryPlan. - * @member {google.firestore.v1.IQueryPlan|null|undefined} queryPlan - * @memberof google.firestore.v1.ResultSetStats - * @instance - */ - ResultSetStats.prototype.queryPlan = null; - - /** - * ResultSetStats queryStats. - * @member {google.protobuf.IStruct|null|undefined} queryStats - * @memberof google.firestore.v1.ResultSetStats - * @instance - */ - ResultSetStats.prototype.queryStats = null; - - /** - * Creates a ResultSetStats message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.firestore.v1.ResultSetStats - * @static - * @param {Object.} object Plain object - * @returns {google.firestore.v1.ResultSetStats} ResultSetStats - */ - ResultSetStats.fromObject = function fromObject(object) { - if (object instanceof $root.google.firestore.v1.ResultSetStats) - return object; - var message = new $root.google.firestore.v1.ResultSetStats(); - if (object.queryPlan != null) { - if (typeof object.queryPlan !== "object") - throw TypeError(".google.firestore.v1.ResultSetStats.queryPlan: object expected"); - message.queryPlan = $root.google.firestore.v1.QueryPlan.fromObject(object.queryPlan); - } - if (object.queryStats != null) { - if (typeof object.queryStats !== "object") - throw TypeError(".google.firestore.v1.ResultSetStats.queryStats: object expected"); - message.queryStats = $root.google.protobuf.Struct.fromObject(object.queryStats); - } - return message; - }; - - /** - * Creates a plain object from a ResultSetStats message. Also converts values to other types if specified. - * @function toObject - * @memberof google.firestore.v1.ResultSetStats - * @static - * @param {google.firestore.v1.ResultSetStats} message ResultSetStats - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ResultSetStats.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.queryPlan = null; - object.queryStats = null; - } - if (message.queryPlan != null && message.hasOwnProperty("queryPlan")) - object.queryPlan = $root.google.firestore.v1.QueryPlan.toObject(message.queryPlan, options); - if (message.queryStats != null && message.hasOwnProperty("queryStats")) - object.queryStats = $root.google.protobuf.Struct.toObject(message.queryStats, options); - return object; - }; - - /** - * Converts this ResultSetStats to JSON. - * @function toJSON - * @memberof google.firestore.v1.ResultSetStats - * @instance - * @returns {Object.} JSON object - */ - ResultSetStats.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ResultSetStats - * @function getTypeUrl - * @memberof google.firestore.v1.ResultSetStats - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ResultSetStats.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.firestore.v1.ResultSetStats"; - }; - - return ResultSetStats; - })(); - v1.StructuredQuery = (function() { /** diff --git a/dev/protos/google/firestore/v1/firestore.proto b/dev/protos/google/firestore/v1/firestore.proto index cda945ff1..a4447d167 100644 --- a/dev/protos/google/firestore/v1/firestore.proto +++ b/dev/protos/google/firestore/v1/firestore.proto @@ -23,7 +23,6 @@ import "google/firestore/v1/aggregation_result.proto"; import "google/firestore/v1/common.proto"; import "google/firestore/v1/document.proto"; import "google/firestore/v1/query.proto"; -import "google/firestore/v1/query_profile.proto"; import "google/firestore/v1/write.proto"; import "google/protobuf/empty.proto"; import "google/protobuf/timestamp.proto"; @@ -51,7 +50,7 @@ option ruby_package = "Google::Cloud::Firestore::V1"; service Firestore { option (google.api.default_host) = "firestore.googleapis.com"; option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/cloud-platform," "https://www.googleapis.com/auth/datastore"; // Gets a single document. @@ -577,11 +576,6 @@ message RunQueryRequest { // minute timestamp within the past 7 days. google.protobuf.Timestamp read_time = 7; } - - // Optional. The mode in which the query request is processed. This field is - // optional, and when not provided, it defaults to `NORMAL` mode where no - // additional statistics will be returned with the query results. - QueryMode mode = 9 [(google.api.field_behavior) = OPTIONAL]; } // The response for @@ -618,13 +612,6 @@ message RunQueryResponse { // documents will be returned. bool done = 6; } - - // Query plan and execution statistics. Note that the returned stats are - // subject to change as Firestore evolves. - // - // This is only present when the request specifies a mode other than `NORMAL` - // and is sent only once with the last response in the stream. - ResultSetStats stats = 7; } // The request for @@ -664,11 +651,6 @@ message RunAggregationQueryRequest { // minute timestamp within the past 7 days. google.protobuf.Timestamp read_time = 6; } - - // Optional. The mode in which the query request is processed. This field is - // optional, and when not provided, it defaults to `NORMAL` mode where no - // additional statistics will be returned with the query results. - QueryMode mode = 7 [(google.api.field_behavior) = OPTIONAL]; } // The response for @@ -694,13 +676,6 @@ message RunAggregationQueryResponse { // `result` will be sent, and this represents the time at which the query // was run. google.protobuf.Timestamp read_time = 3; - - // Query plan and execution statistics. Note that the returned stats are - // subject to change as Firestore evolves. - // - // This is only present when the request specifies a mode other than `NORMAL` - // and is sent only once with the last response in the stream. - ResultSetStats stats = 6; } // The request for @@ -786,7 +761,7 @@ message PartitionQueryResponse { // * query, start_at B // // An empty result may indicate that the query has too few results to be - // partitioned, or that the query is not yet supported for partitioning. + // partitioned. repeated Cursor partitions = 1; // A page token that may be used to request an additional set of results, up @@ -969,21 +944,6 @@ message Target { // The target ID that identifies the target on the stream. Must be a positive // number and non-zero. - // - // If `target_id` is 0 (or unspecified), the server will assign an ID for this - // target and return that in a `TargetChange::ADD` event. Once a target with - // `target_id=0` is added, all subsequent targets must also have - // `target_id=0`. If an `AddTarget` request with `target_id != 0` is - // sent to the server after a target with `target_id=0` is added, the server - // will immediately send a response with a `TargetChange::Remove` event. - // - // Note that if the client sends multiple `AddTarget` requests - // without an ID, the order of IDs returned in `TargetChage.target_ids` are - // undefined. Therefore, clients should provide a target ID instead of relying - // on the server to assign one. - // - // If `target_id` is non-zero, there must not be an existing active target on - // this stream with the same ID. int32 target_id = 5; // If the target should be removed once it is current and consistent. diff --git a/dev/protos/google/firestore/v1/query_profile.proto b/dev/protos/google/firestore/v1/query_profile.proto deleted file mode 100644 index 67d489045..000000000 --- a/dev/protos/google/firestore/v1/query_profile.proto +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright 2023 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. - -syntax = "proto3"; - -package google.firestore.v1; - -import "google/protobuf/struct.proto"; - -option csharp_namespace = "Google.Cloud.Firestore.V1"; -option go_package = "cloud.google.com/go/firestore/apiv1/firestorepb;firestorepb"; -option java_multiple_files = true; -option java_outer_classname = "QueryProfileProto"; -option java_package = "com.google.firestore.v1"; -option objc_class_prefix = "GCFS"; -option php_namespace = "Google\\Cloud\\Firestore\\V1"; -option ruby_package = "Google::Cloud::Firestore::V1"; - -// Specification of the Firestore Query Profile fields. - -// The mode in which the query request must be processed. -enum QueryMode { - // The default mode. Only the query results are returned. - NORMAL = 0; - - // This mode returns only the query plan, without any results or execution - // statistics information. - PLAN = 1; - - // This mode returns both the query plan and the execution statistics along - // with the results. - PROFILE = 2; -} - -// Plan for the query. -message QueryPlan { - // Planning phase information for the query. It will include: - // - // { - // "indexes_used": [ - // {"query_scope": "Collection", "fields": "(foo ASC, __name__ ASC)"}, - // {"query_scope": "Collection", "fields": "(bar ASC, __name__ ASC)"} - // ] - // } - google.protobuf.Struct plan_info = 1; -} - -// Planning and execution statistics for the query. -message ResultSetStats { - // Plan for the query. - QueryPlan query_plan = 1; - - // Aggregated statistics from the execution of the query. - // - // This will only be present when the request specifies `PROFILE` mode. - // For example, a query will return the statistics including: - // - // { - // "results_returned": "20", - // "documents_scanned": "20", - // "indexes_entries_scanned": "10050", - // "total_execution_time": "100.7 msecs" - // } - google.protobuf.Struct query_stats = 2; -} diff --git a/dev/protos/v1.json b/dev/protos/v1.json index 0b8938c6b..863777736 100644 --- a/dev/protos/v1.json +++ b/dev/protos/v1.json @@ -1829,13 +1829,6 @@ "readTime": { "type": "google.protobuf.Timestamp", "id": 7 - }, - "mode": { - "type": "QueryMode", - "id": 9, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } } } }, @@ -1867,10 +1860,6 @@ "done": { "type": "bool", "id": 6 - }, - "stats": { - "type": "ResultSetStats", - "id": 7 } } }, @@ -1912,13 +1901,6 @@ "readTime": { "type": "google.protobuf.Timestamp", "id": 6 - }, - "mode": { - "type": "QueryMode", - "id": 7, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } } } }, @@ -1935,10 +1917,6 @@ "readTime": { "type": "google.protobuf.Timestamp", "id": 3 - }, - "stats": { - "type": "ResultSetStats", - "id": 6 } } }, @@ -2305,33 +2283,6 @@ } } }, - "QueryMode": { - "values": { - "NORMAL": 0, - "PLAN": 1, - "PROFILE": 2 - } - }, - "QueryPlan": { - "fields": { - "planInfo": { - "type": "google.protobuf.Struct", - "id": 1 - } - } - }, - "ResultSetStats": { - "fields": { - "queryPlan": { - "type": "QueryPlan", - "id": 1 - }, - "queryStats": { - "type": "google.protobuf.Struct", - "id": 2 - } - } - }, "StructuredQuery": { "fields": { "select": { From 7c3cf778140a9a9db5a26ebd8808c9bf67e0aaf1 Mon Sep 17 00:00:00 2001 From: Ehsan Nasiri Date: Thu, 8 Feb 2024 16:16:08 -0800 Subject: [PATCH 15/19] Update the public APIs to v2. --- dev/src/query-plan.ts | 22 -- dev/src/query-profile.ts | 38 ++- dev/src/reference.ts | 436 +++++++++++++++++------------------ dev/system-test/firestore.ts | 48 ++-- types/firestore.d.ts | 156 +++++++------ 5 files changed, 364 insertions(+), 336 deletions(-) delete mode 100644 dev/src/query-plan.ts diff --git a/dev/src/query-plan.ts b/dev/src/query-plan.ts deleted file mode 100644 index cf71c7938..000000000 --- a/dev/src/query-plan.ts +++ /dev/null @@ -1,22 +0,0 @@ -/** - * @license - * Copyright 2024 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. - */ - -import * as firestore from '@google-cloud/firestore'; - -export class QueryPlan implements firestore.QueryPlan { - constructor(readonly planInfo: FirebaseFirestore.InformationalQueryPlan) {} -} diff --git a/dev/src/query-profile.ts b/dev/src/query-profile.ts index 72e93e04b..6dfaa66cf 100644 --- a/dev/src/query-profile.ts +++ b/dev/src/query-profile.ts @@ -17,10 +17,40 @@ import * as firestore from '@google-cloud/firestore'; -export class QueryProfile implements firestore.QueryProfile { +/** + * Plan contains information about the planning stage of a query. + */ +export class Plan implements firestore.Plan { + constructor(readonly indexesUsed: Record) {} + + static fromProto(): Plan { + return new Plan({}); + } +} + +/** ExecutionStats contains information about the execution of a query. */ +export class ExecutionStats implements firestore.ExecutionStats { + constructor( + readonly resultsReturned: number, + readonly bytesReturned: number, + readonly executionDuration: firestore.Duration, + readonly readOperations: number, + readonly debugStats: Record + ) {} + + static fromProto(): ExecutionStats { + return new ExecutionStats(0, 0, {seconds: 0, nanoseconds: 0}, 0, {}); + } +} + +/** + * ExplainResults contains information about planning, execution, and results + * of a query. + */ +export class ExplainResults implements firestore.ExplainResults { constructor( - readonly plan: firestore.QueryPlan, - readonly stats: firestore.InformationalQueryExecutionStats, - readonly snapshot: T + readonly plan: Plan, + readonly executionStats: ExecutionStats | null, + readonly snapshot: T | null ) {} } diff --git a/dev/src/reference.ts b/dev/src/reference.ts index 277a8e9ab..aca02dcca 100644 --- a/dev/src/reference.ts +++ b/dev/src/reference.ts @@ -64,8 +64,7 @@ import {CompositeFilter, Filter, UnaryFilter} from './filter'; import {AggregateField, Aggregate, AggregateSpec} from './aggregate'; import {google} from '../protos/firestore_v1_proto_api'; import QueryMode = google.firestore.v1.QueryMode; -import {QueryProfile} from './query-profile'; -import {QueryPlan} from './query-plan'; +import {ExecutionStats, ExplainResults, Plan} from './query-profile'; /** * The direction of a `Query.orderBy()` clause is specified as 'desc' or 'asc' @@ -2318,35 +2317,112 @@ export class Query< } /** - * Performs the planning stage of this query, without actually executing the - * query. Returns a Promise that will be resolved with the result of the - * query planning information. + * Plans and optionally executes this query. Returns an ApiFuture that will be + * resolved with the planner information, statistics from the query execution (if any), + * and the query results (if any). * - * Note: the information included in the output of this function is subject - * to change. - * - * @return A Promise that will be resolved with the results of the query - * planning information. + * @return An ApiFuture that will be resolved with the planner information, statistics + * from the query execution (if any), and the query results (if any). */ - explain(): Promise { - return this._getQueryProfileInfo('PLAN').then(info => info.plan); - } + explain( + options: firestore.ExplainOptions + ): Promise>> { + let readTime: Timestamp; + const docs: Array> = []; + let queryPlan: Plan = {indexesUsed: {}}; + let executionStats: ExecutionStats | null = null; - /** - * Plans and executes this query. Returns a Promise that will be resolved - * with the planning information, statistics from the query execution, and - * the query results. - * - * Note: the information included in the output of this function is subject - * to change. - * - * @return A Promise that will be resolved with the planning information, - * statistics from the query execution, and the query results. - */ - explainAnalyze(): Promise< - firestore.QueryProfile> - > { - return this._getQueryProfileInfo('PROFILE'); + // Capture the error stack to preserve stack tracing across async calls. + const stack = Error().stack!; + + return new Promise((resolve, reject) => { + const tag = requestTag(); + this.firestore.initializeIfNeeded(tag).then(() => { + const request = this.toProto(/* transactionId */ undefined, 'PROFILE'); + this._firestore + .requestStream('runQuery', /* bidirectional= */ false, request, tag) + .then(stream => { + stream.on('error', err => { + reject(wrapError(err, stack)); + }); + stream.on('data', response => { + if (response.document) { + readTime = Timestamp.fromProto(response.readTime); + const document = this.firestore.snapshot_( + response.document, + response.readTime + ); + const finalDoc = new DocumentSnapshotBuilder< + AppModelType, + DbModelType + >(document.ref.withConverter(this._queryOptions.converter)); + // Recreate the QueryDocumentSnapshot with the DocumentReference + // containing the original converter. + finalDoc.fieldsProto = document._fieldsProto; + finalDoc.readTime = document.readTime; + finalDoc.createTime = document.createTime; + finalDoc.updateTime = document.updateTime; + docs.push( + finalDoc.build() as QueryDocumentSnapshot< + AppModelType, + DbModelType + > + ); + } + if (response.stats) { + if (response.stats.queryPlan) { + queryPlan = Plan.fromProto(); + // queryPlan = new Plan( + // this.firestore._serializer!.decodeGoogleProtobufStruct( + // response.stats.queryPlan.planInfo + // ) + // ); + } + if (response.stats.queryStats) { + executionStats = ExecutionStats.fromProto(); + // this.firestore._serializer!.decodeGoogleProtobufStruct( + // response.stats.queryStats + // ); + } + } + if (response.done) { + stream.end(); + } + }); + stream.on('end', () => { + if (this._queryOptions.limitType === LimitType.Last) { + // The results for limitToLast queries need to be flipped since + // we reversed the ordering constraints before sending the query + // to the backend. + docs.reverse(); + } + const querySnapshot = new QuerySnapshot( + this, + readTime, + docs.length, + () => docs, + () => { + const changes: Array< + DocumentChange + > = []; + for (let i = 0; i < docs.length; ++i) { + changes.push(new DocumentChange('added', docs[i], -1, i)); + } + return changes; + } + ); + resolve( + new ExplainResults>( + queryPlan, + executionStats, + querySnapshot + ) + ); + }); + stream.resume(); + }); + }); + }); } /** @@ -2448,6 +2524,28 @@ export class Query< return transform; } + // TODO. + explainStream(): NodeJS.ReadableStream { + if (this._queryOptions.limitType === LimitType.Last) { + throw new Error( + 'Query results for queries that include limitToLast() ' + + 'constraints cannot be streamed. Use Query.get() instead.' + ); + } + + const responseStream = this._stream(); + const transform = new Transform({ + objectMode: true, + transform(chunk, encoding, callback) { + callback(undefined, chunk.document); + }, + }); + + responseStream.pipe(transform); + responseStream.on('error', e => transform.destroy(e)); + return transform; + } + /** * Converts a QueryCursor to its proto representation. * @@ -2782,114 +2880,6 @@ export class Query< return stream; } - /** - * Internal streaming method for query profiling. - * - * @param queryMode The query profiling mode. - * @private - * @internal - * @returns A QueryProfile object containing the results of the profiling. - */ - _getQueryProfileInfo( - queryMode: QueryMode - ): Promise>> { - let readTime: Timestamp; - const docs: Array> = []; - let queryPlan: QueryPlan = {planInfo: {}}; - let executionStats: firestore.InformationalQueryExecutionStats = {}; - - // Capture the error stack to preserve stack tracing across async calls. - const stack = Error().stack!; - - return new Promise((resolve, reject) => { - const tag = requestTag(); - this.firestore.initializeIfNeeded(tag).then(() => { - const request = this.toProto(/* transactionId */ undefined, queryMode); - this._firestore - .requestStream('runQuery', /* bidirectional= */ false, request, tag) - .then(stream => { - stream.on('error', err => { - reject(wrapError(err, stack)); - }); - stream.on('data', response => { - if (response.document) { - readTime = Timestamp.fromProto(response.readTime); - const document = this.firestore.snapshot_( - response.document, - response.readTime - ); - const finalDoc = new DocumentSnapshotBuilder< - AppModelType, - DbModelType - >(document.ref.withConverter(this._queryOptions.converter)); - // Recreate the QueryDocumentSnapshot with the DocumentReference - // containing the original converter. - finalDoc.fieldsProto = document._fieldsProto; - finalDoc.readTime = document.readTime; - finalDoc.createTime = document.createTime; - finalDoc.updateTime = document.updateTime; - docs.push( - finalDoc.build() as QueryDocumentSnapshot< - AppModelType, - DbModelType - > - ); - } - if (response.stats) { - if (response.stats.queryPlan) { - queryPlan = new QueryPlan( - this.firestore._serializer!.decodeGoogleProtobufStruct( - response.stats.queryPlan.planInfo - ) - ); - } - if (response.stats.queryStats) { - executionStats = - this.firestore._serializer!.decodeGoogleProtobufStruct( - response.stats.queryStats - ); - } - } - if (response.done) { - stream.end(); - } - }); - stream.on('end', () => { - if (this._queryOptions.limitType === LimitType.Last) { - // The results for limitToLast queries need to be flipped since - // we reversed the ordering constraints before sending the query - // to the backend. - docs.reverse(); - } - const querySnapshot = new QuerySnapshot( - this, - readTime, - docs.length, - () => docs, - () => { - const changes: Array< - DocumentChange - > = []; - for (let i = 0; i < docs.length; ++i) { - changes.push(new DocumentChange('added', docs[i], -1, i)); - } - return changes; - } - ); - resolve( - new QueryProfile>( - queryPlan, - executionStats, - querySnapshot - ) - ); - }); - stream.resume(); - }); - }); - }); - } - /** * Attaches a listener for QuerySnapshot events. * @@ -3478,91 +3468,6 @@ export class AggregateQuery< }); } - /** - * Internal streaming method for aggregate query profiling. - * - * @param queryMode The query profiling mode. - * @private - * @internal - * @returns A QueryProfile object containing the results of the profiling. - */ - _getQueryProfileInfo( - queryMode: QueryMode - ): Promise< - QueryProfile< - AggregateQuerySnapshot - > - > { - // Capture the error stack to preserve stack tracing across async calls. - const stack = Error().stack!; - - let aggregationResult: AggregateQuerySnapshot< - AggregateSpecType, - AppModelType, - DbModelType - >; - let planInfo: QueryPlan = {planInfo: {}}; - let executionStats: firestore.InformationalQueryExecutionStats = {}; - - return new Promise((resolve, reject) => { - const tag = requestTag(); - const firestore = this._query.firestore; - firestore.initializeIfNeeded(tag).then(() => { - const request = this.toProto(/* transactionId */ undefined, queryMode); - firestore - .requestStream( - 'runAggregationQuery', - /* bidirectional= */ false, - request, - tag - ) - .then(stream => { - stream.on('error', err => { - reject(wrapError(err, stack)); - }); - stream.on('data', response => { - if (response.result) { - const readTime = Timestamp.fromProto(response.readTime!); - const data = this.decodeResult(response.result); - aggregationResult = new AggregateQuerySnapshot( - this, - readTime, - data - ); - } - if (response.stats) { - if (response.stats.queryPlan) { - planInfo = new QueryPlan( - this._query.firestore._serializer!.decodeGoogleProtobufStruct( - response.stats.queryPlan.planInfo - ) - ); - } - if (response.stats.queryStats) { - executionStats = - this._query.firestore._serializer!.decodeGoogleProtobufStruct( - response.stats.queryStats - ); - } - } - }); - stream.on('end', () => { - resolve( - new QueryProfile< - AggregateQuerySnapshot< - AggregateSpecType, - AppModelType, - DbModelType - > - >(planInfo, executionStats, aggregationResult) - ); - }); - stream.resume(); - }); - }); - }); - } - /** * Internal streaming method that accepts an optional transaction ID. * @@ -3732,16 +3637,91 @@ export class AggregateQuery< return deepEqual(this._aggregates, other._aggregates); } - explain(): Promise { - return this._getQueryProfileInfo('PLAN').then(info => info.plan); - } - - explainAnalyze(): Promise< - firestore.QueryProfile< + /** + * Plans and optionally executes this query. Returns an ApiFuture that will be + * resolved with the planner information, statistics from the query execution (if any), + * and the query results (if any). + * + * @return An ApiFuture that will be resolved with the planner information, statistics + * from the query execution (if any), and the query results (if any). + */ + explain( + options: firestore.ExplainOptions + ): Promise< + ExplainResults< AggregateQuerySnapshot > > { - return this._getQueryProfileInfo('PROFILE'); + // Capture the error stack to preserve stack tracing across async calls. + const stack = Error().stack!; + + let aggregationResult: AggregateQuerySnapshot< + AggregateSpecType, + AppModelType, + DbModelType + >; + let plan: Plan; + let executionStats: ExecutionStats | null = null; + + return new Promise((resolve, reject) => { + const tag = requestTag(); + const firestore = this._query.firestore; + firestore.initializeIfNeeded(tag).then(() => { + const request = this.toProto(/* transactionId */ undefined, 'PROFILE'); + firestore + .requestStream( + 'runAggregationQuery', + /* bidirectional= */ false, + request, + tag + ) + .then(stream => { + stream.on('error', err => { + reject(wrapError(err, stack)); + }); + stream.on('data', response => { + if (response.result) { + const readTime = Timestamp.fromProto(response.readTime!); + const data = this.decodeResult(response.result); + aggregationResult = new AggregateQuerySnapshot( + this, + readTime, + data + ); + } + if (response.stats) { + if (response.stats.queryPlan) { + plan = Plan.fromProto(); + // planInfo = new Plan( + // this._query.firestore._serializer!.decodeGoogleProtobufStruct( + // response.stats.queryPlan.planInfo + // ) + // ); + } + if (response.stats.queryStats) { + executionStats = ExecutionStats.fromProto(); + // executionStats = + // this._query.firestore._serializer!.decodeGoogleProtobufStruct( + // response.stats.queryStats + // ); + } + } + }); + stream.on('end', () => { + resolve( + new ExplainResults< + AggregateQuerySnapshot< + AggregateSpecType, + AppModelType, + DbModelType + > + >(plan, executionStats, aggregationResult) + ); + }); + stream.resume(); + }); + }); + }); } } diff --git a/dev/system-test/firestore.ts b/dev/system-test/firestore.ts index 35ad8b2ab..237f24aaa 100644 --- a/dev/system-test/firestore.ts +++ b/dev/system-test/firestore.ts @@ -148,39 +148,61 @@ describe('Firestore class', () => { await randomCol.doc('doc1').set({foo: 1}); await randomCol.doc('doc2').set({foo: 2}); await randomCol.doc('doc3').set({foo: 1}); - const plan = await randomCol.where('foo', '>', 1).explain(); - expect(Object.keys(plan.planInfo).length).to.be.greaterThan(0); + const explainResults = await randomCol.where('foo', '>', 1).explain({analyze: false}); + + const plan = explainResults.plan; + expect(explainResults.plan).to.not.be.null; + expect(Object.keys(plan.indexesUsed).length).to.be.greaterThan(0); + + expect(explainResults.executionStats).to.be.null; + expect(explainResults.snapshot).to.be.null; }); it('can profile a query', async () => { await randomCol.doc('doc1').set({foo: 1, bar: 0}); await randomCol.doc('doc2').set({foo: 2, bar: 1}); await randomCol.doc('doc3').set({foo: 1, bar: 2}); - const profile = await randomCol.where('foo', '==', 1).explainAnalyze(); - expect(Object.keys(profile.plan.planInfo).length).to.be.greaterThan(0); - expect(Object.keys(profile.stats).length).to.be.greaterThan(0); - expect(profile.snapshot.size).to.equal(2); + const explainResults = await randomCol.where('foo', '==', 1).explain({analyze: true}); + + expect(explainResults.plan).to.not.be.null; + expect(explainResults.executionStats).to.not.be.null; + expect(explainResults.snapshot).to.not.be.null; + + expect(Object.keys(explainResults.plan.indexesUsed).length).to.be.greaterThan(0); + expect(Object.keys(explainResults.executionStats!).length).to.be.greaterThan(0); + expect(explainResults.snapshot!.size).to.equal(2); }); it('can plan an aggregate query', async () => { await randomCol.doc('doc1').set({foo: 1}); await randomCol.doc('doc2').set({foo: 2}); await randomCol.doc('doc3').set({foo: 1}); - const plan = await randomCol.where('foo', '>', 0).count().explain(); - expect(Object.keys(plan.planInfo).length).to.be.greaterThan(0); + const explainResults = await randomCol.where('foo', '>', 0).count().explain({analyze: false}); + + expect(explainResults.plan).to.not.be.null; + const plan = explainResults.plan; + expect(Object.keys(plan.indexesUsed).length).to.be.greaterThan(0); + + expect(explainResults.executionStats).to.be.null; + expect(explainResults.snapshot).to.be.null; }); it('can profile an aggregate query', async () => { await randomCol.doc('doc1').set({foo: 1}); await randomCol.doc('doc2').set({foo: 2}); await randomCol.doc('doc3').set({foo: 1}); - const profile = await randomCol + const explainResults = await randomCol .where('foo', '<', 3) .count() - .explainAnalyze(); - expect(Object.keys(profile.plan.planInfo).length).to.be.greaterThan(0); - expect(Object.keys(profile.stats).length).to.be.greaterThan(0); - expect(profile.snapshot.data().count).to.equal(3); + .explain({analyze: true}); + + expect(explainResults.plan).to.not.be.null; + expect(explainResults.executionStats).to.not.be.null; + expect(explainResults.snapshot).to.not.be.null; + + expect(Object.keys(explainResults.plan.indexesUsed).length).to.be.greaterThan(0); + expect(Object.keys(explainResults.executionStats!).length).to.be.greaterThan(0); + expect(explainResults.snapshot!.data().count).to.equal(3); }); it('getAll() supports array destructuring', () => { diff --git a/types/firestore.d.ts b/types/firestore.d.ts index 492ea6a03..60593c252 100644 --- a/types/firestore.d.ts +++ b/types/firestore.d.ts @@ -1897,44 +1897,33 @@ declare namespace FirebaseFirestore { get(): Promise>; /** - * Performs the planning stage of this query, without actually executing the - * query. Returns a Promise that will be resolved with the result of the - * query planning information. + * Plans and optionally executes this query. Returns an ApiFuture that will be + * resolved with the planner information, statistics from the query execution (if any), + * and the query results (if any). * - * Note: the information included in the output of this function is subject - * to change. - * - * @return A Promise that will be resolved with the results of the query - * planning information. + * @return An ApiFuture that will be resolved with the planner information, statistics + * from the query execution (if any), and the query results (if any). */ - explain(): Promise; + explain( + options: ExplainOptions + ): Promise>>; /** - * Plans and executes this query. Returns a Promise that will be resolved - * with the planning information, statistics from the query execution, and - * the query results. - * - * Note: the information included in the output of this function is subject - * to change. - * - * Note: `explainAnalyze()` will get query results like the `get()` function, - * however, `explainAnalyze()` uses a different retry strategy than `get()`, - * so it is recommended to only use `get()` in production code. - * - * @return A Promise that will be resolved with the planning information, - * statistics from the query execution, and the query results. - */ - explainAnalyze(): Promise< - QueryProfile> - >; - - /* * Executes the query and returns the results as Node Stream. * * @return A stream of QueryDocumentSnapshot. */ stream(): NodeJS.ReadableStream; + /** + * Plans and optionally executes this query, and streams the results as Node Stream. + * + * @return A stream of Plan, ExecutionStats, and QueryDocumentSnapshot objects. There + * may be no ExecutionStats or QueryDocumentSnapshot objects depending on explain + * options. + */ + explainStream(): NodeJS.ReadableStream; + /** * Attaches a listener for `QuerySnapshot `events. * @@ -2461,31 +2450,17 @@ declare namespace FirebaseFirestore { >; /** - * Performs the planning stage of this query, without actually executing the - * query. Returns a Promise that will be resolved with the result of the - * query planning information. - * - * Note: the information included in the output of this function is subject - * to change. + * Plans and optionally executes this query. Returns an ApiFuture that will be + * resolved with the planner information, statistics from the query execution (if any), + * and the query results (if any). * - * @return A Promise that will be resolved with the results of the query - * planning information. + * @return An ApiFuture that will be resolved with the planner information, statistics + * from the query execution (if any), and the query results (if any). */ - explain(): Promise; - - /** - * Plans and executes this query. Returns a Promise that will be resolved - * with the planning information, statistics from the query execution, and - * the query results. - * - * Note: the information included in the output of this function is subject - * to change. - * - * @return A Promise that will be resolved with the planning information, - * statistics from the query execution, and the query results. - */ - explainAnalyze(): Promise< - QueryProfile< + explain( + options: ExplainOptions + ): Promise< + ExplainResults< AggregateQuerySnapshot > >; @@ -2943,41 +2918,84 @@ declare namespace FirebaseFirestore { static and(...filters: Filter[]): Filter; } + type Duration = { + /** Signed seconds of the span of time. */ + seconds: number; + + /** + * Signed fractions of a second at nanosecond resolution of the span + * of time. Durations less than one second are represented with a 0 + * `seconds` field and a positive or negative `nanos` field. For durations + * of one second or more, a non-zero value for the `nanos` field must be + * of the same sign as the `seconds` field. Must be from -999,999,999 + * to +999,999,999 inclusive. + */ + nanoseconds: number; + }; + + /** Options used to configure explain queries. */ + export interface ExplainOptions { + /** + * Whether analyzing the query is enabled. If true, the query will be + * executed and execution statistics will be returned as part of the + * [ExplainResults]{@link ExplainResults}. + */ + readonly analyze?: boolean; + } + /** - * A QueryPlan contains information about the planning stage of a query. - * All informational content are subject to change, and it is advised to not - * program against them. + * Plan contains information about the planning stage of a query. */ - export interface QueryPlan { + export interface Plan { + /** + * Information about the indexes that were used to serve the query. + * Note: This content is subject to change. + */ + readonly indexesUsed: Record; + } + + /** ExecutionStats contains information about the execution of a query. */ + export interface ExecutionStats { + /** The number of query results. */ + readonly resultsReturned: number; + + /** The number of bytes that were returned as a result of the query. */ + readonly bytesReturned: number; + + /** The total execution time of the query. */ + readonly executionDuration: Duration; + + /** The number of read operations that occurred when executing the query. */ + readonly readOperations: number; + /** - * An `InformationalQueryPlan` object that contains information about the - * query plan. Contents are subject to change. + * Contains additional statistics related to the query execution. + * Note: This content is subject to change. */ - readonly planInfo: InformationalQueryPlan; + readonly debugStats: Record; } /** - * A QueryProfile contains information about planning, execution, and results + * ExplainResults contains information about planning, execution, and results * of a query. - * All informational content are subject to change, and it is advised to not - * program against them. */ - export interface QueryProfile { + export interface ExplainResults { /** - * A `QueryPlan` object that contains information about the query plan. + * Information about the query plan. */ - readonly plan: QueryPlan; + readonly plan: Plan; /** - * An `InformationalQueryExecutionStats` that contains statistics about the - * execution of the query. Contents are subject to change. + * Information about the execution of the query, or null if the query was + * not executed. */ - readonly stats: InformationalQueryExecutionStats; + readonly executionStats: ExecutionStats | null; /** - * The snapshot that contains the results of executing the query. + * The snapshot that contains the results of executing the query, or null + * if the query was not executed. */ - readonly snapshot: T; + readonly snapshot: T | null; } } From 2c4944cd4106295421b1d4db7f604c26eec8d9d8 Mon Sep 17 00:00:00 2001 From: Ehsan Nasiri Date: Fri, 9 Feb 2024 17:10:18 -0800 Subject: [PATCH 16/19] Reuse existing _stream methods. --- dev/src/reference.ts | 366 ++++++++++++++++++----------------- dev/system-test/firestore.ts | 42 ++-- types/firestore.d.ts | 2 +- 3 files changed, 223 insertions(+), 187 deletions(-) diff --git a/dev/src/reference.ts b/dev/src/reference.ts index aca02dcca..0977c5a1d 100644 --- a/dev/src/reference.ts +++ b/dev/src/reference.ts @@ -65,6 +65,7 @@ import {AggregateField, Aggregate, AggregateSpec} from './aggregate'; import {google} from '../protos/firestore_v1_proto_api'; import QueryMode = google.firestore.v1.QueryMode; import {ExecutionStats, ExplainResults, Plan} from './query-profile'; +import {ExplainOptions} from '@google-cloud/firestore'; /** * The direction of a `Query.orderBy()` clause is specified as 'desc' or 'asc' @@ -2327,101 +2328,56 @@ export class Query< explain( options: firestore.ExplainOptions ): Promise>> { - let readTime: Timestamp; - const docs: Array> = []; - let queryPlan: Plan = {indexesUsed: {}}; - let executionStats: ExecutionStats | null = null; - // Capture the error stack to preserve stack tracing across async calls. const stack = Error().stack!; return new Promise((resolve, reject) => { - const tag = requestTag(); - this.firestore.initializeIfNeeded(tag).then(() => { - const request = this.toProto(/* transactionId */ undefined, 'PROFILE'); - this._firestore - .requestStream('runQuery', /* bidirectional= */ false, request, tag) - .then(stream => { - stream.on('error', err => { - reject(wrapError(err, stack)); - }); - stream.on('data', response => { - if (response.document) { - readTime = Timestamp.fromProto(response.readTime); - const document = this.firestore.snapshot_( - response.document, - response.readTime - ); - const finalDoc = new DocumentSnapshotBuilder< - AppModelType, - DbModelType - >(document.ref.withConverter(this._queryOptions.converter)); - // Recreate the QueryDocumentSnapshot with the DocumentReference - // containing the original converter. - finalDoc.fieldsProto = document._fieldsProto; - finalDoc.readTime = document.readTime; - finalDoc.createTime = document.createTime; - finalDoc.updateTime = document.updateTime; - docs.push( - finalDoc.build() as QueryDocumentSnapshot< - AppModelType, - DbModelType - > - ); - } - if (response.stats) { - if (response.stats.queryPlan) { - queryPlan = Plan.fromProto(); - // queryPlan = new Plan( - // this.firestore._serializer!.decodeGoogleProtobufStruct( - // response.stats.queryPlan.planInfo - // ) - // ); - } - if (response.stats.queryStats) { - executionStats = ExecutionStats.fromProto(); - // this.firestore._serializer!.decodeGoogleProtobufStruct( - // response.stats.queryStats - // ); - } - } - if (response.done) { - stream.end(); - } - }); - stream.on('end', () => { - if (this._queryOptions.limitType === LimitType.Last) { - // The results for limitToLast queries need to be flipped since - // we reversed the ordering constraints before sending the query - // to the backend. - docs.reverse(); + let readTime: Timestamp; + const docs: Array> = []; + let queryPlan: Plan = {indexesUsed: {}}; + let executionStats: ExecutionStats | null = null; + + this._stream(undefined, options) + .on('error', err => { + reject(wrapError(err, stack)); + }) + .on('data', data => { + if (data.readTime) { + readTime = data.readTime; + } + if (data.document) { + docs.push(data.document); + } + if (data.explainResults) { + queryPlan = data.explainResults.plan; + executionStats = data.explainResults.executionStats; + } + }) + .on('end', () => { + if (this._queryOptions.limitType === LimitType.Last) { + // The results for limitToLast queries need to be flipped since + // we reversed the ordering constraints before sending the query + // to the backend. + docs.reverse(); + } + + const snapshot = new QuerySnapshot( + this, + readTime, + docs.length, + () => docs, + () => { + const changes: Array> = + []; + for (let i = 0; i < docs.length; ++i) { + changes.push(new DocumentChange('added', docs[i], -1, i)); } - const querySnapshot = new QuerySnapshot( - this, - readTime, - docs.length, - () => docs, - () => { - const changes: Array< - DocumentChange - > = []; - for (let i = 0; i < docs.length; ++i) { - changes.push(new DocumentChange('added', docs[i], -1, i)); - } - return changes; - } - ); - resolve( - new ExplainResults>( - queryPlan, - executionStats, - querySnapshot - ) - ); - }); - stream.resume(); - }); - }); + return changes; + } + ); + + resolve(new ExplainResults(queryPlan, executionStats, snapshot)); + }); }); } @@ -2524,8 +2480,8 @@ export class Query< return transform; } - // TODO. - explainStream(): NodeJS.ReadableStream { + // TODO (ehsann) + explainStream(explainOptions: ExplainOptions): NodeJS.ReadableStream { if (this._queryOptions.limitType === LimitType.Last) { throw new Error( 'Query results for queries that include limitToLast() ' + @@ -2533,14 +2489,19 @@ export class Query< ); } - const responseStream = this._stream(); + const responseStream = this._stream(undefined, explainOptions); const transform = new Transform({ objectMode: true, transform(chunk, encoding, callback) { - callback(undefined, chunk.document); + if (chunk.document) { + this.push(chunk.document); + } + if (chunk.explainResults) { + this.push(chunk.document); + } + callback(); }, }); - responseStream.pipe(transform); responseStream.on('error', e => transform.destroy(e)); return transform; @@ -2723,13 +2684,18 @@ export class Query< * Internal streaming method that accepts an optional transaction ID. * * @param transactionId A transaction ID. + * @param explainOptions options for explain queries (if any). * @private * @internal * @returns A stream of document results. */ - _stream(transactionId?: Uint8Array): NodeJS.ReadableStream { + _stream( + transactionId?: Uint8Array, + explainOptions?: ExplainOptions + ): NodeJS.ReadableStream { const tag = requestTag(); const startTime = Date.now(); + const isExplain = explainOptions !== undefined; let lastReceivedDocument: QueryDocumentSnapshot< AppModelType, @@ -2744,7 +2710,16 @@ export class Query< callback(undefined); return; } + + const output: { + readTime?: Timestamp; + document?: QueryDocumentSnapshot; + explainResults?: ExplainResults; + } = {}; + const readTime = Timestamp.fromProto(proto.readTime); + output.readTime = readTime; + if (proto.document) { const document = this.firestore.snapshot_( proto.document, @@ -2764,16 +2739,37 @@ export class Query< AppModelType, DbModelType >; - callback(undefined, {document: lastReceivedDocument, readTime}); - if (proto.done) { - logger('Query._stream', tag, 'Trigger Logical Termination.'); - backendStream.unpipe(stream); - backendStream.resume(); - backendStream.end(); - stream.end(); + output.document = lastReceivedDocument; + } + + if (proto.plan) { + // queryPlan = new Plan( + // this.firestore._serializer!.decodeGoogleProtobufStruct( + // response.stats.queryPlan.planInfo + // ) + // ); + const plan = Plan.fromProto(); + + // Sometimes plan comes with execution stats, and sometimes not. + let stats: ExecutionStats | null = null; + if (proto.executionStats) { + // this.firestore._serializer!.decodeGoogleProtobufStruct( + // response.stats.queryStats + // ); + stats = ExecutionStats.fromProto(); } - } else { - callback(undefined, {readTime}); + + output.explainResults = new ExplainResults(plan, stats, null); + } + + callback(undefined, output); + + if (proto.done) { + logger('Query._stream', tag, 'Trigger Logical Termination.'); + backendStream.unpipe(stream); + backendStream.resume(); + backendStream.end(); + stream.end(); } }, }); @@ -2801,7 +2797,11 @@ export class Query< // If a non-transactional query failed, attempt to restart. // Transactional queries are retried via the transaction runner. - if (!transactionId && !this._isPermanentRpcError(err, 'runQuery')) { + if ( + !isExplain && + !transactionId && + !this._isPermanentRpcError(err, 'runQuery') + ) { logger( 'Query._stream', tag, @@ -3453,17 +3453,28 @@ export class AggregateQuery< // Capture the error stack to preserve stack tracing across async calls. const stack = Error().stack!; + let result: AggregateQuerySnapshot< + AggregateSpecType, + AppModelType, + DbModelType + > | null = null; + return new Promise((resolve, reject) => { const stream = this._stream(transactionId); stream.on('error', err => { reject(wrapError(err, stack)); }); - stream.once('data', result => { - stream.destroy(); - resolve(result); + stream.on('data', data => { + if (data.aggregationResult) { + result = data.aggregationResult; + } }); stream.on('end', () => { - reject('No AggregateQuery results'); + stream.destroy(); + if (result === null) { + reject('No AggregateQuery results'); + } + resolve(result!); }); }); } @@ -3476,20 +3487,61 @@ export class AggregateQuery< * @param transactionId A transaction ID. * @returns A stream of document results. */ - _stream(transactionId?: Uint8Array): Readable { + _stream( + transactionId?: Uint8Array, + explainOptions?: ExplainOptions + ): Readable { const tag = requestTag(); const firestore = this._query.firestore; const stream: Transform = new Transform({ objectMode: true, transform: (proto: api.IRunAggregationQueryResponse, enc, callback) => { + const output: { + aggregationResult?: AggregateQuerySnapshot< + AggregateSpecType, + AppModelType, + DbModelType + >; + explainResults?: ExplainResults; + } = {}; + if (proto.result) { const readTime = Timestamp.fromProto(proto.readTime!); const data = this.decodeResult(proto.result); - callback(undefined, new AggregateQuerySnapshot(this, readTime, data)); - } else { - callback(Error('RunAggregationQueryResponse is missing result')); + output.aggregationResult = new AggregateQuerySnapshot( + this, + readTime, + data + ); + } + + if (proto.stats) { + let plan: Plan; + let executionStats: ExecutionStats | null = null; + if (proto.stats.queryPlan) { + plan = Plan.fromProto(); + // planInfo = new Plan( + // this._query.firestore._serializer!.decodeGoogleProtobufStruct( + // proto.stats.queryPlan.planInfo + // ) + // ); + } + if (proto.stats.queryStats) { + executionStats = ExecutionStats.fromProto(); + // executionStats = + // this._query.firestore._serializer!.decodeGoogleProtobufStruct( + // proto.stats.queryStats + // ); + } + output.explainResults = new ExplainResults( + plan!, + executionStats, + null + ); } + + callback(undefined, output); }, }); @@ -3655,71 +3707,39 @@ export class AggregateQuery< // Capture the error stack to preserve stack tracing across async calls. const stack = Error().stack!; + let plan: Plan | null = null; + let executionStats: ExecutionStats | null = null; let aggregationResult: AggregateQuerySnapshot< AggregateSpecType, AppModelType, DbModelType - >; - let plan: Plan; - let executionStats: ExecutionStats | null = null; + > | null = null; return new Promise((resolve, reject) => { - const tag = requestTag(); - const firestore = this._query.firestore; - firestore.initializeIfNeeded(tag).then(() => { - const request = this.toProto(/* transactionId */ undefined, 'PROFILE'); - firestore - .requestStream( - 'runAggregationQuery', - /* bidirectional= */ false, - request, - tag - ) - .then(stream => { - stream.on('error', err => { - reject(wrapError(err, stack)); - }); - stream.on('data', response => { - if (response.result) { - const readTime = Timestamp.fromProto(response.readTime!); - const data = this.decodeResult(response.result); - aggregationResult = new AggregateQuerySnapshot( - this, - readTime, - data - ); - } - if (response.stats) { - if (response.stats.queryPlan) { - plan = Plan.fromProto(); - // planInfo = new Plan( - // this._query.firestore._serializer!.decodeGoogleProtobufStruct( - // response.stats.queryPlan.planInfo - // ) - // ); - } - if (response.stats.queryStats) { - executionStats = ExecutionStats.fromProto(); - // executionStats = - // this._query.firestore._serializer!.decodeGoogleProtobufStruct( - // response.stats.queryStats - // ); - } - } - }); - stream.on('end', () => { - resolve( - new ExplainResults< - AggregateQuerySnapshot< - AggregateSpecType, - AppModelType, - DbModelType - > - >(plan, executionStats, aggregationResult) - ); - }); - stream.resume(); - }); + const stream = this._stream(undefined, options); + stream.on('error', err => { + reject(wrapError(err, stack)); + }); + stream.on('data', data => { + if (data.aggregationResult) { + aggregationResult = data.aggregationResult; + } + + if (data.explainResults) { + plan = data.explainResults.plan; + executionStats = data.explainResults.executionStats; + } + }); + stream.on('end', () => { + stream.destroy(); + if (plan === null) { + reject('No explain results'); + } + resolve( + new ExplainResults< + AggregateQuerySnapshot + >(plan!, executionStats, aggregationResult) + ); }); }); } diff --git a/dev/system-test/firestore.ts b/dev/system-test/firestore.ts index 237f24aaa..4c0132bb5 100644 --- a/dev/system-test/firestore.ts +++ b/dev/system-test/firestore.ts @@ -144,40 +144,52 @@ describe('Firestore class', () => { }); }); - it('can plan a query', async () => { + it.only('can plan a query', async () => { await randomCol.doc('doc1').set({foo: 1}); await randomCol.doc('doc2').set({foo: 2}); await randomCol.doc('doc3').set({foo: 1}); - const explainResults = await randomCol.where('foo', '>', 1).explain({analyze: false}); + const explainResults = await randomCol + .where('foo', '>', 1) + .explain({analyze: false}); const plan = explainResults.plan; expect(explainResults.plan).to.not.be.null; + console.log(explainResults); expect(Object.keys(plan.indexesUsed).length).to.be.greaterThan(0); expect(explainResults.executionStats).to.be.null; expect(explainResults.snapshot).to.be.null; }); - it('can profile a query', async () => { + it.only('can profile a query', async () => { await randomCol.doc('doc1').set({foo: 1, bar: 0}); await randomCol.doc('doc2').set({foo: 2, bar: 1}); await randomCol.doc('doc3').set({foo: 1, bar: 2}); - const explainResults = await randomCol.where('foo', '==', 1).explain({analyze: true}); + const explainResults = await randomCol + .where('foo', '==', 1) + .explain({analyze: true}); expect(explainResults.plan).to.not.be.null; expect(explainResults.executionStats).to.not.be.null; expect(explainResults.snapshot).to.not.be.null; - expect(Object.keys(explainResults.plan.indexesUsed).length).to.be.greaterThan(0); - expect(Object.keys(explainResults.executionStats!).length).to.be.greaterThan(0); + expect( + Object.keys(explainResults.plan.indexesUsed).length + ).to.be.greaterThan(0); + expect( + Object.keys(explainResults.executionStats!).length + ).to.be.greaterThan(0); expect(explainResults.snapshot!.size).to.equal(2); }); - it('can plan an aggregate query', async () => { + it.only('can plan an aggregate query', async () => { await randomCol.doc('doc1').set({foo: 1}); await randomCol.doc('doc2').set({foo: 2}); await randomCol.doc('doc3').set({foo: 1}); - const explainResults = await randomCol.where('foo', '>', 0).count().explain({analyze: false}); + const explainResults = await randomCol + .where('foo', '>', 0) + .count() + .explain({analyze: false}); expect(explainResults.plan).to.not.be.null; const plan = explainResults.plan; @@ -187,7 +199,7 @@ describe('Firestore class', () => { expect(explainResults.snapshot).to.be.null; }); - it('can profile an aggregate query', async () => { + it.only('can profile an aggregate query', async () => { await randomCol.doc('doc1').set({foo: 1}); await randomCol.doc('doc2').set({foo: 2}); await randomCol.doc('doc3').set({foo: 1}); @@ -200,8 +212,12 @@ describe('Firestore class', () => { expect(explainResults.executionStats).to.not.be.null; expect(explainResults.snapshot).to.not.be.null; - expect(Object.keys(explainResults.plan.indexesUsed).length).to.be.greaterThan(0); - expect(Object.keys(explainResults.executionStats!).length).to.be.greaterThan(0); + expect( + Object.keys(explainResults.plan.indexesUsed).length + ).to.be.greaterThan(0); + expect( + Object.keys(explainResults.executionStats!).length + ).to.be.greaterThan(0); expect(explainResults.snapshot!.data().count).to.equal(3); }); @@ -1391,13 +1407,13 @@ describe('runs query on a large collection', () => { afterEach(() => verifyInstance(firestore)); - it('can get()', () => { + it.only('can get()', () => { return randomCol.get().then(res => { expect(res.size).to.equal(1000); }); }); - it('can stream()', async () => { + it.only('can stream()', async () => { let received = 0; const stream = randomCol.stream(); diff --git a/types/firestore.d.ts b/types/firestore.d.ts index 60593c252..760b5aa33 100644 --- a/types/firestore.d.ts +++ b/types/firestore.d.ts @@ -1922,7 +1922,7 @@ declare namespace FirebaseFirestore { * may be no ExecutionStats or QueryDocumentSnapshot objects depending on explain * options. */ - explainStream(): NodeJS.ReadableStream; + explainStream(options: ExplainOptions): NodeJS.ReadableStream; /** * Attaches a listener for `QuerySnapshot `events. From 71935d1f0e2f528beef2ed488e83fc861d36c0a0 Mon Sep 17 00:00:00 2001 From: Ehsan Nasiri Date: Thu, 22 Feb 2024 18:56:30 -0800 Subject: [PATCH 17/19] Introduce ExplainMetrics and PlanSummary. --- dev/src/query-profile.ts | 19 +++++-- dev/src/reference.ts | 105 +++++++++++++++++++---------------- dev/system-test/firestore.ts | 6 +- types/firestore.d.ts | 20 +++++-- 4 files changed, 91 insertions(+), 59 deletions(-) diff --git a/dev/src/query-profile.ts b/dev/src/query-profile.ts index 6dfaa66cf..721344d48 100644 --- a/dev/src/query-profile.ts +++ b/dev/src/query-profile.ts @@ -20,11 +20,11 @@ import * as firestore from '@google-cloud/firestore'; /** * Plan contains information about the planning stage of a query. */ -export class Plan implements firestore.Plan { +export class PlanSummary implements firestore.PlanSummary { constructor(readonly indexesUsed: Record) {} - static fromProto(): Plan { - return new Plan({}); + static fromProto(): PlanSummary { + return new PlanSummary({}); } } @@ -43,14 +43,23 @@ export class ExecutionStats implements firestore.ExecutionStats { } } +/** + * ExplainMetrics contains information about planning and execution of a query. + */ +export class ExplainMetrics implements firestore.ExplainMetrics { + constructor( + readonly plan: PlanSummary, + readonly executionStats: ExecutionStats | null + ) {} +} + /** * ExplainResults contains information about planning, execution, and results * of a query. */ export class ExplainResults implements firestore.ExplainResults { constructor( - readonly plan: Plan, - readonly executionStats: ExecutionStats | null, + readonly metrics: ExplainMetrics, readonly snapshot: T | null ) {} } diff --git a/dev/src/reference.ts b/dev/src/reference.ts index 0977c5a1d..d3f855219 100644 --- a/dev/src/reference.ts +++ b/dev/src/reference.ts @@ -64,7 +64,12 @@ import {CompositeFilter, Filter, UnaryFilter} from './filter'; import {AggregateField, Aggregate, AggregateSpec} from './aggregate'; import {google} from '../protos/firestore_v1_proto_api'; import QueryMode = google.firestore.v1.QueryMode; -import {ExecutionStats, ExplainResults, Plan} from './query-profile'; +import { + ExecutionStats, + ExplainMetrics, + ExplainResults, + PlanSummary, +} from './query-profile'; import {ExplainOptions} from '@google-cloud/firestore'; /** @@ -2333,9 +2338,9 @@ export class Query< return new Promise((resolve, reject) => { let readTime: Timestamp; - const docs: Array> = []; - let queryPlan: Plan = {indexesUsed: {}}; - let executionStats: ExecutionStats | null = null; + let docs: Array> | null = + null; + let metrics: ExplainMetrics | null = null; this._stream(undefined, options) .on('error', err => { @@ -2346,37 +2351,48 @@ export class Query< readTime = data.readTime; } if (data.document) { + if (docs === null) { + docs = []; + } docs.push(data.document); } - if (data.explainResults) { - queryPlan = data.explainResults.plan; - executionStats = data.explainResults.executionStats; + if (data.explainMetrics) { + metrics = data.explainMetrics; } }) .on('end', () => { - if (this._queryOptions.limitType === LimitType.Last) { - // The results for limitToLast queries need to be flipped since - // we reversed the ordering constraints before sending the query - // to the backend. - docs.reverse(); + if (metrics === null) { + reject('No explain results.'); } - const snapshot = new QuerySnapshot( - this, - readTime, - docs.length, - () => docs, - () => { - const changes: Array> = - []; - for (let i = 0; i < docs.length; ++i) { - changes.push(new DocumentChange('added', docs[i], -1, i)); - } - return changes; + // Some explain queries will not have a snapshot associated with them. + let snapshot: QuerySnapshot | null = null; + if (docs !== null) { + if (this._queryOptions.limitType === LimitType.Last) { + // The results for limitToLast queries need to be flipped since + // we reversed the ordering constraints before sending the query + // to the backend. + docs.reverse(); } - ); - resolve(new ExplainResults(queryPlan, executionStats, snapshot)); + snapshot = new QuerySnapshot( + this, + readTime, + docs.length, + () => docs!, + () => { + const changes: Array< + DocumentChange + > = []; + for (let i = 0; i < docs!.length; ++i) { + changes.push(new DocumentChange('added', docs![i], -1, i)); + } + return changes; + } + ); + } + + resolve(new ExplainResults(metrics!, snapshot)); }); }); } @@ -2496,7 +2512,7 @@ export class Query< if (chunk.document) { this.push(chunk.document); } - if (chunk.explainResults) { + if (chunk.explainMetrics) { this.push(chunk.document); } callback(); @@ -2684,7 +2700,7 @@ export class Query< * Internal streaming method that accepts an optional transaction ID. * * @param transactionId A transaction ID. - * @param explainOptions options for explain queries (if any). + * @param explainOptions Options to use for explaining the query (if any). * @private * @internal * @returns A stream of document results. @@ -2714,7 +2730,7 @@ export class Query< const output: { readTime?: Timestamp; document?: QueryDocumentSnapshot; - explainResults?: ExplainResults; + explainMetrics?: ExplainMetrics; } = {}; const readTime = Timestamp.fromProto(proto.readTime); @@ -2748,7 +2764,7 @@ export class Query< // response.stats.queryPlan.planInfo // ) // ); - const plan = Plan.fromProto(); + const plan = PlanSummary.fromProto(); // Sometimes plan comes with execution stats, and sometimes not. let stats: ExecutionStats | null = null; @@ -2759,7 +2775,7 @@ export class Query< stats = ExecutionStats.fromProto(); } - output.explainResults = new ExplainResults(plan, stats, null); + output.explainMetrics = new ExplainMetrics(plan, stats); } callback(undefined, output); @@ -3485,6 +3501,7 @@ export class AggregateQuery< * @private * @internal * @param transactionId A transaction ID. + * @param explainOptions Options to use for explaining the query (if any). * @returns A stream of document results. */ _stream( @@ -3503,7 +3520,7 @@ export class AggregateQuery< AppModelType, DbModelType >; - explainResults?: ExplainResults; + explainMetrics?: ExplainMetrics; } = {}; if (proto.result) { @@ -3517,10 +3534,10 @@ export class AggregateQuery< } if (proto.stats) { - let plan: Plan; + let plan: PlanSummary; let executionStats: ExecutionStats | null = null; if (proto.stats.queryPlan) { - plan = Plan.fromProto(); + plan = PlanSummary.fromProto(); // planInfo = new Plan( // this._query.firestore._serializer!.decodeGoogleProtobufStruct( // proto.stats.queryPlan.planInfo @@ -3534,11 +3551,7 @@ export class AggregateQuery< // proto.stats.queryStats // ); } - output.explainResults = new ExplainResults( - plan!, - executionStats, - null - ); + output.explainMetrics = new ExplainMetrics(plan!, executionStats); } callback(undefined, output); @@ -3707,8 +3720,7 @@ export class AggregateQuery< // Capture the error stack to preserve stack tracing across async calls. const stack = Error().stack!; - let plan: Plan | null = null; - let executionStats: ExecutionStats | null = null; + let metrics: ExplainMetrics | null = null; let aggregationResult: AggregateQuerySnapshot< AggregateSpecType, AppModelType, @@ -3725,20 +3737,19 @@ export class AggregateQuery< aggregationResult = data.aggregationResult; } - if (data.explainResults) { - plan = data.explainResults.plan; - executionStats = data.explainResults.executionStats; + if (data.explainMetrics) { + metrics = data.explainMetrics; } }); stream.on('end', () => { stream.destroy(); - if (plan === null) { - reject('No explain results'); + if (metrics === null) { + reject('No explain results.'); } resolve( new ExplainResults< AggregateQuerySnapshot - >(plan!, executionStats, aggregationResult) + >(metrics!, aggregationResult) ); }); }); diff --git a/dev/system-test/firestore.ts b/dev/system-test/firestore.ts index 4c0132bb5..02794d05f 100644 --- a/dev/system-test/firestore.ts +++ b/dev/system-test/firestore.ts @@ -144,6 +144,7 @@ describe('Firestore class', () => { }); }); + /* it.only('can plan a query', async () => { await randomCol.doc('doc1').set({foo: 1}); await randomCol.doc('doc2').set({foo: 2}); @@ -220,6 +221,7 @@ describe('Firestore class', () => { ).to.be.greaterThan(0); expect(explainResults.snapshot!.data().count).to.equal(3); }); + */ it('getAll() supports array destructuring', () => { const ref1 = randomCol.doc('doc1'); @@ -1407,13 +1409,13 @@ describe('runs query on a large collection', () => { afterEach(() => verifyInstance(firestore)); - it.only('can get()', () => { + it('can get()', () => { return randomCol.get().then(res => { expect(res.size).to.equal(1000); }); }); - it.only('can stream()', async () => { + it('can stream()', async () => { let received = 0; const stream = randomCol.stream(); diff --git a/types/firestore.d.ts b/types/firestore.d.ts index 760b5aa33..0f0ce9dfd 100644 --- a/types/firestore.d.ts +++ b/types/firestore.d.ts @@ -2946,7 +2946,7 @@ declare namespace FirebaseFirestore { /** * Plan contains information about the planning stage of a query. */ - export interface Plan { + export interface PlanSummary { /** * Information about the indexes that were used to serve the query. * Note: This content is subject to change. @@ -2976,20 +2976,30 @@ declare namespace FirebaseFirestore { } /** - * ExplainResults contains information about planning, execution, and results - * of a query. + * ExplainMetrics contains information about planning and execution of a query. */ - export interface ExplainResults { + export interface ExplainMetrics { /** * Information about the query plan. */ - readonly plan: Plan; + readonly plan: PlanSummary; /** * Information about the execution of the query, or null if the query was * not executed. */ readonly executionStats: ExecutionStats | null; + } + + /** + * ExplainResults contains information about planning, execution, and results + * of a query. + */ + export interface ExplainResults { + /** + * Information about planning and execution of the query. + */ + readonly metrics: ExplainMetrics; /** * The snapshot that contains the results of executing the query, or null From 4621073a7c22672b116550b21f40ae955f97935b Mon Sep 17 00:00:00 2001 From: Ehsan Nasiri Date: Fri, 23 Feb 2024 09:35:39 -0800 Subject: [PATCH 18/19] Update tests. --- dev/src/query-profile.ts | 2 +- dev/system-test/firestore.ts | 90 +++++++++++++++++++++++++++--------- types/firestore.d.ts | 2 +- 3 files changed, 70 insertions(+), 24 deletions(-) diff --git a/dev/src/query-profile.ts b/dev/src/query-profile.ts index 721344d48..ad28e769f 100644 --- a/dev/src/query-profile.ts +++ b/dev/src/query-profile.ts @@ -48,7 +48,7 @@ export class ExecutionStats implements firestore.ExecutionStats { */ export class ExplainMetrics implements firestore.ExplainMetrics { constructor( - readonly plan: PlanSummary, + readonly planSummary: PlanSummary, readonly executionStats: ExecutionStats | null ) {} } diff --git a/dev/system-test/firestore.ts b/dev/system-test/firestore.ts index 02794d05f..d61d2f114 100644 --- a/dev/system-test/firestore.ts +++ b/dev/system-test/firestore.ts @@ -55,8 +55,8 @@ import {BulkWriter} from '../src/bulk-writer'; import {Status} from 'google-gax'; import {QueryPartition} from '../src/query-partition'; import {CollectionGroup} from '../src/collection-group'; -import IBundleElement = firestore.IBundleElement; import {Filter} from '../src/filter'; +import IBundleElement = firestore.IBundleElement; use(chaiAsPromised); @@ -144,7 +144,6 @@ describe('Firestore class', () => { }); }); - /* it.only('can plan a query', async () => { await randomCol.doc('doc1').set({foo: 1}); await randomCol.doc('doc2').set({foo: 2}); @@ -153,12 +152,18 @@ describe('Firestore class', () => { .where('foo', '>', 1) .explain({analyze: false}); - const plan = explainResults.plan; - expect(explainResults.plan).to.not.be.null; + // Should have metrics. + const metrics = explainResults.metrics; + expect(metrics).to.not.be.null; + + // Should have query plan. + const plan = metrics.planSummary; + expect(plan).to.not.be.null; console.log(explainResults); expect(Object.keys(plan.indexesUsed).length).to.be.greaterThan(0); - expect(explainResults.executionStats).to.be.null; + // No execution stats and no snapshot. + expect(metrics.executionStats).to.be.null; expect(explainResults.snapshot).to.be.null; }); @@ -170,17 +175,52 @@ describe('Firestore class', () => { .where('foo', '==', 1) .explain({analyze: true}); - expect(explainResults.plan).to.not.be.null; - expect(explainResults.executionStats).to.not.be.null; + const metrics = explainResults.metrics; + + expect(metrics.planSummary).to.not.be.null; + expect(metrics.executionStats).to.not.be.null; expect(explainResults.snapshot).to.not.be.null; expect( - Object.keys(explainResults.plan.indexesUsed).length + Object.keys(metrics.planSummary.indexesUsed).length ).to.be.greaterThan(0); + + let stats = metrics.executionStats!; + expect(stats.bytesReturned).to.be.greaterThan(0); + expect(stats.readOperations).to.be.greaterThan(0); + expect(stats.resultsReturned).to.be.equal(2); + expect(stats.executionDuration.nanoseconds > 0 || stats.executionDuration.seconds > 0).to.be.true; + expect(Object.keys(stats.debugStats).length).to.be.greaterThan(0); + + expect(explainResults.snapshot!.size).to.equal(2); + }); + + it.only('can profile a query that does not match any docs', async () => { + await randomCol.doc('doc1').set({foo: 1, bar: 0}); + await randomCol.doc('doc2').set({foo: 2, bar: 1}); + await randomCol.doc('doc3').set({foo: 1, bar: 2}); + const explainResults = await randomCol + .where('foo', '==', 12345) + .explain({analyze: true}); + + const metrics = explainResults.metrics; + + expect(metrics.planSummary).to.not.be.null; + expect(metrics.executionStats).to.not.be.null; + expect(explainResults.snapshot).to.not.be.null; + expect( - Object.keys(explainResults.executionStats!).length + Object.keys(metrics.planSummary.indexesUsed).length ).to.be.greaterThan(0); - expect(explainResults.snapshot!.size).to.equal(2); + + let stats = metrics.executionStats!; + expect(stats.bytesReturned).to.be.greaterThan(0); + expect(stats.readOperations).to.be.greaterThan(0); + expect(stats.resultsReturned).to.be.equal(0); + expect(stats.executionDuration.nanoseconds > 0 || stats.executionDuration.seconds > 0).to.be.true; + expect(Object.keys(stats.debugStats).length).to.be.greaterThan(0); + + expect(explainResults.snapshot!.size).to.equal(0); }); it.only('can plan an aggregate query', async () => { @@ -192,11 +232,13 @@ describe('Firestore class', () => { .count() .explain({analyze: false}); - expect(explainResults.plan).to.not.be.null; - const plan = explainResults.plan; + const metrics = explainResults.metrics; + + const plan = metrics.planSummary; + expect(plan).to.not.be.null; expect(Object.keys(plan.indexesUsed).length).to.be.greaterThan(0); - expect(explainResults.executionStats).to.be.null; + expect(metrics.executionStats).to.be.null; expect(explainResults.snapshot).to.be.null; }); @@ -209,19 +251,23 @@ describe('Firestore class', () => { .count() .explain({analyze: true}); - expect(explainResults.plan).to.not.be.null; - expect(explainResults.executionStats).to.not.be.null; - expect(explainResults.snapshot).to.not.be.null; - - expect( - Object.keys(explainResults.plan.indexesUsed).length - ).to.be.greaterThan(0); + const metrics = explainResults.metrics; + expect(metrics.planSummary).to.not.be.null; expect( - Object.keys(explainResults.executionStats!).length + Object.keys(metrics.planSummary.indexesUsed).length ).to.be.greaterThan(0); + + expect(metrics.executionStats).to.not.be.null; + let stats = metrics.executionStats!; + expect(stats.bytesReturned).to.be.greaterThan(0); + expect(stats.readOperations).to.be.greaterThan(0); + expect(stats.resultsReturned).to.be.equal(1); + expect(stats.executionDuration.nanoseconds > 0 || stats.executionDuration.seconds > 0).to.be.true; + expect(Object.keys(stats.debugStats).length).to.be.greaterThan(0); + + expect(explainResults.snapshot).to.not.be.null; expect(explainResults.snapshot!.data().count).to.equal(3); }); - */ it('getAll() supports array destructuring', () => { const ref1 = randomCol.doc('doc1'); diff --git a/types/firestore.d.ts b/types/firestore.d.ts index 0f0ce9dfd..938cbca9a 100644 --- a/types/firestore.d.ts +++ b/types/firestore.d.ts @@ -2982,7 +2982,7 @@ declare namespace FirebaseFirestore { /** * Information about the query plan. */ - readonly plan: PlanSummary; + readonly planSummary: PlanSummary; /** * Information about the execution of the query, or null if the query was From c3cba6d1ce4dd494836833134b40768274160b28 Mon Sep 17 00:00:00 2001 From: Ehsan Nasiri Date: Mon, 4 Mar 2024 18:40:21 -0800 Subject: [PATCH 19/19] try to get the new protos. --- dev/protos/firestore_v1_proto_api.d.ts | 11013 ++++-- dev/protos/firestore_v1_proto_api.js | 42207 +++++++++++++++++------ dev/protos/v1.json | 1175 +- 3 files changed, 40553 insertions(+), 13842 deletions(-) diff --git a/dev/protos/firestore_v1_proto_api.d.ts b/dev/protos/firestore_v1_proto_api.d.ts index 1036ea689..068f3a53b 100644 --- a/dev/protos/firestore_v1_proto_api.d.ts +++ b/dev/protos/firestore_v1_proto_api.d.ts @@ -1,440 +1,92 @@ -/*! - * Copyright 2024 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. - */ - -import * as $protobuf from "protobufjs"; +// Copyright 2024 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. + +import type {protobuf as $protobuf} from "google-gax"; import Long = require("long"); -/** Namespace firestore. */ -export namespace firestore { - - /** Properties of a BundledQuery. */ - interface IBundledQuery { - - /** BundledQuery parent */ - parent?: (string|null); - - /** BundledQuery structuredQuery */ - structuredQuery?: (google.firestore.v1.IStructuredQuery|null); - - /** BundledQuery limitType */ - limitType?: (firestore.BundledQuery.LimitType|null); - } - - /** Represents a BundledQuery. */ - class BundledQuery implements IBundledQuery { - - /** - * Constructs a new BundledQuery. - * @param [properties] Properties to set - */ - constructor(properties?: firestore.IBundledQuery); - - /** BundledQuery parent. */ - public parent: string; - - /** BundledQuery structuredQuery. */ - public structuredQuery?: (google.firestore.v1.IStructuredQuery|null); - - /** BundledQuery limitType. */ - public limitType: firestore.BundledQuery.LimitType; - - /** BundledQuery queryType. */ - public queryType?: "structuredQuery"; - - /** - * Creates a BundledQuery message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BundledQuery - */ - public static fromObject(object: { [k: string]: any }): firestore.BundledQuery; - - /** - * Creates a plain object from a BundledQuery message. Also converts values to other types if specified. - * @param message BundledQuery - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: firestore.BundledQuery, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BundledQuery to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BundledQuery - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace BundledQuery { - - /** LimitType enum. */ - type LimitType = - "FIRST"| "LAST"; - } - - /** Properties of a NamedQuery. */ - interface INamedQuery { - - /** NamedQuery name */ - name?: (string|null); - - /** NamedQuery bundledQuery */ - bundledQuery?: (firestore.IBundledQuery|null); - - /** NamedQuery readTime */ - readTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents a NamedQuery. */ - class NamedQuery implements INamedQuery { - - /** - * Constructs a new NamedQuery. - * @param [properties] Properties to set - */ - constructor(properties?: firestore.INamedQuery); - - /** NamedQuery name. */ - public name: string; - - /** NamedQuery bundledQuery. */ - public bundledQuery?: (firestore.IBundledQuery|null); - - /** NamedQuery readTime. */ - public readTime?: (google.protobuf.ITimestamp|null); - - /** - * Creates a NamedQuery message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns NamedQuery - */ - public static fromObject(object: { [k: string]: any }): firestore.NamedQuery; - - /** - * Creates a plain object from a NamedQuery message. Also converts values to other types if specified. - * @param message NamedQuery - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: firestore.NamedQuery, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this NamedQuery to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for NamedQuery - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a BundledDocumentMetadata. */ - interface IBundledDocumentMetadata { - - /** BundledDocumentMetadata name */ - name?: (string|null); - - /** BundledDocumentMetadata readTime */ - readTime?: (google.protobuf.ITimestamp|null); - - /** BundledDocumentMetadata exists */ - exists?: (boolean|null); - - /** BundledDocumentMetadata queries */ - queries?: (string[]|null); - } - - /** Represents a BundledDocumentMetadata. */ - class BundledDocumentMetadata implements IBundledDocumentMetadata { - - /** - * Constructs a new BundledDocumentMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: firestore.IBundledDocumentMetadata); - - /** BundledDocumentMetadata name. */ - public name: string; - - /** BundledDocumentMetadata readTime. */ - public readTime?: (google.protobuf.ITimestamp|null); - - /** BundledDocumentMetadata exists. */ - public exists: boolean; - - /** BundledDocumentMetadata queries. */ - public queries: string[]; - - /** - * Creates a BundledDocumentMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BundledDocumentMetadata - */ - public static fromObject(object: { [k: string]: any }): firestore.BundledDocumentMetadata; - - /** - * Creates a plain object from a BundledDocumentMetadata message. Also converts values to other types if specified. - * @param message BundledDocumentMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: firestore.BundledDocumentMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BundledDocumentMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BundledDocumentMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a BundleMetadata. */ - interface IBundleMetadata { - - /** BundleMetadata id */ - id?: (string|null); - - /** BundleMetadata createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** BundleMetadata version */ - version?: (number|null); - - /** BundleMetadata totalDocuments */ - totalDocuments?: (number|null); - - /** BundleMetadata totalBytes */ - totalBytes?: (number|string|null); - } - - /** Represents a BundleMetadata. */ - class BundleMetadata implements IBundleMetadata { - - /** - * Constructs a new BundleMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: firestore.IBundleMetadata); - - /** BundleMetadata id. */ - public id: string; - - /** BundleMetadata createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** BundleMetadata version. */ - public version: number; - - /** BundleMetadata totalDocuments. */ - public totalDocuments: number; - - /** BundleMetadata totalBytes. */ - public totalBytes: (number|string); - - /** - * Creates a BundleMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BundleMetadata - */ - public static fromObject(object: { [k: string]: any }): firestore.BundleMetadata; - - /** - * Creates a plain object from a BundleMetadata message. Also converts values to other types if specified. - * @param message BundleMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: firestore.BundleMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BundleMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BundleMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a BundleElement. */ - interface IBundleElement { - - /** BundleElement metadata */ - metadata?: (firestore.IBundleMetadata|null); - - /** BundleElement namedQuery */ - namedQuery?: (firestore.INamedQuery|null); - - /** BundleElement documentMetadata */ - documentMetadata?: (firestore.IBundledDocumentMetadata|null); - - /** BundleElement document */ - document?: (google.firestore.v1.IDocument|null); - } - - /** Represents a BundleElement. */ - class BundleElement implements IBundleElement { - - /** - * Constructs a new BundleElement. - * @param [properties] Properties to set - */ - constructor(properties?: firestore.IBundleElement); - - /** BundleElement metadata. */ - public metadata?: (firestore.IBundleMetadata|null); - - /** BundleElement namedQuery. */ - public namedQuery?: (firestore.INamedQuery|null); - - /** BundleElement documentMetadata. */ - public documentMetadata?: (firestore.IBundledDocumentMetadata|null); - - /** BundleElement document. */ - public document?: (google.firestore.v1.IDocument|null); - - /** BundleElement elementType. */ - public elementType?: ("metadata"|"namedQuery"|"documentMetadata"|"document"); - - /** - * Creates a BundleElement message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BundleElement - */ - public static fromObject(object: { [k: string]: any }): firestore.BundleElement; - - /** - * Creates a plain object from a BundleElement message. Also converts values to other types if specified. - * @param message BundleElement - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: firestore.BundleElement, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BundleElement to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BundleElement - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } -} - /** Namespace google. */ export namespace google { /** Namespace protobuf. */ namespace protobuf { - /** Properties of a Timestamp. */ - interface ITimestamp { - - /** Timestamp seconds */ - seconds?: (number|string|null); + /** Properties of a Struct. */ + interface IStruct { - /** Timestamp nanos */ - nanos?: (number|null); + /** Struct fields */ + fields?: ({ [k: string]: google.protobuf.IValue }|null); } - /** Represents a Timestamp. */ - class Timestamp implements ITimestamp { + /** Represents a Struct. */ + class Struct implements IStruct { /** - * Constructs a new Timestamp. + * Constructs a new Struct. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.ITimestamp); - - /** Timestamp seconds. */ - public seconds: (number|string); + constructor(properties?: google.protobuf.IStruct); - /** Timestamp nanos. */ - public nanos: number; + /** Struct fields. */ + public fields: { [k: string]: google.protobuf.IValue }; /** - * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Timestamp + * Creates a new Struct instance using the specified properties. + * @param [properties] Properties to set + * @returns Struct instance */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Timestamp; + public static create(properties?: google.protobuf.IStruct): google.protobuf.Struct; /** - * Creates a plain object from a Timestamp message. Also converts values to other types if specified. - * @param message Timestamp - * @param [options] Conversion options - * @returns Plain object + * Encodes the specified Struct message. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @param message Struct message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public static toObject(message: google.protobuf.Timestamp, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static encode(message: google.protobuf.IStruct, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Converts this Timestamp to JSON. - * @returns JSON object + * Encodes the specified Struct message, length delimited. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @param message Struct message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public toJSON(): { [k: string]: any }; + public static encodeDelimited(message: google.protobuf.IStruct, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Gets the default type url for Timestamp - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url + * Decodes a Struct message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Struct. */ - interface IStruct { - - /** Struct fields */ - fields?: ({ [k: string]: google.protobuf.IValue }|null); - } - - /** Represents a Struct. */ - class Struct implements IStruct { + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Struct; /** - * Constructs a new Struct. - * @param [properties] Properties to set + * Decodes a Struct message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - constructor(properties?: google.protobuf.IStruct); + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Struct; - /** Struct fields. */ - public fields: { [k: string]: google.protobuf.IValue }; + /** + * Verifies a Struct message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); /** * Creates a Struct message from a plain object. Also converts values to their respective internal types. @@ -469,7 +121,7 @@ export namespace google { interface IValue { /** Value nullValue */ - nullValue?: (google.protobuf.NullValue|null); + nullValue?: (google.protobuf.NullValue|keyof typeof google.protobuf.NullValue|null); /** Value numberValue */ numberValue?: (number|null); @@ -497,7 +149,7 @@ export namespace google { constructor(properties?: google.protobuf.IValue); /** Value nullValue. */ - public nullValue?: (google.protobuf.NullValue|null); + public nullValue?: (google.protobuf.NullValue|keyof typeof google.protobuf.NullValue|null); /** Value numberValue. */ public numberValue?: (number|null); @@ -517,6 +169,55 @@ export namespace google { /** Value kind. */ public kind?: ("nullValue"|"numberValue"|"stringValue"|"boolValue"|"structValue"|"listValue"); + /** + * Creates a new Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Value instance + */ + public static create(properties?: google.protobuf.IValue): google.protobuf.Value; + + /** + * Encodes the specified Value message. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @param message Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Value message, length delimited. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @param message Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Value; + + /** + * Decodes a Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Value; + + /** + * Verifies a Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + /** * Creates a Value message from a plain object. Also converts values to their respective internal types. * @param object Plain object @@ -547,8 +248,9 @@ export namespace google { } /** NullValue enum. */ - type NullValue = - "NULL_VALUE"; + enum NullValue { + NULL_VALUE = 0 + } /** Properties of a ListValue. */ interface IListValue { @@ -569,6 +271,55 @@ export namespace google { /** ListValue values. */ public values: google.protobuf.IValue[]; + /** + * Creates a new ListValue instance using the specified properties. + * @param [properties] Properties to set + * @returns ListValue instance + */ + public static create(properties?: google.protobuf.IListValue): google.protobuf.ListValue; + + /** + * Encodes the specified ListValue message. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @param message ListValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IListValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListValue message, length delimited. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @param message ListValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IListValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ListValue; + + /** + * Decodes a ListValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ListValue; + + /** + * Verifies a ListValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + /** * Creates a ListValue message from a plain object. Also converts values to their respective internal types. * @param object Plain object @@ -598,6 +349,109 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** Timestamp seconds */ + seconds?: (number|Long|string|null); + + /** Timestamp nanos */ + nanos?: (number|null); + } + + /** Represents a Timestamp. */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ITimestamp); + + /** Timestamp seconds. */ + public seconds: (number|Long|string); + + /** Timestamp nanos. */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: google.protobuf.ITimestamp): google.protobuf.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Timestamp; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Timestamp; + + /** + * Verifies a Timestamp message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Timestamp + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Timestamp; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @param message Timestamp + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Timestamp, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Timestamp to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of a FileDescriptorSet. */ interface IFileDescriptorSet { @@ -617,6 +471,55 @@ export namespace google { /** FileDescriptorSet file. */ public file: google.protobuf.IFileDescriptorProto[]; + /** + * Creates a new FileDescriptorSet instance using the specified properties. + * @param [properties] Properties to set + * @returns FileDescriptorSet instance + */ + public static create(properties?: google.protobuf.IFileDescriptorSet): google.protobuf.FileDescriptorSet; + + /** + * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @param message FileDescriptorSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @param message FileDescriptorSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorSet; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorSet; + + /** + * Verifies a FileDescriptorSet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + /** * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. * @param object Plain object @@ -646,6 +549,21 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Edition enum. */ + enum Edition { + EDITION_UNKNOWN = 0, + EDITION_PROTO2 = 998, + EDITION_PROTO3 = 999, + EDITION_2023 = 1000, + EDITION_2024 = 1001, + EDITION_1_TEST_ONLY = 1, + EDITION_2_TEST_ONLY = 2, + EDITION_99997_TEST_ONLY = 99997, + EDITION_99998_TEST_ONLY = 99998, + EDITION_99999_TEST_ONLY = 99999, + EDITION_MAX = 2147483647 + } + /** Properties of a FileDescriptorProto. */ interface IFileDescriptorProto { @@ -684,6 +602,9 @@ export namespace google { /** FileDescriptorProto syntax */ syntax?: (string|null); + + /** FileDescriptorProto edition */ + edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); } /** Represents a FileDescriptorProto. */ @@ -731,20 +652,72 @@ export namespace google { /** FileDescriptorProto syntax. */ public syntax: string; + /** FileDescriptorProto edition. */ + public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + /** - * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FileDescriptorProto + * Creates a new FileDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FileDescriptorProto instance */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorProto; + public static create(properties?: google.protobuf.IFileDescriptorProto): google.protobuf.FileDescriptorProto; /** - * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. - * @param message FileDescriptorProto - * @param [options] Conversion options - * @returns Plain object + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @param message FileDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public static toObject(message: google.protobuf.FileDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static encode(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @param message FileDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorProto; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorProto; + + /** + * Verifies a FileDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorProto; + + /** + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * @param message FileDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** * Converts this FileDescriptorProto to JSON. @@ -833,6 +806,55 @@ export namespace google { /** DescriptorProto reservedName. */ public reservedName: string[]; + /** + * Creates a new DescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns DescriptorProto instance + */ + public static create(properties?: google.protobuf.IDescriptorProto): google.protobuf.DescriptorProto; + + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @param message DescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @param message DescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto; + + /** + * Verifies a DescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + /** * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. * @param object Plain object @@ -872,6 +894,9 @@ export namespace google { /** ExtensionRange end */ end?: (number|null); + + /** ExtensionRange options */ + options?: (google.protobuf.IExtensionRangeOptions|null); } /** Represents an ExtensionRange. */ @@ -889,6 +914,58 @@ export namespace google { /** ExtensionRange end. */ public end: number; + /** ExtensionRange options. */ + public options?: (google.protobuf.IExtensionRangeOptions|null); + + /** + * Creates a new ExtensionRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtensionRange instance + */ + public static create(properties?: google.protobuf.DescriptorProto.IExtensionRange): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @param message ExtensionRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @param message ExtensionRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Verifies an ExtensionRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + /** * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. * @param object Plain object @@ -943,6 +1020,55 @@ export namespace google { /** ReservedRange end. */ public end: number; + /** + * Creates a new ReservedRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ReservedRange instance + */ + public static create(properties?: google.protobuf.DescriptorProto.IReservedRange): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @param message ReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @param message ReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Verifies a ReservedRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + /** * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. * @param object Plain object @@ -973,6 +1099,251 @@ export namespace google { } } + /** Properties of an ExtensionRangeOptions. */ + interface IExtensionRangeOptions { + + /** ExtensionRangeOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** ExtensionRangeOptions declaration */ + declaration?: (google.protobuf.ExtensionRangeOptions.IDeclaration[]|null); + + /** ExtensionRangeOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** ExtensionRangeOptions verification */ + verification?: (google.protobuf.ExtensionRangeOptions.VerificationState|keyof typeof google.protobuf.ExtensionRangeOptions.VerificationState|null); + } + + /** Represents an ExtensionRangeOptions. */ + class ExtensionRangeOptions implements IExtensionRangeOptions { + + /** + * Constructs a new ExtensionRangeOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IExtensionRangeOptions); + + /** ExtensionRangeOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** ExtensionRangeOptions declaration. */ + public declaration: google.protobuf.ExtensionRangeOptions.IDeclaration[]; + + /** ExtensionRangeOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** ExtensionRangeOptions verification. */ + public verification: (google.protobuf.ExtensionRangeOptions.VerificationState|keyof typeof google.protobuf.ExtensionRangeOptions.VerificationState); + + /** + * Creates a new ExtensionRangeOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtensionRangeOptions instance + */ + public static create(properties?: google.protobuf.IExtensionRangeOptions): google.protobuf.ExtensionRangeOptions; + + /** + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @param message ExtensionRangeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @param message ExtensionRangeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions; + + /** + * Verifies an ExtensionRangeOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtensionRangeOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions; + + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @param message ExtensionRangeOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ExtensionRangeOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtensionRangeOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExtensionRangeOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ExtensionRangeOptions { + + /** Properties of a Declaration. */ + interface IDeclaration { + + /** Declaration number */ + number?: (number|null); + + /** Declaration fullName */ + fullName?: (string|null); + + /** Declaration type */ + type?: (string|null); + + /** Declaration reserved */ + reserved?: (boolean|null); + + /** Declaration repeated */ + repeated?: (boolean|null); + } + + /** Represents a Declaration. */ + class Declaration implements IDeclaration { + + /** + * Constructs a new Declaration. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ExtensionRangeOptions.IDeclaration); + + /** Declaration number. */ + public number: number; + + /** Declaration fullName. */ + public fullName: string; + + /** Declaration type. */ + public type: string; + + /** Declaration reserved. */ + public reserved: boolean; + + /** Declaration repeated. */ + public repeated: boolean; + + /** + * Creates a new Declaration instance using the specified properties. + * @param [properties] Properties to set + * @returns Declaration instance + */ + public static create(properties?: google.protobuf.ExtensionRangeOptions.IDeclaration): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @param message Declaration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ExtensionRangeOptions.IDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @param message Declaration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ExtensionRangeOptions.IDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Declaration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Decodes a Declaration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Verifies a Declaration message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Declaration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Declaration + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Creates a plain object from a Declaration message. Also converts values to other types if specified. + * @param message Declaration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ExtensionRangeOptions.Declaration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Declaration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Declaration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** VerificationState enum. */ + enum VerificationState { + DECLARATION = 0, + UNVERIFIED = 1 + } + } + /** Properties of a FieldDescriptorProto. */ interface IFieldDescriptorProto { @@ -983,10 +1354,10 @@ export namespace google { number?: (number|null); /** FieldDescriptorProto label */ - label?: (google.protobuf.FieldDescriptorProto.Label|null); + label?: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label|null); /** FieldDescriptorProto type */ - type?: (google.protobuf.FieldDescriptorProto.Type|null); + type?: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type|null); /** FieldDescriptorProto typeName */ typeName?: (string|null); @@ -1005,6 +1376,9 @@ export namespace google { /** FieldDescriptorProto options */ options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional */ + proto3Optional?: (boolean|null); } /** Represents a FieldDescriptorProto. */ @@ -1023,10 +1397,10 @@ export namespace google { public number: number; /** FieldDescriptorProto label. */ - public label: google.protobuf.FieldDescriptorProto.Label; + public label: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label); /** FieldDescriptorProto type. */ - public type: google.protobuf.FieldDescriptorProto.Type; + public type: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type); /** FieldDescriptorProto typeName. */ public typeName: string; @@ -1046,6 +1420,58 @@ export namespace google { /** FieldDescriptorProto options. */ public options?: (google.protobuf.IFieldOptions|null); + /** FieldDescriptorProto proto3Optional. */ + public proto3Optional: boolean; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFieldDescriptorProto): google.protobuf.FieldDescriptorProto; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldDescriptorProto; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldDescriptorProto; + + /** + * Verifies a FieldDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + /** * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. * @param object Plain object @@ -1078,12 +1504,33 @@ export namespace google { namespace FieldDescriptorProto { /** Type enum. */ - type Type = - "TYPE_DOUBLE"| "TYPE_FLOAT"| "TYPE_INT64"| "TYPE_UINT64"| "TYPE_INT32"| "TYPE_FIXED64"| "TYPE_FIXED32"| "TYPE_BOOL"| "TYPE_STRING"| "TYPE_GROUP"| "TYPE_MESSAGE"| "TYPE_BYTES"| "TYPE_UINT32"| "TYPE_ENUM"| "TYPE_SFIXED32"| "TYPE_SFIXED64"| "TYPE_SINT32"| "TYPE_SINT64"; + enum Type { + TYPE_DOUBLE = 1, + TYPE_FLOAT = 2, + TYPE_INT64 = 3, + TYPE_UINT64 = 4, + TYPE_INT32 = 5, + TYPE_FIXED64 = 6, + TYPE_FIXED32 = 7, + TYPE_BOOL = 8, + TYPE_STRING = 9, + TYPE_GROUP = 10, + TYPE_MESSAGE = 11, + TYPE_BYTES = 12, + TYPE_UINT32 = 13, + TYPE_ENUM = 14, + TYPE_SFIXED32 = 15, + TYPE_SFIXED64 = 16, + TYPE_SINT32 = 17, + TYPE_SINT64 = 18 + } /** Label enum. */ - type Label = - "LABEL_OPTIONAL"| "LABEL_REQUIRED"| "LABEL_REPEATED"; + enum Label { + LABEL_OPTIONAL = 1, + LABEL_REPEATED = 3, + LABEL_REQUIRED = 2 + } } /** Properties of an OneofDescriptorProto. */ @@ -1112,33 +1559,82 @@ export namespace google { public options?: (google.protobuf.IOneofOptions|null); /** - * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OneofDescriptorProto + * Creates a new OneofDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofDescriptorProto instance */ - public static fromObject(object: { [k: string]: any }): google.protobuf.OneofDescriptorProto; + public static create(properties?: google.protobuf.IOneofDescriptorProto): google.protobuf.OneofDescriptorProto; /** - * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. - * @param message OneofDescriptorProto - * @param [options] Conversion options - * @returns Plain object + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public static toObject(message: google.protobuf.OneofDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static encode(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Converts this OneofDescriptorProto to JSON. - * @returns JSON object + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public toJSON(): { [k: string]: any }; + public static encodeDelimited(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Gets the default type url for OneofDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofDescriptorProto; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofDescriptorProto; + + /** + * Verifies an OneofDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneofDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofDescriptorProto; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @param message OneofDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OneofDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } /** Properties of an EnumDescriptorProto. */ interface IEnumDescriptorProto { @@ -1151,6 +1647,12 @@ export namespace google { /** EnumDescriptorProto options */ options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange */ + reservedRange?: (google.protobuf.EnumDescriptorProto.IEnumReservedRange[]|null); + + /** EnumDescriptorProto reservedName */ + reservedName?: (string[]|null); } /** Represents an EnumDescriptorProto. */ @@ -1171,6 +1673,61 @@ export namespace google { /** EnumDescriptorProto options. */ public options?: (google.protobuf.IEnumOptions|null); + /** EnumDescriptorProto reservedRange. */ + public reservedRange: google.protobuf.EnumDescriptorProto.IEnumReservedRange[]; + + /** EnumDescriptorProto reservedName. */ + public reservedName: string[]; + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumDescriptorProto): google.protobuf.EnumDescriptorProto; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto; + + /** + * Verifies an EnumDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + /** * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. * @param object Plain object @@ -1200,6 +1757,112 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + namespace EnumDescriptorProto { + + /** Properties of an EnumReservedRange. */ + interface IEnumReservedRange { + + /** EnumReservedRange start */ + start?: (number|null); + + /** EnumReservedRange end */ + end?: (number|null); + } + + /** Represents an EnumReservedRange. */ + class EnumReservedRange implements IEnumReservedRange { + + /** + * Constructs a new EnumReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange); + + /** EnumReservedRange start. */ + public start: number; + + /** EnumReservedRange end. */ + public end: number; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumReservedRange instance + */ + public static create(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Verifies an EnumReservedRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumReservedRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @param message EnumReservedRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto.EnumReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumReservedRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + /** Properties of an EnumValueDescriptorProto. */ interface IEnumValueDescriptorProto { @@ -1231,6 +1894,55 @@ export namespace google { /** EnumValueDescriptorProto options. */ public options?: (google.protobuf.IEnumValueOptions|null); + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumValueDescriptorProto): google.protobuf.EnumValueDescriptorProto; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueDescriptorProto; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueDescriptorProto; + + /** + * Verifies an EnumValueDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + /** * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. * @param object Plain object @@ -1291,6 +2003,55 @@ export namespace google { /** ServiceDescriptorProto options. */ public options?: (google.protobuf.IServiceOptions|null); + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceDescriptorProto instance + */ + public static create(properties?: google.protobuf.IServiceDescriptorProto): google.protobuf.ServiceDescriptorProto; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceDescriptorProto; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceDescriptorProto; + + /** + * Verifies a ServiceDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + /** * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. * @param object Plain object @@ -1369,6 +2130,55 @@ export namespace google { /** MethodDescriptorProto serverStreaming. */ public serverStreaming: boolean; + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodDescriptorProto instance + */ + public static create(properties?: google.protobuf.IMethodDescriptorProto): google.protobuf.MethodDescriptorProto; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodDescriptorProto; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodDescriptorProto; + + /** + * Verifies a MethodDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + /** * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. * @param object Plain object @@ -1417,7 +2227,7 @@ export namespace google { javaStringCheckUtf8?: (boolean|null); /** FileOptions optimizeFor */ - optimizeFor?: (google.protobuf.FileOptions.OptimizeMode|null); + optimizeFor?: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode|null); /** FileOptions goPackage */ goPackage?: (string|null); @@ -1443,11 +2253,26 @@ export namespace google { /** FileOptions csharpNamespace */ csharpNamespace?: (string|null); + /** FileOptions swiftPrefix */ + swiftPrefix?: (string|null); + + /** FileOptions phpClassPrefix */ + phpClassPrefix?: (string|null); + + /** FileOptions phpNamespace */ + phpNamespace?: (string|null); + + /** FileOptions phpMetadataNamespace */ + phpMetadataNamespace?: (string|null); + + /** FileOptions rubyPackage */ + rubyPackage?: (string|null); + + /** FileOptions features */ + features?: (google.protobuf.IFeatureSet|null); + /** FileOptions uninterpretedOption */ uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** FileOptions .google.api.resourceDefinition */ - ".google.api.resourceDefinition"?: (google.api.IResourceDescriptor[]|null); } /** Represents a FileOptions. */ @@ -1475,7 +2300,7 @@ export namespace google { public javaStringCheckUtf8: boolean; /** FileOptions optimizeFor. */ - public optimizeFor: google.protobuf.FileOptions.OptimizeMode; + public optimizeFor: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode); /** FileOptions goPackage. */ public goPackage: string; @@ -1501,9 +2326,76 @@ export namespace google { /** FileOptions csharpNamespace. */ public csharpNamespace: string; + /** FileOptions swiftPrefix. */ + public swiftPrefix: string; + + /** FileOptions phpClassPrefix. */ + public phpClassPrefix: string; + + /** FileOptions phpNamespace. */ + public phpNamespace: string; + + /** FileOptions phpMetadataNamespace. */ + public phpMetadataNamespace: string; + + /** FileOptions rubyPackage. */ + public rubyPackage: string; + + /** FileOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + /** FileOptions uninterpretedOption. */ public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + /** + * Creates a new FileOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FileOptions instance + */ + public static create(properties?: google.protobuf.IFileOptions): google.protobuf.FileOptions; + + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @param message FileOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @param message FileOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileOptions; + + /** + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileOptions; + + /** + * Verifies a FileOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + /** * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. * @param object Plain object @@ -1536,8 +2428,11 @@ export namespace google { namespace FileOptions { /** OptimizeMode enum. */ - type OptimizeMode = - "SPEED"| "CODE_SIZE"| "LITE_RUNTIME"; + enum OptimizeMode { + SPEED = 1, + CODE_SIZE = 2, + LITE_RUNTIME = 3 + } } /** Properties of a MessageOptions. */ @@ -1555,11 +2450,14 @@ export namespace google { /** MessageOptions mapEntry */ mapEntry?: (boolean|null); + /** MessageOptions deprecatedLegacyJsonFieldConflicts */ + deprecatedLegacyJsonFieldConflicts?: (boolean|null); + + /** MessageOptions features */ + features?: (google.protobuf.IFeatureSet|null); + /** MessageOptions uninterpretedOption */ uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** MessageOptions .google.api.resource */ - ".google.api.resource"?: (google.api.IResourceDescriptor|null); } /** Represents a MessageOptions. */ @@ -1583,9 +2481,64 @@ export namespace google { /** MessageOptions mapEntry. */ public mapEntry: boolean; + /** MessageOptions deprecatedLegacyJsonFieldConflicts. */ + public deprecatedLegacyJsonFieldConflicts: boolean; + + /** MessageOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + /** MessageOptions uninterpretedOption. */ public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + /** + * Creates a new MessageOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MessageOptions instance + */ + public static create(properties?: google.protobuf.IMessageOptions): google.protobuf.MessageOptions; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @param message MessageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @param message MessageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MessageOptions; + + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MessageOptions; + + /** + * Verifies a MessageOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + /** * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. * @param object Plain object @@ -1619,31 +2572,46 @@ export namespace google { interface IFieldOptions { /** FieldOptions ctype */ - ctype?: (google.protobuf.FieldOptions.CType|null); + ctype?: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType|null); /** FieldOptions packed */ packed?: (boolean|null); /** FieldOptions jstype */ - jstype?: (google.protobuf.FieldOptions.JSType|null); + jstype?: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType|null); /** FieldOptions lazy */ lazy?: (boolean|null); + /** FieldOptions unverifiedLazy */ + unverifiedLazy?: (boolean|null); + /** FieldOptions deprecated */ deprecated?: (boolean|null); /** FieldOptions weak */ weak?: (boolean|null); + /** FieldOptions debugRedact */ + debugRedact?: (boolean|null); + + /** FieldOptions retention */ + retention?: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention|null); + + /** FieldOptions targets */ + targets?: (google.protobuf.FieldOptions.OptionTargetType[]|null); + + /** FieldOptions editionDefaults */ + editionDefaults?: (google.protobuf.FieldOptions.IEditionDefault[]|null); + + /** FieldOptions features */ + features?: (google.protobuf.IFeatureSet|null); + /** FieldOptions uninterpretedOption */ uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); /** FieldOptions .google.api.fieldBehavior */ ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|null); - - /** FieldOptions .google.api.resourceReference */ - ".google.api.resourceReference"?: (google.api.IResourceReference|null); } /** Represents a FieldOptions. */ @@ -1656,28 +2624,95 @@ export namespace google { constructor(properties?: google.protobuf.IFieldOptions); /** FieldOptions ctype. */ - public ctype: google.protobuf.FieldOptions.CType; + public ctype: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType); /** FieldOptions packed. */ public packed: boolean; /** FieldOptions jstype. */ - public jstype: google.protobuf.FieldOptions.JSType; + public jstype: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType); /** FieldOptions lazy. */ public lazy: boolean; + /** FieldOptions unverifiedLazy. */ + public unverifiedLazy: boolean; + /** FieldOptions deprecated. */ public deprecated: boolean; /** FieldOptions weak. */ public weak: boolean; - /** FieldOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + /** FieldOptions debugRedact. */ + public debugRedact: boolean; - /** - * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. + /** FieldOptions retention. */ + public retention: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention); + + /** FieldOptions targets. */ + public targets: google.protobuf.FieldOptions.OptionTargetType[]; + + /** FieldOptions editionDefaults. */ + public editionDefaults: google.protobuf.FieldOptions.IEditionDefault[]; + + /** FieldOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** FieldOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldOptions instance + */ + public static create(properties?: google.protobuf.IFieldOptions): google.protobuf.FieldOptions; + + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @param message FieldOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @param message FieldOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions; + + /** + * Verifies a FieldOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. * @param object Plain object * @returns FieldOptions */ @@ -1708,17 +2743,150 @@ export namespace google { namespace FieldOptions { /** CType enum. */ - type CType = - "STRING"| "CORD"| "STRING_PIECE"; + enum CType { + STRING = 0, + CORD = 1, + STRING_PIECE = 2 + } /** JSType enum. */ - type JSType = - "JS_NORMAL"| "JS_STRING"| "JS_NUMBER"; + enum JSType { + JS_NORMAL = 0, + JS_STRING = 1, + JS_NUMBER = 2 + } + + /** OptionRetention enum. */ + enum OptionRetention { + RETENTION_UNKNOWN = 0, + RETENTION_RUNTIME = 1, + RETENTION_SOURCE = 2 + } + + /** OptionTargetType enum. */ + enum OptionTargetType { + TARGET_TYPE_UNKNOWN = 0, + TARGET_TYPE_FILE = 1, + TARGET_TYPE_EXTENSION_RANGE = 2, + TARGET_TYPE_MESSAGE = 3, + TARGET_TYPE_FIELD = 4, + TARGET_TYPE_ONEOF = 5, + TARGET_TYPE_ENUM = 6, + TARGET_TYPE_ENUM_ENTRY = 7, + TARGET_TYPE_SERVICE = 8, + TARGET_TYPE_METHOD = 9 + } + + /** Properties of an EditionDefault. */ + interface IEditionDefault { + + /** EditionDefault edition */ + edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** EditionDefault value */ + value?: (string|null); + } + + /** Represents an EditionDefault. */ + class EditionDefault implements IEditionDefault { + + /** + * Constructs a new EditionDefault. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FieldOptions.IEditionDefault); + + /** EditionDefault edition. */ + public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** EditionDefault value. */ + public value: string; + + /** + * Creates a new EditionDefault instance using the specified properties. + * @param [properties] Properties to set + * @returns EditionDefault instance + */ + public static create(properties?: google.protobuf.FieldOptions.IEditionDefault): google.protobuf.FieldOptions.EditionDefault; + + /** + * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @param message EditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FieldOptions.IEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @param message EditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FieldOptions.IEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EditionDefault message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions.EditionDefault; + + /** + * Decodes an EditionDefault message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions.EditionDefault; + + /** + * Verifies an EditionDefault message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EditionDefault message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EditionDefault + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions.EditionDefault; + + /** + * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. + * @param message EditionDefault + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldOptions.EditionDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EditionDefault to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EditionDefault + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } } /** Properties of an OneofOptions. */ interface IOneofOptions { + /** OneofOptions features */ + features?: (google.protobuf.IFeatureSet|null); + /** OneofOptions uninterpretedOption */ uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); } @@ -1732,9 +2900,61 @@ export namespace google { */ constructor(properties?: google.protobuf.IOneofOptions); + /** OneofOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + /** OneofOptions uninterpretedOption. */ public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + /** + * Creates a new OneofOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofOptions instance + */ + public static create(properties?: google.protobuf.IOneofOptions): google.protobuf.OneofOptions; + + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @param message OneofOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @param message OneofOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofOptions; + + /** + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofOptions; + + /** + * Verifies an OneofOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + /** * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. * @param object Plain object @@ -1773,6 +2993,12 @@ export namespace google { /** EnumOptions deprecated */ deprecated?: (boolean|null); + /** EnumOptions deprecatedLegacyJsonFieldConflicts */ + deprecatedLegacyJsonFieldConflicts?: (boolean|null); + + /** EnumOptions features */ + features?: (google.protobuf.IFeatureSet|null); + /** EnumOptions uninterpretedOption */ uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); } @@ -1792,9 +3018,64 @@ export namespace google { /** EnumOptions deprecated. */ public deprecated: boolean; + /** EnumOptions deprecatedLegacyJsonFieldConflicts. */ + public deprecatedLegacyJsonFieldConflicts: boolean; + + /** EnumOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + /** EnumOptions uninterpretedOption. */ public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + /** + * Creates a new EnumOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumOptions instance + */ + public static create(properties?: google.protobuf.IEnumOptions): google.protobuf.EnumOptions; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumOptions; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumOptions; + + /** + * Verifies an EnumOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + /** * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. * @param object Plain object @@ -1830,6 +3111,12 @@ export namespace google { /** EnumValueOptions deprecated */ deprecated?: (boolean|null); + /** EnumValueOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** EnumValueOptions debugRedact */ + debugRedact?: (boolean|null); + /** EnumValueOptions uninterpretedOption */ uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); } @@ -1846,9 +3133,64 @@ export namespace google { /** EnumValueOptions deprecated. */ public deprecated: boolean; + /** EnumValueOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** EnumValueOptions debugRedact. */ + public debugRedact: boolean; + /** EnumValueOptions uninterpretedOption. */ public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueOptions instance + */ + public static create(properties?: google.protobuf.IEnumValueOptions): google.protobuf.EnumValueOptions; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueOptions; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueOptions; + + /** + * Verifies an EnumValueOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + /** * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. * @param object Plain object @@ -1881,6 +3223,9 @@ export namespace google { /** Properties of a ServiceOptions. */ interface IServiceOptions { + /** ServiceOptions features */ + features?: (google.protobuf.IFeatureSet|null); + /** ServiceOptions deprecated */ deprecated?: (boolean|null); @@ -1903,12 +3248,64 @@ export namespace google { */ constructor(properties?: google.protobuf.IServiceOptions); + /** ServiceOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + /** ServiceOptions deprecated. */ public deprecated: boolean; /** ServiceOptions uninterpretedOption. */ public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + /** + * Creates a new ServiceOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceOptions instance + */ + public static create(properties?: google.protobuf.IServiceOptions): google.protobuf.ServiceOptions; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceOptions; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceOptions; + + /** + * Verifies a ServiceOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + /** * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. * @param object Plain object @@ -1944,6 +3341,12 @@ export namespace google { /** MethodOptions deprecated */ deprecated?: (boolean|null); + /** MethodOptions idempotencyLevel */ + idempotencyLevel?: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel|null); + + /** MethodOptions features */ + features?: (google.protobuf.IFeatureSet|null); + /** MethodOptions uninterpretedOption */ uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); @@ -1952,9 +3355,6 @@ export namespace google { /** MethodOptions .google.api.methodSignature */ ".google.api.methodSignature"?: (string[]|null); - - /** MethodOptions .google.longrunning.operationInfo */ - ".google.longrunning.operationInfo"?: (google.longrunning.IOperationInfo|null); } /** Represents a MethodOptions. */ @@ -1969,9 +3369,64 @@ export namespace google { /** MethodOptions deprecated. */ public deprecated: boolean; + /** MethodOptions idempotencyLevel. */ + public idempotencyLevel: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel); + + /** MethodOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + /** MethodOptions uninterpretedOption. */ public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + /** + * Creates a new MethodOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodOptions instance + */ + public static create(properties?: google.protobuf.IMethodOptions): google.protobuf.MethodOptions; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodOptions; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodOptions; + + /** + * Verifies a MethodOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + /** * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. * @param object Plain object @@ -2001,6 +3456,16 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + namespace MethodOptions { + + /** IdempotencyLevel enum. */ + enum IdempotencyLevel { + IDEMPOTENCY_UNKNOWN = 0, + NO_SIDE_EFFECTS = 1, + IDEMPOTENT = 2 + } + } + /** Properties of an UninterpretedOption. */ interface IUninterpretedOption { @@ -2011,16 +3476,16 @@ export namespace google { identifierValue?: (string|null); /** UninterpretedOption positiveIntValue */ - positiveIntValue?: (number|string|null); + positiveIntValue?: (number|Long|string|null); /** UninterpretedOption negativeIntValue */ - negativeIntValue?: (number|string|null); + negativeIntValue?: (number|Long|string|null); /** UninterpretedOption doubleValue */ doubleValue?: (number|null); /** UninterpretedOption stringValue */ - stringValue?: (Uint8Array|null); + stringValue?: (Uint8Array|string|null); /** UninterpretedOption aggregateValue */ aggregateValue?: (string|null); @@ -2042,20 +3507,69 @@ export namespace google { public identifierValue: string; /** UninterpretedOption positiveIntValue. */ - public positiveIntValue: (number|string); + public positiveIntValue: (number|Long|string); /** UninterpretedOption negativeIntValue. */ - public negativeIntValue: (number|string); + public negativeIntValue: (number|Long|string); /** UninterpretedOption doubleValue. */ public doubleValue: number; /** UninterpretedOption stringValue. */ - public stringValue: Uint8Array; + public stringValue: (Uint8Array|string); /** UninterpretedOption aggregateValue. */ public aggregateValue: string; + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @param [properties] Properties to set + * @returns UninterpretedOption instance + */ + public static create(properties?: google.protobuf.IUninterpretedOption): google.protobuf.UninterpretedOption; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption; + + /** + * Verifies an UninterpretedOption message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + /** * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. * @param object Plain object @@ -2112,6 +3626,55 @@ export namespace google { /** NamePart isExtension. */ public isExtension: boolean; + /** + * Creates a new NamePart instance using the specified properties. + * @param [properties] Properties to set + * @returns NamePart instance + */ + public static create(properties?: google.protobuf.UninterpretedOption.INamePart): google.protobuf.UninterpretedOption.NamePart; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption.NamePart; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption.NamePart; + + /** + * Verifies a NamePart message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + /** * Creates a NamePart message from a plain object. Also converts values to their respective internal types. * @param object Plain object @@ -2142,7 +3705,395 @@ export namespace google { } } - /** Properties of a SourceCodeInfo. */ + /** Properties of a FeatureSet. */ + interface IFeatureSet { + + /** FeatureSet fieldPresence */ + fieldPresence?: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence|null); + + /** FeatureSet enumType */ + enumType?: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType|null); + + /** FeatureSet repeatedFieldEncoding */ + repeatedFieldEncoding?: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding|null); + + /** FeatureSet utf8Validation */ + utf8Validation?: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation|null); + + /** FeatureSet messageEncoding */ + messageEncoding?: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding|null); + + /** FeatureSet jsonFormat */ + jsonFormat?: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat|null); + } + + /** Represents a FeatureSet. */ + class FeatureSet implements IFeatureSet { + + /** + * Constructs a new FeatureSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFeatureSet); + + /** FeatureSet fieldPresence. */ + public fieldPresence: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence); + + /** FeatureSet enumType. */ + public enumType: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType); + + /** FeatureSet repeatedFieldEncoding. */ + public repeatedFieldEncoding: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding); + + /** FeatureSet utf8Validation. */ + public utf8Validation: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation); + + /** FeatureSet messageEncoding. */ + public messageEncoding: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding); + + /** FeatureSet jsonFormat. */ + public jsonFormat: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat); + + /** + * Creates a new FeatureSet instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSet instance + */ + public static create(properties?: google.protobuf.IFeatureSet): google.protobuf.FeatureSet; + + /** + * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @param message FeatureSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @param message FeatureSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSet; + + /** + * Decodes a FeatureSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSet; + + /** + * Verifies a FeatureSet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FeatureSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSet + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSet; + + /** + * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. + * @param message FeatureSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FeatureSet { + + /** FieldPresence enum. */ + enum FieldPresence { + FIELD_PRESENCE_UNKNOWN = 0, + EXPLICIT = 1, + IMPLICIT = 2, + LEGACY_REQUIRED = 3 + } + + /** EnumType enum. */ + enum EnumType { + ENUM_TYPE_UNKNOWN = 0, + OPEN = 1, + CLOSED = 2 + } + + /** RepeatedFieldEncoding enum. */ + enum RepeatedFieldEncoding { + REPEATED_FIELD_ENCODING_UNKNOWN = 0, + PACKED = 1, + EXPANDED = 2 + } + + /** Utf8Validation enum. */ + enum Utf8Validation { + UTF8_VALIDATION_UNKNOWN = 0, + VERIFY = 2, + NONE = 3 + } + + /** MessageEncoding enum. */ + enum MessageEncoding { + MESSAGE_ENCODING_UNKNOWN = 0, + LENGTH_PREFIXED = 1, + DELIMITED = 2 + } + + /** JsonFormat enum. */ + enum JsonFormat { + JSON_FORMAT_UNKNOWN = 0, + ALLOW = 1, + LEGACY_BEST_EFFORT = 2 + } + } + + /** Properties of a FeatureSetDefaults. */ + interface IFeatureSetDefaults { + + /** FeatureSetDefaults defaults */ + defaults?: (google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault[]|null); + + /** FeatureSetDefaults minimumEdition */ + minimumEdition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSetDefaults maximumEdition */ + maximumEdition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + } + + /** Represents a FeatureSetDefaults. */ + class FeatureSetDefaults implements IFeatureSetDefaults { + + /** + * Constructs a new FeatureSetDefaults. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFeatureSetDefaults); + + /** FeatureSetDefaults defaults. */ + public defaults: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault[]; + + /** FeatureSetDefaults minimumEdition. */ + public minimumEdition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSetDefaults maximumEdition. */ + public maximumEdition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** + * Creates a new FeatureSetDefaults instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSetDefaults instance + */ + public static create(properties?: google.protobuf.IFeatureSetDefaults): google.protobuf.FeatureSetDefaults; + + /** + * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @param message FeatureSetDefaults message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFeatureSetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @param message FeatureSetDefaults message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFeatureSetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSetDefaults; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSetDefaults; + + /** + * Verifies a FeatureSetDefaults message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FeatureSetDefaults message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSetDefaults + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSetDefaults; + + /** + * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. + * @param message FeatureSetDefaults + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSetDefaults, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSetDefaults to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSetDefaults + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FeatureSetDefaults { + + /** Properties of a FeatureSetEditionDefault. */ + interface IFeatureSetEditionDefault { + + /** FeatureSetEditionDefault edition */ + edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSetEditionDefault features */ + features?: (google.protobuf.IFeatureSet|null); + } + + /** Represents a FeatureSetEditionDefault. */ + class FeatureSetEditionDefault implements IFeatureSetEditionDefault { + + /** + * Constructs a new FeatureSetEditionDefault. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault); + + /** FeatureSetEditionDefault edition. */ + public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSetEditionDefault features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** + * Creates a new FeatureSetEditionDefault instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSetEditionDefault instance + */ + public static create(properties?: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @param message FeatureSetEditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @param message FeatureSetEditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Verifies a FeatureSetEditionDefault message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSetEditionDefault + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. + * @param message FeatureSetEditionDefault + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSetEditionDefault to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSetEditionDefault + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a SourceCodeInfo. */ interface ISourceCodeInfo { /** SourceCodeInfo location */ @@ -2161,6 +4112,55 @@ export namespace google { /** SourceCodeInfo location. */ public location: google.protobuf.SourceCodeInfo.ILocation[]; + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns SourceCodeInfo instance + */ + public static create(properties?: google.protobuf.ISourceCodeInfo): google.protobuf.SourceCodeInfo; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo; + + /** + * Verifies a SourceCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + /** * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. * @param object Plain object @@ -2235,6 +4235,55 @@ export namespace google { /** Location leadingDetachedComments. */ public leadingDetachedComments: string[]; + /** + * Creates a new Location instance using the specified properties. + * @param [properties] Properties to set + * @returns Location instance + */ + public static create(properties?: google.protobuf.SourceCodeInfo.ILocation): google.protobuf.SourceCodeInfo.Location; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Location message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo.Location; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo.Location; + + /** + * Verifies a Location message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + /** * Creates a Location message from a plain object. Also converts values to their respective internal types. * @param object Plain object @@ -2284,6 +4333,55 @@ export namespace google { /** GeneratedCodeInfo annotation. */ public annotation: google.protobuf.GeneratedCodeInfo.IAnnotation[]; + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns GeneratedCodeInfo instance + */ + public static create(properties?: google.protobuf.IGeneratedCodeInfo): google.protobuf.GeneratedCodeInfo; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo; + + /** + * Verifies a GeneratedCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + /** * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. * @param object Plain object @@ -2329,6 +4427,9 @@ export namespace google { /** Annotation end */ end?: (number|null); + + /** Annotation semantic */ + semantic?: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null); } /** Represents an Annotation. */ @@ -2352,23 +4453,75 @@ export namespace google { /** Annotation end. */ public end: number; + /** Annotation semantic. */ + public semantic: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic); + /** - * Creates an Annotation message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Annotation + * Creates a new Annotation instance using the specified properties. + * @param [properties] Properties to set + * @returns Annotation instance */ - public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo.Annotation; + public static create(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation): google.protobuf.GeneratedCodeInfo.Annotation; /** - * Creates a plain object from an Annotation message. Also converts values to other types if specified. - * @param message Annotation - * @param [options] Conversion options - * @returns Plain object + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public static toObject(message: google.protobuf.GeneratedCodeInfo.Annotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static encode(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Converts this Annotation to JSON. + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Verifies an Annotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Annotation + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @param message Annotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo.Annotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Annotation to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; @@ -2380,44 +4533,115 @@ export namespace google { */ public static getTypeUrl(typeUrlPrefix?: string): string; } + + namespace Annotation { + + /** Semantic enum. */ + enum Semantic { + NONE = 0, + SET = 1, + ALIAS = 2 + } + } } - /** Properties of an Empty. */ - interface IEmpty { + /** Properties of a Duration. */ + interface IDuration { + + /** Duration seconds */ + seconds?: (number|Long|string|null); + + /** Duration nanos */ + nanos?: (number|null); } - /** Represents an Empty. */ - class Empty implements IEmpty { + /** Represents a Duration. */ + class Duration implements IDuration { /** - * Constructs a new Empty. + * Constructs a new Duration. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.IEmpty); + constructor(properties?: google.protobuf.IDuration); + + /** Duration seconds. */ + public seconds: (number|Long|string); + + /** Duration nanos. */ + public nanos: number; /** - * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * Creates a new Duration instance using the specified properties. + * @param [properties] Properties to set + * @returns Duration instance + */ + public static create(properties?: google.protobuf.IDuration): google.protobuf.Duration; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Duration; + + /** + * Decodes a Duration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Duration; + + /** + * Verifies a Duration message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Duration message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Empty + * @returns Duration */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Empty; + public static fromObject(object: { [k: string]: any }): google.protobuf.Duration; /** - * Creates a plain object from an Empty message. Also converts values to other types if specified. - * @param message Empty + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @param message Duration * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.protobuf.Empty, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.Duration, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Empty to JSON. + * Converts this Duration to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for Empty + * Gets the default type url for Duration * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ @@ -2443,6 +4667,55 @@ export namespace google { /** DoubleValue value. */ public value: number; + /** + * Creates a new DoubleValue instance using the specified properties. + * @param [properties] Properties to set + * @returns DoubleValue instance + */ + public static create(properties?: google.protobuf.IDoubleValue): google.protobuf.DoubleValue; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @param message DoubleValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDoubleValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DoubleValue message, length delimited. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @param message DoubleValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDoubleValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DoubleValue; + + /** + * Decodes a DoubleValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DoubleValue; + + /** + * Verifies a DoubleValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + /** * Creates a DoubleValue message from a plain object. Also converts values to their respective internal types. * @param object Plain object @@ -2491,6 +4764,55 @@ export namespace google { /** FloatValue value. */ public value: number; + /** + * Creates a new FloatValue instance using the specified properties. + * @param [properties] Properties to set + * @returns FloatValue instance + */ + public static create(properties?: google.protobuf.IFloatValue): google.protobuf.FloatValue; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @param message FloatValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFloatValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FloatValue message, length delimited. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @param message FloatValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFloatValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FloatValue; + + /** + * Decodes a FloatValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FloatValue; + + /** + * Verifies a FloatValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + /** * Creates a FloatValue message from a plain object. Also converts values to their respective internal types. * @param object Plain object @@ -2524,7 +4846,7 @@ export namespace google { interface IInt64Value { /** Int64Value value */ - value?: (number|string|null); + value?: (number|Long|string|null); } /** Represents an Int64Value. */ @@ -2537,7 +4859,56 @@ export namespace google { constructor(properties?: google.protobuf.IInt64Value); /** Int64Value value. */ - public value: (number|string); + public value: (number|Long|string); + + /** + * Creates a new Int64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int64Value instance + */ + public static create(properties?: google.protobuf.IInt64Value): google.protobuf.Int64Value; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @param message Int64Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Int64Value message, length delimited. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @param message Int64Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Int64Value; + + /** + * Decodes an Int64Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Int64Value; + + /** + * Verifies an Int64Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); /** * Creates an Int64Value message from a plain object. Also converts values to their respective internal types. @@ -2572,7 +4943,7 @@ export namespace google { interface IUInt64Value { /** UInt64Value value */ - value?: (number|string|null); + value?: (number|Long|string|null); } /** Represents a UInt64Value. */ @@ -2585,7 +4956,56 @@ export namespace google { constructor(properties?: google.protobuf.IUInt64Value); /** UInt64Value value. */ - public value: (number|string); + public value: (number|Long|string); + + /** + * Creates a new UInt64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt64Value instance + */ + public static create(properties?: google.protobuf.IUInt64Value): google.protobuf.UInt64Value; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @param message UInt64Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UInt64Value message, length delimited. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @param message UInt64Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UInt64Value; + + /** + * Decodes a UInt64Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UInt64Value; + + /** + * Verifies a UInt64Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); /** * Creates a UInt64Value message from a plain object. Also converts values to their respective internal types. @@ -2635,6 +5055,55 @@ export namespace google { /** Int32Value value. */ public value: number; + /** + * Creates a new Int32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int32Value instance + */ + public static create(properties?: google.protobuf.IInt32Value): google.protobuf.Int32Value; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @param message Int32Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Int32Value message, length delimited. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @param message Int32Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Int32Value; + + /** + * Decodes an Int32Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Int32Value; + + /** + * Verifies an Int32Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + /** * Creates an Int32Value message from a plain object. Also converts values to their respective internal types. * @param object Plain object @@ -2683,6 +5152,55 @@ export namespace google { /** UInt32Value value. */ public value: number; + /** + * Creates a new UInt32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt32Value instance + */ + public static create(properties?: google.protobuf.IUInt32Value): google.protobuf.UInt32Value; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @param message UInt32Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UInt32Value message, length delimited. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @param message UInt32Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UInt32Value; + + /** + * Decodes a UInt32Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UInt32Value; + + /** + * Verifies a UInt32Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + /** * Creates a UInt32Value message from a plain object. Also converts values to their respective internal types. * @param object Plain object @@ -2731,6 +5249,55 @@ export namespace google { /** BoolValue value. */ public value: boolean; + /** + * Creates a new BoolValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BoolValue instance + */ + public static create(properties?: google.protobuf.IBoolValue): google.protobuf.BoolValue; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @param message BoolValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IBoolValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BoolValue message, length delimited. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @param message BoolValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IBoolValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.BoolValue; + + /** + * Decodes a BoolValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.BoolValue; + + /** + * Verifies a BoolValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + /** * Creates a BoolValue message from a plain object. Also converts values to their respective internal types. * @param object Plain object @@ -2780,30 +5347,79 @@ export namespace google { public value: string; /** - * Creates a StringValue message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns StringValue + * Creates a new StringValue instance using the specified properties. + * @param [properties] Properties to set + * @returns StringValue instance */ - public static fromObject(object: { [k: string]: any }): google.protobuf.StringValue; + public static create(properties?: google.protobuf.IStringValue): google.protobuf.StringValue; /** - * Creates a plain object from a StringValue message. Also converts values to other types if specified. - * @param message StringValue - * @param [options] Conversion options - * @returns Plain object + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @param message StringValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public static toObject(message: google.protobuf.StringValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static encode(message: google.protobuf.IStringValue, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Converts this StringValue to JSON. - * @returns JSON object + * Encodes the specified StringValue message, length delimited. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @param message StringValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public toJSON(): { [k: string]: any }; + public static encodeDelimited(message: google.protobuf.IStringValue, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Gets the default type url for StringValue - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url + * Decodes a StringValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.StringValue; + + /** + * Decodes a StringValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.StringValue; + + /** + * Verifies a StringValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StringValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StringValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.StringValue; + + /** + * Creates a plain object from a StringValue message. Also converts values to other types if specified. + * @param message StringValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.StringValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StringValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StringValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } @@ -2812,7 +5428,7 @@ export namespace google { interface IBytesValue { /** BytesValue value */ - value?: (Uint8Array|null); + value?: (Uint8Array|string|null); } /** Represents a BytesValue. */ @@ -2825,7 +5441,56 @@ export namespace google { constructor(properties?: google.protobuf.IBytesValue); /** BytesValue value. */ - public value: Uint8Array; + public value: (Uint8Array|string); + + /** + * Creates a new BytesValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BytesValue instance + */ + public static create(properties?: google.protobuf.IBytesValue): google.protobuf.BytesValue; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @param message BytesValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IBytesValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BytesValue message, length delimited. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @param message BytesValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IBytesValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.BytesValue; + + /** + * Decodes a BytesValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.BytesValue; + + /** + * Verifies a BytesValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); /** * Creates a BytesValue message from a plain object. Also converts values to their respective internal types. @@ -2856,156 +5521,194 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of an Any. */ - interface IAny { - - /** Any type_url */ - type_url?: (string|null); - - /** Any value */ - value?: (Uint8Array|null); + /** Properties of an Empty. */ + interface IEmpty { } - /** Represents an Any. */ - class Any implements IAny { + /** Represents an Empty. */ + class Empty implements IEmpty { /** - * Constructs a new Any. + * Constructs a new Empty. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.IAny); - - /** Any type_url. */ - public type_url: string; - - /** Any value. */ - public value: Uint8Array; + constructor(properties?: google.protobuf.IEmpty); /** - * Creates an Any message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Any + * Creates a new Empty instance using the specified properties. + * @param [properties] Properties to set + * @returns Empty instance */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Any; + public static create(properties?: google.protobuf.IEmpty): google.protobuf.Empty; /** - * Creates a plain object from an Any message. Also converts values to other types if specified. - * @param message Any - * @param [options] Conversion options - * @returns Plain object + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public static toObject(message: google.protobuf.Any, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static encode(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Converts this Any to JSON. - * @returns JSON object + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public toJSON(): { [k: string]: any }; + public static encodeDelimited(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Gets the default type url for Any - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url + * Decodes an Empty message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a FieldMask. */ - interface IFieldMask { - - /** FieldMask paths */ - paths?: (string[]|null); - } - - /** Represents a FieldMask. */ - class FieldMask implements IFieldMask { + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Empty; /** - * Constructs a new FieldMask. - * @param [properties] Properties to set + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - constructor(properties?: google.protobuf.IFieldMask); + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Empty; - /** FieldMask paths. */ - public paths: string[]; + /** + * Verifies an Empty message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. + * Creates an Empty message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns FieldMask + * @returns Empty */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FieldMask; + public static fromObject(object: { [k: string]: any }): google.protobuf.Empty; /** - * Creates a plain object from a FieldMask message. Also converts values to other types if specified. - * @param message FieldMask + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @param message Empty * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.protobuf.FieldMask, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.Empty, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this FieldMask to JSON. + * Converts this Empty to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for FieldMask + * Gets the default type url for Empty * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a Duration. */ - interface IDuration { + /** Properties of an Any. */ + interface IAny { - /** Duration seconds */ - seconds?: (number|string|null); + /** Any type_url */ + type_url?: (string|null); - /** Duration nanos */ - nanos?: (number|null); + /** Any value */ + value?: (Uint8Array|string|null); } - /** Represents a Duration. */ - class Duration implements IDuration { + /** Represents an Any. */ + class Any implements IAny { /** - * Constructs a new Duration. + * Constructs a new Any. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.IDuration); + constructor(properties?: google.protobuf.IAny); - /** Duration seconds. */ - public seconds: (number|string); + /** Any type_url. */ + public type_url: string; - /** Duration nanos. */ - public nanos: number; + /** Any value. */ + public value: (Uint8Array|string); /** - * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * Creates a new Any instance using the specified properties. + * @param [properties] Properties to set + * @returns Any instance + */ + public static create(properties?: google.protobuf.IAny): google.protobuf.Any; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Any message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Any; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Any; + + /** + * Verifies an Any message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Duration + * @returns Any */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Duration; + public static fromObject(object: { [k: string]: any }): google.protobuf.Any; /** - * Creates a plain object from a Duration message. Also converts values to other types if specified. - * @param message Duration + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @param message Any * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.protobuf.Duration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.Any, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Duration to JSON. + * Converts this Any to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for Duration + * Gets the default type url for Any * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ @@ -3038,6 +5741,55 @@ export namespace google { /** AggregationResult aggregateFields. */ public aggregateFields: { [k: string]: google.firestore.v1.IValue }; + /** + * Creates a new AggregationResult instance using the specified properties. + * @param [properties] Properties to set + * @returns AggregationResult instance + */ + public static create(properties?: google.firestore.v1.IAggregationResult): google.firestore.v1.AggregationResult; + + /** + * Encodes the specified AggregationResult message. Does not implicitly {@link google.firestore.v1.AggregationResult.verify|verify} messages. + * @param message AggregationResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.firestore.v1.IAggregationResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AggregationResult message, length delimited. Does not implicitly {@link google.firestore.v1.AggregationResult.verify|verify} messages. + * @param message AggregationResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.firestore.v1.IAggregationResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AggregationResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AggregationResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.firestore.v1.AggregationResult; + + /** + * Decodes an AggregationResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AggregationResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.firestore.v1.AggregationResult; + + /** + * Verifies an AggregationResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + /** * Creates an AggregationResult message from a plain object. Also converts values to their respective internal types. * @param object Plain object @@ -3067,651 +5819,1190 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a BitSequence. */ - interface IBitSequence { + /** Properties of a Document. */ + interface IDocument { - /** BitSequence bitmap */ - bitmap?: (Uint8Array|null); + /** Document name */ + name?: (string|null); - /** BitSequence padding */ - padding?: (number|null); + /** Document fields */ + fields?: ({ [k: string]: google.firestore.v1.IValue }|null); + + /** Document createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Document updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); } - /** Represents a BitSequence. */ - class BitSequence implements IBitSequence { + /** Represents a Document. */ + class Document implements IDocument { /** - * Constructs a new BitSequence. + * Constructs a new Document. * @param [properties] Properties to set */ - constructor(properties?: google.firestore.v1.IBitSequence); + constructor(properties?: google.firestore.v1.IDocument); - /** BitSequence bitmap. */ - public bitmap: Uint8Array; + /** Document name. */ + public name: string; - /** BitSequence padding. */ - public padding: number; + /** Document fields. */ + public fields: { [k: string]: google.firestore.v1.IValue }; + + /** Document createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Document updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); /** - * Creates a BitSequence message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BitSequence + * Creates a new Document instance using the specified properties. + * @param [properties] Properties to set + * @returns Document instance */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1.BitSequence; + public static create(properties?: google.firestore.v1.IDocument): google.firestore.v1.Document; /** - * Creates a plain object from a BitSequence message. Also converts values to other types if specified. - * @param message BitSequence - * @param [options] Conversion options - * @returns Plain object + * Encodes the specified Document message. Does not implicitly {@link google.firestore.v1.Document.verify|verify} messages. + * @param message Document message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public static toObject(message: google.firestore.v1.BitSequence, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static encode(message: google.firestore.v1.IDocument, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Converts this BitSequence to JSON. - * @returns JSON object + * Encodes the specified Document message, length delimited. Does not implicitly {@link google.firestore.v1.Document.verify|verify} messages. + * @param message Document message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public toJSON(): { [k: string]: any }; + public static encodeDelimited(message: google.firestore.v1.IDocument, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Gets the default type url for BitSequence - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url + * Decodes a Document message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Document + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a BloomFilter. */ - interface IBloomFilter { - - /** BloomFilter bits */ - bits?: (google.firestore.v1.IBitSequence|null); - - /** BloomFilter hashCount */ - hashCount?: (number|null); - } - - /** Represents a BloomFilter. */ - class BloomFilter implements IBloomFilter { + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.firestore.v1.Document; /** - * Constructs a new BloomFilter. - * @param [properties] Properties to set + * Decodes a Document message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Document + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - constructor(properties?: google.firestore.v1.IBloomFilter); - - /** BloomFilter bits. */ - public bits?: (google.firestore.v1.IBitSequence|null); + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.firestore.v1.Document; - /** BloomFilter hashCount. */ - public hashCount: number; + /** + * Verifies a Document message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a BloomFilter message from a plain object. Also converts values to their respective internal types. + * Creates a Document message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns BloomFilter + * @returns Document */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1.BloomFilter; + public static fromObject(object: { [k: string]: any }): google.firestore.v1.Document; /** - * Creates a plain object from a BloomFilter message. Also converts values to other types if specified. - * @param message BloomFilter + * Creates a plain object from a Document message. Also converts values to other types if specified. + * @param message Document * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.firestore.v1.BloomFilter, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.firestore.v1.Document, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this BloomFilter to JSON. + * Converts this Document to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for BloomFilter + * Gets the default type url for Document * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a DocumentMask. */ - interface IDocumentMask { + /** Properties of a Value. */ + interface IValue { - /** DocumentMask fieldPaths */ - fieldPaths?: (string[]|null); + /** Value nullValue */ + nullValue?: (google.protobuf.NullValue|keyof typeof google.protobuf.NullValue|null); + + /** Value booleanValue */ + booleanValue?: (boolean|null); + + /** Value integerValue */ + integerValue?: (number|Long|string|null); + + /** Value doubleValue */ + doubleValue?: (number|null); + + /** Value timestampValue */ + timestampValue?: (google.protobuf.ITimestamp|null); + + /** Value stringValue */ + stringValue?: (string|null); + + /** Value bytesValue */ + bytesValue?: (Uint8Array|string|null); + + /** Value referenceValue */ + referenceValue?: (string|null); + + /** Value geoPointValue */ + geoPointValue?: (google.type.ILatLng|null); + + /** Value arrayValue */ + arrayValue?: (google.firestore.v1.IArrayValue|null); + + /** Value mapValue */ + mapValue?: (google.firestore.v1.IMapValue|null); } - /** Represents a DocumentMask. */ - class DocumentMask implements IDocumentMask { + /** Represents a Value. */ + class Value implements IValue { /** - * Constructs a new DocumentMask. + * Constructs a new Value. * @param [properties] Properties to set */ - constructor(properties?: google.firestore.v1.IDocumentMask); + constructor(properties?: google.firestore.v1.IValue); - /** DocumentMask fieldPaths. */ - public fieldPaths: string[]; + /** Value nullValue. */ + public nullValue?: (google.protobuf.NullValue|keyof typeof google.protobuf.NullValue|null); + + /** Value booleanValue. */ + public booleanValue?: (boolean|null); + + /** Value integerValue. */ + public integerValue?: (number|Long|string|null); + + /** Value doubleValue. */ + public doubleValue?: (number|null); + + /** Value timestampValue. */ + public timestampValue?: (google.protobuf.ITimestamp|null); + + /** Value stringValue. */ + public stringValue?: (string|null); + + /** Value bytesValue. */ + public bytesValue?: (Uint8Array|string|null); + + /** Value referenceValue. */ + public referenceValue?: (string|null); + + /** Value geoPointValue. */ + public geoPointValue?: (google.type.ILatLng|null); + + /** Value arrayValue. */ + public arrayValue?: (google.firestore.v1.IArrayValue|null); + + /** Value mapValue. */ + public mapValue?: (google.firestore.v1.IMapValue|null); + + /** Value valueType. */ + public valueType?: ("nullValue"|"booleanValue"|"integerValue"|"doubleValue"|"timestampValue"|"stringValue"|"bytesValue"|"referenceValue"|"geoPointValue"|"arrayValue"|"mapValue"); /** - * Creates a DocumentMask message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DocumentMask + * Creates a new Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Value instance */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1.DocumentMask; + public static create(properties?: google.firestore.v1.IValue): google.firestore.v1.Value; /** - * Creates a plain object from a DocumentMask message. Also converts values to other types if specified. - * @param message DocumentMask - * @param [options] Conversion options - * @returns Plain object + * Encodes the specified Value message. Does not implicitly {@link google.firestore.v1.Value.verify|verify} messages. + * @param message Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public static toObject(message: google.firestore.v1.DocumentMask, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static encode(message: google.firestore.v1.IValue, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Converts this DocumentMask to JSON. - * @returns JSON object + * Encodes the specified Value message, length delimited. Does not implicitly {@link google.firestore.v1.Value.verify|verify} messages. + * @param message Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public toJSON(): { [k: string]: any }; + public static encodeDelimited(message: google.firestore.v1.IValue, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Gets the default type url for DocumentMask - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url + * Decodes a Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Precondition. */ - interface IPrecondition { - - /** Precondition exists */ - exists?: (boolean|null); - - /** Precondition updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents a Precondition. */ - class Precondition implements IPrecondition { + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.firestore.v1.Value; /** - * Constructs a new Precondition. - * @param [properties] Properties to set + * Decodes a Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - constructor(properties?: google.firestore.v1.IPrecondition); - - /** Precondition exists. */ - public exists?: (boolean|null); + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.firestore.v1.Value; - /** Precondition updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** Precondition conditionType. */ - public conditionType?: ("exists"|"updateTime"); + /** + * Verifies a Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a Precondition message from a plain object. Also converts values to their respective internal types. + * Creates a Value message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Precondition + * @returns Value */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1.Precondition; + public static fromObject(object: { [k: string]: any }): google.firestore.v1.Value; /** - * Creates a plain object from a Precondition message. Also converts values to other types if specified. - * @param message Precondition + * Creates a plain object from a Value message. Also converts values to other types if specified. + * @param message Value * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.firestore.v1.Precondition, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.firestore.v1.Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Precondition to JSON. + * Converts this Value to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for Precondition + * Gets the default type url for Value * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a TransactionOptions. */ - interface ITransactionOptions { - - /** TransactionOptions readOnly */ - readOnly?: (google.firestore.v1.TransactionOptions.IReadOnly|null); + /** Properties of an ArrayValue. */ + interface IArrayValue { - /** TransactionOptions readWrite */ - readWrite?: (google.firestore.v1.TransactionOptions.IReadWrite|null); + /** ArrayValue values */ + values?: (google.firestore.v1.IValue[]|null); } - /** Represents a TransactionOptions. */ - class TransactionOptions implements ITransactionOptions { + /** Represents an ArrayValue. */ + class ArrayValue implements IArrayValue { /** - * Constructs a new TransactionOptions. + * Constructs a new ArrayValue. * @param [properties] Properties to set */ - constructor(properties?: google.firestore.v1.ITransactionOptions); + constructor(properties?: google.firestore.v1.IArrayValue); - /** TransactionOptions readOnly. */ - public readOnly?: (google.firestore.v1.TransactionOptions.IReadOnly|null); + /** ArrayValue values. */ + public values: google.firestore.v1.IValue[]; - /** TransactionOptions readWrite. */ - public readWrite?: (google.firestore.v1.TransactionOptions.IReadWrite|null); + /** + * Creates a new ArrayValue instance using the specified properties. + * @param [properties] Properties to set + * @returns ArrayValue instance + */ + public static create(properties?: google.firestore.v1.IArrayValue): google.firestore.v1.ArrayValue; - /** TransactionOptions mode. */ - public mode?: ("readOnly"|"readWrite"); + /** + * Encodes the specified ArrayValue message. Does not implicitly {@link google.firestore.v1.ArrayValue.verify|verify} messages. + * @param message ArrayValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.firestore.v1.IArrayValue, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Creates a TransactionOptions message from a plain object. Also converts values to their respective internal types. + * Encodes the specified ArrayValue message, length delimited. Does not implicitly {@link google.firestore.v1.ArrayValue.verify|verify} messages. + * @param message ArrayValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.firestore.v1.IArrayValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ArrayValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ArrayValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.firestore.v1.ArrayValue; + + /** + * Decodes an ArrayValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ArrayValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.firestore.v1.ArrayValue; + + /** + * Verifies an ArrayValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ArrayValue message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns TransactionOptions + * @returns ArrayValue */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1.TransactionOptions; + public static fromObject(object: { [k: string]: any }): google.firestore.v1.ArrayValue; /** - * Creates a plain object from a TransactionOptions message. Also converts values to other types if specified. - * @param message TransactionOptions + * Creates a plain object from an ArrayValue message. Also converts values to other types if specified. + * @param message ArrayValue * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.firestore.v1.TransactionOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.firestore.v1.ArrayValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this TransactionOptions to JSON. + * Converts this ArrayValue to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for TransactionOptions + * Gets the default type url for ArrayValue * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - namespace TransactionOptions { + /** Properties of a MapValue. */ + interface IMapValue { - /** Properties of a ReadWrite. */ - interface IReadWrite { + /** MapValue fields */ + fields?: ({ [k: string]: google.firestore.v1.IValue }|null); + } - /** ReadWrite retryTransaction */ - retryTransaction?: (Uint8Array|null); - } + /** Represents a MapValue. */ + class MapValue implements IMapValue { - /** Represents a ReadWrite. */ - class ReadWrite implements IReadWrite { + /** + * Constructs a new MapValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.firestore.v1.IMapValue); - /** - * Constructs a new ReadWrite. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1.TransactionOptions.IReadWrite); + /** MapValue fields. */ + public fields: { [k: string]: google.firestore.v1.IValue }; - /** ReadWrite retryTransaction. */ - public retryTransaction: Uint8Array; + /** + * Creates a new MapValue instance using the specified properties. + * @param [properties] Properties to set + * @returns MapValue instance + */ + public static create(properties?: google.firestore.v1.IMapValue): google.firestore.v1.MapValue; - /** - * Creates a ReadWrite message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ReadWrite - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1.TransactionOptions.ReadWrite; + /** + * Encodes the specified MapValue message. Does not implicitly {@link google.firestore.v1.MapValue.verify|verify} messages. + * @param message MapValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.firestore.v1.IMapValue, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a plain object from a ReadWrite message. Also converts values to other types if specified. - * @param message ReadWrite - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1.TransactionOptions.ReadWrite, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Encodes the specified MapValue message, length delimited. Does not implicitly {@link google.firestore.v1.MapValue.verify|verify} messages. + * @param message MapValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.firestore.v1.IMapValue, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Converts this ReadWrite to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** + * Decodes a MapValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MapValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.firestore.v1.MapValue; - /** - * Gets the default type url for ReadWrite - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } + /** + * Decodes a MapValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MapValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.firestore.v1.MapValue; - /** Properties of a ReadOnly. */ - interface IReadOnly { + /** + * Verifies a MapValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** ReadOnly readTime */ - readTime?: (google.protobuf.ITimestamp|null); - } + /** + * Creates a MapValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MapValue + */ + public static fromObject(object: { [k: string]: any }): google.firestore.v1.MapValue; - /** Represents a ReadOnly. */ - class ReadOnly implements IReadOnly { + /** + * Creates a plain object from a MapValue message. Also converts values to other types if specified. + * @param message MapValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.firestore.v1.MapValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Constructs a new ReadOnly. - * @param [properties] Properties to set - */ - constructor(properties?: google.firestore.v1.TransactionOptions.IReadOnly); + /** + * Converts this MapValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** ReadOnly readTime. */ - public readTime?: (google.protobuf.ITimestamp|null); + /** + * Gets the default type url for MapValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } - /** ReadOnly consistencySelector. */ - public consistencySelector?: "readTime"; + /** Properties of a BitSequence. */ + interface IBitSequence { - /** - * Creates a ReadOnly message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ReadOnly - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1.TransactionOptions.ReadOnly; + /** BitSequence bitmap */ + bitmap?: (Uint8Array|string|null); - /** - * Creates a plain object from a ReadOnly message. Also converts values to other types if specified. - * @param message ReadOnly - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1.TransactionOptions.ReadOnly, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** BitSequence padding */ + padding?: (number|null); + } - /** - * Converts this ReadOnly to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** Represents a BitSequence. */ + class BitSequence implements IBitSequence { - /** - * Gets the default type url for ReadOnly - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } + /** + * Constructs a new BitSequence. + * @param [properties] Properties to set + */ + constructor(properties?: google.firestore.v1.IBitSequence); - /** Properties of a Document. */ - interface IDocument { + /** BitSequence bitmap. */ + public bitmap: (Uint8Array|string); - /** Document name */ - name?: (string|null); + /** BitSequence padding. */ + public padding: number; - /** Document fields */ - fields?: ({ [k: string]: google.firestore.v1.IValue }|null); + /** + * Creates a new BitSequence instance using the specified properties. + * @param [properties] Properties to set + * @returns BitSequence instance + */ + public static create(properties?: google.firestore.v1.IBitSequence): google.firestore.v1.BitSequence; - /** Document createTime */ - createTime?: (google.protobuf.ITimestamp|null); + /** + * Encodes the specified BitSequence message. Does not implicitly {@link google.firestore.v1.BitSequence.verify|verify} messages. + * @param message BitSequence message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.firestore.v1.IBitSequence, writer?: $protobuf.Writer): $protobuf.Writer; - /** Document updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); + /** + * Encodes the specified BitSequence message, length delimited. Does not implicitly {@link google.firestore.v1.BitSequence.verify|verify} messages. + * @param message BitSequence message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.firestore.v1.IBitSequence, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BitSequence message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BitSequence + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.firestore.v1.BitSequence; + + /** + * Decodes a BitSequence message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BitSequence + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.firestore.v1.BitSequence; + + /** + * Verifies a BitSequence message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BitSequence message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BitSequence + */ + public static fromObject(object: { [k: string]: any }): google.firestore.v1.BitSequence; + + /** + * Creates a plain object from a BitSequence message. Also converts values to other types if specified. + * @param message BitSequence + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.firestore.v1.BitSequence, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BitSequence to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BitSequence + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Represents a Document. */ - class Document implements IDocument { + /** Properties of a BloomFilter. */ + interface IBloomFilter { + + /** BloomFilter bits */ + bits?: (google.firestore.v1.IBitSequence|null); + + /** BloomFilter hashCount */ + hashCount?: (number|null); + } + + /** Represents a BloomFilter. */ + class BloomFilter implements IBloomFilter { /** - * Constructs a new Document. + * Constructs a new BloomFilter. * @param [properties] Properties to set */ - constructor(properties?: google.firestore.v1.IDocument); + constructor(properties?: google.firestore.v1.IBloomFilter); - /** Document name. */ - public name: string; + /** BloomFilter bits. */ + public bits?: (google.firestore.v1.IBitSequence|null); - /** Document fields. */ - public fields: { [k: string]: google.firestore.v1.IValue }; + /** BloomFilter hashCount. */ + public hashCount: number; - /** Document createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); + /** + * Creates a new BloomFilter instance using the specified properties. + * @param [properties] Properties to set + * @returns BloomFilter instance + */ + public static create(properties?: google.firestore.v1.IBloomFilter): google.firestore.v1.BloomFilter; - /** Document updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); + /** + * Encodes the specified BloomFilter message. Does not implicitly {@link google.firestore.v1.BloomFilter.verify|verify} messages. + * @param message BloomFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.firestore.v1.IBloomFilter, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Creates a Document message from a plain object. Also converts values to their respective internal types. + * Encodes the specified BloomFilter message, length delimited. Does not implicitly {@link google.firestore.v1.BloomFilter.verify|verify} messages. + * @param message BloomFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.firestore.v1.IBloomFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BloomFilter message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BloomFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.firestore.v1.BloomFilter; + + /** + * Decodes a BloomFilter message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BloomFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.firestore.v1.BloomFilter; + + /** + * Verifies a BloomFilter message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BloomFilter message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Document + * @returns BloomFilter */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1.Document; + public static fromObject(object: { [k: string]: any }): google.firestore.v1.BloomFilter; /** - * Creates a plain object from a Document message. Also converts values to other types if specified. - * @param message Document + * Creates a plain object from a BloomFilter message. Also converts values to other types if specified. + * @param message BloomFilter * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.firestore.v1.Document, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.firestore.v1.BloomFilter, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Document to JSON. + * Converts this BloomFilter to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for Document + * Gets the default type url for BloomFilter * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a Value. */ - interface IValue { + /** Properties of a DocumentMask. */ + interface IDocumentMask { - /** Value nullValue */ - nullValue?: (google.protobuf.NullValue|null); + /** DocumentMask fieldPaths */ + fieldPaths?: (string[]|null); + } - /** Value booleanValue */ - booleanValue?: (boolean|null); + /** Represents a DocumentMask. */ + class DocumentMask implements IDocumentMask { - /** Value integerValue */ - integerValue?: (number|string|null); + /** + * Constructs a new DocumentMask. + * @param [properties] Properties to set + */ + constructor(properties?: google.firestore.v1.IDocumentMask); - /** Value doubleValue */ - doubleValue?: (number|null); + /** DocumentMask fieldPaths. */ + public fieldPaths: string[]; - /** Value timestampValue */ - timestampValue?: (google.protobuf.ITimestamp|null); + /** + * Creates a new DocumentMask instance using the specified properties. + * @param [properties] Properties to set + * @returns DocumentMask instance + */ + public static create(properties?: google.firestore.v1.IDocumentMask): google.firestore.v1.DocumentMask; - /** Value stringValue */ - stringValue?: (string|null); + /** + * Encodes the specified DocumentMask message. Does not implicitly {@link google.firestore.v1.DocumentMask.verify|verify} messages. + * @param message DocumentMask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.firestore.v1.IDocumentMask, writer?: $protobuf.Writer): $protobuf.Writer; - /** Value bytesValue */ - bytesValue?: (Uint8Array|null); + /** + * Encodes the specified DocumentMask message, length delimited. Does not implicitly {@link google.firestore.v1.DocumentMask.verify|verify} messages. + * @param message DocumentMask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.firestore.v1.IDocumentMask, writer?: $protobuf.Writer): $protobuf.Writer; - /** Value referenceValue */ - referenceValue?: (string|null); + /** + * Decodes a DocumentMask message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DocumentMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.firestore.v1.DocumentMask; - /** Value geoPointValue */ - geoPointValue?: (google.type.ILatLng|null); + /** + * Decodes a DocumentMask message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DocumentMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.firestore.v1.DocumentMask; - /** Value arrayValue */ - arrayValue?: (google.firestore.v1.IArrayValue|null); + /** + * Verifies a DocumentMask message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** Value mapValue */ - mapValue?: (google.firestore.v1.IMapValue|null); - } + /** + * Creates a DocumentMask message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DocumentMask + */ + public static fromObject(object: { [k: string]: any }): google.firestore.v1.DocumentMask; - /** Represents a Value. */ - class Value implements IValue { + /** + * Creates a plain object from a DocumentMask message. Also converts values to other types if specified. + * @param message DocumentMask + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.firestore.v1.DocumentMask, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Constructs a new Value. - * @param [properties] Properties to set + * Converts this DocumentMask to JSON. + * @returns JSON object */ - constructor(properties?: google.firestore.v1.IValue); + public toJSON(): { [k: string]: any }; - /** Value nullValue. */ - public nullValue?: (google.protobuf.NullValue|null); + /** + * Gets the default type url for DocumentMask + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } - /** Value booleanValue. */ - public booleanValue?: (boolean|null); + /** Properties of a Precondition. */ + interface IPrecondition { - /** Value integerValue. */ - public integerValue?: (number|string|null); + /** Precondition exists */ + exists?: (boolean|null); - /** Value doubleValue. */ - public doubleValue?: (number|null); + /** Precondition updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + } - /** Value timestampValue. */ - public timestampValue?: (google.protobuf.ITimestamp|null); + /** Represents a Precondition. */ + class Precondition implements IPrecondition { - /** Value stringValue. */ - public stringValue?: (string|null); + /** + * Constructs a new Precondition. + * @param [properties] Properties to set + */ + constructor(properties?: google.firestore.v1.IPrecondition); - /** Value bytesValue. */ - public bytesValue?: (Uint8Array|null); + /** Precondition exists. */ + public exists?: (boolean|null); - /** Value referenceValue. */ - public referenceValue?: (string|null); + /** Precondition updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); - /** Value geoPointValue. */ - public geoPointValue?: (google.type.ILatLng|null); + /** Precondition conditionType. */ + public conditionType?: ("exists"|"updateTime"); - /** Value arrayValue. */ - public arrayValue?: (google.firestore.v1.IArrayValue|null); + /** + * Creates a new Precondition instance using the specified properties. + * @param [properties] Properties to set + * @returns Precondition instance + */ + public static create(properties?: google.firestore.v1.IPrecondition): google.firestore.v1.Precondition; - /** Value mapValue. */ - public mapValue?: (google.firestore.v1.IMapValue|null); + /** + * Encodes the specified Precondition message. Does not implicitly {@link google.firestore.v1.Precondition.verify|verify} messages. + * @param message Precondition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.firestore.v1.IPrecondition, writer?: $protobuf.Writer): $protobuf.Writer; - /** Value valueType. */ - public valueType?: ("nullValue"|"booleanValue"|"integerValue"|"doubleValue"|"timestampValue"|"stringValue"|"bytesValue"|"referenceValue"|"geoPointValue"|"arrayValue"|"mapValue"); + /** + * Encodes the specified Precondition message, length delimited. Does not implicitly {@link google.firestore.v1.Precondition.verify|verify} messages. + * @param message Precondition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.firestore.v1.IPrecondition, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Creates a Value message from a plain object. Also converts values to their respective internal types. + * Decodes a Precondition message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Precondition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.firestore.v1.Precondition; + + /** + * Decodes a Precondition message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Precondition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.firestore.v1.Precondition; + + /** + * Verifies a Precondition message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Precondition message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Value + * @returns Precondition */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1.Value; + public static fromObject(object: { [k: string]: any }): google.firestore.v1.Precondition; /** - * Creates a plain object from a Value message. Also converts values to other types if specified. - * @param message Value + * Creates a plain object from a Precondition message. Also converts values to other types if specified. + * @param message Precondition * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.firestore.v1.Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.firestore.v1.Precondition, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Value to JSON. + * Converts this Precondition to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for Value + * Gets the default type url for Precondition * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of an ArrayValue. */ - interface IArrayValue { + /** Properties of a TransactionOptions. */ + interface ITransactionOptions { - /** ArrayValue values */ - values?: (google.firestore.v1.IValue[]|null); + /** TransactionOptions readOnly */ + readOnly?: (google.firestore.v1.TransactionOptions.IReadOnly|null); + + /** TransactionOptions readWrite */ + readWrite?: (google.firestore.v1.TransactionOptions.IReadWrite|null); } - /** Represents an ArrayValue. */ - class ArrayValue implements IArrayValue { + /** Represents a TransactionOptions. */ + class TransactionOptions implements ITransactionOptions { /** - * Constructs a new ArrayValue. + * Constructs a new TransactionOptions. * @param [properties] Properties to set */ - constructor(properties?: google.firestore.v1.IArrayValue); + constructor(properties?: google.firestore.v1.ITransactionOptions); - /** ArrayValue values. */ - public values: google.firestore.v1.IValue[]; + /** TransactionOptions readOnly. */ + public readOnly?: (google.firestore.v1.TransactionOptions.IReadOnly|null); + + /** TransactionOptions readWrite. */ + public readWrite?: (google.firestore.v1.TransactionOptions.IReadWrite|null); + + /** TransactionOptions mode. */ + public mode?: ("readOnly"|"readWrite"); /** - * Creates an ArrayValue message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ArrayValue + * Creates a new TransactionOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionOptions instance */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1.ArrayValue; + public static create(properties?: google.firestore.v1.ITransactionOptions): google.firestore.v1.TransactionOptions; /** - * Creates a plain object from an ArrayValue message. Also converts values to other types if specified. - * @param message ArrayValue - * @param [options] Conversion options - * @returns Plain object + * Encodes the specified TransactionOptions message. Does not implicitly {@link google.firestore.v1.TransactionOptions.verify|verify} messages. + * @param message TransactionOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public static toObject(message: google.firestore.v1.ArrayValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static encode(message: google.firestore.v1.ITransactionOptions, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Converts this ArrayValue to JSON. - * @returns JSON object + * Encodes the specified TransactionOptions message, length delimited. Does not implicitly {@link google.firestore.v1.TransactionOptions.verify|verify} messages. + * @param message TransactionOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public toJSON(): { [k: string]: any }; + public static encodeDelimited(message: google.firestore.v1.ITransactionOptions, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Gets the default type url for ArrayValue - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url + * Decodes a TransactionOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TransactionOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a MapValue. */ - interface IMapValue { - - /** MapValue fields */ - fields?: ({ [k: string]: google.firestore.v1.IValue }|null); - } - - /** Represents a MapValue. */ - class MapValue implements IMapValue { + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.firestore.v1.TransactionOptions; /** - * Constructs a new MapValue. - * @param [properties] Properties to set + * Decodes a TransactionOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TransactionOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - constructor(properties?: google.firestore.v1.IMapValue); + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.firestore.v1.TransactionOptions; - /** MapValue fields. */ - public fields: { [k: string]: google.firestore.v1.IValue }; + /** + * Verifies a TransactionOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a MapValue message from a plain object. Also converts values to their respective internal types. + * Creates a TransactionOptions message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns MapValue + * @returns TransactionOptions */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1.MapValue; + public static fromObject(object: { [k: string]: any }): google.firestore.v1.TransactionOptions; /** - * Creates a plain object from a MapValue message. Also converts values to other types if specified. - * @param message MapValue + * Creates a plain object from a TransactionOptions message. Also converts values to other types if specified. + * @param message TransactionOptions * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.firestore.v1.MapValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.firestore.v1.TransactionOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this MapValue to JSON. + * Converts this TransactionOptions to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for MapValue + * Gets the default type url for TransactionOptions * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } + namespace TransactionOptions { + + /** Properties of a ReadWrite. */ + interface IReadWrite { + + /** ReadWrite retryTransaction */ + retryTransaction?: (Uint8Array|string|null); + } + + /** Represents a ReadWrite. */ + class ReadWrite implements IReadWrite { + + /** + * Constructs a new ReadWrite. + * @param [properties] Properties to set + */ + constructor(properties?: google.firestore.v1.TransactionOptions.IReadWrite); + + /** ReadWrite retryTransaction. */ + public retryTransaction: (Uint8Array|string); + + /** + * Creates a new ReadWrite instance using the specified properties. + * @param [properties] Properties to set + * @returns ReadWrite instance + */ + public static create(properties?: google.firestore.v1.TransactionOptions.IReadWrite): google.firestore.v1.TransactionOptions.ReadWrite; + + /** + * Encodes the specified ReadWrite message. Does not implicitly {@link google.firestore.v1.TransactionOptions.ReadWrite.verify|verify} messages. + * @param message ReadWrite message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.firestore.v1.TransactionOptions.IReadWrite, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReadWrite message, length delimited. Does not implicitly {@link google.firestore.v1.TransactionOptions.ReadWrite.verify|verify} messages. + * @param message ReadWrite message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.firestore.v1.TransactionOptions.IReadWrite, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReadWrite message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReadWrite + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.firestore.v1.TransactionOptions.ReadWrite; + + /** + * Decodes a ReadWrite message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReadWrite + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.firestore.v1.TransactionOptions.ReadWrite; + + /** + * Verifies a ReadWrite message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReadWrite message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReadWrite + */ + public static fromObject(object: { [k: string]: any }): google.firestore.v1.TransactionOptions.ReadWrite; + + /** + * Creates a plain object from a ReadWrite message. Also converts values to other types if specified. + * @param message ReadWrite + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.firestore.v1.TransactionOptions.ReadWrite, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReadWrite to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReadWrite + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReadOnly. */ + interface IReadOnly { + + /** ReadOnly readTime */ + readTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a ReadOnly. */ + class ReadOnly implements IReadOnly { + + /** + * Constructs a new ReadOnly. + * @param [properties] Properties to set + */ + constructor(properties?: google.firestore.v1.TransactionOptions.IReadOnly); + + /** ReadOnly readTime. */ + public readTime?: (google.protobuf.ITimestamp|null); + + /** ReadOnly consistencySelector. */ + public consistencySelector?: "readTime"; + + /** + * Creates a new ReadOnly instance using the specified properties. + * @param [properties] Properties to set + * @returns ReadOnly instance + */ + public static create(properties?: google.firestore.v1.TransactionOptions.IReadOnly): google.firestore.v1.TransactionOptions.ReadOnly; + + /** + * Encodes the specified ReadOnly message. Does not implicitly {@link google.firestore.v1.TransactionOptions.ReadOnly.verify|verify} messages. + * @param message ReadOnly message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.firestore.v1.TransactionOptions.IReadOnly, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReadOnly message, length delimited. Does not implicitly {@link google.firestore.v1.TransactionOptions.ReadOnly.verify|verify} messages. + * @param message ReadOnly message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.firestore.v1.TransactionOptions.IReadOnly, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReadOnly message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReadOnly + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.firestore.v1.TransactionOptions.ReadOnly; + + /** + * Decodes a ReadOnly message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReadOnly + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.firestore.v1.TransactionOptions.ReadOnly; + + /** + * Verifies a ReadOnly message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReadOnly message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReadOnly + */ + public static fromObject(object: { [k: string]: any }): google.firestore.v1.TransactionOptions.ReadOnly; + + /** + * Creates a plain object from a ReadOnly message. Also converts values to other types if specified. + * @param message ReadOnly + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.firestore.v1.TransactionOptions.ReadOnly, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReadOnly to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReadOnly + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + /** Represents a Firestore */ class Firestore extends $protobuf.rpc.Service { @@ -3723,6 +7014,15 @@ export namespace google { */ constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + /** + * Creates new Firestore service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Firestore; + /** * Calls GetDocument. * @param request GetDocumentRequest message or plain object @@ -3951,112 +7251,112 @@ export namespace google { namespace Firestore { /** - * Callback as used by {@link google.firestore.v1.Firestore#getDocument}. + * Callback as used by {@link google.firestore.v1.Firestore|getDocument}. * @param error Error, if any * @param [response] Document */ type GetDocumentCallback = (error: (Error|null), response?: google.firestore.v1.Document) => void; /** - * Callback as used by {@link google.firestore.v1.Firestore#listDocuments}. + * Callback as used by {@link google.firestore.v1.Firestore|listDocuments}. * @param error Error, if any * @param [response] ListDocumentsResponse */ type ListDocumentsCallback = (error: (Error|null), response?: google.firestore.v1.ListDocumentsResponse) => void; /** - * Callback as used by {@link google.firestore.v1.Firestore#updateDocument}. + * Callback as used by {@link google.firestore.v1.Firestore|updateDocument}. * @param error Error, if any * @param [response] Document */ type UpdateDocumentCallback = (error: (Error|null), response?: google.firestore.v1.Document) => void; /** - * Callback as used by {@link google.firestore.v1.Firestore#deleteDocument}. + * Callback as used by {@link google.firestore.v1.Firestore|deleteDocument}. * @param error Error, if any * @param [response] Empty */ type DeleteDocumentCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; /** - * Callback as used by {@link google.firestore.v1.Firestore#batchGetDocuments}. + * Callback as used by {@link google.firestore.v1.Firestore|batchGetDocuments}. * @param error Error, if any * @param [response] BatchGetDocumentsResponse */ type BatchGetDocumentsCallback = (error: (Error|null), response?: google.firestore.v1.BatchGetDocumentsResponse) => void; /** - * Callback as used by {@link google.firestore.v1.Firestore#beginTransaction}. + * Callback as used by {@link google.firestore.v1.Firestore|beginTransaction}. * @param error Error, if any * @param [response] BeginTransactionResponse */ type BeginTransactionCallback = (error: (Error|null), response?: google.firestore.v1.BeginTransactionResponse) => void; /** - * Callback as used by {@link google.firestore.v1.Firestore#commit}. + * Callback as used by {@link google.firestore.v1.Firestore|commit}. * @param error Error, if any * @param [response] CommitResponse */ type CommitCallback = (error: (Error|null), response?: google.firestore.v1.CommitResponse) => void; /** - * Callback as used by {@link google.firestore.v1.Firestore#rollback}. + * Callback as used by {@link google.firestore.v1.Firestore|rollback}. * @param error Error, if any * @param [response] Empty */ type RollbackCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; /** - * Callback as used by {@link google.firestore.v1.Firestore#runQuery}. + * Callback as used by {@link google.firestore.v1.Firestore|runQuery}. * @param error Error, if any * @param [response] RunQueryResponse */ type RunQueryCallback = (error: (Error|null), response?: google.firestore.v1.RunQueryResponse) => void; /** - * Callback as used by {@link google.firestore.v1.Firestore#runAggregationQuery}. + * Callback as used by {@link google.firestore.v1.Firestore|runAggregationQuery}. * @param error Error, if any * @param [response] RunAggregationQueryResponse */ type RunAggregationQueryCallback = (error: (Error|null), response?: google.firestore.v1.RunAggregationQueryResponse) => void; /** - * Callback as used by {@link google.firestore.v1.Firestore#partitionQuery}. + * Callback as used by {@link google.firestore.v1.Firestore|partitionQuery}. * @param error Error, if any * @param [response] PartitionQueryResponse */ type PartitionQueryCallback = (error: (Error|null), response?: google.firestore.v1.PartitionQueryResponse) => void; /** - * Callback as used by {@link google.firestore.v1.Firestore#write}. + * Callback as used by {@link google.firestore.v1.Firestore|write}. * @param error Error, if any * @param [response] WriteResponse */ type WriteCallback = (error: (Error|null), response?: google.firestore.v1.WriteResponse) => void; /** - * Callback as used by {@link google.firestore.v1.Firestore#listen}. + * Callback as used by {@link google.firestore.v1.Firestore|listen}. * @param error Error, if any * @param [response] ListenResponse */ type ListenCallback = (error: (Error|null), response?: google.firestore.v1.ListenResponse) => void; /** - * Callback as used by {@link google.firestore.v1.Firestore#listCollectionIds}. + * Callback as used by {@link google.firestore.v1.Firestore|listCollectionIds}. * @param error Error, if any * @param [response] ListCollectionIdsResponse */ type ListCollectionIdsCallback = (error: (Error|null), response?: google.firestore.v1.ListCollectionIdsResponse) => void; /** - * Callback as used by {@link google.firestore.v1.Firestore#batchWrite}. + * Callback as used by {@link google.firestore.v1.Firestore|batchWrite}. * @param error Error, if any * @param [response] BatchWriteResponse */ type BatchWriteCallback = (error: (Error|null), response?: google.firestore.v1.BatchWriteResponse) => void; /** - * Callback as used by {@link google.firestore.v1.Firestore#createDocument}. + * Callback as used by {@link google.firestore.v1.Firestore|createDocument}. * @param error Error, if any * @param [response] Document */ @@ -4073,7 +7373,7 @@ export namespace google { mask?: (google.firestore.v1.IDocumentMask|null); /** GetDocumentRequest transaction */ - transaction?: (Uint8Array|null); + transaction?: (Uint8Array|string|null); /** GetDocumentRequest readTime */ readTime?: (google.protobuf.ITimestamp|null); @@ -4095,7 +7395,7 @@ export namespace google { public mask?: (google.firestore.v1.IDocumentMask|null); /** GetDocumentRequest transaction. */ - public transaction?: (Uint8Array|null); + public transaction?: (Uint8Array|string|null); /** GetDocumentRequest readTime. */ public readTime?: (google.protobuf.ITimestamp|null); @@ -4103,6 +7403,55 @@ export namespace google { /** GetDocumentRequest consistencySelector. */ public consistencySelector?: ("transaction"|"readTime"); + /** + * Creates a new GetDocumentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetDocumentRequest instance + */ + public static create(properties?: google.firestore.v1.IGetDocumentRequest): google.firestore.v1.GetDocumentRequest; + + /** + * Encodes the specified GetDocumentRequest message. Does not implicitly {@link google.firestore.v1.GetDocumentRequest.verify|verify} messages. + * @param message GetDocumentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.firestore.v1.IGetDocumentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetDocumentRequest message, length delimited. Does not implicitly {@link google.firestore.v1.GetDocumentRequest.verify|verify} messages. + * @param message GetDocumentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.firestore.v1.IGetDocumentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetDocumentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetDocumentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.firestore.v1.GetDocumentRequest; + + /** + * Decodes a GetDocumentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetDocumentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.firestore.v1.GetDocumentRequest; + + /** + * Verifies a GetDocumentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + /** * Creates a GetDocumentRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object @@ -4154,7 +7503,7 @@ export namespace google { mask?: (google.firestore.v1.IDocumentMask|null); /** ListDocumentsRequest transaction */ - transaction?: (Uint8Array|null); + transaction?: (Uint8Array|string|null); /** ListDocumentsRequest readTime */ readTime?: (google.protobuf.ITimestamp|null); @@ -4191,7 +7540,7 @@ export namespace google { public mask?: (google.firestore.v1.IDocumentMask|null); /** ListDocumentsRequest transaction. */ - public transaction?: (Uint8Array|null); + public transaction?: (Uint8Array|string|null); /** ListDocumentsRequest readTime. */ public readTime?: (google.protobuf.ITimestamp|null); @@ -4199,8 +7548,57 @@ export namespace google { /** ListDocumentsRequest showMissing. */ public showMissing: boolean; - /** ListDocumentsRequest consistencySelector. */ - public consistencySelector?: ("transaction"|"readTime"); + /** ListDocumentsRequest consistencySelector. */ + public consistencySelector?: ("transaction"|"readTime"); + + /** + * Creates a new ListDocumentsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListDocumentsRequest instance + */ + public static create(properties?: google.firestore.v1.IListDocumentsRequest): google.firestore.v1.ListDocumentsRequest; + + /** + * Encodes the specified ListDocumentsRequest message. Does not implicitly {@link google.firestore.v1.ListDocumentsRequest.verify|verify} messages. + * @param message ListDocumentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.firestore.v1.IListDocumentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListDocumentsRequest message, length delimited. Does not implicitly {@link google.firestore.v1.ListDocumentsRequest.verify|verify} messages. + * @param message ListDocumentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.firestore.v1.IListDocumentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListDocumentsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListDocumentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.firestore.v1.ListDocumentsRequest; + + /** + * Decodes a ListDocumentsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListDocumentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.firestore.v1.ListDocumentsRequest; + + /** + * Verifies a ListDocumentsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); /** * Creates a ListDocumentsRequest message from a plain object. Also converts values to their respective internal types. @@ -4256,6 +7654,55 @@ export namespace google { /** ListDocumentsResponse nextPageToken. */ public nextPageToken: string; + /** + * Creates a new ListDocumentsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListDocumentsResponse instance + */ + public static create(properties?: google.firestore.v1.IListDocumentsResponse): google.firestore.v1.ListDocumentsResponse; + + /** + * Encodes the specified ListDocumentsResponse message. Does not implicitly {@link google.firestore.v1.ListDocumentsResponse.verify|verify} messages. + * @param message ListDocumentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.firestore.v1.IListDocumentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListDocumentsResponse message, length delimited. Does not implicitly {@link google.firestore.v1.ListDocumentsResponse.verify|verify} messages. + * @param message ListDocumentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.firestore.v1.IListDocumentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListDocumentsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListDocumentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.firestore.v1.ListDocumentsResponse; + + /** + * Decodes a ListDocumentsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListDocumentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.firestore.v1.ListDocumentsResponse; + + /** + * Verifies a ListDocumentsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + /** * Creates a ListDocumentsResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object @@ -4328,6 +7775,55 @@ export namespace google { /** CreateDocumentRequest mask. */ public mask?: (google.firestore.v1.IDocumentMask|null); + /** + * Creates a new CreateDocumentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateDocumentRequest instance + */ + public static create(properties?: google.firestore.v1.ICreateDocumentRequest): google.firestore.v1.CreateDocumentRequest; + + /** + * Encodes the specified CreateDocumentRequest message. Does not implicitly {@link google.firestore.v1.CreateDocumentRequest.verify|verify} messages. + * @param message CreateDocumentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.firestore.v1.ICreateDocumentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateDocumentRequest message, length delimited. Does not implicitly {@link google.firestore.v1.CreateDocumentRequest.verify|verify} messages. + * @param message CreateDocumentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.firestore.v1.ICreateDocumentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateDocumentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateDocumentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.firestore.v1.CreateDocumentRequest; + + /** + * Decodes a CreateDocumentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateDocumentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.firestore.v1.CreateDocumentRequest; + + /** + * Verifies a CreateDocumentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + /** * Creates a CreateDocumentRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object @@ -4394,6 +7890,55 @@ export namespace google { /** UpdateDocumentRequest currentDocument. */ public currentDocument?: (google.firestore.v1.IPrecondition|null); + /** + * Creates a new UpdateDocumentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateDocumentRequest instance + */ + public static create(properties?: google.firestore.v1.IUpdateDocumentRequest): google.firestore.v1.UpdateDocumentRequest; + + /** + * Encodes the specified UpdateDocumentRequest message. Does not implicitly {@link google.firestore.v1.UpdateDocumentRequest.verify|verify} messages. + * @param message UpdateDocumentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.firestore.v1.IUpdateDocumentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateDocumentRequest message, length delimited. Does not implicitly {@link google.firestore.v1.UpdateDocumentRequest.verify|verify} messages. + * @param message UpdateDocumentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.firestore.v1.IUpdateDocumentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateDocumentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateDocumentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.firestore.v1.UpdateDocumentRequest; + + /** + * Decodes an UpdateDocumentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateDocumentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.firestore.v1.UpdateDocumentRequest; + + /** + * Verifies an UpdateDocumentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + /** * Creates an UpdateDocumentRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object @@ -4448,6 +7993,55 @@ export namespace google { /** DeleteDocumentRequest currentDocument. */ public currentDocument?: (google.firestore.v1.IPrecondition|null); + /** + * Creates a new DeleteDocumentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteDocumentRequest instance + */ + public static create(properties?: google.firestore.v1.IDeleteDocumentRequest): google.firestore.v1.DeleteDocumentRequest; + + /** + * Encodes the specified DeleteDocumentRequest message. Does not implicitly {@link google.firestore.v1.DeleteDocumentRequest.verify|verify} messages. + * @param message DeleteDocumentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.firestore.v1.IDeleteDocumentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteDocumentRequest message, length delimited. Does not implicitly {@link google.firestore.v1.DeleteDocumentRequest.verify|verify} messages. + * @param message DeleteDocumentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.firestore.v1.IDeleteDocumentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteDocumentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteDocumentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.firestore.v1.DeleteDocumentRequest; + + /** + * Decodes a DeleteDocumentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteDocumentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.firestore.v1.DeleteDocumentRequest; + + /** + * Verifies a DeleteDocumentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + /** * Creates a DeleteDocumentRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object @@ -4490,7 +8084,7 @@ export namespace google { mask?: (google.firestore.v1.IDocumentMask|null); /** BatchGetDocumentsRequest transaction */ - transaction?: (Uint8Array|null); + transaction?: (Uint8Array|string|null); /** BatchGetDocumentsRequest newTransaction */ newTransaction?: (google.firestore.v1.ITransactionOptions|null); @@ -4518,7 +8112,7 @@ export namespace google { public mask?: (google.firestore.v1.IDocumentMask|null); /** BatchGetDocumentsRequest transaction. */ - public transaction?: (Uint8Array|null); + public transaction?: (Uint8Array|string|null); /** BatchGetDocumentsRequest newTransaction. */ public newTransaction?: (google.firestore.v1.ITransactionOptions|null); @@ -4529,6 +8123,55 @@ export namespace google { /** BatchGetDocumentsRequest consistencySelector. */ public consistencySelector?: ("transaction"|"newTransaction"|"readTime"); + /** + * Creates a new BatchGetDocumentsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchGetDocumentsRequest instance + */ + public static create(properties?: google.firestore.v1.IBatchGetDocumentsRequest): google.firestore.v1.BatchGetDocumentsRequest; + + /** + * Encodes the specified BatchGetDocumentsRequest message. Does not implicitly {@link google.firestore.v1.BatchGetDocumentsRequest.verify|verify} messages. + * @param message BatchGetDocumentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.firestore.v1.IBatchGetDocumentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchGetDocumentsRequest message, length delimited. Does not implicitly {@link google.firestore.v1.BatchGetDocumentsRequest.verify|verify} messages. + * @param message BatchGetDocumentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.firestore.v1.IBatchGetDocumentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchGetDocumentsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchGetDocumentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.firestore.v1.BatchGetDocumentsRequest; + + /** + * Decodes a BatchGetDocumentsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchGetDocumentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.firestore.v1.BatchGetDocumentsRequest; + + /** + * Verifies a BatchGetDocumentsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + /** * Creates a BatchGetDocumentsRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object @@ -4568,7 +8211,7 @@ export namespace google { missing?: (string|null); /** BatchGetDocumentsResponse transaction */ - transaction?: (Uint8Array|null); + transaction?: (Uint8Array|string|null); /** BatchGetDocumentsResponse readTime */ readTime?: (google.protobuf.ITimestamp|null); @@ -4590,7 +8233,7 @@ export namespace google { public missing?: (string|null); /** BatchGetDocumentsResponse transaction. */ - public transaction: Uint8Array; + public transaction: (Uint8Array|string); /** BatchGetDocumentsResponse readTime. */ public readTime?: (google.protobuf.ITimestamp|null); @@ -4598,6 +8241,55 @@ export namespace google { /** BatchGetDocumentsResponse result. */ public result?: ("found"|"missing"); + /** + * Creates a new BatchGetDocumentsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchGetDocumentsResponse instance + */ + public static create(properties?: google.firestore.v1.IBatchGetDocumentsResponse): google.firestore.v1.BatchGetDocumentsResponse; + + /** + * Encodes the specified BatchGetDocumentsResponse message. Does not implicitly {@link google.firestore.v1.BatchGetDocumentsResponse.verify|verify} messages. + * @param message BatchGetDocumentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.firestore.v1.IBatchGetDocumentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchGetDocumentsResponse message, length delimited. Does not implicitly {@link google.firestore.v1.BatchGetDocumentsResponse.verify|verify} messages. + * @param message BatchGetDocumentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.firestore.v1.IBatchGetDocumentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchGetDocumentsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchGetDocumentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.firestore.v1.BatchGetDocumentsResponse; + + /** + * Decodes a BatchGetDocumentsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchGetDocumentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.firestore.v1.BatchGetDocumentsResponse; + + /** + * Verifies a BatchGetDocumentsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + /** * Creates a BatchGetDocumentsResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object @@ -4652,6 +8344,55 @@ export namespace google { /** BeginTransactionRequest options. */ public options?: (google.firestore.v1.ITransactionOptions|null); + /** + * Creates a new BeginTransactionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns BeginTransactionRequest instance + */ + public static create(properties?: google.firestore.v1.IBeginTransactionRequest): google.firestore.v1.BeginTransactionRequest; + + /** + * Encodes the specified BeginTransactionRequest message. Does not implicitly {@link google.firestore.v1.BeginTransactionRequest.verify|verify} messages. + * @param message BeginTransactionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.firestore.v1.IBeginTransactionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BeginTransactionRequest message, length delimited. Does not implicitly {@link google.firestore.v1.BeginTransactionRequest.verify|verify} messages. + * @param message BeginTransactionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.firestore.v1.IBeginTransactionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BeginTransactionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BeginTransactionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.firestore.v1.BeginTransactionRequest; + + /** + * Decodes a BeginTransactionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BeginTransactionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.firestore.v1.BeginTransactionRequest; + + /** + * Verifies a BeginTransactionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + /** * Creates a BeginTransactionRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object @@ -4685,7 +8426,7 @@ export namespace google { interface IBeginTransactionResponse { /** BeginTransactionResponse transaction */ - transaction?: (Uint8Array|null); + transaction?: (Uint8Array|string|null); } /** Represents a BeginTransactionResponse. */ @@ -4698,7 +8439,56 @@ export namespace google { constructor(properties?: google.firestore.v1.IBeginTransactionResponse); /** BeginTransactionResponse transaction. */ - public transaction: Uint8Array; + public transaction: (Uint8Array|string); + + /** + * Creates a new BeginTransactionResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns BeginTransactionResponse instance + */ + public static create(properties?: google.firestore.v1.IBeginTransactionResponse): google.firestore.v1.BeginTransactionResponse; + + /** + * Encodes the specified BeginTransactionResponse message. Does not implicitly {@link google.firestore.v1.BeginTransactionResponse.verify|verify} messages. + * @param message BeginTransactionResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.firestore.v1.IBeginTransactionResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BeginTransactionResponse message, length delimited. Does not implicitly {@link google.firestore.v1.BeginTransactionResponse.verify|verify} messages. + * @param message BeginTransactionResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.firestore.v1.IBeginTransactionResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BeginTransactionResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BeginTransactionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.firestore.v1.BeginTransactionResponse; + + /** + * Decodes a BeginTransactionResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BeginTransactionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.firestore.v1.BeginTransactionResponse; + + /** + * Verifies a BeginTransactionResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); /** * Creates a BeginTransactionResponse message from a plain object. Also converts values to their respective internal types. @@ -4739,7 +8529,7 @@ export namespace google { writes?: (google.firestore.v1.IWrite[]|null); /** CommitRequest transaction */ - transaction?: (Uint8Array|null); + transaction?: (Uint8Array|string|null); } /** Represents a CommitRequest. */ @@ -4758,7 +8548,56 @@ export namespace google { public writes: google.firestore.v1.IWrite[]; /** CommitRequest transaction. */ - public transaction: Uint8Array; + public transaction: (Uint8Array|string); + + /** + * Creates a new CommitRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CommitRequest instance + */ + public static create(properties?: google.firestore.v1.ICommitRequest): google.firestore.v1.CommitRequest; + + /** + * Encodes the specified CommitRequest message. Does not implicitly {@link google.firestore.v1.CommitRequest.verify|verify} messages. + * @param message CommitRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.firestore.v1.ICommitRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CommitRequest message, length delimited. Does not implicitly {@link google.firestore.v1.CommitRequest.verify|verify} messages. + * @param message CommitRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.firestore.v1.ICommitRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CommitRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CommitRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.firestore.v1.CommitRequest; + + /** + * Decodes a CommitRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CommitRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.firestore.v1.CommitRequest; + + /** + * Verifies a CommitRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); /** * Creates a CommitRequest message from a plain object. Also converts values to their respective internal types. @@ -4814,6 +8653,55 @@ export namespace google { /** CommitResponse commitTime. */ public commitTime?: (google.protobuf.ITimestamp|null); + /** + * Creates a new CommitResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns CommitResponse instance + */ + public static create(properties?: google.firestore.v1.ICommitResponse): google.firestore.v1.CommitResponse; + + /** + * Encodes the specified CommitResponse message. Does not implicitly {@link google.firestore.v1.CommitResponse.verify|verify} messages. + * @param message CommitResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.firestore.v1.ICommitResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CommitResponse message, length delimited. Does not implicitly {@link google.firestore.v1.CommitResponse.verify|verify} messages. + * @param message CommitResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.firestore.v1.ICommitResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CommitResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CommitResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.firestore.v1.CommitResponse; + + /** + * Decodes a CommitResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CommitResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.firestore.v1.CommitResponse; + + /** + * Verifies a CommitResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + /** * Creates a CommitResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object @@ -4850,7 +8738,7 @@ export namespace google { database?: (string|null); /** RollbackRequest transaction */ - transaction?: (Uint8Array|null); + transaction?: (Uint8Array|string|null); } /** Represents a RollbackRequest. */ @@ -4866,7 +8754,56 @@ export namespace google { public database: string; /** RollbackRequest transaction. */ - public transaction: Uint8Array; + public transaction: (Uint8Array|string); + + /** + * Creates a new RollbackRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RollbackRequest instance + */ + public static create(properties?: google.firestore.v1.IRollbackRequest): google.firestore.v1.RollbackRequest; + + /** + * Encodes the specified RollbackRequest message. Does not implicitly {@link google.firestore.v1.RollbackRequest.verify|verify} messages. + * @param message RollbackRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.firestore.v1.IRollbackRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RollbackRequest message, length delimited. Does not implicitly {@link google.firestore.v1.RollbackRequest.verify|verify} messages. + * @param message RollbackRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.firestore.v1.IRollbackRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RollbackRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RollbackRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.firestore.v1.RollbackRequest; + + /** + * Decodes a RollbackRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RollbackRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.firestore.v1.RollbackRequest; + + /** + * Verifies a RollbackRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); /** * Creates a RollbackRequest message from a plain object. Also converts values to their respective internal types. @@ -4907,7 +8844,7 @@ export namespace google { structuredQuery?: (google.firestore.v1.IStructuredQuery|null); /** RunQueryRequest transaction */ - transaction?: (Uint8Array|null); + transaction?: (Uint8Array|string|null); /** RunQueryRequest newTransaction */ newTransaction?: (google.firestore.v1.ITransactionOptions|null); @@ -4915,8 +8852,8 @@ export namespace google { /** RunQueryRequest readTime */ readTime?: (google.protobuf.ITimestamp|null); - /** RunQueryRequest mode */ - mode?: (google.firestore.v1.QueryMode|null); + /** RunQueryRequest explainOptions */ + explainOptions?: (google.firestore.v1.IExplainOptions|null); } /** Represents a RunQueryRequest. */ @@ -4935,7 +8872,7 @@ export namespace google { public structuredQuery?: (google.firestore.v1.IStructuredQuery|null); /** RunQueryRequest transaction. */ - public transaction?: (Uint8Array|null); + public transaction?: (Uint8Array|string|null); /** RunQueryRequest newTransaction. */ public newTransaction?: (google.firestore.v1.ITransactionOptions|null); @@ -4943,14 +8880,63 @@ export namespace google { /** RunQueryRequest readTime. */ public readTime?: (google.protobuf.ITimestamp|null); - /** RunQueryRequest mode. */ - public mode: google.firestore.v1.QueryMode; + /** RunQueryRequest explainOptions. */ + public explainOptions?: (google.firestore.v1.IExplainOptions|null); /** RunQueryRequest queryType. */ public queryType?: "structuredQuery"; - /** RunQueryRequest consistencySelector. */ - public consistencySelector?: ("transaction"|"newTransaction"|"readTime"); + /** RunQueryRequest consistencySelector. */ + public consistencySelector?: ("transaction"|"newTransaction"|"readTime"); + + /** + * Creates a new RunQueryRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RunQueryRequest instance + */ + public static create(properties?: google.firestore.v1.IRunQueryRequest): google.firestore.v1.RunQueryRequest; + + /** + * Encodes the specified RunQueryRequest message. Does not implicitly {@link google.firestore.v1.RunQueryRequest.verify|verify} messages. + * @param message RunQueryRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.firestore.v1.IRunQueryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RunQueryRequest message, length delimited. Does not implicitly {@link google.firestore.v1.RunQueryRequest.verify|verify} messages. + * @param message RunQueryRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.firestore.v1.IRunQueryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RunQueryRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RunQueryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.firestore.v1.RunQueryRequest; + + /** + * Decodes a RunQueryRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RunQueryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.firestore.v1.RunQueryRequest; + + /** + * Verifies a RunQueryRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); /** * Creates a RunQueryRequest message from a plain object. Also converts values to their respective internal types. @@ -4985,7 +8971,7 @@ export namespace google { interface IRunQueryResponse { /** RunQueryResponse transaction */ - transaction?: (Uint8Array|null); + transaction?: (Uint8Array|string|null); /** RunQueryResponse document */ document?: (google.firestore.v1.IDocument|null); @@ -4999,8 +8985,8 @@ export namespace google { /** RunQueryResponse done */ done?: (boolean|null); - /** RunQueryResponse stats */ - stats?: (google.firestore.v1.IResultSetStats|null); + /** RunQueryResponse explainMetrics */ + explainMetrics?: (google.firestore.v1.IExplainMetrics|null); } /** Represents a RunQueryResponse. */ @@ -5013,7 +8999,7 @@ export namespace google { constructor(properties?: google.firestore.v1.IRunQueryResponse); /** RunQueryResponse transaction. */ - public transaction: Uint8Array; + public transaction: (Uint8Array|string); /** RunQueryResponse document. */ public document?: (google.firestore.v1.IDocument|null); @@ -5027,12 +9013,61 @@ export namespace google { /** RunQueryResponse done. */ public done?: (boolean|null); - /** RunQueryResponse stats. */ - public stats?: (google.firestore.v1.IResultSetStats|null); + /** RunQueryResponse explainMetrics. */ + public explainMetrics?: (google.firestore.v1.IExplainMetrics|null); /** RunQueryResponse continuationSelector. */ public continuationSelector?: "done"; + /** + * Creates a new RunQueryResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns RunQueryResponse instance + */ + public static create(properties?: google.firestore.v1.IRunQueryResponse): google.firestore.v1.RunQueryResponse; + + /** + * Encodes the specified RunQueryResponse message. Does not implicitly {@link google.firestore.v1.RunQueryResponse.verify|verify} messages. + * @param message RunQueryResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.firestore.v1.IRunQueryResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RunQueryResponse message, length delimited. Does not implicitly {@link google.firestore.v1.RunQueryResponse.verify|verify} messages. + * @param message RunQueryResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.firestore.v1.IRunQueryResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RunQueryResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RunQueryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.firestore.v1.RunQueryResponse; + + /** + * Decodes a RunQueryResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RunQueryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.firestore.v1.RunQueryResponse; + + /** + * Verifies a RunQueryResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + /** * Creates a RunQueryResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object @@ -5072,7 +9107,7 @@ export namespace google { structuredAggregationQuery?: (google.firestore.v1.IStructuredAggregationQuery|null); /** RunAggregationQueryRequest transaction */ - transaction?: (Uint8Array|null); + transaction?: (Uint8Array|string|null); /** RunAggregationQueryRequest newTransaction */ newTransaction?: (google.firestore.v1.ITransactionOptions|null); @@ -5080,8 +9115,8 @@ export namespace google { /** RunAggregationQueryRequest readTime */ readTime?: (google.protobuf.ITimestamp|null); - /** RunAggregationQueryRequest mode */ - mode?: (google.firestore.v1.QueryMode|null); + /** RunAggregationQueryRequest explainOptions */ + explainOptions?: (google.firestore.v1.IExplainOptions|null); } /** Represents a RunAggregationQueryRequest. */ @@ -5100,7 +9135,7 @@ export namespace google { public structuredAggregationQuery?: (google.firestore.v1.IStructuredAggregationQuery|null); /** RunAggregationQueryRequest transaction. */ - public transaction?: (Uint8Array|null); + public transaction?: (Uint8Array|string|null); /** RunAggregationQueryRequest newTransaction. */ public newTransaction?: (google.firestore.v1.ITransactionOptions|null); @@ -5108,8 +9143,8 @@ export namespace google { /** RunAggregationQueryRequest readTime. */ public readTime?: (google.protobuf.ITimestamp|null); - /** RunAggregationQueryRequest mode. */ - public mode: google.firestore.v1.QueryMode; + /** RunAggregationQueryRequest explainOptions. */ + public explainOptions?: (google.firestore.v1.IExplainOptions|null); /** RunAggregationQueryRequest queryType. */ public queryType?: "structuredAggregationQuery"; @@ -5117,6 +9152,55 @@ export namespace google { /** RunAggregationQueryRequest consistencySelector. */ public consistencySelector?: ("transaction"|"newTransaction"|"readTime"); + /** + * Creates a new RunAggregationQueryRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RunAggregationQueryRequest instance + */ + public static create(properties?: google.firestore.v1.IRunAggregationQueryRequest): google.firestore.v1.RunAggregationQueryRequest; + + /** + * Encodes the specified RunAggregationQueryRequest message. Does not implicitly {@link google.firestore.v1.RunAggregationQueryRequest.verify|verify} messages. + * @param message RunAggregationQueryRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.firestore.v1.IRunAggregationQueryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RunAggregationQueryRequest message, length delimited. Does not implicitly {@link google.firestore.v1.RunAggregationQueryRequest.verify|verify} messages. + * @param message RunAggregationQueryRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.firestore.v1.IRunAggregationQueryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RunAggregationQueryRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RunAggregationQueryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.firestore.v1.RunAggregationQueryRequest; + + /** + * Decodes a RunAggregationQueryRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RunAggregationQueryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.firestore.v1.RunAggregationQueryRequest; + + /** + * Verifies a RunAggregationQueryRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + /** * Creates a RunAggregationQueryRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object @@ -5153,13 +9237,13 @@ export namespace google { result?: (google.firestore.v1.IAggregationResult|null); /** RunAggregationQueryResponse transaction */ - transaction?: (Uint8Array|null); + transaction?: (Uint8Array|string|null); /** RunAggregationQueryResponse readTime */ readTime?: (google.protobuf.ITimestamp|null); - /** RunAggregationQueryResponse stats */ - stats?: (google.firestore.v1.IResultSetStats|null); + /** RunAggregationQueryResponse explainMetrics */ + explainMetrics?: (google.firestore.v1.IExplainMetrics|null); } /** Represents a RunAggregationQueryResponse. */ @@ -5175,13 +9259,62 @@ export namespace google { public result?: (google.firestore.v1.IAggregationResult|null); /** RunAggregationQueryResponse transaction. */ - public transaction: Uint8Array; + public transaction: (Uint8Array|string); /** RunAggregationQueryResponse readTime. */ public readTime?: (google.protobuf.ITimestamp|null); - /** RunAggregationQueryResponse stats. */ - public stats?: (google.firestore.v1.IResultSetStats|null); + /** RunAggregationQueryResponse explainMetrics. */ + public explainMetrics?: (google.firestore.v1.IExplainMetrics|null); + + /** + * Creates a new RunAggregationQueryResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns RunAggregationQueryResponse instance + */ + public static create(properties?: google.firestore.v1.IRunAggregationQueryResponse): google.firestore.v1.RunAggregationQueryResponse; + + /** + * Encodes the specified RunAggregationQueryResponse message. Does not implicitly {@link google.firestore.v1.RunAggregationQueryResponse.verify|verify} messages. + * @param message RunAggregationQueryResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.firestore.v1.IRunAggregationQueryResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RunAggregationQueryResponse message, length delimited. Does not implicitly {@link google.firestore.v1.RunAggregationQueryResponse.verify|verify} messages. + * @param message RunAggregationQueryResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.firestore.v1.IRunAggregationQueryResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RunAggregationQueryResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RunAggregationQueryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.firestore.v1.RunAggregationQueryResponse; + + /** + * Decodes a RunAggregationQueryResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RunAggregationQueryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.firestore.v1.RunAggregationQueryResponse; + + /** + * Verifies a RunAggregationQueryResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); /** * Creates a RunAggregationQueryResponse message from a plain object. Also converts values to their respective internal types. @@ -5222,7 +9355,7 @@ export namespace google { structuredQuery?: (google.firestore.v1.IStructuredQuery|null); /** PartitionQueryRequest partitionCount */ - partitionCount?: (number|string|null); + partitionCount?: (number|Long|string|null); /** PartitionQueryRequest pageToken */ pageToken?: (string|null); @@ -5250,7 +9383,7 @@ export namespace google { public structuredQuery?: (google.firestore.v1.IStructuredQuery|null); /** PartitionQueryRequest partitionCount. */ - public partitionCount: (number|string); + public partitionCount: (number|Long|string); /** PartitionQueryRequest pageToken. */ public pageToken: string; @@ -5267,6 +9400,55 @@ export namespace google { /** PartitionQueryRequest consistencySelector. */ public consistencySelector?: "readTime"; + /** + * Creates a new PartitionQueryRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns PartitionQueryRequest instance + */ + public static create(properties?: google.firestore.v1.IPartitionQueryRequest): google.firestore.v1.PartitionQueryRequest; + + /** + * Encodes the specified PartitionQueryRequest message. Does not implicitly {@link google.firestore.v1.PartitionQueryRequest.verify|verify} messages. + * @param message PartitionQueryRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.firestore.v1.IPartitionQueryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PartitionQueryRequest message, length delimited. Does not implicitly {@link google.firestore.v1.PartitionQueryRequest.verify|verify} messages. + * @param message PartitionQueryRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.firestore.v1.IPartitionQueryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PartitionQueryRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PartitionQueryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.firestore.v1.PartitionQueryRequest; + + /** + * Decodes a PartitionQueryRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PartitionQueryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.firestore.v1.PartitionQueryRequest; + + /** + * Verifies a PartitionQueryRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + /** * Creates a PartitionQueryRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object @@ -5321,6 +9503,55 @@ export namespace google { /** PartitionQueryResponse nextPageToken. */ public nextPageToken: string; + /** + * Creates a new PartitionQueryResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns PartitionQueryResponse instance + */ + public static create(properties?: google.firestore.v1.IPartitionQueryResponse): google.firestore.v1.PartitionQueryResponse; + + /** + * Encodes the specified PartitionQueryResponse message. Does not implicitly {@link google.firestore.v1.PartitionQueryResponse.verify|verify} messages. + * @param message PartitionQueryResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.firestore.v1.IPartitionQueryResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PartitionQueryResponse message, length delimited. Does not implicitly {@link google.firestore.v1.PartitionQueryResponse.verify|verify} messages. + * @param message PartitionQueryResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.firestore.v1.IPartitionQueryResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PartitionQueryResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PartitionQueryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.firestore.v1.PartitionQueryResponse; + + /** + * Decodes a PartitionQueryResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PartitionQueryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.firestore.v1.PartitionQueryResponse; + + /** + * Verifies a PartitionQueryResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + /** * Creates a PartitionQueryResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object @@ -5363,7 +9594,7 @@ export namespace google { writes?: (google.firestore.v1.IWrite[]|null); /** WriteRequest streamToken */ - streamToken?: (Uint8Array|null); + streamToken?: (Uint8Array|string|null); /** WriteRequest labels */ labels?: ({ [k: string]: string }|null); @@ -5388,11 +9619,60 @@ export namespace google { public writes: google.firestore.v1.IWrite[]; /** WriteRequest streamToken. */ - public streamToken: Uint8Array; + public streamToken: (Uint8Array|string); /** WriteRequest labels. */ public labels: { [k: string]: string }; + /** + * Creates a new WriteRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns WriteRequest instance + */ + public static create(properties?: google.firestore.v1.IWriteRequest): google.firestore.v1.WriteRequest; + + /** + * Encodes the specified WriteRequest message. Does not implicitly {@link google.firestore.v1.WriteRequest.verify|verify} messages. + * @param message WriteRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.firestore.v1.IWriteRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WriteRequest message, length delimited. Does not implicitly {@link google.firestore.v1.WriteRequest.verify|verify} messages. + * @param message WriteRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.firestore.v1.IWriteRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WriteRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WriteRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.firestore.v1.WriteRequest; + + /** + * Decodes a WriteRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WriteRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.firestore.v1.WriteRequest; + + /** + * Verifies a WriteRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + /** * Creates a WriteRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object @@ -5429,7 +9709,7 @@ export namespace google { streamId?: (string|null); /** WriteResponse streamToken */ - streamToken?: (Uint8Array|null); + streamToken?: (Uint8Array|string|null); /** WriteResponse writeResults */ writeResults?: (google.firestore.v1.IWriteResult[]|null); @@ -5451,7 +9731,7 @@ export namespace google { public streamId: string; /** WriteResponse streamToken. */ - public streamToken: Uint8Array; + public streamToken: (Uint8Array|string); /** WriteResponse writeResults. */ public writeResults: google.firestore.v1.IWriteResult[]; @@ -5459,6 +9739,55 @@ export namespace google { /** WriteResponse commitTime. */ public commitTime?: (google.protobuf.ITimestamp|null); + /** + * Creates a new WriteResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns WriteResponse instance + */ + public static create(properties?: google.firestore.v1.IWriteResponse): google.firestore.v1.WriteResponse; + + /** + * Encodes the specified WriteResponse message. Does not implicitly {@link google.firestore.v1.WriteResponse.verify|verify} messages. + * @param message WriteResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.firestore.v1.IWriteResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WriteResponse message, length delimited. Does not implicitly {@link google.firestore.v1.WriteResponse.verify|verify} messages. + * @param message WriteResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.firestore.v1.IWriteResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WriteResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WriteResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.firestore.v1.WriteResponse; + + /** + * Decodes a WriteResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WriteResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.firestore.v1.WriteResponse; + + /** + * Verifies a WriteResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + /** * Creates a WriteResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object @@ -5528,6 +9857,55 @@ export namespace google { /** ListenRequest targetChange. */ public targetChange?: ("addTarget"|"removeTarget"); + /** + * Creates a new ListenRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListenRequest instance + */ + public static create(properties?: google.firestore.v1.IListenRequest): google.firestore.v1.ListenRequest; + + /** + * Encodes the specified ListenRequest message. Does not implicitly {@link google.firestore.v1.ListenRequest.verify|verify} messages. + * @param message ListenRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.firestore.v1.IListenRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListenRequest message, length delimited. Does not implicitly {@link google.firestore.v1.ListenRequest.verify|verify} messages. + * @param message ListenRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.firestore.v1.IListenRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListenRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListenRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.firestore.v1.ListenRequest; + + /** + * Decodes a ListenRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListenRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.firestore.v1.ListenRequest; + + /** + * Verifies a ListenRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + /** * Creates a ListenRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object @@ -5603,6 +9981,55 @@ export namespace google { /** ListenResponse responseType. */ public responseType?: ("targetChange"|"documentChange"|"documentDelete"|"documentRemove"|"filter"); + /** + * Creates a new ListenResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListenResponse instance + */ + public static create(properties?: google.firestore.v1.IListenResponse): google.firestore.v1.ListenResponse; + + /** + * Encodes the specified ListenResponse message. Does not implicitly {@link google.firestore.v1.ListenResponse.verify|verify} messages. + * @param message ListenResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.firestore.v1.IListenResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListenResponse message, length delimited. Does not implicitly {@link google.firestore.v1.ListenResponse.verify|verify} messages. + * @param message ListenResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.firestore.v1.IListenResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListenResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListenResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.firestore.v1.ListenResponse; + + /** + * Decodes a ListenResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListenResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.firestore.v1.ListenResponse; + + /** + * Verifies a ListenResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + /** * Creates a ListenResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object @@ -5642,7 +10069,7 @@ export namespace google { documents?: (google.firestore.v1.Target.IDocumentsTarget|null); /** Target resumeToken */ - resumeToken?: (Uint8Array|null); + resumeToken?: (Uint8Array|string|null); /** Target readTime */ readTime?: (google.protobuf.ITimestamp|null); @@ -5673,7 +10100,7 @@ export namespace google { public documents?: (google.firestore.v1.Target.IDocumentsTarget|null); /** Target resumeToken. */ - public resumeToken?: (Uint8Array|null); + public resumeToken?: (Uint8Array|string|null); /** Target readTime. */ public readTime?: (google.protobuf.ITimestamp|null); @@ -5693,6 +10120,55 @@ export namespace google { /** Target resumeType. */ public resumeType?: ("resumeToken"|"readTime"); + /** + * Creates a new Target instance using the specified properties. + * @param [properties] Properties to set + * @returns Target instance + */ + public static create(properties?: google.firestore.v1.ITarget): google.firestore.v1.Target; + + /** + * Encodes the specified Target message. Does not implicitly {@link google.firestore.v1.Target.verify|verify} messages. + * @param message Target message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.firestore.v1.ITarget, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Target message, length delimited. Does not implicitly {@link google.firestore.v1.Target.verify|verify} messages. + * @param message Target message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.firestore.v1.ITarget, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Target message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Target + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.firestore.v1.Target; + + /** + * Decodes a Target message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Target + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.firestore.v1.Target; + + /** + * Verifies a Target message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + /** * Creates a Target message from a plain object. Also converts values to their respective internal types. * @param object Plain object @@ -5743,6 +10219,55 @@ export namespace google { /** DocumentsTarget documents. */ public documents: string[]; + /** + * Creates a new DocumentsTarget instance using the specified properties. + * @param [properties] Properties to set + * @returns DocumentsTarget instance + */ + public static create(properties?: google.firestore.v1.Target.IDocumentsTarget): google.firestore.v1.Target.DocumentsTarget; + + /** + * Encodes the specified DocumentsTarget message. Does not implicitly {@link google.firestore.v1.Target.DocumentsTarget.verify|verify} messages. + * @param message DocumentsTarget message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.firestore.v1.Target.IDocumentsTarget, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DocumentsTarget message, length delimited. Does not implicitly {@link google.firestore.v1.Target.DocumentsTarget.verify|verify} messages. + * @param message DocumentsTarget message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.firestore.v1.Target.IDocumentsTarget, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DocumentsTarget message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DocumentsTarget + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.firestore.v1.Target.DocumentsTarget; + + /** + * Decodes a DocumentsTarget message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DocumentsTarget + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.firestore.v1.Target.DocumentsTarget; + + /** + * Verifies a DocumentsTarget message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + /** * Creates a DocumentsTarget message from a plain object. Also converts values to their respective internal types. * @param object Plain object @@ -5800,6 +10325,55 @@ export namespace google { /** QueryTarget queryType. */ public queryType?: "structuredQuery"; + /** + * Creates a new QueryTarget instance using the specified properties. + * @param [properties] Properties to set + * @returns QueryTarget instance + */ + public static create(properties?: google.firestore.v1.Target.IQueryTarget): google.firestore.v1.Target.QueryTarget; + + /** + * Encodes the specified QueryTarget message. Does not implicitly {@link google.firestore.v1.Target.QueryTarget.verify|verify} messages. + * @param message QueryTarget message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.firestore.v1.Target.IQueryTarget, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified QueryTarget message, length delimited. Does not implicitly {@link google.firestore.v1.Target.QueryTarget.verify|verify} messages. + * @param message QueryTarget message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.firestore.v1.Target.IQueryTarget, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a QueryTarget message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns QueryTarget + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.firestore.v1.Target.QueryTarget; + + /** + * Decodes a QueryTarget message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns QueryTarget + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.firestore.v1.Target.QueryTarget; + + /** + * Verifies a QueryTarget message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + /** * Creates a QueryTarget message from a plain object. Also converts values to their respective internal types. * @param object Plain object @@ -5834,7 +10408,7 @@ export namespace google { interface ITargetChange { /** TargetChange targetChangeType */ - targetChangeType?: (google.firestore.v1.TargetChange.TargetChangeType|null); + targetChangeType?: (google.firestore.v1.TargetChange.TargetChangeType|keyof typeof google.firestore.v1.TargetChange.TargetChangeType|null); /** TargetChange targetIds */ targetIds?: (number[]|null); @@ -5843,7 +10417,7 @@ export namespace google { cause?: (google.rpc.IStatus|null); /** TargetChange resumeToken */ - resumeToken?: (Uint8Array|null); + resumeToken?: (Uint8Array|string|null); /** TargetChange readTime */ readTime?: (google.protobuf.ITimestamp|null); @@ -5859,7 +10433,7 @@ export namespace google { constructor(properties?: google.firestore.v1.ITargetChange); /** TargetChange targetChangeType. */ - public targetChangeType: google.firestore.v1.TargetChange.TargetChangeType; + public targetChangeType: (google.firestore.v1.TargetChange.TargetChangeType|keyof typeof google.firestore.v1.TargetChange.TargetChangeType); /** TargetChange targetIds. */ public targetIds: number[]; @@ -5868,11 +10442,60 @@ export namespace google { public cause?: (google.rpc.IStatus|null); /** TargetChange resumeToken. */ - public resumeToken: Uint8Array; + public resumeToken: (Uint8Array|string); /** TargetChange readTime. */ public readTime?: (google.protobuf.ITimestamp|null); + /** + * Creates a new TargetChange instance using the specified properties. + * @param [properties] Properties to set + * @returns TargetChange instance + */ + public static create(properties?: google.firestore.v1.ITargetChange): google.firestore.v1.TargetChange; + + /** + * Encodes the specified TargetChange message. Does not implicitly {@link google.firestore.v1.TargetChange.verify|verify} messages. + * @param message TargetChange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.firestore.v1.ITargetChange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TargetChange message, length delimited. Does not implicitly {@link google.firestore.v1.TargetChange.verify|verify} messages. + * @param message TargetChange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.firestore.v1.ITargetChange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TargetChange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TargetChange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.firestore.v1.TargetChange; + + /** + * Decodes a TargetChange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TargetChange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.firestore.v1.TargetChange; + + /** + * Verifies a TargetChange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + /** * Creates a TargetChange message from a plain object. Also converts values to their respective internal types. * @param object Plain object @@ -5905,8 +10528,13 @@ export namespace google { namespace TargetChange { /** TargetChangeType enum. */ - type TargetChangeType = - "NO_CHANGE"| "ADD"| "REMOVE"| "CURRENT"| "RESET"; + enum TargetChangeType { + NO_CHANGE = 0, + ADD = 1, + REMOVE = 2, + CURRENT = 3, + RESET = 4 + } } /** Properties of a ListCollectionIdsRequest. */ @@ -5949,6 +10577,55 @@ export namespace google { /** ListCollectionIdsRequest consistencySelector. */ public consistencySelector?: "readTime"; + /** + * Creates a new ListCollectionIdsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListCollectionIdsRequest instance + */ + public static create(properties?: google.firestore.v1.IListCollectionIdsRequest): google.firestore.v1.ListCollectionIdsRequest; + + /** + * Encodes the specified ListCollectionIdsRequest message. Does not implicitly {@link google.firestore.v1.ListCollectionIdsRequest.verify|verify} messages. + * @param message ListCollectionIdsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.firestore.v1.IListCollectionIdsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListCollectionIdsRequest message, length delimited. Does not implicitly {@link google.firestore.v1.ListCollectionIdsRequest.verify|verify} messages. + * @param message ListCollectionIdsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.firestore.v1.IListCollectionIdsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListCollectionIdsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListCollectionIdsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.firestore.v1.ListCollectionIdsRequest; + + /** + * Decodes a ListCollectionIdsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListCollectionIdsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.firestore.v1.ListCollectionIdsRequest; + + /** + * Verifies a ListCollectionIdsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + /** * Creates a ListCollectionIdsRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object @@ -6003,6 +10680,55 @@ export namespace google { /** ListCollectionIdsResponse nextPageToken. */ public nextPageToken: string; + /** + * Creates a new ListCollectionIdsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListCollectionIdsResponse instance + */ + public static create(properties?: google.firestore.v1.IListCollectionIdsResponse): google.firestore.v1.ListCollectionIdsResponse; + + /** + * Encodes the specified ListCollectionIdsResponse message. Does not implicitly {@link google.firestore.v1.ListCollectionIdsResponse.verify|verify} messages. + * @param message ListCollectionIdsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.firestore.v1.IListCollectionIdsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListCollectionIdsResponse message, length delimited. Does not implicitly {@link google.firestore.v1.ListCollectionIdsResponse.verify|verify} messages. + * @param message ListCollectionIdsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.firestore.v1.IListCollectionIdsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListCollectionIdsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListCollectionIdsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.firestore.v1.ListCollectionIdsResponse; + + /** + * Decodes a ListCollectionIdsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListCollectionIdsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.firestore.v1.ListCollectionIdsResponse; + + /** + * Verifies a ListCollectionIdsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + /** * Creates a ListCollectionIdsResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object @@ -6063,6 +10789,55 @@ export namespace google { /** BatchWriteRequest labels. */ public labels: { [k: string]: string }; + /** + * Creates a new BatchWriteRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchWriteRequest instance + */ + public static create(properties?: google.firestore.v1.IBatchWriteRequest): google.firestore.v1.BatchWriteRequest; + + /** + * Encodes the specified BatchWriteRequest message. Does not implicitly {@link google.firestore.v1.BatchWriteRequest.verify|verify} messages. + * @param message BatchWriteRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.firestore.v1.IBatchWriteRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchWriteRequest message, length delimited. Does not implicitly {@link google.firestore.v1.BatchWriteRequest.verify|verify} messages. + * @param message BatchWriteRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.firestore.v1.IBatchWriteRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchWriteRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchWriteRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.firestore.v1.BatchWriteRequest; + + /** + * Decodes a BatchWriteRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchWriteRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.firestore.v1.BatchWriteRequest; + + /** + * Verifies a BatchWriteRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + /** * Creates a BatchWriteRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object @@ -6118,134 +10893,77 @@ export namespace google { public status: google.rpc.IStatus[]; /** - * Creates a BatchWriteResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BatchWriteResponse - */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1.BatchWriteResponse; - - /** - * Creates a plain object from a BatchWriteResponse message. Also converts values to other types if specified. - * @param message BatchWriteResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.firestore.v1.BatchWriteResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BatchWriteResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BatchWriteResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** QueryMode enum. */ - type QueryMode = - "NORMAL"| "PLAN"| "PROFILE"; - - /** Properties of a QueryPlan. */ - interface IQueryPlan { - - /** QueryPlan planInfo */ - planInfo?: (google.protobuf.IStruct|null); - } - - /** Represents a QueryPlan. */ - class QueryPlan implements IQueryPlan { - - /** - * Constructs a new QueryPlan. + * Creates a new BatchWriteResponse instance using the specified properties. * @param [properties] Properties to set + * @returns BatchWriteResponse instance */ - constructor(properties?: google.firestore.v1.IQueryPlan); - - /** QueryPlan planInfo. */ - public planInfo?: (google.protobuf.IStruct|null); + public static create(properties?: google.firestore.v1.IBatchWriteResponse): google.firestore.v1.BatchWriteResponse; /** - * Creates a QueryPlan message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryPlan + * Encodes the specified BatchWriteResponse message. Does not implicitly {@link google.firestore.v1.BatchWriteResponse.verify|verify} messages. + * @param message BatchWriteResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1.QueryPlan; + public static encode(message: google.firestore.v1.IBatchWriteResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Creates a plain object from a QueryPlan message. Also converts values to other types if specified. - * @param message QueryPlan - * @param [options] Conversion options - * @returns Plain object + * Encodes the specified BatchWriteResponse message, length delimited. Does not implicitly {@link google.firestore.v1.BatchWriteResponse.verify|verify} messages. + * @param message BatchWriteResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public static toObject(message: google.firestore.v1.QueryPlan, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static encodeDelimited(message: google.firestore.v1.IBatchWriteResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Converts this QueryPlan to JSON. - * @returns JSON object + * Decodes a BatchWriteResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchWriteResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public toJSON(): { [k: string]: any }; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.firestore.v1.BatchWriteResponse; /** - * Gets the default type url for QueryPlan - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url + * Decodes a BatchWriteResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchWriteResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ResultSetStats. */ - interface IResultSetStats { - - /** ResultSetStats queryPlan */ - queryPlan?: (google.firestore.v1.IQueryPlan|null); - - /** ResultSetStats queryStats */ - queryStats?: (google.protobuf.IStruct|null); - } - - /** Represents a ResultSetStats. */ - class ResultSetStats implements IResultSetStats { + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.firestore.v1.BatchWriteResponse; /** - * Constructs a new ResultSetStats. - * @param [properties] Properties to set + * Verifies a BatchWriteResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - constructor(properties?: google.firestore.v1.IResultSetStats); - - /** ResultSetStats queryPlan. */ - public queryPlan?: (google.firestore.v1.IQueryPlan|null); - - /** ResultSetStats queryStats. */ - public queryStats?: (google.protobuf.IStruct|null); + public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ResultSetStats message from a plain object. Also converts values to their respective internal types. + * Creates a BatchWriteResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ResultSetStats + * @returns BatchWriteResponse */ - public static fromObject(object: { [k: string]: any }): google.firestore.v1.ResultSetStats; + public static fromObject(object: { [k: string]: any }): google.firestore.v1.BatchWriteResponse; /** - * Creates a plain object from a ResultSetStats message. Also converts values to other types if specified. - * @param message ResultSetStats + * Creates a plain object from a BatchWriteResponse message. Also converts values to other types if specified. + * @param message BatchWriteResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.firestore.v1.ResultSetStats, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.firestore.v1.BatchWriteResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ResultSetStats to JSON. + * Converts this BatchWriteResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ResultSetStats + * Gets the default type url for BatchWriteResponse * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ @@ -6278,6 +10996,9 @@ export namespace google { /** StructuredQuery limit */ limit?: (google.protobuf.IInt32Value|null); + + /** StructuredQuery findNearest */ + findNearest?: (google.firestore.v1.StructuredQuery.IFindNearest|null); } /** Represents a StructuredQuery. */ @@ -6313,6 +11034,58 @@ export namespace google { /** StructuredQuery limit. */ public limit?: (google.protobuf.IInt32Value|null); + /** StructuredQuery findNearest. */ + public findNearest?: (google.firestore.v1.StructuredQuery.IFindNearest|null); + + /** + * Creates a new StructuredQuery instance using the specified properties. + * @param [properties] Properties to set + * @returns StructuredQuery instance + */ + public static create(properties?: google.firestore.v1.IStructuredQuery): google.firestore.v1.StructuredQuery; + + /** + * Encodes the specified StructuredQuery message. Does not implicitly {@link google.firestore.v1.StructuredQuery.verify|verify} messages. + * @param message StructuredQuery message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.firestore.v1.IStructuredQuery, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StructuredQuery message, length delimited. Does not implicitly {@link google.firestore.v1.StructuredQuery.verify|verify} messages. + * @param message StructuredQuery message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.firestore.v1.IStructuredQuery, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StructuredQuery message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StructuredQuery + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.firestore.v1.StructuredQuery; + + /** + * Decodes a StructuredQuery message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StructuredQuery + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.firestore.v1.StructuredQuery; + + /** + * Verifies a StructuredQuery message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + /** * Creates a StructuredQuery message from a plain object. Also converts values to their respective internal types. * @param object Plain object @@ -6369,6 +11142,55 @@ export namespace google { /** CollectionSelector allDescendants. */ public allDescendants: boolean; + /** + * Creates a new CollectionSelector instance using the specified properties. + * @param [properties] Properties to set + * @returns CollectionSelector instance + */ + public static create(properties?: google.firestore.v1.StructuredQuery.ICollectionSelector): google.firestore.v1.StructuredQuery.CollectionSelector; + + /** + * Encodes the specified CollectionSelector message. Does not implicitly {@link google.firestore.v1.StructuredQuery.CollectionSelector.verify|verify} messages. + * @param message CollectionSelector message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.firestore.v1.StructuredQuery.ICollectionSelector, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CollectionSelector message, length delimited. Does not implicitly {@link google.firestore.v1.StructuredQuery.CollectionSelector.verify|verify} messages. + * @param message CollectionSelector message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.firestore.v1.StructuredQuery.ICollectionSelector, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CollectionSelector message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CollectionSelector + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.firestore.v1.StructuredQuery.CollectionSelector; + + /** + * Decodes a CollectionSelector message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CollectionSelector + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.firestore.v1.StructuredQuery.CollectionSelector; + + /** + * Verifies a CollectionSelector message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + /** * Creates a CollectionSelector message from a plain object. Also converts values to their respective internal types. * @param object Plain object @@ -6432,6 +11254,55 @@ export namespace google { /** Filter filterType. */ public filterType?: ("compositeFilter"|"fieldFilter"|"unaryFilter"); + /** + * Creates a new Filter instance using the specified properties. + * @param [properties] Properties to set + * @returns Filter instance + */ + public static create(properties?: google.firestore.v1.StructuredQuery.IFilter): google.firestore.v1.StructuredQuery.Filter; + + /** + * Encodes the specified Filter message. Does not implicitly {@link google.firestore.v1.StructuredQuery.Filter.verify|verify} messages. + * @param message Filter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.firestore.v1.StructuredQuery.IFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Filter message, length delimited. Does not implicitly {@link google.firestore.v1.StructuredQuery.Filter.verify|verify} messages. + * @param message Filter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.firestore.v1.StructuredQuery.IFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Filter message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Filter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.firestore.v1.StructuredQuery.Filter; + + /** + * Decodes a Filter message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Filter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.firestore.v1.StructuredQuery.Filter; + + /** + * Verifies a Filter message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + /** * Creates a Filter message from a plain object. Also converts values to their respective internal types. * @param object Plain object @@ -6465,7 +11336,7 @@ export namespace google { interface ICompositeFilter { /** CompositeFilter op */ - op?: (google.firestore.v1.StructuredQuery.CompositeFilter.Operator|null); + op?: (google.firestore.v1.StructuredQuery.CompositeFilter.Operator|keyof typeof google.firestore.v1.StructuredQuery.CompositeFilter.Operator|null); /** CompositeFilter filters */ filters?: (google.firestore.v1.StructuredQuery.IFilter[]|null); @@ -6481,11 +11352,60 @@ export namespace google { constructor(properties?: google.firestore.v1.StructuredQuery.ICompositeFilter); /** CompositeFilter op. */ - public op: google.firestore.v1.StructuredQuery.CompositeFilter.Operator; + public op: (google.firestore.v1.StructuredQuery.CompositeFilter.Operator|keyof typeof google.firestore.v1.StructuredQuery.CompositeFilter.Operator); /** CompositeFilter filters. */ public filters: google.firestore.v1.StructuredQuery.IFilter[]; + /** + * Creates a new CompositeFilter instance using the specified properties. + * @param [properties] Properties to set + * @returns CompositeFilter instance + */ + public static create(properties?: google.firestore.v1.StructuredQuery.ICompositeFilter): google.firestore.v1.StructuredQuery.CompositeFilter; + + /** + * Encodes the specified CompositeFilter message. Does not implicitly {@link google.firestore.v1.StructuredQuery.CompositeFilter.verify|verify} messages. + * @param message CompositeFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.firestore.v1.StructuredQuery.ICompositeFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CompositeFilter message, length delimited. Does not implicitly {@link google.firestore.v1.StructuredQuery.CompositeFilter.verify|verify} messages. + * @param message CompositeFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.firestore.v1.StructuredQuery.ICompositeFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CompositeFilter message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CompositeFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.firestore.v1.StructuredQuery.CompositeFilter; + + /** + * Decodes a CompositeFilter message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CompositeFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.firestore.v1.StructuredQuery.CompositeFilter; + + /** + * Verifies a CompositeFilter message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + /** * Creates a CompositeFilter message from a plain object. Also converts values to their respective internal types. * @param object Plain object @@ -6518,8 +11438,11 @@ export namespace google { namespace CompositeFilter { /** Operator enum. */ - type Operator = - "OPERATOR_UNSPECIFIED"| "AND"| "OR"; + enum Operator { + OPERATOR_UNSPECIFIED = 0, + AND = 1, + OR = 2 + } } /** Properties of a FieldFilter. */ @@ -6529,7 +11452,7 @@ export namespace google { field?: (google.firestore.v1.StructuredQuery.IFieldReference|null); /** FieldFilter op */ - op?: (google.firestore.v1.StructuredQuery.FieldFilter.Operator|null); + op?: (google.firestore.v1.StructuredQuery.FieldFilter.Operator|keyof typeof google.firestore.v1.StructuredQuery.FieldFilter.Operator|null); /** FieldFilter value */ value?: (google.firestore.v1.IValue|null); @@ -6548,10 +11471,59 @@ export namespace google { public field?: (google.firestore.v1.StructuredQuery.IFieldReference|null); /** FieldFilter op. */ - public op: google.firestore.v1.StructuredQuery.FieldFilter.Operator; + public op: (google.firestore.v1.StructuredQuery.FieldFilter.Operator|keyof typeof google.firestore.v1.StructuredQuery.FieldFilter.Operator); + + /** FieldFilter value. */ + public value?: (google.firestore.v1.IValue|null); + + /** + * Creates a new FieldFilter instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldFilter instance + */ + public static create(properties?: google.firestore.v1.StructuredQuery.IFieldFilter): google.firestore.v1.StructuredQuery.FieldFilter; + + /** + * Encodes the specified FieldFilter message. Does not implicitly {@link google.firestore.v1.StructuredQuery.FieldFilter.verify|verify} messages. + * @param message FieldFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.firestore.v1.StructuredQuery.IFieldFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldFilter message, length delimited. Does not implicitly {@link google.firestore.v1.StructuredQuery.FieldFilter.verify|verify} messages. + * @param message FieldFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.firestore.v1.StructuredQuery.IFieldFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldFilter message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.firestore.v1.StructuredQuery.FieldFilter; + + /** + * Decodes a FieldFilter message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.firestore.v1.StructuredQuery.FieldFilter; - /** FieldFilter value. */ - public value?: (google.firestore.v1.IValue|null); + /** + * Verifies a FieldFilter message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); /** * Creates a FieldFilter message from a plain object. Also converts values to their respective internal types. @@ -6585,15 +11557,26 @@ export namespace google { namespace FieldFilter { /** Operator enum. */ - type Operator = - "OPERATOR_UNSPECIFIED"| "LESS_THAN"| "LESS_THAN_OR_EQUAL"| "GREATER_THAN"| "GREATER_THAN_OR_EQUAL"| "EQUAL"| "NOT_EQUAL"| "ARRAY_CONTAINS"| "IN"| "ARRAY_CONTAINS_ANY"| "NOT_IN"; + enum Operator { + OPERATOR_UNSPECIFIED = 0, + LESS_THAN = 1, + LESS_THAN_OR_EQUAL = 2, + GREATER_THAN = 3, + GREATER_THAN_OR_EQUAL = 4, + EQUAL = 5, + NOT_EQUAL = 6, + ARRAY_CONTAINS = 7, + IN = 8, + ARRAY_CONTAINS_ANY = 9, + NOT_IN = 10 + } } /** Properties of an UnaryFilter. */ interface IUnaryFilter { /** UnaryFilter op */ - op?: (google.firestore.v1.StructuredQuery.UnaryFilter.Operator|null); + op?: (google.firestore.v1.StructuredQuery.UnaryFilter.Operator|keyof typeof google.firestore.v1.StructuredQuery.UnaryFilter.Operator|null); /** UnaryFilter field */ field?: (google.firestore.v1.StructuredQuery.IFieldReference|null); @@ -6609,7 +11592,7 @@ export namespace google { constructor(properties?: google.firestore.v1.StructuredQuery.IUnaryFilter); /** UnaryFilter op. */ - public op: google.firestore.v1.StructuredQuery.UnaryFilter.Operator; + public op: (google.firestore.v1.StructuredQuery.UnaryFilter.Operator|keyof typeof google.firestore.v1.StructuredQuery.UnaryFilter.Operator); /** UnaryFilter field. */ public field?: (google.firestore.v1.StructuredQuery.IFieldReference|null); @@ -6617,6 +11600,55 @@ export namespace google { /** UnaryFilter operandType. */ public operandType?: "field"; + /** + * Creates a new UnaryFilter instance using the specified properties. + * @param [properties] Properties to set + * @returns UnaryFilter instance + */ + public static create(properties?: google.firestore.v1.StructuredQuery.IUnaryFilter): google.firestore.v1.StructuredQuery.UnaryFilter; + + /** + * Encodes the specified UnaryFilter message. Does not implicitly {@link google.firestore.v1.StructuredQuery.UnaryFilter.verify|verify} messages. + * @param message UnaryFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.firestore.v1.StructuredQuery.IUnaryFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UnaryFilter message, length delimited. Does not implicitly {@link google.firestore.v1.StructuredQuery.UnaryFilter.verify|verify} messages. + * @param message UnaryFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.firestore.v1.StructuredQuery.IUnaryFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UnaryFilter message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UnaryFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.firestore.v1.StructuredQuery.UnaryFilter; + + /** + * Decodes an UnaryFilter message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UnaryFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.firestore.v1.StructuredQuery.UnaryFilter; + + /** + * Verifies an UnaryFilter message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + /** * Creates an UnaryFilter message from a plain object. Also converts values to their respective internal types. * @param object Plain object @@ -6649,8 +11681,13 @@ export namespace google { namespace UnaryFilter { /** Operator enum. */ - type Operator = - "OPERATOR_UNSPECIFIED"| "IS_NAN"| "IS_NULL"| "IS_NOT_NAN"| "IS_NOT_NULL"; + enum Operator { + OPERATOR_UNSPECIFIED = 0, + IS_NAN = 2, + IS_NULL = 3, + IS_NOT_NAN = 4, + IS_NOT_NULL = 5 + } } /** Properties of an Order. */ @@ -6660,7 +11697,7 @@ export namespace google { field?: (google.firestore.v1.StructuredQuery.IFieldReference|null); /** Order direction */ - direction?: (google.firestore.v1.StructuredQuery.Direction|null); + direction?: (google.firestore.v1.StructuredQuery.Direction|keyof typeof google.firestore.v1.StructuredQuery.Direction|null); } /** Represents an Order. */ @@ -6676,7 +11713,56 @@ export namespace google { public field?: (google.firestore.v1.StructuredQuery.IFieldReference|null); /** Order direction. */ - public direction: google.firestore.v1.StructuredQuery.Direction; + public direction: (google.firestore.v1.StructuredQuery.Direction|keyof typeof google.firestore.v1.StructuredQuery.Direction); + + /** + * Creates a new Order instance using the specified properties. + * @param [properties] Properties to set + * @returns Order instance + */ + public static create(properties?: google.firestore.v1.StructuredQuery.IOrder): google.firestore.v1.StructuredQuery.Order; + + /** + * Encodes the specified Order message. Does not implicitly {@link google.firestore.v1.StructuredQuery.Order.verify|verify} messages. + * @param message Order message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.firestore.v1.StructuredQuery.IOrder, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Order message, length delimited. Does not implicitly {@link google.firestore.v1.StructuredQuery.Order.verify|verify} messages. + * @param message Order message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.firestore.v1.StructuredQuery.IOrder, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Order message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Order + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.firestore.v1.StructuredQuery.Order; + + /** + * Decodes an Order message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Order + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.firestore.v1.StructuredQuery.Order; + + /** + * Verifies an Order message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); /** * Creates an Order message from a plain object. Also converts values to their respective internal types. @@ -6708,8 +11794,11 @@ export namespace google { } /** Direction enum. */ - type Direction = - "DIRECTION_UNSPECIFIED"| "ASCENDING"| "DESCENDING"; + enum Direction { + DIRECTION_UNSPECIFIED = 0, + ASCENDING = 1, + DESCENDING = 2 + } /** Properties of a FieldReference. */ interface IFieldReference { @@ -6730,6 +11819,55 @@ export namespace google { /** FieldReference fieldPath. */ public fieldPath: string; + /** + * Creates a new FieldReference instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldReference instance + */ + public static create(properties?: google.firestore.v1.StructuredQuery.IFieldReference): google.firestore.v1.StructuredQuery.FieldReference; + + /** + * Encodes the specified FieldReference message. Does not implicitly {@link google.firestore.v1.StructuredQuery.FieldReference.verify|verify} messages. + * @param message FieldReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.firestore.v1.StructuredQuery.IFieldReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldReference message, length delimited. Does not implicitly {@link google.firestore.v1.StructuredQuery.FieldReference.verify|verify} messages. + * @param message FieldReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.firestore.v1.StructuredQuery.IFieldReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldReference message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.firestore.v1.StructuredQuery.FieldReference; + + /** + * Decodes a FieldReference message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.firestore.v1.StructuredQuery.FieldReference; + + /** + * Verifies a FieldReference message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + /** * Creates a FieldReference message from a plain object. Also converts values to their respective internal types. * @param object Plain object @@ -6778,6 +11916,55 @@ export namespace google { /** Projection fields. */ public fields: google.firestore.v1.StructuredQuery.IFieldReference[]; + /** + * Creates a new Projection instance using the specified properties. + * @param [properties] Properties to set + * @returns Projection instance + */ + public static create(properties?: google.firestore.v1.StructuredQuery.IProjection): google.firestore.v1.StructuredQuery.Projection; + + /** + * Encodes the specified Projection message. Does not implicitly {@link google.firestore.v1.StructuredQuery.Projection.verify|verify} messages. + * @param message Projection message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.firestore.v1.StructuredQuery.IProjection, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Projection message, length delimited. Does not implicitly {@link google.firestore.v1.StructuredQuery.Projection.verify|verify} messages. + * @param message Projection message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.firestore.v1.StructuredQuery.IProjection, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Projection message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Projection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.firestore.v1.StructuredQuery.Projection; + + /** + * Decodes a Projection message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Projection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.firestore.v1.StructuredQuery.Projection; + + /** + * Verifies a Projection message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + /** * Creates a Projection message from a plain object. Also converts values to their respective internal types. * @param object Plain object @@ -6806,6 +11993,132 @@ export namespace google { */ public static getTypeUrl(typeUrlPrefix?: string): string; } + + /** Properties of a FindNearest. */ + interface IFindNearest { + + /** FindNearest vectorField */ + vectorField?: (google.firestore.v1.StructuredQuery.IFieldReference|null); + + /** FindNearest queryVector */ + queryVector?: (google.firestore.v1.IValue|null); + + /** FindNearest distanceMeasure */ + distanceMeasure?: (google.firestore.v1.StructuredQuery.FindNearest.DistanceMeasure|keyof typeof google.firestore.v1.StructuredQuery.FindNearest.DistanceMeasure|null); + + /** FindNearest limit */ + limit?: (google.protobuf.IInt32Value|null); + } + + /** Represents a FindNearest. */ + class FindNearest implements IFindNearest { + + /** + * Constructs a new FindNearest. + * @param [properties] Properties to set + */ + constructor(properties?: google.firestore.v1.StructuredQuery.IFindNearest); + + /** FindNearest vectorField. */ + public vectorField?: (google.firestore.v1.StructuredQuery.IFieldReference|null); + + /** FindNearest queryVector. */ + public queryVector?: (google.firestore.v1.IValue|null); + + /** FindNearest distanceMeasure. */ + public distanceMeasure: (google.firestore.v1.StructuredQuery.FindNearest.DistanceMeasure|keyof typeof google.firestore.v1.StructuredQuery.FindNearest.DistanceMeasure); + + /** FindNearest limit. */ + public limit?: (google.protobuf.IInt32Value|null); + + /** + * Creates a new FindNearest instance using the specified properties. + * @param [properties] Properties to set + * @returns FindNearest instance + */ + public static create(properties?: google.firestore.v1.StructuredQuery.IFindNearest): google.firestore.v1.StructuredQuery.FindNearest; + + /** + * Encodes the specified FindNearest message. Does not implicitly {@link google.firestore.v1.StructuredQuery.FindNearest.verify|verify} messages. + * @param message FindNearest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.firestore.v1.StructuredQuery.IFindNearest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FindNearest message, length delimited. Does not implicitly {@link google.firestore.v1.StructuredQuery.FindNearest.verify|verify} messages. + * @param message FindNearest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.firestore.v1.StructuredQuery.IFindNearest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FindNearest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FindNearest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.firestore.v1.StructuredQuery.FindNearest; + + /** + * Decodes a FindNearest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FindNearest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.firestore.v1.StructuredQuery.FindNearest; + + /** + * Verifies a FindNearest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FindNearest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FindNearest + */ + public static fromObject(object: { [k: string]: any }): google.firestore.v1.StructuredQuery.FindNearest; + + /** + * Creates a plain object from a FindNearest message. Also converts values to other types if specified. + * @param message FindNearest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.firestore.v1.StructuredQuery.FindNearest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FindNearest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FindNearest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FindNearest { + + /** DistanceMeasure enum. */ + enum DistanceMeasure { + DISTANCE_MEASURE_UNSPECIFIED = 0, + EUCLIDEAN = 1, + COSINE = 2, + DOT_PRODUCT = 3 + } + } } /** Properties of a StructuredAggregationQuery. */ @@ -6836,6 +12149,55 @@ export namespace google { /** StructuredAggregationQuery queryType. */ public queryType?: "structuredQuery"; + /** + * Creates a new StructuredAggregationQuery instance using the specified properties. + * @param [properties] Properties to set + * @returns StructuredAggregationQuery instance + */ + public static create(properties?: google.firestore.v1.IStructuredAggregationQuery): google.firestore.v1.StructuredAggregationQuery; + + /** + * Encodes the specified StructuredAggregationQuery message. Does not implicitly {@link google.firestore.v1.StructuredAggregationQuery.verify|verify} messages. + * @param message StructuredAggregationQuery message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.firestore.v1.IStructuredAggregationQuery, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StructuredAggregationQuery message, length delimited. Does not implicitly {@link google.firestore.v1.StructuredAggregationQuery.verify|verify} messages. + * @param message StructuredAggregationQuery message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.firestore.v1.IStructuredAggregationQuery, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StructuredAggregationQuery message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StructuredAggregationQuery + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.firestore.v1.StructuredAggregationQuery; + + /** + * Decodes a StructuredAggregationQuery message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StructuredAggregationQuery + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.firestore.v1.StructuredAggregationQuery; + + /** + * Verifies a StructuredAggregationQuery message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + /** * Creates a StructuredAggregationQuery message from a plain object. Also converts values to their respective internal types. * @param object Plain object @@ -6907,6 +12269,55 @@ export namespace google { /** Aggregation operator. */ public operator?: ("count"|"sum"|"avg"); + /** + * Creates a new Aggregation instance using the specified properties. + * @param [properties] Properties to set + * @returns Aggregation instance + */ + public static create(properties?: google.firestore.v1.StructuredAggregationQuery.IAggregation): google.firestore.v1.StructuredAggregationQuery.Aggregation; + + /** + * Encodes the specified Aggregation message. Does not implicitly {@link google.firestore.v1.StructuredAggregationQuery.Aggregation.verify|verify} messages. + * @param message Aggregation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.firestore.v1.StructuredAggregationQuery.IAggregation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Aggregation message, length delimited. Does not implicitly {@link google.firestore.v1.StructuredAggregationQuery.Aggregation.verify|verify} messages. + * @param message Aggregation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.firestore.v1.StructuredAggregationQuery.IAggregation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Aggregation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Aggregation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.firestore.v1.StructuredAggregationQuery.Aggregation; + + /** + * Decodes an Aggregation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Aggregation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.firestore.v1.StructuredAggregationQuery.Aggregation; + + /** + * Verifies an Aggregation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + /** * Creates an Aggregation message from a plain object. Also converts values to their respective internal types. * @param object Plain object @@ -6957,6 +12368,55 @@ export namespace google { /** Count upTo. */ public upTo?: (google.protobuf.IInt64Value|null); + /** + * Creates a new Count instance using the specified properties. + * @param [properties] Properties to set + * @returns Count instance + */ + public static create(properties?: google.firestore.v1.StructuredAggregationQuery.Aggregation.ICount): google.firestore.v1.StructuredAggregationQuery.Aggregation.Count; + + /** + * Encodes the specified Count message. Does not implicitly {@link google.firestore.v1.StructuredAggregationQuery.Aggregation.Count.verify|verify} messages. + * @param message Count message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.firestore.v1.StructuredAggregationQuery.Aggregation.ICount, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Count message, length delimited. Does not implicitly {@link google.firestore.v1.StructuredAggregationQuery.Aggregation.Count.verify|verify} messages. + * @param message Count message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.firestore.v1.StructuredAggregationQuery.Aggregation.ICount, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Count message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Count + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.firestore.v1.StructuredAggregationQuery.Aggregation.Count; + + /** + * Decodes a Count message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Count + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.firestore.v1.StructuredAggregationQuery.Aggregation.Count; + + /** + * Verifies a Count message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + /** * Creates a Count message from a plain object. Also converts values to their respective internal types. * @param object Plain object @@ -7005,6 +12465,55 @@ export namespace google { /** Sum field. */ public field?: (google.firestore.v1.StructuredQuery.IFieldReference|null); + /** + * Creates a new Sum instance using the specified properties. + * @param [properties] Properties to set + * @returns Sum instance + */ + public static create(properties?: google.firestore.v1.StructuredAggregationQuery.Aggregation.ISum): google.firestore.v1.StructuredAggregationQuery.Aggregation.Sum; + + /** + * Encodes the specified Sum message. Does not implicitly {@link google.firestore.v1.StructuredAggregationQuery.Aggregation.Sum.verify|verify} messages. + * @param message Sum message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.firestore.v1.StructuredAggregationQuery.Aggregation.ISum, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Sum message, length delimited. Does not implicitly {@link google.firestore.v1.StructuredAggregationQuery.Aggregation.Sum.verify|verify} messages. + * @param message Sum message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.firestore.v1.StructuredAggregationQuery.Aggregation.ISum, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Sum message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Sum + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.firestore.v1.StructuredAggregationQuery.Aggregation.Sum; + + /** + * Decodes a Sum message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Sum + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.firestore.v1.StructuredAggregationQuery.Aggregation.Sum; + + /** + * Verifies a Sum message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + /** * Creates a Sum message from a plain object. Also converts values to their respective internal types. * @param object Plain object @@ -7045,13 +12554,62 @@ export namespace google { class Avg implements IAvg { /** - * Constructs a new Avg. - * @param [properties] Properties to set + * Constructs a new Avg. + * @param [properties] Properties to set + */ + constructor(properties?: google.firestore.v1.StructuredAggregationQuery.Aggregation.IAvg); + + /** Avg field. */ + public field?: (google.firestore.v1.StructuredQuery.IFieldReference|null); + + /** + * Creates a new Avg instance using the specified properties. + * @param [properties] Properties to set + * @returns Avg instance + */ + public static create(properties?: google.firestore.v1.StructuredAggregationQuery.Aggregation.IAvg): google.firestore.v1.StructuredAggregationQuery.Aggregation.Avg; + + /** + * Encodes the specified Avg message. Does not implicitly {@link google.firestore.v1.StructuredAggregationQuery.Aggregation.Avg.verify|verify} messages. + * @param message Avg message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.firestore.v1.StructuredAggregationQuery.Aggregation.IAvg, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Avg message, length delimited. Does not implicitly {@link google.firestore.v1.StructuredAggregationQuery.Aggregation.Avg.verify|verify} messages. + * @param message Avg message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.firestore.v1.StructuredAggregationQuery.Aggregation.IAvg, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Avg message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Avg + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.firestore.v1.StructuredAggregationQuery.Aggregation.Avg; + + /** + * Decodes an Avg message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Avg + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - constructor(properties?: google.firestore.v1.StructuredAggregationQuery.Aggregation.IAvg); + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.firestore.v1.StructuredAggregationQuery.Aggregation.Avg; - /** Avg field. */ - public field?: (google.firestore.v1.StructuredQuery.IFieldReference|null); + /** + * Verifies an Avg message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); /** * Creates an Avg message from a plain object. Also converts values to their respective internal types. @@ -7109,6 +12667,55 @@ export namespace google { /** Cursor before. */ public before: boolean; + /** + * Creates a new Cursor instance using the specified properties. + * @param [properties] Properties to set + * @returns Cursor instance + */ + public static create(properties?: google.firestore.v1.ICursor): google.firestore.v1.Cursor; + + /** + * Encodes the specified Cursor message. Does not implicitly {@link google.firestore.v1.Cursor.verify|verify} messages. + * @param message Cursor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.firestore.v1.ICursor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Cursor message, length delimited. Does not implicitly {@link google.firestore.v1.Cursor.verify|verify} messages. + * @param message Cursor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.firestore.v1.ICursor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Cursor message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Cursor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.firestore.v1.Cursor; + + /** + * Decodes a Cursor message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Cursor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.firestore.v1.Cursor; + + /** + * Verifies a Cursor message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + /** * Creates a Cursor message from a plain object. Also converts values to their respective internal types. * @param object Plain object @@ -7138,6 +12745,424 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of an ExplainOptions. */ + interface IExplainOptions { + + /** ExplainOptions analyze */ + analyze?: (boolean|null); + } + + /** Represents an ExplainOptions. */ + class ExplainOptions implements IExplainOptions { + + /** + * Constructs a new ExplainOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.firestore.v1.IExplainOptions); + + /** ExplainOptions analyze. */ + public analyze: boolean; + + /** + * Creates a new ExplainOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ExplainOptions instance + */ + public static create(properties?: google.firestore.v1.IExplainOptions): google.firestore.v1.ExplainOptions; + + /** + * Encodes the specified ExplainOptions message. Does not implicitly {@link google.firestore.v1.ExplainOptions.verify|verify} messages. + * @param message ExplainOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.firestore.v1.IExplainOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExplainOptions message, length delimited. Does not implicitly {@link google.firestore.v1.ExplainOptions.verify|verify} messages. + * @param message ExplainOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.firestore.v1.IExplainOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExplainOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExplainOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.firestore.v1.ExplainOptions; + + /** + * Decodes an ExplainOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExplainOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.firestore.v1.ExplainOptions; + + /** + * Verifies an ExplainOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExplainOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExplainOptions + */ + public static fromObject(object: { [k: string]: any }): google.firestore.v1.ExplainOptions; + + /** + * Creates a plain object from an ExplainOptions message. Also converts values to other types if specified. + * @param message ExplainOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.firestore.v1.ExplainOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExplainOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExplainOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExplainMetrics. */ + interface IExplainMetrics { + + /** ExplainMetrics planSummary */ + planSummary?: (google.firestore.v1.IPlanSummary|null); + + /** ExplainMetrics executionStats */ + executionStats?: (google.firestore.v1.IExecutionStats|null); + } + + /** Represents an ExplainMetrics. */ + class ExplainMetrics implements IExplainMetrics { + + /** + * Constructs a new ExplainMetrics. + * @param [properties] Properties to set + */ + constructor(properties?: google.firestore.v1.IExplainMetrics); + + /** ExplainMetrics planSummary. */ + public planSummary?: (google.firestore.v1.IPlanSummary|null); + + /** ExplainMetrics executionStats. */ + public executionStats?: (google.firestore.v1.IExecutionStats|null); + + /** + * Creates a new ExplainMetrics instance using the specified properties. + * @param [properties] Properties to set + * @returns ExplainMetrics instance + */ + public static create(properties?: google.firestore.v1.IExplainMetrics): google.firestore.v1.ExplainMetrics; + + /** + * Encodes the specified ExplainMetrics message. Does not implicitly {@link google.firestore.v1.ExplainMetrics.verify|verify} messages. + * @param message ExplainMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.firestore.v1.IExplainMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExplainMetrics message, length delimited. Does not implicitly {@link google.firestore.v1.ExplainMetrics.verify|verify} messages. + * @param message ExplainMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.firestore.v1.IExplainMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExplainMetrics message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExplainMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.firestore.v1.ExplainMetrics; + + /** + * Decodes an ExplainMetrics message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExplainMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.firestore.v1.ExplainMetrics; + + /** + * Verifies an ExplainMetrics message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExplainMetrics message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExplainMetrics + */ + public static fromObject(object: { [k: string]: any }): google.firestore.v1.ExplainMetrics; + + /** + * Creates a plain object from an ExplainMetrics message. Also converts values to other types if specified. + * @param message ExplainMetrics + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.firestore.v1.ExplainMetrics, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExplainMetrics to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExplainMetrics + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PlanSummary. */ + interface IPlanSummary { + + /** PlanSummary indexesUsed */ + indexesUsed?: (google.protobuf.IStruct[]|null); + } + + /** Represents a PlanSummary. */ + class PlanSummary implements IPlanSummary { + + /** + * Constructs a new PlanSummary. + * @param [properties] Properties to set + */ + constructor(properties?: google.firestore.v1.IPlanSummary); + + /** PlanSummary indexesUsed. */ + public indexesUsed: google.protobuf.IStruct[]; + + /** + * Creates a new PlanSummary instance using the specified properties. + * @param [properties] Properties to set + * @returns PlanSummary instance + */ + public static create(properties?: google.firestore.v1.IPlanSummary): google.firestore.v1.PlanSummary; + + /** + * Encodes the specified PlanSummary message. Does not implicitly {@link google.firestore.v1.PlanSummary.verify|verify} messages. + * @param message PlanSummary message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.firestore.v1.IPlanSummary, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PlanSummary message, length delimited. Does not implicitly {@link google.firestore.v1.PlanSummary.verify|verify} messages. + * @param message PlanSummary message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.firestore.v1.IPlanSummary, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PlanSummary message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PlanSummary + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.firestore.v1.PlanSummary; + + /** + * Decodes a PlanSummary message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PlanSummary + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.firestore.v1.PlanSummary; + + /** + * Verifies a PlanSummary message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PlanSummary message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PlanSummary + */ + public static fromObject(object: { [k: string]: any }): google.firestore.v1.PlanSummary; + + /** + * Creates a plain object from a PlanSummary message. Also converts values to other types if specified. + * @param message PlanSummary + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.firestore.v1.PlanSummary, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PlanSummary to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PlanSummary + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExecutionStats. */ + interface IExecutionStats { + + /** ExecutionStats resultsReturned */ + resultsReturned?: (number|Long|string|null); + + /** ExecutionStats bytesReturned */ + bytesReturned?: (number|Long|string|null); + + /** ExecutionStats executionDuration */ + executionDuration?: (google.protobuf.IDuration|null); + + /** ExecutionStats readOperations */ + readOperations?: (number|Long|string|null); + + /** ExecutionStats debugStats */ + debugStats?: (google.protobuf.IStruct|null); + } + + /** Represents an ExecutionStats. */ + class ExecutionStats implements IExecutionStats { + + /** + * Constructs a new ExecutionStats. + * @param [properties] Properties to set + */ + constructor(properties?: google.firestore.v1.IExecutionStats); + + /** ExecutionStats resultsReturned. */ + public resultsReturned: (number|Long|string); + + /** ExecutionStats bytesReturned. */ + public bytesReturned: (number|Long|string); + + /** ExecutionStats executionDuration. */ + public executionDuration?: (google.protobuf.IDuration|null); + + /** ExecutionStats readOperations. */ + public readOperations: (number|Long|string); + + /** ExecutionStats debugStats. */ + public debugStats?: (google.protobuf.IStruct|null); + + /** + * Creates a new ExecutionStats instance using the specified properties. + * @param [properties] Properties to set + * @returns ExecutionStats instance + */ + public static create(properties?: google.firestore.v1.IExecutionStats): google.firestore.v1.ExecutionStats; + + /** + * Encodes the specified ExecutionStats message. Does not implicitly {@link google.firestore.v1.ExecutionStats.verify|verify} messages. + * @param message ExecutionStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.firestore.v1.IExecutionStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExecutionStats message, length delimited. Does not implicitly {@link google.firestore.v1.ExecutionStats.verify|verify} messages. + * @param message ExecutionStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.firestore.v1.IExecutionStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExecutionStats message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExecutionStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.firestore.v1.ExecutionStats; + + /** + * Decodes an ExecutionStats message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExecutionStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.firestore.v1.ExecutionStats; + + /** + * Verifies an ExecutionStats message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExecutionStats message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExecutionStats + */ + public static fromObject(object: { [k: string]: any }): google.firestore.v1.ExecutionStats; + + /** + * Creates a plain object from an ExecutionStats message. Also converts values to other types if specified. + * @param message ExecutionStats + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.firestore.v1.ExecutionStats, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExecutionStats to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExecutionStats + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of a Write. */ interface IWrite { @@ -7184,11 +13209,60 @@ export namespace google { /** Write updateTransforms. */ public updateTransforms: google.firestore.v1.DocumentTransform.IFieldTransform[]; - /** Write currentDocument. */ - public currentDocument?: (google.firestore.v1.IPrecondition|null); + /** Write currentDocument. */ + public currentDocument?: (google.firestore.v1.IPrecondition|null); + + /** Write operation. */ + public operation?: ("update"|"delete"|"transform"); + + /** + * Creates a new Write instance using the specified properties. + * @param [properties] Properties to set + * @returns Write instance + */ + public static create(properties?: google.firestore.v1.IWrite): google.firestore.v1.Write; + + /** + * Encodes the specified Write message. Does not implicitly {@link google.firestore.v1.Write.verify|verify} messages. + * @param message Write message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.firestore.v1.IWrite, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Write message, length delimited. Does not implicitly {@link google.firestore.v1.Write.verify|verify} messages. + * @param message Write message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.firestore.v1.IWrite, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Write message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Write + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.firestore.v1.Write; + + /** + * Decodes a Write message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Write + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.firestore.v1.Write; - /** Write operation. */ - public operation?: ("update"|"delete"|"transform"); + /** + * Verifies a Write message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); /** * Creates a Write message from a plain object. Also converts values to their respective internal types. @@ -7244,6 +13318,55 @@ export namespace google { /** DocumentTransform fieldTransforms. */ public fieldTransforms: google.firestore.v1.DocumentTransform.IFieldTransform[]; + /** + * Creates a new DocumentTransform instance using the specified properties. + * @param [properties] Properties to set + * @returns DocumentTransform instance + */ + public static create(properties?: google.firestore.v1.IDocumentTransform): google.firestore.v1.DocumentTransform; + + /** + * Encodes the specified DocumentTransform message. Does not implicitly {@link google.firestore.v1.DocumentTransform.verify|verify} messages. + * @param message DocumentTransform message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.firestore.v1.IDocumentTransform, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DocumentTransform message, length delimited. Does not implicitly {@link google.firestore.v1.DocumentTransform.verify|verify} messages. + * @param message DocumentTransform message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.firestore.v1.IDocumentTransform, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DocumentTransform message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DocumentTransform + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.firestore.v1.DocumentTransform; + + /** + * Decodes a DocumentTransform message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DocumentTransform + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.firestore.v1.DocumentTransform; + + /** + * Verifies a DocumentTransform message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + /** * Creates a DocumentTransform message from a plain object. Also converts values to their respective internal types. * @param object Plain object @@ -7282,7 +13405,7 @@ export namespace google { fieldPath?: (string|null); /** FieldTransform setToServerValue */ - setToServerValue?: (google.firestore.v1.DocumentTransform.FieldTransform.ServerValue|null); + setToServerValue?: (google.firestore.v1.DocumentTransform.FieldTransform.ServerValue|keyof typeof google.firestore.v1.DocumentTransform.FieldTransform.ServerValue|null); /** FieldTransform increment */ increment?: (google.firestore.v1.IValue|null); @@ -7313,7 +13436,7 @@ export namespace google { public fieldPath: string; /** FieldTransform setToServerValue. */ - public setToServerValue?: (google.firestore.v1.DocumentTransform.FieldTransform.ServerValue|null); + public setToServerValue?: (google.firestore.v1.DocumentTransform.FieldTransform.ServerValue|keyof typeof google.firestore.v1.DocumentTransform.FieldTransform.ServerValue|null); /** FieldTransform increment. */ public increment?: (google.firestore.v1.IValue|null); @@ -7333,6 +13456,55 @@ export namespace google { /** FieldTransform transformType. */ public transformType?: ("setToServerValue"|"increment"|"maximum"|"minimum"|"appendMissingElements"|"removeAllFromArray"); + /** + * Creates a new FieldTransform instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldTransform instance + */ + public static create(properties?: google.firestore.v1.DocumentTransform.IFieldTransform): google.firestore.v1.DocumentTransform.FieldTransform; + + /** + * Encodes the specified FieldTransform message. Does not implicitly {@link google.firestore.v1.DocumentTransform.FieldTransform.verify|verify} messages. + * @param message FieldTransform message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.firestore.v1.DocumentTransform.IFieldTransform, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldTransform message, length delimited. Does not implicitly {@link google.firestore.v1.DocumentTransform.FieldTransform.verify|verify} messages. + * @param message FieldTransform message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.firestore.v1.DocumentTransform.IFieldTransform, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldTransform message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldTransform + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.firestore.v1.DocumentTransform.FieldTransform; + + /** + * Decodes a FieldTransform message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldTransform + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.firestore.v1.DocumentTransform.FieldTransform; + + /** + * Verifies a FieldTransform message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + /** * Creates a FieldTransform message from a plain object. Also converts values to their respective internal types. * @param object Plain object @@ -7365,8 +13537,10 @@ export namespace google { namespace FieldTransform { /** ServerValue enum. */ - type ServerValue = - "SERVER_VALUE_UNSPECIFIED"| "REQUEST_TIME"; + enum ServerValue { + SERVER_VALUE_UNSPECIFIED = 0, + REQUEST_TIME = 1 + } } } @@ -7395,6 +13569,55 @@ export namespace google { /** WriteResult transformResults. */ public transformResults: google.firestore.v1.IValue[]; + /** + * Creates a new WriteResult instance using the specified properties. + * @param [properties] Properties to set + * @returns WriteResult instance + */ + public static create(properties?: google.firestore.v1.IWriteResult): google.firestore.v1.WriteResult; + + /** + * Encodes the specified WriteResult message. Does not implicitly {@link google.firestore.v1.WriteResult.verify|verify} messages. + * @param message WriteResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.firestore.v1.IWriteResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WriteResult message, length delimited. Does not implicitly {@link google.firestore.v1.WriteResult.verify|verify} messages. + * @param message WriteResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.firestore.v1.IWriteResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WriteResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WriteResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.firestore.v1.WriteResult; + + /** + * Decodes a WriteResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WriteResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.firestore.v1.WriteResult; + + /** + * Verifies a WriteResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + /** * Creates a WriteResult message from a plain object. Also converts values to their respective internal types. * @param object Plain object @@ -7455,6 +13678,55 @@ export namespace google { /** DocumentChange removedTargetIds. */ public removedTargetIds: number[]; + /** + * Creates a new DocumentChange instance using the specified properties. + * @param [properties] Properties to set + * @returns DocumentChange instance + */ + public static create(properties?: google.firestore.v1.IDocumentChange): google.firestore.v1.DocumentChange; + + /** + * Encodes the specified DocumentChange message. Does not implicitly {@link google.firestore.v1.DocumentChange.verify|verify} messages. + * @param message DocumentChange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.firestore.v1.IDocumentChange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DocumentChange message, length delimited. Does not implicitly {@link google.firestore.v1.DocumentChange.verify|verify} messages. + * @param message DocumentChange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.firestore.v1.IDocumentChange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DocumentChange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DocumentChange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.firestore.v1.DocumentChange; + + /** + * Decodes a DocumentChange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DocumentChange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.firestore.v1.DocumentChange; + + /** + * Verifies a DocumentChange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + /** * Creates a DocumentChange message from a plain object. Also converts values to their respective internal types. * @param object Plain object @@ -7515,6 +13787,55 @@ export namespace google { /** DocumentDelete readTime. */ public readTime?: (google.protobuf.ITimestamp|null); + /** + * Creates a new DocumentDelete instance using the specified properties. + * @param [properties] Properties to set + * @returns DocumentDelete instance + */ + public static create(properties?: google.firestore.v1.IDocumentDelete): google.firestore.v1.DocumentDelete; + + /** + * Encodes the specified DocumentDelete message. Does not implicitly {@link google.firestore.v1.DocumentDelete.verify|verify} messages. + * @param message DocumentDelete message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.firestore.v1.IDocumentDelete, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DocumentDelete message, length delimited. Does not implicitly {@link google.firestore.v1.DocumentDelete.verify|verify} messages. + * @param message DocumentDelete message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.firestore.v1.IDocumentDelete, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DocumentDelete message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DocumentDelete + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.firestore.v1.DocumentDelete; + + /** + * Decodes a DocumentDelete message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DocumentDelete + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.firestore.v1.DocumentDelete; + + /** + * Verifies a DocumentDelete message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + /** * Creates a DocumentDelete message from a plain object. Also converts values to their respective internal types. * @param object Plain object @@ -7575,6 +13896,55 @@ export namespace google { /** DocumentRemove readTime. */ public readTime?: (google.protobuf.ITimestamp|null); + /** + * Creates a new DocumentRemove instance using the specified properties. + * @param [properties] Properties to set + * @returns DocumentRemove instance + */ + public static create(properties?: google.firestore.v1.IDocumentRemove): google.firestore.v1.DocumentRemove; + + /** + * Encodes the specified DocumentRemove message. Does not implicitly {@link google.firestore.v1.DocumentRemove.verify|verify} messages. + * @param message DocumentRemove message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.firestore.v1.IDocumentRemove, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DocumentRemove message, length delimited. Does not implicitly {@link google.firestore.v1.DocumentRemove.verify|verify} messages. + * @param message DocumentRemove message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.firestore.v1.IDocumentRemove, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DocumentRemove message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DocumentRemove + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.firestore.v1.DocumentRemove; + + /** + * Decodes a DocumentRemove message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DocumentRemove + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.firestore.v1.DocumentRemove; + + /** + * Verifies a DocumentRemove message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + /** * Creates a DocumentRemove message from a plain object. Also converts values to their respective internal types. * @param object Plain object @@ -7635,6 +14005,55 @@ export namespace google { /** ExistenceFilter unchangedNames. */ public unchangedNames?: (google.firestore.v1.IBloomFilter|null); + /** + * Creates a new ExistenceFilter instance using the specified properties. + * @param [properties] Properties to set + * @returns ExistenceFilter instance + */ + public static create(properties?: google.firestore.v1.IExistenceFilter): google.firestore.v1.ExistenceFilter; + + /** + * Encodes the specified ExistenceFilter message. Does not implicitly {@link google.firestore.v1.ExistenceFilter.verify|verify} messages. + * @param message ExistenceFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.firestore.v1.IExistenceFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExistenceFilter message, length delimited. Does not implicitly {@link google.firestore.v1.ExistenceFilter.verify|verify} messages. + * @param message ExistenceFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.firestore.v1.IExistenceFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExistenceFilter message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExistenceFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.firestore.v1.ExistenceFilter; + + /** + * Decodes an ExistenceFilter message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExistenceFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.firestore.v1.ExistenceFilter; + + /** + * Verifies an ExistenceFilter message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + /** * Creates an ExistenceFilter message from a plain object. Also converts values to their respective internal types. * @param object Plain object @@ -7666,6 +14085,113 @@ export namespace google { } } + /** Namespace type. */ + namespace type { + + /** Properties of a LatLng. */ + interface ILatLng { + + /** LatLng latitude */ + latitude?: (number|null); + + /** LatLng longitude */ + longitude?: (number|null); + } + + /** Represents a LatLng. */ + class LatLng implements ILatLng { + + /** + * Constructs a new LatLng. + * @param [properties] Properties to set + */ + constructor(properties?: google.type.ILatLng); + + /** LatLng latitude. */ + public latitude: number; + + /** LatLng longitude. */ + public longitude: number; + + /** + * Creates a new LatLng instance using the specified properties. + * @param [properties] Properties to set + * @returns LatLng instance + */ + public static create(properties?: google.type.ILatLng): google.type.LatLng; + + /** + * Encodes the specified LatLng message. Does not implicitly {@link google.type.LatLng.verify|verify} messages. + * @param message LatLng message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.type.ILatLng, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LatLng message, length delimited. Does not implicitly {@link google.type.LatLng.verify|verify} messages. + * @param message LatLng message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.type.ILatLng, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LatLng message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LatLng + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.type.LatLng; + + /** + * Decodes a LatLng message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LatLng + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.type.LatLng; + + /** + * Verifies a LatLng message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LatLng message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LatLng + */ + public static fromObject(object: { [k: string]: any }): google.type.LatLng; + + /** + * Creates a plain object from a LatLng message. Also converts values to other types if specified. + * @param message LatLng + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.type.LatLng, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LatLng to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LatLng + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + /** Namespace api. */ namespace api { @@ -7674,19 +14200,74 @@ export namespace google { /** Http rules */ rules?: (google.api.IHttpRule[]|null); + + /** Http fullyDecodeReservedExpansion */ + fullyDecodeReservedExpansion?: (boolean|null); } - /** Represents a Http. */ - class Http implements IHttp { + /** Represents a Http. */ + class Http implements IHttp { + + /** + * Constructs a new Http. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttp); + + /** Http rules. */ + public rules: google.api.IHttpRule[]; + + /** Http fullyDecodeReservedExpansion. */ + public fullyDecodeReservedExpansion: boolean; + + /** + * Creates a new Http instance using the specified properties. + * @param [properties] Properties to set + * @returns Http instance + */ + public static create(properties?: google.api.IHttp): google.api.Http; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Constructs a new Http. - * @param [properties] Properties to set + * Decodes a Http message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - constructor(properties?: google.api.IHttp); + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Http; - /** Http rules. */ - public rules: google.api.IHttpRule[]; + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Http; + + /** + * Verifies a Http message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); /** * Creates a Http message from a plain object. Also converts values to their respective internal types. @@ -7720,6 +14301,9 @@ export namespace google { /** Properties of a HttpRule. */ interface IHttpRule { + /** HttpRule selector */ + selector?: (string|null); + /** HttpRule get */ get?: (string|null); @@ -7738,12 +14322,12 @@ export namespace google { /** HttpRule custom */ custom?: (google.api.ICustomHttpPattern|null); - /** HttpRule selector */ - selector?: (string|null); - /** HttpRule body */ body?: (string|null); + /** HttpRule responseBody */ + responseBody?: (string|null); + /** HttpRule additionalBindings */ additionalBindings?: (google.api.IHttpRule[]|null); } @@ -7757,6 +14341,9 @@ export namespace google { */ constructor(properties?: google.api.IHttpRule); + /** HttpRule selector. */ + public selector: string; + /** HttpRule get. */ public get?: (string|null); @@ -7775,18 +14362,67 @@ export namespace google { /** HttpRule custom. */ public custom?: (google.api.ICustomHttpPattern|null); - /** HttpRule selector. */ - public selector: string; - /** HttpRule body. */ public body: string; + /** HttpRule responseBody. */ + public responseBody: string; + /** HttpRule additionalBindings. */ public additionalBindings: google.api.IHttpRule[]; /** HttpRule pattern. */ public pattern?: ("get"|"put"|"post"|"delete"|"patch"|"custom"); + /** + * Creates a new HttpRule instance using the specified properties. + * @param [properties] Properties to set + * @returns HttpRule instance + */ + public static create(properties?: google.api.IHttpRule): google.api.HttpRule; + + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.HttpRule; + + /** + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.HttpRule; + + /** + * Verifies a HttpRule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + /** * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. * @param object Plain object @@ -7841,6 +14477,55 @@ export namespace google { /** CustomHttpPattern path. */ public path: string; + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomHttpPattern instance + */ + public static create(properties?: google.api.ICustomHttpPattern): google.api.CustomHttpPattern; + + /** + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @param message CustomHttpPattern message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @param message CustomHttpPattern message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CustomHttpPattern; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CustomHttpPattern; + + /** + * Verifies a CustomHttpPattern message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + /** * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. * @param object Plain object @@ -7895,6 +14580,55 @@ export namespace google { /** CommonLanguageSettings destinations. */ public destinations: google.api.ClientLibraryDestination[]; + /** + * Creates a new CommonLanguageSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns CommonLanguageSettings instance + */ + public static create(properties?: google.api.ICommonLanguageSettings): google.api.CommonLanguageSettings; + + /** + * Encodes the specified CommonLanguageSettings message. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @param message CommonLanguageSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICommonLanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CommonLanguageSettings message, length delimited. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @param message CommonLanguageSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICommonLanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CommonLanguageSettings; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CommonLanguageSettings; + + /** + * Verifies a CommonLanguageSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + /** * Creates a CommonLanguageSettings message from a plain object. Also converts values to their respective internal types. * @param object Plain object @@ -7931,7 +14665,7 @@ export namespace google { version?: (string|null); /** ClientLibrarySettings launchStage */ - launchStage?: (google.api.LaunchStage|null); + launchStage?: (google.api.LaunchStage|keyof typeof google.api.LaunchStage|null); /** ClientLibrarySettings restNumericEnums */ restNumericEnums?: (boolean|null); @@ -7974,7 +14708,7 @@ export namespace google { public version: string; /** ClientLibrarySettings launchStage. */ - public launchStage: google.api.LaunchStage; + public launchStage: (google.api.LaunchStage|keyof typeof google.api.LaunchStage); /** ClientLibrarySettings restNumericEnums. */ public restNumericEnums: boolean; @@ -8000,1547 +14734,1434 @@ export namespace google { /** ClientLibrarySettings rubySettings. */ public rubySettings?: (google.api.IRubySettings|null); - /** ClientLibrarySettings goSettings. */ - public goSettings?: (google.api.IGoSettings|null); - - /** - * Creates a ClientLibrarySettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ClientLibrarySettings - */ - public static fromObject(object: { [k: string]: any }): google.api.ClientLibrarySettings; - - /** - * Creates a plain object from a ClientLibrarySettings message. Also converts values to other types if specified. - * @param message ClientLibrarySettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.ClientLibrarySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ClientLibrarySettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ClientLibrarySettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Publishing. */ - interface IPublishing { - - /** Publishing methodSettings */ - methodSettings?: (google.api.IMethodSettings[]|null); - - /** Publishing newIssueUri */ - newIssueUri?: (string|null); - - /** Publishing documentationUri */ - documentationUri?: (string|null); - - /** Publishing apiShortName */ - apiShortName?: (string|null); - - /** Publishing githubLabel */ - githubLabel?: (string|null); - - /** Publishing codeownerGithubTeams */ - codeownerGithubTeams?: (string[]|null); - - /** Publishing docTagPrefix */ - docTagPrefix?: (string|null); - - /** Publishing organization */ - organization?: (google.api.ClientLibraryOrganization|null); - - /** Publishing librarySettings */ - librarySettings?: (google.api.IClientLibrarySettings[]|null); - - /** Publishing protoReferenceDocumentationUri */ - protoReferenceDocumentationUri?: (string|null); - } - - /** Represents a Publishing. */ - class Publishing implements IPublishing { - - /** - * Constructs a new Publishing. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IPublishing); - - /** Publishing methodSettings. */ - public methodSettings: google.api.IMethodSettings[]; - - /** Publishing newIssueUri. */ - public newIssueUri: string; - - /** Publishing documentationUri. */ - public documentationUri: string; - - /** Publishing apiShortName. */ - public apiShortName: string; - - /** Publishing githubLabel. */ - public githubLabel: string; - - /** Publishing codeownerGithubTeams. */ - public codeownerGithubTeams: string[]; - - /** Publishing docTagPrefix. */ - public docTagPrefix: string; - - /** Publishing organization. */ - public organization: google.api.ClientLibraryOrganization; - - /** Publishing librarySettings. */ - public librarySettings: google.api.IClientLibrarySettings[]; - - /** Publishing protoReferenceDocumentationUri. */ - public protoReferenceDocumentationUri: string; - - /** - * Creates a Publishing message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Publishing - */ - public static fromObject(object: { [k: string]: any }): google.api.Publishing; - - /** - * Creates a plain object from a Publishing message. Also converts values to other types if specified. - * @param message Publishing - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.Publishing, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Publishing to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Publishing - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a JavaSettings. */ - interface IJavaSettings { - - /** JavaSettings libraryPackage */ - libraryPackage?: (string|null); - - /** JavaSettings serviceClassNames */ - serviceClassNames?: ({ [k: string]: string }|null); - - /** JavaSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a JavaSettings. */ - class JavaSettings implements IJavaSettings { - - /** - * Constructs a new JavaSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IJavaSettings); - - /** JavaSettings libraryPackage. */ - public libraryPackage: string; - - /** JavaSettings serviceClassNames. */ - public serviceClassNames: { [k: string]: string }; - - /** JavaSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); + /** ClientLibrarySettings goSettings. */ + public goSettings?: (google.api.IGoSettings|null); /** - * Creates a JavaSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns JavaSettings + * Creates a new ClientLibrarySettings instance using the specified properties. + * @param [properties] Properties to set + * @returns ClientLibrarySettings instance */ - public static fromObject(object: { [k: string]: any }): google.api.JavaSettings; + public static create(properties?: google.api.IClientLibrarySettings): google.api.ClientLibrarySettings; /** - * Creates a plain object from a JavaSettings message. Also converts values to other types if specified. - * @param message JavaSettings - * @param [options] Conversion options - * @returns Plain object + * Encodes the specified ClientLibrarySettings message. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @param message ClientLibrarySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public static toObject(message: google.api.JavaSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static encode(message: google.api.IClientLibrarySettings, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Converts this JavaSettings to JSON. - * @returns JSON object + * Encodes the specified ClientLibrarySettings message, length delimited. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @param message ClientLibrarySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public toJSON(): { [k: string]: any }; + public static encodeDelimited(message: google.api.IClientLibrarySettings, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Gets the default type url for JavaSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url + * Decodes a ClientLibrarySettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CppSettings. */ - interface ICppSettings { - - /** CppSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a CppSettings. */ - class CppSettings implements ICppSettings { + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ClientLibrarySettings; /** - * Constructs a new CppSettings. - * @param [properties] Properties to set + * Decodes a ClientLibrarySettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - constructor(properties?: google.api.ICppSettings); + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ClientLibrarySettings; - /** CppSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); + /** + * Verifies a ClientLibrarySettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a CppSettings message from a plain object. Also converts values to their respective internal types. + * Creates a ClientLibrarySettings message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CppSettings + * @returns ClientLibrarySettings */ - public static fromObject(object: { [k: string]: any }): google.api.CppSettings; + public static fromObject(object: { [k: string]: any }): google.api.ClientLibrarySettings; /** - * Creates a plain object from a CppSettings message. Also converts values to other types if specified. - * @param message CppSettings + * Creates a plain object from a ClientLibrarySettings message. Also converts values to other types if specified. + * @param message ClientLibrarySettings * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.api.CppSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.api.ClientLibrarySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CppSettings to JSON. + * Converts this ClientLibrarySettings to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for CppSettings + * Gets the default type url for ClientLibrarySettings * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a PhpSettings. */ - interface IPhpSettings { + /** Properties of a Publishing. */ + interface IPublishing { - /** PhpSettings common */ - common?: (google.api.ICommonLanguageSettings|null); + /** Publishing methodSettings */ + methodSettings?: (google.api.IMethodSettings[]|null); + + /** Publishing newIssueUri */ + newIssueUri?: (string|null); + + /** Publishing documentationUri */ + documentationUri?: (string|null); + + /** Publishing apiShortName */ + apiShortName?: (string|null); + + /** Publishing githubLabel */ + githubLabel?: (string|null); + + /** Publishing codeownerGithubTeams */ + codeownerGithubTeams?: (string[]|null); + + /** Publishing docTagPrefix */ + docTagPrefix?: (string|null); + + /** Publishing organization */ + organization?: (google.api.ClientLibraryOrganization|keyof typeof google.api.ClientLibraryOrganization|null); + + /** Publishing librarySettings */ + librarySettings?: (google.api.IClientLibrarySettings[]|null); + + /** Publishing protoReferenceDocumentationUri */ + protoReferenceDocumentationUri?: (string|null); } - /** Represents a PhpSettings. */ - class PhpSettings implements IPhpSettings { + /** Represents a Publishing. */ + class Publishing implements IPublishing { /** - * Constructs a new PhpSettings. + * Constructs a new Publishing. * @param [properties] Properties to set */ - constructor(properties?: google.api.IPhpSettings); + constructor(properties?: google.api.IPublishing); - /** PhpSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); + /** Publishing methodSettings. */ + public methodSettings: google.api.IMethodSettings[]; - /** - * Creates a PhpSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PhpSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.PhpSettings; + /** Publishing newIssueUri. */ + public newIssueUri: string; - /** - * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. - * @param message PhpSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.PhpSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** Publishing documentationUri. */ + public documentationUri: string; - /** - * Converts this PhpSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** Publishing apiShortName. */ + public apiShortName: string; - /** - * Gets the default type url for PhpSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } + /** Publishing githubLabel. */ + public githubLabel: string; - /** Properties of a PythonSettings. */ - interface IPythonSettings { + /** Publishing codeownerGithubTeams. */ + public codeownerGithubTeams: string[]; - /** PythonSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } + /** Publishing docTagPrefix. */ + public docTagPrefix: string; - /** Represents a PythonSettings. */ - class PythonSettings implements IPythonSettings { + /** Publishing organization. */ + public organization: (google.api.ClientLibraryOrganization|keyof typeof google.api.ClientLibraryOrganization); + + /** Publishing librarySettings. */ + public librarySettings: google.api.IClientLibrarySettings[]; + + /** Publishing protoReferenceDocumentationUri. */ + public protoReferenceDocumentationUri: string; /** - * Constructs a new PythonSettings. + * Creates a new Publishing instance using the specified properties. * @param [properties] Properties to set + * @returns Publishing instance */ - constructor(properties?: google.api.IPythonSettings); - - /** PythonSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); + public static create(properties?: google.api.IPublishing): google.api.Publishing; /** - * Creates a PythonSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PythonSettings + * Encodes the specified Publishing message. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @param message Publishing message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public static fromObject(object: { [k: string]: any }): google.api.PythonSettings; + public static encode(message: google.api.IPublishing, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. - * @param message PythonSettings - * @param [options] Conversion options - * @returns Plain object + * Encodes the specified Publishing message, length delimited. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @param message Publishing message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public static toObject(message: google.api.PythonSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static encodeDelimited(message: google.api.IPublishing, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Converts this PythonSettings to JSON. - * @returns JSON object + * Decodes a Publishing message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public toJSON(): { [k: string]: any }; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Publishing; /** - * Gets the default type url for PythonSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url + * Decodes a Publishing message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a NodeSettings. */ - interface INodeSettings { - - /** NodeSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a NodeSettings. */ - class NodeSettings implements INodeSettings { + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Publishing; /** - * Constructs a new NodeSettings. - * @param [properties] Properties to set + * Verifies a Publishing message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - constructor(properties?: google.api.INodeSettings); - - /** NodeSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); + public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a NodeSettings message from a plain object. Also converts values to their respective internal types. + * Creates a Publishing message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns NodeSettings + * @returns Publishing */ - public static fromObject(object: { [k: string]: any }): google.api.NodeSettings; + public static fromObject(object: { [k: string]: any }): google.api.Publishing; /** - * Creates a plain object from a NodeSettings message. Also converts values to other types if specified. - * @param message NodeSettings + * Creates a plain object from a Publishing message. Also converts values to other types if specified. + * @param message Publishing * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.api.NodeSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.api.Publishing, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this NodeSettings to JSON. + * Converts this Publishing to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for NodeSettings + * Gets the default type url for Publishing * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a DotnetSettings. */ - interface IDotnetSettings { - - /** DotnetSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - - /** DotnetSettings renamedServices */ - renamedServices?: ({ [k: string]: string }|null); - - /** DotnetSettings renamedResources */ - renamedResources?: ({ [k: string]: string }|null); + /** Properties of a JavaSettings. */ + interface IJavaSettings { - /** DotnetSettings ignoredResources */ - ignoredResources?: (string[]|null); + /** JavaSettings libraryPackage */ + libraryPackage?: (string|null); - /** DotnetSettings forcedNamespaceAliases */ - forcedNamespaceAliases?: (string[]|null); + /** JavaSettings serviceClassNames */ + serviceClassNames?: ({ [k: string]: string }|null); - /** DotnetSettings handwrittenSignatures */ - handwrittenSignatures?: (string[]|null); + /** JavaSettings common */ + common?: (google.api.ICommonLanguageSettings|null); } - /** Represents a DotnetSettings. */ - class DotnetSettings implements IDotnetSettings { + /** Represents a JavaSettings. */ + class JavaSettings implements IJavaSettings { /** - * Constructs a new DotnetSettings. + * Constructs a new JavaSettings. * @param [properties] Properties to set */ - constructor(properties?: google.api.IDotnetSettings); + constructor(properties?: google.api.IJavaSettings); - /** DotnetSettings common. */ + /** JavaSettings libraryPackage. */ + public libraryPackage: string; + + /** JavaSettings serviceClassNames. */ + public serviceClassNames: { [k: string]: string }; + + /** JavaSettings common. */ public common?: (google.api.ICommonLanguageSettings|null); - /** DotnetSettings renamedServices. */ - public renamedServices: { [k: string]: string }; + /** + * Creates a new JavaSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns JavaSettings instance + */ + public static create(properties?: google.api.IJavaSettings): google.api.JavaSettings; + + /** + * Encodes the specified JavaSettings message. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @param message JavaSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IJavaSettings, writer?: $protobuf.Writer): $protobuf.Writer; - /** DotnetSettings renamedResources. */ - public renamedResources: { [k: string]: string }; + /** + * Encodes the specified JavaSettings message, length delimited. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @param message JavaSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IJavaSettings, writer?: $protobuf.Writer): $protobuf.Writer; - /** DotnetSettings ignoredResources. */ - public ignoredResources: string[]; + /** + * Decodes a JavaSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.JavaSettings; - /** DotnetSettings forcedNamespaceAliases. */ - public forcedNamespaceAliases: string[]; + /** + * Decodes a JavaSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.JavaSettings; - /** DotnetSettings handwrittenSignatures. */ - public handwrittenSignatures: string[]; + /** + * Verifies a JavaSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a DotnetSettings message from a plain object. Also converts values to their respective internal types. + * Creates a JavaSettings message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns DotnetSettings + * @returns JavaSettings */ - public static fromObject(object: { [k: string]: any }): google.api.DotnetSettings; + public static fromObject(object: { [k: string]: any }): google.api.JavaSettings; /** - * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. - * @param message DotnetSettings + * Creates a plain object from a JavaSettings message. Also converts values to other types if specified. + * @param message JavaSettings * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.api.DotnetSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.api.JavaSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this DotnetSettings to JSON. + * Converts this JavaSettings to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for DotnetSettings + * Gets the default type url for JavaSettings * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a RubySettings. */ - interface IRubySettings { + /** Properties of a CppSettings. */ + interface ICppSettings { - /** RubySettings common */ + /** CppSettings common */ common?: (google.api.ICommonLanguageSettings|null); } - /** Represents a RubySettings. */ - class RubySettings implements IRubySettings { + /** Represents a CppSettings. */ + class CppSettings implements ICppSettings { /** - * Constructs a new RubySettings. + * Constructs a new CppSettings. * @param [properties] Properties to set */ - constructor(properties?: google.api.IRubySettings); + constructor(properties?: google.api.ICppSettings); - /** RubySettings common. */ + /** CppSettings common. */ public common?: (google.api.ICommonLanguageSettings|null); /** - * Creates a RubySettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RubySettings + * Creates a new CppSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns CppSettings instance */ - public static fromObject(object: { [k: string]: any }): google.api.RubySettings; + public static create(properties?: google.api.ICppSettings): google.api.CppSettings; /** - * Creates a plain object from a RubySettings message. Also converts values to other types if specified. - * @param message RubySettings - * @param [options] Conversion options - * @returns Plain object + * Encodes the specified CppSettings message. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @param message CppSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public static toObject(message: google.api.RubySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static encode(message: google.api.ICppSettings, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Converts this RubySettings to JSON. - * @returns JSON object + * Encodes the specified CppSettings message, length delimited. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @param message CppSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public toJSON(): { [k: string]: any }; + public static encodeDelimited(message: google.api.ICppSettings, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Gets the default type url for RubySettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url + * Decodes a CppSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GoSettings. */ - interface IGoSettings { - - /** GoSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a GoSettings. */ - class GoSettings implements IGoSettings { + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CppSettings; /** - * Constructs a new GoSettings. - * @param [properties] Properties to set + * Decodes a CppSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - constructor(properties?: google.api.IGoSettings); + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CppSettings; - /** GoSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); + /** + * Verifies a CppSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a GoSettings message from a plain object. Also converts values to their respective internal types. + * Creates a CppSettings message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GoSettings + * @returns CppSettings */ - public static fromObject(object: { [k: string]: any }): google.api.GoSettings; + public static fromObject(object: { [k: string]: any }): google.api.CppSettings; /** - * Creates a plain object from a GoSettings message. Also converts values to other types if specified. - * @param message GoSettings + * Creates a plain object from a CppSettings message. Also converts values to other types if specified. + * @param message CppSettings * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.api.GoSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.api.CppSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GoSettings to JSON. + * Converts this CppSettings to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for GoSettings + * Gets the default type url for CppSettings * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a MethodSettings. */ - interface IMethodSettings { + /** Properties of a PhpSettings. */ + interface IPhpSettings { - /** MethodSettings selector */ - selector?: (string|null); + /** PhpSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } - /** MethodSettings longRunning */ - longRunning?: (google.api.MethodSettings.ILongRunning|null); + /** Represents a PhpSettings. */ + class PhpSettings implements IPhpSettings { - /** MethodSettings autoPopulatedFields */ - autoPopulatedFields?: (string[]|null); - } + /** + * Constructs a new PhpSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IPhpSettings); - /** Represents a MethodSettings. */ - class MethodSettings implements IMethodSettings { + /** PhpSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); /** - * Constructs a new MethodSettings. + * Creates a new PhpSettings instance using the specified properties. * @param [properties] Properties to set + * @returns PhpSettings instance */ - constructor(properties?: google.api.IMethodSettings); + public static create(properties?: google.api.IPhpSettings): google.api.PhpSettings; - /** MethodSettings selector. */ - public selector: string; + /** + * Encodes the specified PhpSettings message. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @param message PhpSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IPhpSettings, writer?: $protobuf.Writer): $protobuf.Writer; - /** MethodSettings longRunning. */ - public longRunning?: (google.api.MethodSettings.ILongRunning|null); + /** + * Encodes the specified PhpSettings message, length delimited. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @param message PhpSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IPhpSettings, writer?: $protobuf.Writer): $protobuf.Writer; - /** MethodSettings autoPopulatedFields. */ - public autoPopulatedFields: string[]; + /** + * Decodes a PhpSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.PhpSettings; /** - * Creates a MethodSettings message from a plain object. Also converts values to their respective internal types. + * Decodes a PhpSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.PhpSettings; + + /** + * Verifies a PhpSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PhpSettings message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns MethodSettings + * @returns PhpSettings */ - public static fromObject(object: { [k: string]: any }): google.api.MethodSettings; + public static fromObject(object: { [k: string]: any }): google.api.PhpSettings; /** - * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. - * @param message MethodSettings + * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. + * @param message PhpSettings * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.api.MethodSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.api.PhpSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this MethodSettings to JSON. + * Converts this PhpSettings to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for MethodSettings + * Gets the default type url for PhpSettings * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - namespace MethodSettings { - - /** Properties of a LongRunning. */ - interface ILongRunning { - - /** LongRunning initialPollDelay */ - initialPollDelay?: (google.protobuf.IDuration|null); - - /** LongRunning pollDelayMultiplier */ - pollDelayMultiplier?: (number|null); - - /** LongRunning maxPollDelay */ - maxPollDelay?: (google.protobuf.IDuration|null); - - /** LongRunning totalPollTimeout */ - totalPollTimeout?: (google.protobuf.IDuration|null); - } - - /** Represents a LongRunning. */ - class LongRunning implements ILongRunning { - - /** - * Constructs a new LongRunning. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.MethodSettings.ILongRunning); - - /** LongRunning initialPollDelay. */ - public initialPollDelay?: (google.protobuf.IDuration|null); - - /** LongRunning pollDelayMultiplier. */ - public pollDelayMultiplier: number; - - /** LongRunning maxPollDelay. */ - public maxPollDelay?: (google.protobuf.IDuration|null); - - /** LongRunning totalPollTimeout. */ - public totalPollTimeout?: (google.protobuf.IDuration|null); - - /** - * Creates a LongRunning message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns LongRunning - */ - public static fromObject(object: { [k: string]: any }): google.api.MethodSettings.LongRunning; - - /** - * Creates a plain object from a LongRunning message. Also converts values to other types if specified. - * @param message LongRunning - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.MethodSettings.LongRunning, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this LongRunning to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for LongRunning - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** ClientLibraryOrganization enum. */ - type ClientLibraryOrganization = - "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED"| "CLOUD"| "ADS"| "PHOTOS"| "STREET_VIEW"| "SHOPPING"| "GEO"| "GENERATIVE_AI"; - - /** ClientLibraryDestination enum. */ - type ClientLibraryDestination = - "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED"| "GITHUB"| "PACKAGE_MANAGER"; - - /** FieldBehavior enum. */ - type FieldBehavior = - "FIELD_BEHAVIOR_UNSPECIFIED"| "OPTIONAL"| "REQUIRED"| "OUTPUT_ONLY"| "INPUT_ONLY"| "IMMUTABLE"| "UNORDERED_LIST"| "NON_EMPTY_DEFAULT"| "IDENTIFIER"; - - /** LaunchStage enum. */ - type LaunchStage = - "LAUNCH_STAGE_UNSPECIFIED"| "UNIMPLEMENTED"| "PRELAUNCH"| "EARLY_ACCESS"| "ALPHA"| "BETA"| "GA"| "DEPRECATED"; - - /** Properties of a ResourceDescriptor. */ - interface IResourceDescriptor { - - /** ResourceDescriptor type */ - type?: (string|null); - - /** ResourceDescriptor pattern */ - pattern?: (string[]|null); - - /** ResourceDescriptor nameField */ - nameField?: (string|null); - - /** ResourceDescriptor history */ - history?: (google.api.ResourceDescriptor.History|null); - - /** ResourceDescriptor plural */ - plural?: (string|null); - - /** ResourceDescriptor singular */ - singular?: (string|null); + /** Properties of a PythonSettings. */ + interface IPythonSettings { - /** ResourceDescriptor style */ - style?: (google.api.ResourceDescriptor.Style[]|null); + /** PythonSettings common */ + common?: (google.api.ICommonLanguageSettings|null); } - /** Represents a ResourceDescriptor. */ - class ResourceDescriptor implements IResourceDescriptor { + /** Represents a PythonSettings. */ + class PythonSettings implements IPythonSettings { /** - * Constructs a new ResourceDescriptor. + * Constructs a new PythonSettings. * @param [properties] Properties to set */ - constructor(properties?: google.api.IResourceDescriptor); + constructor(properties?: google.api.IPythonSettings); - /** ResourceDescriptor type. */ - public type: string; + /** PythonSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); - /** ResourceDescriptor pattern. */ - public pattern: string[]; + /** + * Creates a new PythonSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns PythonSettings instance + */ + public static create(properties?: google.api.IPythonSettings): google.api.PythonSettings; - /** ResourceDescriptor nameField. */ - public nameField: string; + /** + * Encodes the specified PythonSettings message. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @param message PythonSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IPythonSettings, writer?: $protobuf.Writer): $protobuf.Writer; - /** ResourceDescriptor history. */ - public history: google.api.ResourceDescriptor.History; + /** + * Encodes the specified PythonSettings message, length delimited. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @param message PythonSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IPythonSettings, writer?: $protobuf.Writer): $protobuf.Writer; - /** ResourceDescriptor plural. */ - public plural: string; + /** + * Decodes a PythonSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.PythonSettings; - /** ResourceDescriptor singular. */ - public singular: string; + /** + * Decodes a PythonSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.PythonSettings; - /** ResourceDescriptor style. */ - public style: google.api.ResourceDescriptor.Style[]; + /** + * Verifies a PythonSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * Creates a PythonSettings message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ResourceDescriptor + * @returns PythonSettings */ - public static fromObject(object: { [k: string]: any }): google.api.ResourceDescriptor; + public static fromObject(object: { [k: string]: any }): google.api.PythonSettings; /** - * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. - * @param message ResourceDescriptor + * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. + * @param message PythonSettings * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.api.ResourceDescriptor, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.api.PythonSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ResourceDescriptor to JSON. + * Converts this PythonSettings to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ResourceDescriptor + * Gets the default type url for PythonSettings * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - namespace ResourceDescriptor { - - /** History enum. */ - type History = - "HISTORY_UNSPECIFIED"| "ORIGINALLY_SINGLE_PATTERN"| "FUTURE_MULTI_PATTERN"; - - /** Style enum. */ - type Style = - "STYLE_UNSPECIFIED"| "DECLARATIVE_FRIENDLY"; - } - - /** Properties of a ResourceReference. */ - interface IResourceReference { - - /** ResourceReference type */ - type?: (string|null); + /** Properties of a NodeSettings. */ + interface INodeSettings { - /** ResourceReference childType */ - childType?: (string|null); + /** NodeSettings common */ + common?: (google.api.ICommonLanguageSettings|null); } - /** Represents a ResourceReference. */ - class ResourceReference implements IResourceReference { + /** Represents a NodeSettings. */ + class NodeSettings implements INodeSettings { /** - * Constructs a new ResourceReference. + * Constructs a new NodeSettings. * @param [properties] Properties to set */ - constructor(properties?: google.api.IResourceReference); - - /** ResourceReference type. */ - public type: string; + constructor(properties?: google.api.INodeSettings); - /** ResourceReference childType. */ - public childType: string; + /** NodeSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); /** - * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ResourceReference + * Creates a new NodeSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeSettings instance */ - public static fromObject(object: { [k: string]: any }): google.api.ResourceReference; + public static create(properties?: google.api.INodeSettings): google.api.NodeSettings; /** - * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. - * @param message ResourceReference - * @param [options] Conversion options - * @returns Plain object + * Encodes the specified NodeSettings message. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @param message NodeSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public static toObject(message: google.api.ResourceReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static encode(message: google.api.INodeSettings, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Converts this ResourceReference to JSON. - * @returns JSON object + * Encodes the specified NodeSettings message, length delimited. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @param message NodeSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public toJSON(): { [k: string]: any }; + public static encodeDelimited(message: google.api.INodeSettings, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Gets the default type url for ResourceReference - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url + * Decodes a NodeSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Namespace type. */ - namespace type { - - /** Properties of a LatLng. */ - interface ILatLng { - - /** LatLng latitude */ - latitude?: (number|null); - - /** LatLng longitude */ - longitude?: (number|null); - } - - /** Represents a LatLng. */ - class LatLng implements ILatLng { + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.NodeSettings; /** - * Constructs a new LatLng. - * @param [properties] Properties to set + * Decodes a NodeSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - constructor(properties?: google.type.ILatLng); - - /** LatLng latitude. */ - public latitude: number; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.NodeSettings; - /** LatLng longitude. */ - public longitude: number; + /** + * Verifies a NodeSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a LatLng message from a plain object. Also converts values to their respective internal types. + * Creates a NodeSettings message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns LatLng + * @returns NodeSettings */ - public static fromObject(object: { [k: string]: any }): google.type.LatLng; + public static fromObject(object: { [k: string]: any }): google.api.NodeSettings; /** - * Creates a plain object from a LatLng message. Also converts values to other types if specified. - * @param message LatLng + * Creates a plain object from a NodeSettings message. Also converts values to other types if specified. + * @param message NodeSettings * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.type.LatLng, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.api.NodeSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this LatLng to JSON. + * Converts this NodeSettings to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for LatLng + * Gets the default type url for NodeSettings * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - } - /** Namespace rpc. */ - namespace rpc { + /** Properties of a DotnetSettings. */ + interface IDotnetSettings { - /** Properties of a Status. */ - interface IStatus { + /** DotnetSettings common */ + common?: (google.api.ICommonLanguageSettings|null); - /** Status code */ - code?: (number|null); + /** DotnetSettings renamedServices */ + renamedServices?: ({ [k: string]: string }|null); - /** Status message */ - message?: (string|null); + /** DotnetSettings renamedResources */ + renamedResources?: ({ [k: string]: string }|null); - /** Status details */ - details?: (google.protobuf.IAny[]|null); + /** DotnetSettings ignoredResources */ + ignoredResources?: (string[]|null); + + /** DotnetSettings forcedNamespaceAliases */ + forcedNamespaceAliases?: (string[]|null); + + /** DotnetSettings handwrittenSignatures */ + handwrittenSignatures?: (string[]|null); } - /** Represents a Status. */ - class Status implements IStatus { + /** Represents a DotnetSettings. */ + class DotnetSettings implements IDotnetSettings { /** - * Constructs a new Status. + * Constructs a new DotnetSettings. * @param [properties] Properties to set */ - constructor(properties?: google.rpc.IStatus); + constructor(properties?: google.api.IDotnetSettings); - /** Status code. */ - public code: number; + /** DotnetSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); - /** Status message. */ - public message: string; + /** DotnetSettings renamedServices. */ + public renamedServices: { [k: string]: string }; - /** Status details. */ - public details: google.protobuf.IAny[]; + /** DotnetSettings renamedResources. */ + public renamedResources: { [k: string]: string }; - /** - * Creates a Status message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Status - */ - public static fromObject(object: { [k: string]: any }): google.rpc.Status; + /** DotnetSettings ignoredResources. */ + public ignoredResources: string[]; - /** - * Creates a plain object from a Status message. Also converts values to other types if specified. - * @param message Status - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.rpc.Status, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** DotnetSettings forcedNamespaceAliases. */ + public forcedNamespaceAliases: string[]; - /** - * Converts this Status to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** DotnetSettings handwrittenSignatures. */ + public handwrittenSignatures: string[]; /** - * Gets the default type url for Status - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url + * Creates a new DotnetSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns DotnetSettings instance */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Namespace longrunning. */ - namespace longrunning { - - /** Represents an Operations */ - class Operations extends $protobuf.rpc.Service { + public static create(properties?: google.api.IDotnetSettings): google.api.DotnetSettings; /** - * Constructs a new Operations service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited + * Encodes the specified DotnetSettings message. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @param message DotnetSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + public static encode(message: google.api.IDotnetSettings, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls ListOperations. - * @param request ListOperationsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListOperationsResponse + * Encodes the specified DotnetSettings message, length delimited. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @param message DotnetSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public listOperations(request: google.longrunning.IListOperationsRequest, callback: google.longrunning.Operations.ListOperationsCallback): void; + public static encodeDelimited(message: google.api.IDotnetSettings, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls ListOperations. - * @param request ListOperationsRequest message or plain object - * @returns Promise + * Decodes a DotnetSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public listOperations(request: google.longrunning.IListOperationsRequest): Promise; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.DotnetSettings; /** - * Calls GetOperation. - * @param request GetOperationRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * Decodes a DotnetSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public getOperation(request: google.longrunning.IGetOperationRequest, callback: google.longrunning.Operations.GetOperationCallback): void; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.DotnetSettings; /** - * Calls GetOperation. - * @param request GetOperationRequest message or plain object - * @returns Promise + * Verifies a DotnetSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - public getOperation(request: google.longrunning.IGetOperationRequest): Promise; + public static verify(message: { [k: string]: any }): (string|null); /** - * Calls DeleteOperation. - * @param request DeleteOperationRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty + * Creates a DotnetSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DotnetSettings */ - public deleteOperation(request: google.longrunning.IDeleteOperationRequest, callback: google.longrunning.Operations.DeleteOperationCallback): void; + public static fromObject(object: { [k: string]: any }): google.api.DotnetSettings; /** - * Calls DeleteOperation. - * @param request DeleteOperationRequest message or plain object - * @returns Promise + * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. + * @param message DotnetSettings + * @param [options] Conversion options + * @returns Plain object */ - public deleteOperation(request: google.longrunning.IDeleteOperationRequest): Promise; + public static toObject(message: google.api.DotnetSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Calls CancelOperation. - * @param request CancelOperationRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty + * Converts this DotnetSettings to JSON. + * @returns JSON object */ - public cancelOperation(request: google.longrunning.ICancelOperationRequest, callback: google.longrunning.Operations.CancelOperationCallback): void; + public toJSON(): { [k: string]: any }; /** - * Calls CancelOperation. - * @param request CancelOperationRequest message or plain object - * @returns Promise + * Gets the default type url for DotnetSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url */ - public cancelOperation(request: google.longrunning.ICancelOperationRequest): Promise; + public static getTypeUrl(typeUrlPrefix?: string): string; + } - /** - * Calls WaitOperation. - * @param request WaitOperationRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public waitOperation(request: google.longrunning.IWaitOperationRequest, callback: google.longrunning.Operations.WaitOperationCallback): void; + /** Properties of a RubySettings. */ + interface IRubySettings { - /** - * Calls WaitOperation. - * @param request WaitOperationRequest message or plain object - * @returns Promise - */ - public waitOperation(request: google.longrunning.IWaitOperationRequest): Promise; + /** RubySettings common */ + common?: (google.api.ICommonLanguageSettings|null); } - namespace Operations { + /** Represents a RubySettings. */ + class RubySettings implements IRubySettings { /** - * Callback as used by {@link google.longrunning.Operations#listOperations}. - * @param error Error, if any - * @param [response] ListOperationsResponse + * Constructs a new RubySettings. + * @param [properties] Properties to set */ - type ListOperationsCallback = (error: (Error|null), response?: google.longrunning.ListOperationsResponse) => void; + constructor(properties?: google.api.IRubySettings); + + /** RubySettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); /** - * Callback as used by {@link google.longrunning.Operations#getOperation}. - * @param error Error, if any - * @param [response] Operation + * Creates a new RubySettings instance using the specified properties. + * @param [properties] Properties to set + * @returns RubySettings instance */ - type GetOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + public static create(properties?: google.api.IRubySettings): google.api.RubySettings; /** - * Callback as used by {@link google.longrunning.Operations#deleteOperation}. - * @param error Error, if any - * @param [response] Empty + * Encodes the specified RubySettings message. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @param message RubySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - type DeleteOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + public static encode(message: google.api.IRubySettings, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Callback as used by {@link google.longrunning.Operations#cancelOperation}. - * @param error Error, if any - * @param [response] Empty + * Encodes the specified RubySettings message, length delimited. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @param message RubySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - type CancelOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + public static encodeDelimited(message: google.api.IRubySettings, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Callback as used by {@link google.longrunning.Operations#waitOperation}. - * @param error Error, if any - * @param [response] Operation + * Decodes a RubySettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - type WaitOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - } - - /** Properties of an Operation. */ - interface IOperation { - - /** Operation name */ - name?: (string|null); - - /** Operation metadata */ - metadata?: (google.protobuf.IAny|null); - - /** Operation done */ - done?: (boolean|null); - - /** Operation error */ - error?: (google.rpc.IStatus|null); - - /** Operation response */ - response?: (google.protobuf.IAny|null); - } - - /** Represents an Operation. */ - class Operation implements IOperation { + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.RubySettings; /** - * Constructs a new Operation. - * @param [properties] Properties to set + * Decodes a RubySettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - constructor(properties?: google.longrunning.IOperation); - - /** Operation name. */ - public name: string; - - /** Operation metadata. */ - public metadata?: (google.protobuf.IAny|null); - - /** Operation done. */ - public done: boolean; - - /** Operation error. */ - public error?: (google.rpc.IStatus|null); + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.RubySettings; - /** Operation response. */ - public response?: (google.protobuf.IAny|null); - - /** Operation result. */ - public result?: ("error"|"response"); + /** + * Verifies a RubySettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an Operation message from a plain object. Also converts values to their respective internal types. + * Creates a RubySettings message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Operation + * @returns RubySettings */ - public static fromObject(object: { [k: string]: any }): google.longrunning.Operation; + public static fromObject(object: { [k: string]: any }): google.api.RubySettings; /** - * Creates a plain object from an Operation message. Also converts values to other types if specified. - * @param message Operation + * Creates a plain object from a RubySettings message. Also converts values to other types if specified. + * @param message RubySettings * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.longrunning.Operation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.api.RubySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Operation to JSON. + * Converts this RubySettings to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for Operation + * Gets the default type url for RubySettings * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a GetOperationRequest. */ - interface IGetOperationRequest { + /** Properties of a GoSettings. */ + interface IGoSettings { - /** GetOperationRequest name */ - name?: (string|null); + /** GoSettings common */ + common?: (google.api.ICommonLanguageSettings|null); } - /** Represents a GetOperationRequest. */ - class GetOperationRequest implements IGetOperationRequest { + /** Represents a GoSettings. */ + class GoSettings implements IGoSettings { + + /** + * Constructs a new GoSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IGoSettings); + + /** GoSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); /** - * Constructs a new GetOperationRequest. + * Creates a new GoSettings instance using the specified properties. * @param [properties] Properties to set + * @returns GoSettings instance */ - constructor(properties?: google.longrunning.IGetOperationRequest); - - /** GetOperationRequest name. */ - public name: string; + public static create(properties?: google.api.IGoSettings): google.api.GoSettings; /** - * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetOperationRequest + * Encodes the specified GoSettings message. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @param message GoSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public static fromObject(object: { [k: string]: any }): google.longrunning.GetOperationRequest; + public static encode(message: google.api.IGoSettings, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. - * @param message GetOperationRequest - * @param [options] Conversion options - * @returns Plain object + * Encodes the specified GoSettings message, length delimited. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @param message GoSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public static toObject(message: google.longrunning.GetOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static encodeDelimited(message: google.api.IGoSettings, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Converts this GetOperationRequest to JSON. - * @returns JSON object + * Decodes a GoSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public toJSON(): { [k: string]: any }; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.GoSettings; /** - * Gets the default type url for GetOperationRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url + * Decodes a GoSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListOperationsRequest. */ - interface IListOperationsRequest { - - /** ListOperationsRequest name */ - name?: (string|null); - - /** ListOperationsRequest filter */ - filter?: (string|null); - - /** ListOperationsRequest pageSize */ - pageSize?: (number|null); - - /** ListOperationsRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a ListOperationsRequest. */ - class ListOperationsRequest implements IListOperationsRequest { + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.GoSettings; /** - * Constructs a new ListOperationsRequest. - * @param [properties] Properties to set + * Verifies a GoSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - constructor(properties?: google.longrunning.IListOperationsRequest); - - /** ListOperationsRequest name. */ - public name: string; - - /** ListOperationsRequest filter. */ - public filter: string; - - /** ListOperationsRequest pageSize. */ - public pageSize: number; - - /** ListOperationsRequest pageToken. */ - public pageToken: string; + public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GoSettings message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListOperationsRequest + * @returns GoSettings */ - public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsRequest; + public static fromObject(object: { [k: string]: any }): google.api.GoSettings; /** - * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. - * @param message ListOperationsRequest + * Creates a plain object from a GoSettings message. Also converts values to other types if specified. + * @param message GoSettings * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.longrunning.ListOperationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.api.GoSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListOperationsRequest to JSON. + * Converts this GoSettings to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ListOperationsRequest + * Gets the default type url for GoSettings * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a ListOperationsResponse. */ - interface IListOperationsResponse { + /** Properties of a MethodSettings. */ + interface IMethodSettings { + + /** MethodSettings selector */ + selector?: (string|null); - /** ListOperationsResponse operations */ - operations?: (google.longrunning.IOperation[]|null); + /** MethodSettings longRunning */ + longRunning?: (google.api.MethodSettings.ILongRunning|null); - /** ListOperationsResponse nextPageToken */ - nextPageToken?: (string|null); + /** MethodSettings autoPopulatedFields */ + autoPopulatedFields?: (string[]|null); } - /** Represents a ListOperationsResponse. */ - class ListOperationsResponse implements IListOperationsResponse { + /** Represents a MethodSettings. */ + class MethodSettings implements IMethodSettings { /** - * Constructs a new ListOperationsResponse. + * Constructs a new MethodSettings. * @param [properties] Properties to set */ - constructor(properties?: google.longrunning.IListOperationsResponse); + constructor(properties?: google.api.IMethodSettings); + + /** MethodSettings selector. */ + public selector: string; - /** ListOperationsResponse operations. */ - public operations: google.longrunning.IOperation[]; + /** MethodSettings longRunning. */ + public longRunning?: (google.api.MethodSettings.ILongRunning|null); - /** ListOperationsResponse nextPageToken. */ - public nextPageToken: string; + /** MethodSettings autoPopulatedFields. */ + public autoPopulatedFields: string[]; /** - * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListOperationsResponse + * Creates a new MethodSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodSettings instance */ - public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsResponse; + public static create(properties?: google.api.IMethodSettings): google.api.MethodSettings; /** - * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. - * @param message ListOperationsResponse - * @param [options] Conversion options - * @returns Plain object + * Encodes the specified MethodSettings message. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @param message MethodSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public static toObject(message: google.longrunning.ListOperationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static encode(message: google.api.IMethodSettings, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Converts this ListOperationsResponse to JSON. - * @returns JSON object + * Encodes the specified MethodSettings message, length delimited. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @param message MethodSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public toJSON(): { [k: string]: any }; + public static encodeDelimited(message: google.api.IMethodSettings, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Gets the default type url for ListOperationsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url + * Decodes a MethodSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CancelOperationRequest. */ - interface ICancelOperationRequest { - - /** CancelOperationRequest name */ - name?: (string|null); - } - - /** Represents a CancelOperationRequest. */ - class CancelOperationRequest implements ICancelOperationRequest { + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.MethodSettings; /** - * Constructs a new CancelOperationRequest. - * @param [properties] Properties to set + * Decodes a MethodSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - constructor(properties?: google.longrunning.ICancelOperationRequest); + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.MethodSettings; - /** CancelOperationRequest name. */ - public name: string; + /** + * Verifies a MethodSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. + * Creates a MethodSettings message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CancelOperationRequest + * @returns MethodSettings */ - public static fromObject(object: { [k: string]: any }): google.longrunning.CancelOperationRequest; + public static fromObject(object: { [k: string]: any }): google.api.MethodSettings; /** - * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. - * @param message CancelOperationRequest + * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. + * @param message MethodSettings * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.longrunning.CancelOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.api.MethodSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CancelOperationRequest to JSON. + * Converts this MethodSettings to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for CancelOperationRequest + * Gets the default type url for MethodSettings * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a DeleteOperationRequest. */ - interface IDeleteOperationRequest { + namespace MethodSettings { - /** DeleteOperationRequest name */ - name?: (string|null); - } + /** Properties of a LongRunning. */ + interface ILongRunning { - /** Represents a DeleteOperationRequest. */ - class DeleteOperationRequest implements IDeleteOperationRequest { + /** LongRunning initialPollDelay */ + initialPollDelay?: (google.protobuf.IDuration|null); - /** - * Constructs a new DeleteOperationRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IDeleteOperationRequest); + /** LongRunning pollDelayMultiplier */ + pollDelayMultiplier?: (number|null); - /** DeleteOperationRequest name. */ - public name: string; + /** LongRunning maxPollDelay */ + maxPollDelay?: (google.protobuf.IDuration|null); - /** - * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteOperationRequest - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.DeleteOperationRequest; + /** LongRunning totalPollTimeout */ + totalPollTimeout?: (google.protobuf.IDuration|null); + } - /** - * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. - * @param message DeleteOperationRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.DeleteOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** Represents a LongRunning. */ + class LongRunning implements ILongRunning { - /** - * Converts this DeleteOperationRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** + * Constructs a new LongRunning. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.MethodSettings.ILongRunning); - /** - * Gets the default type url for DeleteOperationRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; + /** LongRunning initialPollDelay. */ + public initialPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning pollDelayMultiplier. */ + public pollDelayMultiplier: number; + + /** LongRunning maxPollDelay. */ + public maxPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning totalPollTimeout. */ + public totalPollTimeout?: (google.protobuf.IDuration|null); + + /** + * Creates a new LongRunning instance using the specified properties. + * @param [properties] Properties to set + * @returns LongRunning instance + */ + public static create(properties?: google.api.MethodSettings.ILongRunning): google.api.MethodSettings.LongRunning; + + /** + * Encodes the specified LongRunning message. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @param message LongRunning message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.MethodSettings.ILongRunning, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LongRunning message, length delimited. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @param message LongRunning message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.MethodSettings.ILongRunning, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LongRunning message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.MethodSettings.LongRunning; + + /** + * Decodes a LongRunning message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.MethodSettings.LongRunning; + + /** + * Verifies a LongRunning message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LongRunning message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LongRunning + */ + public static fromObject(object: { [k: string]: any }): google.api.MethodSettings.LongRunning; + + /** + * Creates a plain object from a LongRunning message. Also converts values to other types if specified. + * @param message LongRunning + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.MethodSettings.LongRunning, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LongRunning to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LongRunning + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } } - /** Properties of a WaitOperationRequest. */ - interface IWaitOperationRequest { + /** ClientLibraryOrganization enum. */ + enum ClientLibraryOrganization { + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0, + CLOUD = 1, + ADS = 2, + PHOTOS = 3, + STREET_VIEW = 4, + SHOPPING = 5, + GEO = 6, + GENERATIVE_AI = 7 + } - /** WaitOperationRequest name */ - name?: (string|null); + /** ClientLibraryDestination enum. */ + enum ClientLibraryDestination { + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0, + GITHUB = 10, + PACKAGE_MANAGER = 20 + } + + /** LaunchStage enum. */ + enum LaunchStage { + LAUNCH_STAGE_UNSPECIFIED = 0, + UNIMPLEMENTED = 6, + PRELAUNCH = 7, + EARLY_ACCESS = 1, + ALPHA = 2, + BETA = 3, + GA = 4, + DEPRECATED = 5 + } + + /** FieldBehavior enum. */ + enum FieldBehavior { + FIELD_BEHAVIOR_UNSPECIFIED = 0, + OPTIONAL = 1, + REQUIRED = 2, + OUTPUT_ONLY = 3, + INPUT_ONLY = 4, + IMMUTABLE = 5, + UNORDERED_LIST = 6, + NON_EMPTY_DEFAULT = 7, + IDENTIFIER = 8 + } + } + + /** Namespace rpc. */ + namespace rpc { + + /** Properties of a Status. */ + interface IStatus { + + /** Status code */ + code?: (number|null); + + /** Status message */ + message?: (string|null); - /** WaitOperationRequest timeout */ - timeout?: (google.protobuf.IDuration|null); + /** Status details */ + details?: (google.protobuf.IAny[]|null); } - /** Represents a WaitOperationRequest. */ - class WaitOperationRequest implements IWaitOperationRequest { + /** Represents a Status. */ + class Status implements IStatus { /** - * Constructs a new WaitOperationRequest. + * Constructs a new Status. * @param [properties] Properties to set */ - constructor(properties?: google.longrunning.IWaitOperationRequest); + constructor(properties?: google.rpc.IStatus); - /** WaitOperationRequest name. */ - public name: string; + /** Status code. */ + public code: number; + + /** Status message. */ + public message: string; - /** WaitOperationRequest timeout. */ - public timeout?: (google.protobuf.IDuration|null); + /** Status details. */ + public details: google.protobuf.IAny[]; /** - * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns WaitOperationRequest + * Creates a new Status instance using the specified properties. + * @param [properties] Properties to set + * @returns Status instance */ - public static fromObject(object: { [k: string]: any }): google.longrunning.WaitOperationRequest; + public static create(properties?: google.rpc.IStatus): google.rpc.Status; /** - * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. - * @param message WaitOperationRequest - * @param [options] Conversion options - * @returns Plain object + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public static toObject(message: google.longrunning.WaitOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static encode(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Converts this WaitOperationRequest to JSON. - * @returns JSON object + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public toJSON(): { [k: string]: any }; + public static encodeDelimited(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Gets the default type url for WaitOperationRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url + * Decodes a Status message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an OperationInfo. */ - interface IOperationInfo { - - /** OperationInfo responseType */ - responseType?: (string|null); - - /** OperationInfo metadataType */ - metadataType?: (string|null); - } - - /** Represents an OperationInfo. */ - class OperationInfo implements IOperationInfo { + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.rpc.Status; /** - * Constructs a new OperationInfo. - * @param [properties] Properties to set + * Decodes a Status message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - constructor(properties?: google.longrunning.IOperationInfo); - - /** OperationInfo responseType. */ - public responseType: string; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.rpc.Status; - /** OperationInfo metadataType. */ - public metadataType: string; + /** + * Verifies a Status message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. + * Creates a Status message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns OperationInfo + * @returns Status */ - public static fromObject(object: { [k: string]: any }): google.longrunning.OperationInfo; + public static fromObject(object: { [k: string]: any }): google.rpc.Status; /** - * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. - * @param message OperationInfo + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @param message Status * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.longrunning.OperationInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.rpc.Status, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this OperationInfo to JSON. + * Converts this Status to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for OperationInfo + * Gets the default type url for Status * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ diff --git a/dev/protos/firestore_v1_proto_api.js b/dev/protos/firestore_v1_proto_api.js index 2261afc81..d85877438 100644 --- a/dev/protos/firestore_v1_proto_api.js +++ b/dev/protos/firestore_v1_proto_api.js @@ -1,18 +1,16 @@ -/*! - * Copyright 2024 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. - */ +// Copyright 2024 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 */ @@ -21,1013 +19,202 @@ define(["protobufjs/minimal"], factory); /* CommonJS */ else if (typeof require === 'function' && typeof module === 'object' && module && module.exports) - module.exports = factory(require("protobufjs/minimal")); + module.exports = factory(require("google-gax/build/src/protobuf").protobufMinimal); })(this, function($protobuf) { "use strict"; // Common aliases - var $util = $protobuf.util; - + var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + // Exported root namespace - var $root = $protobuf.roots.firestore_v1 || ($protobuf.roots.firestore_v1 = {}); - - $root.firestore = (function() { - - /** - * Namespace firestore. - * @exports firestore - * @namespace - */ - var firestore = {}; - - firestore.BundledQuery = (function() { - - /** - * Properties of a BundledQuery. - * @memberof firestore - * @interface IBundledQuery - * @property {string|null} [parent] BundledQuery parent - * @property {google.firestore.v1.IStructuredQuery|null} [structuredQuery] BundledQuery structuredQuery - * @property {firestore.BundledQuery.LimitType|null} [limitType] BundledQuery limitType - */ - - /** - * Constructs a new BundledQuery. - * @memberof firestore - * @classdesc Represents a BundledQuery. - * @implements IBundledQuery - * @constructor - * @param {firestore.IBundledQuery=} [properties] Properties to set - */ - function BundledQuery(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]]; - } - - /** - * BundledQuery parent. - * @member {string} parent - * @memberof firestore.BundledQuery - * @instance - */ - BundledQuery.prototype.parent = ""; - - /** - * BundledQuery structuredQuery. - * @member {google.firestore.v1.IStructuredQuery|null|undefined} structuredQuery - * @memberof firestore.BundledQuery - * @instance - */ - BundledQuery.prototype.structuredQuery = null; - - /** - * BundledQuery limitType. - * @member {firestore.BundledQuery.LimitType} limitType - * @memberof firestore.BundledQuery - * @instance - */ - BundledQuery.prototype.limitType = 0; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * BundledQuery queryType. - * @member {"structuredQuery"|undefined} queryType - * @memberof firestore.BundledQuery - * @instance - */ - Object.defineProperty(BundledQuery.prototype, "queryType", { - get: $util.oneOfGetter($oneOfFields = ["structuredQuery"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a BundledQuery message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof firestore.BundledQuery - * @static - * @param {Object.} object Plain object - * @returns {firestore.BundledQuery} BundledQuery - */ - BundledQuery.fromObject = function fromObject(object) { - if (object instanceof $root.firestore.BundledQuery) - return object; - var message = new $root.firestore.BundledQuery(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.structuredQuery != null) { - if (typeof object.structuredQuery !== "object") - throw TypeError(".firestore.BundledQuery.structuredQuery: object expected"); - message.structuredQuery = $root.google.firestore.v1.StructuredQuery.fromObject(object.structuredQuery); - } - switch (object.limitType) { - default: - if (typeof object.limitType === "number") { - message.limitType = object.limitType; - break; - } - break; - case "FIRST": - case 0: - message.limitType = 0; - break; - case "LAST": - case 1: - message.limitType = 1; - break; - } - return message; - }; - - /** - * Creates a plain object from a BundledQuery message. Also converts values to other types if specified. - * @function toObject - * @memberof firestore.BundledQuery - * @static - * @param {firestore.BundledQuery} message BundledQuery - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BundledQuery.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.limitType = options.enums === String ? "FIRST" : 0; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.structuredQuery != null && message.hasOwnProperty("structuredQuery")) { - object.structuredQuery = $root.google.firestore.v1.StructuredQuery.toObject(message.structuredQuery, options); - if (options.oneofs) - object.queryType = "structuredQuery"; - } - if (message.limitType != null && message.hasOwnProperty("limitType")) - object.limitType = options.enums === String ? $root.firestore.BundledQuery.LimitType[message.limitType] === undefined ? message.limitType : $root.firestore.BundledQuery.LimitType[message.limitType] : message.limitType; - return object; - }; - - /** - * Converts this BundledQuery to JSON. - * @function toJSON - * @memberof firestore.BundledQuery - * @instance - * @returns {Object.} JSON object - */ - BundledQuery.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BundledQuery - * @function getTypeUrl - * @memberof firestore.BundledQuery - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BundledQuery.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/firestore.BundledQuery"; - }; - - /** - * LimitType enum. - * @name firestore.BundledQuery.LimitType - * @enum {string} - * @property {string} FIRST=FIRST FIRST value - * @property {string} LAST=LAST LAST value - */ - BundledQuery.LimitType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "FIRST"] = "FIRST"; - values[valuesById[1] = "LAST"] = "LAST"; - return values; - })(); - - return BundledQuery; - })(); - - firestore.NamedQuery = (function() { - - /** - * Properties of a NamedQuery. - * @memberof firestore - * @interface INamedQuery - * @property {string|null} [name] NamedQuery name - * @property {firestore.IBundledQuery|null} [bundledQuery] NamedQuery bundledQuery - * @property {google.protobuf.ITimestamp|null} [readTime] NamedQuery readTime - */ - - /** - * Constructs a new NamedQuery. - * @memberof firestore - * @classdesc Represents a NamedQuery. - * @implements INamedQuery - * @constructor - * @param {firestore.INamedQuery=} [properties] Properties to set - */ - function NamedQuery(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]]; - } - - /** - * NamedQuery name. - * @member {string} name - * @memberof firestore.NamedQuery - * @instance - */ - NamedQuery.prototype.name = ""; - - /** - * NamedQuery bundledQuery. - * @member {firestore.IBundledQuery|null|undefined} bundledQuery - * @memberof firestore.NamedQuery - * @instance - */ - NamedQuery.prototype.bundledQuery = null; - - /** - * NamedQuery readTime. - * @member {google.protobuf.ITimestamp|null|undefined} readTime - * @memberof firestore.NamedQuery - * @instance - */ - NamedQuery.prototype.readTime = null; - - /** - * Creates a NamedQuery message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof firestore.NamedQuery - * @static - * @param {Object.} object Plain object - * @returns {firestore.NamedQuery} NamedQuery - */ - NamedQuery.fromObject = function fromObject(object) { - if (object instanceof $root.firestore.NamedQuery) - return object; - var message = new $root.firestore.NamedQuery(); - if (object.name != null) - message.name = String(object.name); - if (object.bundledQuery != null) { - if (typeof object.bundledQuery !== "object") - throw TypeError(".firestore.NamedQuery.bundledQuery: object expected"); - message.bundledQuery = $root.firestore.BundledQuery.fromObject(object.bundledQuery); - } - if (object.readTime != null) { - if (typeof object.readTime !== "object") - throw TypeError(".firestore.NamedQuery.readTime: object expected"); - message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); - } - return message; - }; - - /** - * Creates a plain object from a NamedQuery message. Also converts values to other types if specified. - * @function toObject - * @memberof firestore.NamedQuery - * @static - * @param {firestore.NamedQuery} message NamedQuery - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - NamedQuery.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.bundledQuery = null; - object.readTime = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.bundledQuery != null && message.hasOwnProperty("bundledQuery")) - object.bundledQuery = $root.firestore.BundledQuery.toObject(message.bundledQuery, options); - if (message.readTime != null && message.hasOwnProperty("readTime")) - object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); - return object; - }; - - /** - * Converts this NamedQuery to JSON. - * @function toJSON - * @memberof firestore.NamedQuery - * @instance - * @returns {Object.} JSON object - */ - NamedQuery.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for NamedQuery - * @function getTypeUrl - * @memberof firestore.NamedQuery - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - NamedQuery.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/firestore.NamedQuery"; - }; - - return NamedQuery; - })(); - - firestore.BundledDocumentMetadata = (function() { - - /** - * Properties of a BundledDocumentMetadata. - * @memberof firestore - * @interface IBundledDocumentMetadata - * @property {string|null} [name] BundledDocumentMetadata name - * @property {google.protobuf.ITimestamp|null} [readTime] BundledDocumentMetadata readTime - * @property {boolean|null} [exists] BundledDocumentMetadata exists - * @property {Array.|null} [queries] BundledDocumentMetadata queries - */ - - /** - * Constructs a new BundledDocumentMetadata. - * @memberof firestore - * @classdesc Represents a BundledDocumentMetadata. - * @implements IBundledDocumentMetadata - * @constructor - * @param {firestore.IBundledDocumentMetadata=} [properties] Properties to set - */ - function BundledDocumentMetadata(properties) { - this.queries = []; - 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]]; - } - - /** - * BundledDocumentMetadata name. - * @member {string} name - * @memberof firestore.BundledDocumentMetadata - * @instance - */ - BundledDocumentMetadata.prototype.name = ""; - - /** - * BundledDocumentMetadata readTime. - * @member {google.protobuf.ITimestamp|null|undefined} readTime - * @memberof firestore.BundledDocumentMetadata - * @instance - */ - BundledDocumentMetadata.prototype.readTime = null; - - /** - * BundledDocumentMetadata exists. - * @member {boolean} exists - * @memberof firestore.BundledDocumentMetadata - * @instance - */ - BundledDocumentMetadata.prototype.exists = false; - - /** - * BundledDocumentMetadata queries. - * @member {Array.} queries - * @memberof firestore.BundledDocumentMetadata - * @instance - */ - BundledDocumentMetadata.prototype.queries = $util.emptyArray; - - /** - * Creates a BundledDocumentMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof firestore.BundledDocumentMetadata - * @static - * @param {Object.} object Plain object - * @returns {firestore.BundledDocumentMetadata} BundledDocumentMetadata - */ - BundledDocumentMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.firestore.BundledDocumentMetadata) - return object; - var message = new $root.firestore.BundledDocumentMetadata(); - if (object.name != null) - message.name = String(object.name); - if (object.readTime != null) { - if (typeof object.readTime !== "object") - throw TypeError(".firestore.BundledDocumentMetadata.readTime: object expected"); - message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); - } - if (object.exists != null) - message.exists = Boolean(object.exists); - if (object.queries) { - if (!Array.isArray(object.queries)) - throw TypeError(".firestore.BundledDocumentMetadata.queries: array expected"); - message.queries = []; - for (var i = 0; i < object.queries.length; ++i) - message.queries[i] = String(object.queries[i]); - } - return message; - }; - - /** - * Creates a plain object from a BundledDocumentMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof firestore.BundledDocumentMetadata - * @static - * @param {firestore.BundledDocumentMetadata} message BundledDocumentMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BundledDocumentMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.queries = []; - if (options.defaults) { - object.name = ""; - object.readTime = null; - object.exists = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.readTime != null && message.hasOwnProperty("readTime")) - object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); - if (message.exists != null && message.hasOwnProperty("exists")) - object.exists = message.exists; - if (message.queries && message.queries.length) { - object.queries = []; - for (var j = 0; j < message.queries.length; ++j) - object.queries[j] = message.queries[j]; - } - return object; - }; - - /** - * Converts this BundledDocumentMetadata to JSON. - * @function toJSON - * @memberof firestore.BundledDocumentMetadata - * @instance - * @returns {Object.} JSON object - */ - BundledDocumentMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BundledDocumentMetadata - * @function getTypeUrl - * @memberof firestore.BundledDocumentMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BundledDocumentMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/firestore.BundledDocumentMetadata"; - }; - - return BundledDocumentMetadata; - })(); - - firestore.BundleMetadata = (function() { - - /** - * Properties of a BundleMetadata. - * @memberof firestore - * @interface IBundleMetadata - * @property {string|null} [id] BundleMetadata id - * @property {google.protobuf.ITimestamp|null} [createTime] BundleMetadata createTime - * @property {number|null} [version] BundleMetadata version - * @property {number|null} [totalDocuments] BundleMetadata totalDocuments - * @property {number|string|null} [totalBytes] BundleMetadata totalBytes - */ - - /** - * Constructs a new BundleMetadata. - * @memberof firestore - * @classdesc Represents a BundleMetadata. - * @implements IBundleMetadata - * @constructor - * @param {firestore.IBundleMetadata=} [properties] Properties to set - */ - function BundleMetadata(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]]; - } - - /** - * BundleMetadata id. - * @member {string} id - * @memberof firestore.BundleMetadata - * @instance - */ - BundleMetadata.prototype.id = ""; - - /** - * BundleMetadata createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof firestore.BundleMetadata - * @instance - */ - BundleMetadata.prototype.createTime = null; - - /** - * BundleMetadata version. - * @member {number} version - * @memberof firestore.BundleMetadata - * @instance - */ - BundleMetadata.prototype.version = 0; - - /** - * BundleMetadata totalDocuments. - * @member {number} totalDocuments - * @memberof firestore.BundleMetadata - * @instance - */ - BundleMetadata.prototype.totalDocuments = 0; - - /** - * BundleMetadata totalBytes. - * @member {number|string} totalBytes - * @memberof firestore.BundleMetadata - * @instance - */ - BundleMetadata.prototype.totalBytes = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Creates a BundleMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof firestore.BundleMetadata - * @static - * @param {Object.} object Plain object - * @returns {firestore.BundleMetadata} BundleMetadata - */ - BundleMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.firestore.BundleMetadata) - return object; - var message = new $root.firestore.BundleMetadata(); - if (object.id != null) - message.id = String(object.id); - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".firestore.BundleMetadata.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.version != null) - message.version = object.version >>> 0; - if (object.totalDocuments != null) - message.totalDocuments = object.totalDocuments >>> 0; - if (object.totalBytes != null) - if ($util.Long) - (message.totalBytes = $util.Long.fromValue(object.totalBytes)).unsigned = true; - else if (typeof object.totalBytes === "string") - message.totalBytes = parseInt(object.totalBytes, 10); - else if (typeof object.totalBytes === "number") - message.totalBytes = object.totalBytes; - else if (typeof object.totalBytes === "object") - message.totalBytes = new $util.LongBits(object.totalBytes.low >>> 0, object.totalBytes.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from a BundleMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof firestore.BundleMetadata - * @static - * @param {firestore.BundleMetadata} message BundleMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BundleMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.id = ""; - object.createTime = null; - object.version = 0; - object.totalDocuments = 0; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.totalBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.totalBytes = options.longs === String ? "0" : 0; - } - if (message.id != null && message.hasOwnProperty("id")) - object.id = message.id; - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.version != null && message.hasOwnProperty("version")) - object.version = message.version; - if (message.totalDocuments != null && message.hasOwnProperty("totalDocuments")) - object.totalDocuments = message.totalDocuments; - if (message.totalBytes != null && message.hasOwnProperty("totalBytes")) - if (typeof message.totalBytes === "number") - object.totalBytes = options.longs === String ? String(message.totalBytes) : message.totalBytes; - else - object.totalBytes = options.longs === String ? $util.Long.prototype.toString.call(message.totalBytes) : options.longs === Number ? new $util.LongBits(message.totalBytes.low >>> 0, message.totalBytes.high >>> 0).toNumber(true) : message.totalBytes; - return object; - }; - - /** - * Converts this BundleMetadata to JSON. - * @function toJSON - * @memberof firestore.BundleMetadata - * @instance - * @returns {Object.} JSON object - */ - BundleMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BundleMetadata - * @function getTypeUrl - * @memberof firestore.BundleMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BundleMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/firestore.BundleMetadata"; - }; - - return BundleMetadata; - })(); - - firestore.BundleElement = (function() { - - /** - * Properties of a BundleElement. - * @memberof firestore - * @interface IBundleElement - * @property {firestore.IBundleMetadata|null} [metadata] BundleElement metadata - * @property {firestore.INamedQuery|null} [namedQuery] BundleElement namedQuery - * @property {firestore.IBundledDocumentMetadata|null} [documentMetadata] BundleElement documentMetadata - * @property {google.firestore.v1.IDocument|null} [document] BundleElement document - */ - - /** - * Constructs a new BundleElement. - * @memberof firestore - * @classdesc Represents a BundleElement. - * @implements IBundleElement - * @constructor - * @param {firestore.IBundleElement=} [properties] Properties to set - */ - function BundleElement(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]]; - } - - /** - * BundleElement metadata. - * @member {firestore.IBundleMetadata|null|undefined} metadata - * @memberof firestore.BundleElement - * @instance - */ - BundleElement.prototype.metadata = null; - - /** - * BundleElement namedQuery. - * @member {firestore.INamedQuery|null|undefined} namedQuery - * @memberof firestore.BundleElement - * @instance - */ - BundleElement.prototype.namedQuery = null; - - /** - * BundleElement documentMetadata. - * @member {firestore.IBundledDocumentMetadata|null|undefined} documentMetadata - * @memberof firestore.BundleElement - * @instance - */ - BundleElement.prototype.documentMetadata = null; - - /** - * BundleElement document. - * @member {google.firestore.v1.IDocument|null|undefined} document - * @memberof firestore.BundleElement - * @instance - */ - BundleElement.prototype.document = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * BundleElement elementType. - * @member {"metadata"|"namedQuery"|"documentMetadata"|"document"|undefined} elementType - * @memberof firestore.BundleElement - * @instance - */ - Object.defineProperty(BundleElement.prototype, "elementType", { - get: $util.oneOfGetter($oneOfFields = ["metadata", "namedQuery", "documentMetadata", "document"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a BundleElement message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof firestore.BundleElement - * @static - * @param {Object.} object Plain object - * @returns {firestore.BundleElement} BundleElement - */ - BundleElement.fromObject = function fromObject(object) { - if (object instanceof $root.firestore.BundleElement) - return object; - var message = new $root.firestore.BundleElement(); - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".firestore.BundleElement.metadata: object expected"); - message.metadata = $root.firestore.BundleMetadata.fromObject(object.metadata); - } - if (object.namedQuery != null) { - if (typeof object.namedQuery !== "object") - throw TypeError(".firestore.BundleElement.namedQuery: object expected"); - message.namedQuery = $root.firestore.NamedQuery.fromObject(object.namedQuery); - } - if (object.documentMetadata != null) { - if (typeof object.documentMetadata !== "object") - throw TypeError(".firestore.BundleElement.documentMetadata: object expected"); - message.documentMetadata = $root.firestore.BundledDocumentMetadata.fromObject(object.documentMetadata); - } - if (object.document != null) { - if (typeof object.document !== "object") - throw TypeError(".firestore.BundleElement.document: object expected"); - message.document = $root.google.firestore.v1.Document.fromObject(object.document); - } - return message; - }; - - /** - * Creates a plain object from a BundleElement message. Also converts values to other types if specified. - * @function toObject - * @memberof firestore.BundleElement - * @static - * @param {firestore.BundleElement} message BundleElement - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BundleElement.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.metadata != null && message.hasOwnProperty("metadata")) { - object.metadata = $root.firestore.BundleMetadata.toObject(message.metadata, options); - if (options.oneofs) - object.elementType = "metadata"; - } - if (message.namedQuery != null && message.hasOwnProperty("namedQuery")) { - object.namedQuery = $root.firestore.NamedQuery.toObject(message.namedQuery, options); - if (options.oneofs) - object.elementType = "namedQuery"; - } - if (message.documentMetadata != null && message.hasOwnProperty("documentMetadata")) { - object.documentMetadata = $root.firestore.BundledDocumentMetadata.toObject(message.documentMetadata, options); - if (options.oneofs) - object.elementType = "documentMetadata"; - } - if (message.document != null && message.hasOwnProperty("document")) { - object.document = $root.google.firestore.v1.Document.toObject(message.document, options); - if (options.oneofs) - object.elementType = "document"; - } - return object; - }; - - /** - * Converts this BundleElement to JSON. - * @function toJSON - * @memberof firestore.BundleElement - * @instance - * @returns {Object.} JSON object - */ - BundleElement.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BundleElement - * @function getTypeUrl - * @memberof firestore.BundleElement - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BundleElement.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/firestore.BundleElement"; - }; - - return BundleElement; - })(); - - return firestore; - })(); - + var $root = $protobuf.roots._google_cloud_firestore_protos || ($protobuf.roots._google_cloud_firestore_protos = {}); + $root.google = (function() { - + /** * Namespace google. * @exports google * @namespace */ var google = {}; - + google.protobuf = (function() { - + /** * Namespace protobuf. * @memberof google * @namespace */ var protobuf = {}; - - protobuf.Timestamp = (function() { - + + protobuf.Struct = (function() { + /** - * Properties of a Timestamp. + * Properties of a Struct. * @memberof google.protobuf - * @interface ITimestamp - * @property {number|string|null} [seconds] Timestamp seconds - * @property {number|null} [nanos] Timestamp nanos + * @interface IStruct + * @property {Object.|null} [fields] Struct fields */ - + /** - * Constructs a new Timestamp. + * Constructs a new Struct. * @memberof google.protobuf - * @classdesc Represents a Timestamp. - * @implements ITimestamp + * @classdesc Represents a Struct. + * @implements IStruct * @constructor - * @param {google.protobuf.ITimestamp=} [properties] Properties to set + * @param {google.protobuf.IStruct=} [properties] Properties to set */ - function Timestamp(properties) { + function Struct(properties) { + this.fields = {}; 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]]; } - - /** - * Timestamp seconds. - * @member {number|string} seconds - * @memberof google.protobuf.Timestamp - * @instance - */ - Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - + /** - * Timestamp nanos. - * @member {number} nanos - * @memberof google.protobuf.Timestamp + * Struct fields. + * @member {Object.} fields + * @memberof google.protobuf.Struct * @instance */ - Timestamp.prototype.nanos = 0; - + Struct.prototype.fields = $util.emptyObject; + /** - * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Timestamp + * Creates a new Struct instance using the specified properties. + * @function create + * @memberof google.protobuf.Struct * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Timestamp} Timestamp + * @param {google.protobuf.IStruct=} [properties] Properties to set + * @returns {google.protobuf.Struct} Struct instance */ - Timestamp.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Timestamp) - return object; - var message = new $root.google.protobuf.Timestamp(); - if (object.seconds != null) - if ($util.Long) - (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; - else if (typeof object.seconds === "string") - message.seconds = parseInt(object.seconds, 10); - else if (typeof object.seconds === "number") - message.seconds = object.seconds; - else if (typeof object.seconds === "object") - message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); - if (object.nanos != null) - message.nanos = object.nanos | 0; - return message; + Struct.create = function create(properties) { + return new Struct(properties); }; - + /** - * Creates a plain object from a Timestamp message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Timestamp + * Encodes the specified Struct message. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Struct * @static - * @param {google.protobuf.Timestamp} message Timestamp - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * @param {google.protobuf.IStruct} message Struct message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Timestamp.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.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.seconds = options.longs === String ? "0" : 0; - object.nanos = 0; - } - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (typeof message.seconds === "number") - object.seconds = options.longs === String ? String(message.seconds) : message.seconds; - else - object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; - if (message.nanos != null && message.hasOwnProperty("nanos")) - object.nanos = message.nanos; - return object; + Struct.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fields != null && Object.hasOwnProperty.call(message, "fields")) + for (var keys = Object.keys(message.fields), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.protobuf.Value.encode(message.fields[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; }; - + /** - * Converts this Timestamp to JSON. - * @function toJSON - * @memberof google.protobuf.Timestamp - * @instance - * @returns {Object.} JSON object + * Encodes the specified Struct message, length delimited. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.IStruct} message Struct message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Timestamp.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + Struct.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); }; - + /** - * Gets the default type url for Timestamp - * @function getTypeUrl - * @memberof google.protobuf.Timestamp + * Decodes a Struct message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Struct * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Struct} Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Struct.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Struct(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (message.fields === $util.emptyObject) + message.fields = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.fields[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } } - return typeUrlPrefix + "/google.protobuf.Timestamp"; + return message; }; - - return Timestamp; - })(); - - protobuf.Struct = (function() { - - /** - * Properties of a Struct. - * @memberof google.protobuf - * @interface IStruct - * @property {Object.|null} [fields] Struct fields - */ - + /** - * Constructs a new Struct. - * @memberof google.protobuf - * @classdesc Represents a Struct. - * @implements IStruct - * @constructor - * @param {google.protobuf.IStruct=} [properties] Properties to set + * Decodes a Struct message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Struct + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Struct} Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - function Struct(properties) { - this.fields = {}; - 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]]; - } - + Struct.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + /** - * Struct fields. - * @member {Object.} fields + * Verifies a Struct message. + * @function verify * @memberof google.protobuf.Struct - * @instance + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Struct.prototype.fields = $util.emptyObject; - + Struct.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fields != null && message.hasOwnProperty("fields")) { + if (!$util.isObject(message.fields)) + return "fields: object expected"; + var key = Object.keys(message.fields); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.fields[key[i]]); + if (error) + return "fields." + error; + } + } + return null; + }; + /** * Creates a Struct message from a plain object. Also converts values to their respective internal types. * @function fromObject @@ -1052,7 +239,7 @@ } return message; }; - + /** * Creates a plain object from a Struct message. Also converts values to other types if specified. * @function toObject @@ -1076,7 +263,7 @@ } return object; }; - + /** * Converts this Struct to JSON. * @function toJSON @@ -1087,7 +274,7 @@ Struct.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - + /** * Gets the default type url for Struct * @function getTypeUrl @@ -1102,12 +289,12 @@ } return typeUrlPrefix + "/google.protobuf.Struct"; }; - + return Struct; })(); - + protobuf.Value = (function() { - + /** * Properties of a Value. * @memberof google.protobuf @@ -1119,7 +306,7 @@ * @property {google.protobuf.IStruct|null} [structValue] Value structValue * @property {google.protobuf.IListValue|null} [listValue] Value listValue */ - + /** * Constructs a new Value. * @memberof google.protobuf @@ -1134,7 +321,7 @@ if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } - + /** * Value nullValue. * @member {google.protobuf.NullValue|null|undefined} nullValue @@ -1142,7 +329,7 @@ * @instance */ Value.prototype.nullValue = null; - + /** * Value numberValue. * @member {number|null|undefined} numberValue @@ -1150,7 +337,7 @@ * @instance */ Value.prototype.numberValue = null; - + /** * Value stringValue. * @member {string|null|undefined} stringValue @@ -1158,7 +345,7 @@ * @instance */ Value.prototype.stringValue = null; - + /** * Value boolValue. * @member {boolean|null|undefined} boolValue @@ -1166,7 +353,7 @@ * @instance */ Value.prototype.boolValue = null; - + /** * Value structValue. * @member {google.protobuf.IStruct|null|undefined} structValue @@ -1174,7 +361,7 @@ * @instance */ Value.prototype.structValue = null; - + /** * Value listValue. * @member {google.protobuf.IListValue|null|undefined} listValue @@ -1182,10 +369,10 @@ * @instance */ Value.prototype.listValue = null; - + // OneOf field names bound to virtual getters and setters var $oneOfFields; - + /** * Value kind. * @member {"nullValue"|"numberValue"|"stringValue"|"boolValue"|"structValue"|"listValue"|undefined} kind @@ -1196,7 +383,190 @@ get: $util.oneOfGetter($oneOfFields = ["nullValue", "numberValue", "stringValue", "boolValue", "structValue", "listValue"]), set: $util.oneOfSetter($oneOfFields) }); - + + /** + * Creates a new Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.IValue=} [properties] Properties to set + * @returns {google.protobuf.Value} Value instance + */ + Value.create = function create(properties) { + return new Value(properties); + }; + + /** + * Encodes the specified Value message. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.IValue} message Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.nullValue != null && Object.hasOwnProperty.call(message, "nullValue")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.nullValue); + if (message.numberValue != null && Object.hasOwnProperty.call(message, "numberValue")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.numberValue); + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.stringValue); + if (message.boolValue != null && Object.hasOwnProperty.call(message, "boolValue")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.boolValue); + if (message.structValue != null && Object.hasOwnProperty.call(message, "structValue")) + $root.google.protobuf.Struct.encode(message.structValue, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.listValue != null && Object.hasOwnProperty.call(message, "listValue")) + $root.google.protobuf.ListValue.encode(message.listValue, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Value message, length delimited. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.IValue} message Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Value} Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Value.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.nullValue = reader.int32(); + break; + } + case 2: { + message.numberValue = reader.double(); + break; + } + case 3: { + message.stringValue = reader.string(); + break; + } + case 4: { + message.boolValue = reader.bool(); + break; + } + case 5: { + message.structValue = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + case 6: { + message.listValue = $root.google.protobuf.ListValue.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Value} Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Value message. + * @function verify + * @memberof google.protobuf.Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.nullValue != null && message.hasOwnProperty("nullValue")) { + properties.kind = 1; + switch (message.nullValue) { + default: + return "nullValue: enum value expected"; + case 0: + break; + } + } + if (message.numberValue != null && message.hasOwnProperty("numberValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (typeof message.numberValue !== "number") + return "numberValue: number expected"; + } + if (message.stringValue != null && message.hasOwnProperty("stringValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (!$util.isString(message.stringValue)) + return "stringValue: string expected"; + } + if (message.boolValue != null && message.hasOwnProperty("boolValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (typeof message.boolValue !== "boolean") + return "boolValue: boolean expected"; + } + if (message.structValue != null && message.hasOwnProperty("structValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.protobuf.Struct.verify(message.structValue); + if (error) + return "structValue." + error; + } + } + if (message.listValue != null && message.hasOwnProperty("listValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.protobuf.ListValue.verify(message.listValue); + if (error) + return "listValue." + error; + } + } + return null; + }; + /** * Creates a Value message from a plain object. Also converts values to their respective internal types. * @function fromObject @@ -1210,16 +580,16 @@ return object; var message = new $root.google.protobuf.Value(); switch (object.nullValue) { - default: - if (typeof object.nullValue === "number") { - message.nullValue = object.nullValue; + default: + if (typeof object.nullValue === "number") { + message.nullValue = object.nullValue; + break; + } + break; + case "NULL_VALUE": + case 0: + message.nullValue = 0; break; - } - break; - case "NULL_VALUE": - case 0: - message.nullValue = 0; - break; } if (object.numberValue != null) message.numberValue = Number(object.numberValue); @@ -1239,7 +609,7 @@ } return message; }; - + /** * Creates a plain object from a Value message. Also converts values to other types if specified. * @function toObject @@ -1285,7 +655,7 @@ } return object; }; - + /** * Converts this Value to JSON. * @function toJSON @@ -1296,7 +666,7 @@ Value.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - + /** * Gets the default type url for Value * @function getTypeUrl @@ -1311,31 +681,31 @@ } return typeUrlPrefix + "/google.protobuf.Value"; }; - + return Value; })(); - + /** * NullValue enum. * @name google.protobuf.NullValue - * @enum {string} - * @property {string} NULL_VALUE=NULL_VALUE NULL_VALUE value + * @enum {number} + * @property {number} NULL_VALUE=0 NULL_VALUE value */ protobuf.NullValue = (function() { var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "NULL_VALUE"] = "NULL_VALUE"; + values[valuesById[0] = "NULL_VALUE"] = 0; return values; })(); - + protobuf.ListValue = (function() { - + /** * Properties of a ListValue. * @memberof google.protobuf * @interface IListValue * @property {Array.|null} [values] ListValue values */ - + /** * Constructs a new ListValue. * @memberof google.protobuf @@ -1351,7 +721,7 @@ if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } - + /** * ListValue values. * @member {Array.} values @@ -1359,7 +729,121 @@ * @instance */ ListValue.prototype.values = $util.emptyArray; - + + /** + * Creates a new ListValue instance using the specified properties. + * @function create + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.IListValue=} [properties] Properties to set + * @returns {google.protobuf.ListValue} ListValue instance + */ + ListValue.create = function create(properties) { + return new ListValue(properties); + }; + + /** + * Encodes the specified ListValue message. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.IListValue} message ListValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.values != null && message.values.length) + for (var i = 0; i < message.values.length; ++i) + $root.google.protobuf.Value.encode(message.values[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ListValue message, length delimited. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.IListValue} message ListValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ListValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ListValue} ListValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListValue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ListValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.values && message.values.length)) + message.values = []; + message.values.push($root.google.protobuf.Value.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ListValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ListValue} ListValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListValue message. + * @function verify + * @memberof google.protobuf.ListValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.values != null && message.hasOwnProperty("values")) { + if (!Array.isArray(message.values)) + return "values: array expected"; + for (var i = 0; i < message.values.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.values[i]); + if (error) + return "values." + error; + } + } + return null; + }; + /** * Creates a ListValue message from a plain object. Also converts values to their respective internal types. * @function fromObject @@ -1384,7 +868,7 @@ } return message; }; - + /** * Creates a plain object from a ListValue message. Also converts values to other types if specified. * @function toObject @@ -1407,7 +891,7 @@ } return object; }; - + /** * Converts this ListValue to JSON. * @function toJSON @@ -1418,7 +902,7 @@ ListValue.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - + /** * Gets the default type url for ListValue * @function getTypeUrl @@ -1433,55 +917,410 @@ } return typeUrlPrefix + "/google.protobuf.ListValue"; }; - + return ListValue; })(); - - protobuf.FileDescriptorSet = (function() { - + + protobuf.Timestamp = (function() { + /** - * Properties of a FileDescriptorSet. + * Properties of a Timestamp. * @memberof google.protobuf - * @interface IFileDescriptorSet - * @property {Array.|null} [file] FileDescriptorSet file + * @interface ITimestamp + * @property {number|Long|null} [seconds] Timestamp seconds + * @property {number|null} [nanos] Timestamp nanos */ - + /** - * Constructs a new FileDescriptorSet. + * Constructs a new Timestamp. * @memberof google.protobuf - * @classdesc Represents a FileDescriptorSet. - * @implements IFileDescriptorSet + * @classdesc Represents a Timestamp. + * @implements ITimestamp * @constructor - * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + * @param {google.protobuf.ITimestamp=} [properties] Properties to set */ - function FileDescriptorSet(properties) { - this.file = []; + function Timestamp(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]]; } - + /** - * FileDescriptorSet file. - * @member {Array.} file - * @memberof google.protobuf.FileDescriptorSet + * Timestamp seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Timestamp * @instance */ - FileDescriptorSet.prototype.file = $util.emptyArray; - + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + /** - * 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.} object Plain object - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * Timestamp nanos. + * @member {number} nanos + * @memberof google.protobuf.Timestamp + * @instance */ - FileDescriptorSet.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FileDescriptorSet) - return object; - var message = new $root.google.protobuf.FileDescriptorSet(); + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + * @returns {google.protobuf.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Timestamp message. + * @function verify + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Timestamp.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Timestamp} Timestamp + */ + Timestamp.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Timestamp) + return object; + var message = new $root.google.protobuf.Timestamp(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.Timestamp} message Timestamp + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Timestamp.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.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Timestamp to JSON. + * @function toJSON + * @memberof google.protobuf.Timestamp + * @instance + * @returns {Object.} JSON object + */ + Timestamp.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Timestamp + * @function getTypeUrl + * @memberof google.protobuf.Timestamp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Timestamp"; + }; + + return Timestamp; + })(); + + protobuf.FileDescriptorSet = (function() { + + /** + * Properties of a FileDescriptorSet. + * @memberof google.protobuf + * @interface IFileDescriptorSet + * @property {Array.|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.} 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) { + 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(); + 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.} 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.} 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"); @@ -1494,7 +1333,7 @@ } return message; }; - + /** * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. * @function toObject @@ -1517,7 +1356,7 @@ } return object; }; - + /** * Converts this FileDescriptorSet to JSON. * @function toJSON @@ -1528,7 +1367,7 @@ FileDescriptorSet.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - + /** * Gets the default type url for FileDescriptorSet * @function getTypeUrl @@ -1543,12 +1382,44 @@ } 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_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[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 @@ -1565,8 +1436,9 @@ * @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 @@ -1588,7 +1460,7 @@ if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } - + /** * FileDescriptorProto name. * @member {string} name @@ -1596,7 +1468,7 @@ * @instance */ FileDescriptorProto.prototype.name = ""; - + /** * FileDescriptorProto package. * @member {string} package @@ -1604,7 +1476,7 @@ * @instance */ FileDescriptorProto.prototype["package"] = ""; - + /** * FileDescriptorProto dependency. * @member {Array.} dependency @@ -1612,7 +1484,7 @@ * @instance */ FileDescriptorProto.prototype.dependency = $util.emptyArray; - + /** * FileDescriptorProto publicDependency. * @member {Array.} publicDependency @@ -1620,7 +1492,7 @@ * @instance */ FileDescriptorProto.prototype.publicDependency = $util.emptyArray; - + /** * FileDescriptorProto weakDependency. * @member {Array.} weakDependency @@ -1628,7 +1500,7 @@ * @instance */ FileDescriptorProto.prototype.weakDependency = $util.emptyArray; - + /** * FileDescriptorProto messageType. * @member {Array.} messageType @@ -1636,7 +1508,7 @@ * @instance */ FileDescriptorProto.prototype.messageType = $util.emptyArray; - + /** * FileDescriptorProto enumType. * @member {Array.} enumType @@ -1644,7 +1516,7 @@ * @instance */ FileDescriptorProto.prototype.enumType = $util.emptyArray; - + /** * FileDescriptorProto service. * @member {Array.} service @@ -1652,7 +1524,7 @@ * @instance */ FileDescriptorProto.prototype.service = $util.emptyArray; - + /** * FileDescriptorProto extension. * @member {Array.} extension @@ -1660,7 +1532,7 @@ * @instance */ FileDescriptorProto.prototype.extension = $util.emptyArray; - + /** * FileDescriptorProto options. * @member {google.protobuf.IFileOptions|null|undefined} options @@ -1668,7 +1540,7 @@ * @instance */ FileDescriptorProto.prototype.options = null; - + /** * FileDescriptorProto sourceCodeInfo. * @member {google.protobuf.ISourceCodeInfo|null|undefined} sourceCodeInfo @@ -1676,7 +1548,7 @@ * @instance */ FileDescriptorProto.prototype.sourceCodeInfo = null; - + /** * FileDescriptorProto syntax. * @member {string} syntax @@ -1684,12 +1556,318 @@ * @instance */ FileDescriptorProto.prototype.syntax = ""; - + /** - * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject + * FileDescriptorProto edition. + * @member {google.protobuf.Edition} edition * @memberof google.protobuf.FileDescriptorProto - * @static + * @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); + 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) { + 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(); + 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 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.} 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.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 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.} object Plain object * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto */ @@ -1774,9 +1952,61 @@ } 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_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 @@ -1805,6 +2035,7 @@ 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; @@ -1851,9 +2082,11 @@ } 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; return object; }; - + /** * Converts this FileDescriptorProto to JSON. * @function toJSON @@ -1864,7 +2097,7 @@ FileDescriptorProto.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - + /** * Gets the default type url for FileDescriptorProto * @function getTypeUrl @@ -1879,12 +2112,12 @@ } return typeUrlPrefix + "/google.protobuf.FileDescriptorProto"; }; - + return FileDescriptorProto; })(); - + protobuf.DescriptorProto = (function() { - + /** * Properties of a DescriptorProto. * @memberof google.protobuf @@ -1900,7 +2133,7 @@ * @property {Array.|null} [reservedRange] DescriptorProto reservedRange * @property {Array.|null} [reservedName] DescriptorProto reservedName */ - + /** * Constructs a new DescriptorProto. * @memberof google.protobuf @@ -1923,7 +2156,7 @@ if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } - + /** * DescriptorProto name. * @member {string} name @@ -1931,7 +2164,7 @@ * @instance */ DescriptorProto.prototype.name = ""; - + /** * DescriptorProto field. * @member {Array.} field @@ -1939,7 +2172,7 @@ * @instance */ DescriptorProto.prototype.field = $util.emptyArray; - + /** * DescriptorProto extension. * @member {Array.} extension @@ -1947,7 +2180,7 @@ * @instance */ DescriptorProto.prototype.extension = $util.emptyArray; - + /** * DescriptorProto nestedType. * @member {Array.} nestedType @@ -1955,7 +2188,7 @@ * @instance */ DescriptorProto.prototype.nestedType = $util.emptyArray; - + /** * DescriptorProto enumType. * @member {Array.} enumType @@ -1963,7 +2196,7 @@ * @instance */ DescriptorProto.prototype.enumType = $util.emptyArray; - + /** * DescriptorProto extensionRange. * @member {Array.} extensionRange @@ -1971,7 +2204,7 @@ * @instance */ DescriptorProto.prototype.extensionRange = $util.emptyArray; - + /** * DescriptorProto oneofDecl. * @member {Array.} oneofDecl @@ -1979,7 +2212,7 @@ * @instance */ DescriptorProto.prototype.oneofDecl = $util.emptyArray; - + /** * DescriptorProto options. * @member {google.protobuf.IMessageOptions|null|undefined} options @@ -1987,7 +2220,7 @@ * @instance */ DescriptorProto.prototype.options = null; - + /** * DescriptorProto reservedRange. * @member {Array.} reservedRange @@ -1995,7 +2228,7 @@ * @instance */ DescriptorProto.prototype.reservedRange = $util.emptyArray; - + /** * DescriptorProto reservedName. * @member {Array.} reservedName @@ -2003,7 +2236,265 @@ * @instance */ DescriptorProto.prototype.reservedName = $util.emptyArray; - + + /** + * 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]); + 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) { + 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(); + 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; + } + 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.} 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"; + } + return null; + }; + /** * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. * @function fromObject @@ -2102,7 +2593,7 @@ } return message; }; - + /** * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. * @function toObject @@ -2176,7 +2667,7 @@ } return object; }; - + /** * Converts this DescriptorProto to JSON. * @function toJSON @@ -2187,7 +2678,7 @@ DescriptorProto.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - + /** * Gets the default type url for DescriptorProto * @function getTypeUrl @@ -2202,17 +2693,18 @@ } 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 @@ -2227,7 +2719,7 @@ if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } - + /** * ExtensionRange start. * @member {number} start @@ -2235,7 +2727,7 @@ * @instance */ ExtensionRange.prototype.start = 0; - + /** * ExtensionRange end. * @member {number} end @@ -2243,7 +2735,140 @@ * @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) { + 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(); + 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.} 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 @@ -2260,9 +2885,14 @@ 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 @@ -2279,14 +2909,17 @@ 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 @@ -2297,7 +2930,7 @@ ExtensionRange.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - + /** * Gets the default type url for ExtensionRange * @function getTypeUrl @@ -2312,12 +2945,12 @@ } return typeUrlPrefix + "/google.protobuf.DescriptorProto.ExtensionRange"; }; - + return ExtensionRange; })(); - + DescriptorProto.ReservedRange = (function() { - + /** * Properties of a ReservedRange. * @memberof google.protobuf.DescriptorProto @@ -2325,7 +2958,7 @@ * @property {number|null} [start] ReservedRange start * @property {number|null} [end] ReservedRange end */ - + /** * Constructs a new ReservedRange. * @memberof google.protobuf.DescriptorProto @@ -2340,7 +2973,7 @@ if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } - + /** * ReservedRange start. * @member {number} start @@ -2348,7 +2981,7 @@ * @instance */ ReservedRange.prototype.start = 0; - + /** * ReservedRange end. * @member {number} end @@ -2356,7 +2989,121 @@ * @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) { + 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(); + 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.} 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 @@ -2375,7 +3122,7 @@ 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 @@ -2399,7 +3146,7 @@ object.end = message.end; return object; }; - + /** * Converts this ReservedRange to JSON. * @function toJSON @@ -2410,7 +3157,7 @@ ReservedRange.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - + /** * Gets the default type url for ReservedRange * @function getTypeUrl @@ -2425,6631 +3172,15668 @@ } return typeUrlPrefix + "/google.protobuf.DescriptorProto.ReservedRange"; }; - + return ReservedRange; })(); - + return DescriptorProto; })(); - - protobuf.FieldDescriptorProto = (function() { - + + protobuf.ExtensionRangeOptions = (function() { + /** - * Properties of a FieldDescriptorProto. + * Properties of an ExtensionRangeOptions. * @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 + * @interface IExtensionRangeOptions + * @property {Array.|null} [uninterpretedOption] ExtensionRangeOptions uninterpretedOption + * @property {Array.|null} [declaration] ExtensionRangeOptions declaration + * @property {google.protobuf.IFeatureSet|null} [features] ExtensionRangeOptions features + * @property {google.protobuf.ExtensionRangeOptions.VerificationState|null} [verification] ExtensionRangeOptions verification */ - + /** - * Constructs a new FieldDescriptorProto. + * Constructs a new ExtensionRangeOptions. * @memberof google.protobuf - * @classdesc Represents a FieldDescriptorProto. - * @implements IFieldDescriptorProto + * @classdesc Represents an ExtensionRangeOptions. + * @implements IExtensionRangeOptions * @constructor - * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set */ - function FieldDescriptorProto(properties) { + 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]]; } - + /** - * FieldDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.FieldDescriptorProto + * ExtensionRangeOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ExtensionRangeOptions * @instance */ - FieldDescriptorProto.prototype.name = ""; - + ExtensionRangeOptions.prototype.uninterpretedOption = $util.emptyArray; + /** - * FieldDescriptorProto number. - * @member {number} number - * @memberof google.protobuf.FieldDescriptorProto + * ExtensionRangeOptions declaration. + * @member {Array.} declaration + * @memberof google.protobuf.ExtensionRangeOptions * @instance */ - FieldDescriptorProto.prototype.number = 0; - + ExtensionRangeOptions.prototype.declaration = $util.emptyArray; + /** - * FieldDescriptorProto label. - * @member {google.protobuf.FieldDescriptorProto.Label} label - * @memberof google.protobuf.FieldDescriptorProto + * ExtensionRangeOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.ExtensionRangeOptions * @instance */ - FieldDescriptorProto.prototype.label = 1; - + ExtensionRangeOptions.prototype.features = null; + /** - * FieldDescriptorProto type. - * @member {google.protobuf.FieldDescriptorProto.Type} type - * @memberof google.protobuf.FieldDescriptorProto + * ExtensionRangeOptions verification. + * @member {google.protobuf.ExtensionRangeOptions.VerificationState} verification + * @memberof google.protobuf.ExtensionRangeOptions * @instance */ - FieldDescriptorProto.prototype.type = 1; - + ExtensionRangeOptions.prototype.verification = 1; + /** - * FieldDescriptorProto typeName. - * @member {string} typeName - * @memberof google.protobuf.FieldDescriptorProto - * @instance + * 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 */ - FieldDescriptorProto.prototype.typeName = ""; - + ExtensionRangeOptions.create = function create(properties) { + return new ExtensionRangeOptions(properties); + }; + /** - * FieldDescriptorProto extendee. - * @member {string} extendee - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.extendee = ""; - + * 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; + }; + /** - * FieldDescriptorProto defaultValue. - * @member {string} defaultValue - * @memberof google.protobuf.FieldDescriptorProto - * @instance + * 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 */ - FieldDescriptorProto.prototype.defaultValue = ""; - + ExtensionRangeOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + /** - * FieldDescriptorProto oneofIndex. - * @member {number} oneofIndex - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.oneofIndex = 0; - + * 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) { + 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(); + 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; + }; + /** - * FieldDescriptorProto jsonName. - * @member {string} jsonName - * @memberof google.protobuf.FieldDescriptorProto - * @instance + * 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 */ - FieldDescriptorProto.prototype.jsonName = ""; - + ExtensionRangeOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + /** - * FieldDescriptorProto options. - * @member {google.protobuf.IFieldOptions|null|undefined} options - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.options = null; - + * Verifies an ExtensionRangeOptions message. + * @function verify + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} 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 a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.FieldDescriptorProto + * @memberof google.protobuf.ExtensionRangeOptions * @static * @param {Object.} object Plain object - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions */ - FieldDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FieldDescriptorProto) + ExtensionRangeOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ExtensionRangeOptions) 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; + 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]); } - break; - case "LABEL_OPTIONAL": - case 1: - message.label = 1; - break; - case "LABEL_REQUIRED": - case 2: - message.label = 2; - break; - case "LABEL_REPEATED": - case 3: - message.label = 3; - break; } - switch (object.type) { - default: - if (typeof object.type === "number") { - message.type = object.type; - break; + 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]); } - 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.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 a FieldDescriptorProto message. Also converts values to other types if specified. + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.FieldDescriptorProto + * @memberof google.protobuf.ExtensionRangeOptions * @static - * @param {google.protobuf.FieldDescriptorProto} message FieldDescriptorProto + * @param {google.protobuf.ExtensionRangeOptions} message ExtensionRangeOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - FieldDescriptorProto.toObject = function toObject(message, options) { + ExtensionRangeOptions.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) { + object.declaration = []; + object.uninterpretedOption = []; + } 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.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); } - 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; return object; }; - + /** - * Converts this FieldDescriptorProto to JSON. + * Converts this ExtensionRangeOptions to JSON. * @function toJSON - * @memberof google.protobuf.FieldDescriptorProto + * @memberof google.protobuf.ExtensionRangeOptions * @instance * @returns {Object.} JSON object */ - FieldDescriptorProto.prototype.toJSON = function toJSON() { + ExtensionRangeOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - + /** - * Gets the default type url for FieldDescriptorProto + * Gets the default type url for ExtensionRangeOptions * @function getTypeUrl - * @memberof google.protobuf.FieldDescriptorProto + * @memberof google.protobuf.ExtensionRangeOptions * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - FieldDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ExtensionRangeOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.FieldDescriptorProto"; + return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions"; }; - - /** - * Type enum. - * @name google.protobuf.FieldDescriptorProto.Type - * @enum {string} - * @property {string} TYPE_DOUBLE=TYPE_DOUBLE TYPE_DOUBLE value - * @property {string} TYPE_FLOAT=TYPE_FLOAT TYPE_FLOAT value - * @property {string} TYPE_INT64=TYPE_INT64 TYPE_INT64 value - * @property {string} TYPE_UINT64=TYPE_UINT64 TYPE_UINT64 value - * @property {string} TYPE_INT32=TYPE_INT32 TYPE_INT32 value - * @property {string} TYPE_FIXED64=TYPE_FIXED64 TYPE_FIXED64 value - * @property {string} TYPE_FIXED32=TYPE_FIXED32 TYPE_FIXED32 value - * @property {string} TYPE_BOOL=TYPE_BOOL TYPE_BOOL value - * @property {string} TYPE_STRING=TYPE_STRING TYPE_STRING value - * @property {string} TYPE_GROUP=TYPE_GROUP TYPE_GROUP value - * @property {string} TYPE_MESSAGE=TYPE_MESSAGE TYPE_MESSAGE value - * @property {string} TYPE_BYTES=TYPE_BYTES TYPE_BYTES value - * @property {string} TYPE_UINT32=TYPE_UINT32 TYPE_UINT32 value - * @property {string} TYPE_ENUM=TYPE_ENUM TYPE_ENUM value - * @property {string} TYPE_SFIXED32=TYPE_SFIXED32 TYPE_SFIXED32 value - * @property {string} TYPE_SFIXED64=TYPE_SFIXED64 TYPE_SFIXED64 value - * @property {string} TYPE_SINT32=TYPE_SINT32 TYPE_SINT32 value - * @property {string} TYPE_SINT64=TYPE_SINT64 TYPE_SINT64 value - */ - FieldDescriptorProto.Type = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[1] = "TYPE_DOUBLE"] = "TYPE_DOUBLE"; - values[valuesById[2] = "TYPE_FLOAT"] = "TYPE_FLOAT"; - values[valuesById[3] = "TYPE_INT64"] = "TYPE_INT64"; - values[valuesById[4] = "TYPE_UINT64"] = "TYPE_UINT64"; - values[valuesById[5] = "TYPE_INT32"] = "TYPE_INT32"; - values[valuesById[6] = "TYPE_FIXED64"] = "TYPE_FIXED64"; - values[valuesById[7] = "TYPE_FIXED32"] = "TYPE_FIXED32"; - values[valuesById[8] = "TYPE_BOOL"] = "TYPE_BOOL"; - values[valuesById[9] = "TYPE_STRING"] = "TYPE_STRING"; - values[valuesById[10] = "TYPE_GROUP"] = "TYPE_GROUP"; - values[valuesById[11] = "TYPE_MESSAGE"] = "TYPE_MESSAGE"; - values[valuesById[12] = "TYPE_BYTES"] = "TYPE_BYTES"; - values[valuesById[13] = "TYPE_UINT32"] = "TYPE_UINT32"; - values[valuesById[14] = "TYPE_ENUM"] = "TYPE_ENUM"; - values[valuesById[15] = "TYPE_SFIXED32"] = "TYPE_SFIXED32"; - values[valuesById[16] = "TYPE_SFIXED64"] = "TYPE_SFIXED64"; - values[valuesById[17] = "TYPE_SINT32"] = "TYPE_SINT32"; - values[valuesById[18] = "TYPE_SINT64"] = "TYPE_SINT64"; - return values; + + 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) { + 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(); + 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.} 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.} 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.} 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.} 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; })(); - + /** - * Label enum. - * @name google.protobuf.FieldDescriptorProto.Label - * @enum {string} - * @property {string} LABEL_OPTIONAL=LABEL_OPTIONAL LABEL_OPTIONAL value - * @property {string} LABEL_REQUIRED=LABEL_REQUIRED LABEL_REQUIRED value - * @property {string} LABEL_REPEATED=LABEL_REPEATED LABEL_REPEATED value + * VerificationState enum. + * @name google.protobuf.ExtensionRangeOptions.VerificationState + * @enum {number} + * @property {number} DECLARATION=0 DECLARATION value + * @property {number} UNVERIFIED=1 UNVERIFIED value */ - FieldDescriptorProto.Label = (function() { + ExtensionRangeOptions.VerificationState = (function() { var valuesById = {}, values = Object.create(valuesById); - values[valuesById[1] = "LABEL_OPTIONAL"] = "LABEL_OPTIONAL"; - values[valuesById[2] = "LABEL_REQUIRED"] = "LABEL_REQUIRED"; - values[valuesById[3] = "LABEL_REPEATED"] = "LABEL_REPEATED"; + values[valuesById[0] = "DECLARATION"] = 0; + values[valuesById[1] = "UNVERIFIED"] = 1; return values; })(); - - return FieldDescriptorProto; + + return ExtensionRangeOptions; })(); - - protobuf.OneofDescriptorProto = (function() { - + + protobuf.FieldDescriptorProto = (function() { + /** - * Properties of an OneofDescriptorProto. + * Properties of a FieldDescriptorProto. * @memberof google.protobuf - * @interface IOneofDescriptorProto - * @property {string|null} [name] OneofDescriptorProto name - * @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options + * @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 OneofDescriptorProto. + * Constructs a new FieldDescriptorProto. * @memberof google.protobuf - * @classdesc Represents an OneofDescriptorProto. - * @implements IOneofDescriptorProto + * @classdesc Represents a FieldDescriptorProto. + * @implements IFieldDescriptorProto * @constructor - * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set */ - function OneofDescriptorProto(properties) { + 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]]; } - + /** - * OneofDescriptorProto name. + * FieldDescriptorProto name. * @member {string} name - * @memberof google.protobuf.OneofDescriptorProto + * @memberof google.protobuf.FieldDescriptorProto * @instance */ - OneofDescriptorProto.prototype.name = ""; - + FieldDescriptorProto.prototype.name = ""; + /** - * OneofDescriptorProto options. - * @member {google.protobuf.IOneofOptions|null|undefined} options - * @memberof google.protobuf.OneofDescriptorProto + * FieldDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.FieldDescriptorProto * @instance */ - OneofDescriptorProto.prototype.options = null; - + FieldDescriptorProto.prototype.number = 0; + /** - * 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.} object Plain object - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * FieldDescriptorProto label. + * @member {google.protobuf.FieldDescriptorProto.Label} label + * @memberof google.protobuf.FieldDescriptorProto + * @instance */ - 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; - }; - + FieldDescriptorProto.prototype.label = 1; + /** - * 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.} Plain object + * FieldDescriptorProto type. + * @member {google.protobuf.FieldDescriptorProto.Type} type + * @memberof google.protobuf.FieldDescriptorProto + * @instance */ - 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; - }; - + FieldDescriptorProto.prototype.type = 1; + /** - * Converts this OneofDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.OneofDescriptorProto + * FieldDescriptorProto typeName. + * @member {string} typeName + * @memberof google.protobuf.FieldDescriptorProto * @instance - * @returns {Object.} JSON object */ - OneofDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - + FieldDescriptorProto.prototype.typeName = ""; + /** - * 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 + * FieldDescriptorProto extendee. + * @member {string} extendee + * @memberof google.protobuf.FieldDescriptorProto + * @instance */ - OneofDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.OneofDescriptorProto"; - }; - - return OneofDescriptorProto; - })(); - - protobuf.EnumDescriptorProto = (function() { - + FieldDescriptorProto.prototype.extendee = ""; + /** - * Properties of an EnumDescriptorProto. - * @memberof google.protobuf - * @interface IEnumDescriptorProto - * @property {string|null} [name] EnumDescriptorProto name - * @property {Array.|null} [value] EnumDescriptorProto value - * @property {google.protobuf.IEnumOptions|null} [options] EnumDescriptorProto options + * FieldDescriptorProto defaultValue. + * @member {string} defaultValue + * @memberof google.protobuf.FieldDescriptorProto + * @instance */ - + FieldDescriptorProto.prototype.defaultValue = ""; + /** - * Constructs a new EnumDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents an EnumDescriptorProto. - * @implements IEnumDescriptorProto - * @constructor - * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + * FieldDescriptorProto oneofIndex. + * @member {number} oneofIndex + * @memberof google.protobuf.FieldDescriptorProto + * @instance */ - function EnumDescriptorProto(properties) { - this.value = []; - 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.prototype.oneofIndex = 0; + /** - * EnumDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.EnumDescriptorProto + * FieldDescriptorProto jsonName. + * @member {string} jsonName + * @memberof google.protobuf.FieldDescriptorProto * @instance */ - EnumDescriptorProto.prototype.name = ""; - + FieldDescriptorProto.prototype.jsonName = ""; + /** - * EnumDescriptorProto value. - * @member {Array.} value - * @memberof google.protobuf.EnumDescriptorProto + * FieldDescriptorProto options. + * @member {google.protobuf.IFieldOptions|null|undefined} options + * @memberof google.protobuf.FieldDescriptorProto * @instance */ - EnumDescriptorProto.prototype.value = $util.emptyArray; - + FieldDescriptorProto.prototype.options = null; + /** - * EnumDescriptorProto options. - * @member {google.protobuf.IEnumOptions|null|undefined} options - * @memberof google.protobuf.EnumDescriptorProto + * FieldDescriptorProto proto3Optional. + * @member {boolean} proto3Optional + * @memberof google.protobuf.FieldDescriptorProto * @instance */ - EnumDescriptorProto.prototype.options = null; - + FieldDescriptorProto.prototype.proto3Optional = false; + /** - * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * 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) { + 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(); + 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.} 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.EnumDescriptorProto + * @memberof google.protobuf.FieldDescriptorProto * @static * @param {Object.} object Plain object - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto */ - EnumDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumDescriptorProto) + FieldDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldDescriptorProto) return object; - var message = new $root.google.protobuf.EnumDescriptorProto(); + var message = new $root.google.protobuf.FieldDescriptorProto(); 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.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.EnumDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.EnumOptions.fromObject(object.options); + 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 an EnumDescriptorProto message. Also converts values to other types if specified. + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.EnumDescriptorProto + * @memberof google.protobuf.FieldDescriptorProto * @static - * @param {google.protobuf.EnumDescriptorProto} message EnumDescriptorProto + * @param {google.protobuf.FieldDescriptorProto} message FieldDescriptorProto * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - EnumDescriptorProto.toObject = function toObject(message, options) { + FieldDescriptorProto.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.value = []; 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.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.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.EnumOptions.toObject(message.options, 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 EnumDescriptorProto to JSON. + * Converts this FieldDescriptorProto to JSON. * @function toJSON - * @memberof google.protobuf.EnumDescriptorProto + * @memberof google.protobuf.FieldDescriptorProto * @instance * @returns {Object.} JSON object */ - EnumDescriptorProto.prototype.toJSON = function toJSON() { + FieldDescriptorProto.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - + /** - * Gets the default type url for EnumDescriptorProto + * Gets the default type url for FieldDescriptorProto * @function getTypeUrl - * @memberof google.protobuf.EnumDescriptorProto + * @memberof google.protobuf.FieldDescriptorProto * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - EnumDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + FieldDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto"; + return typeUrlPrefix + "/google.protobuf.FieldDescriptorProto"; }; - - return EnumDescriptorProto; + + /** + * 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.EnumValueDescriptorProto = (function() { - + + protobuf.OneofDescriptorProto = (function() { + /** - * Properties of an EnumValueDescriptorProto. + * Properties of an OneofDescriptorProto. * @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 + * @interface IOneofDescriptorProto + * @property {string|null} [name] OneofDescriptorProto name + * @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options */ - + /** - * Constructs a new EnumValueDescriptorProto. + * Constructs a new OneofDescriptorProto. * @memberof google.protobuf - * @classdesc Represents an EnumValueDescriptorProto. - * @implements IEnumValueDescriptorProto + * @classdesc Represents an OneofDescriptorProto. + * @implements IOneofDescriptorProto * @constructor - * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set */ - function EnumValueDescriptorProto(properties) { + 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]]; } - + /** - * EnumValueDescriptorProto name. + * OneofDescriptorProto name. * @member {string} name - * @memberof google.protobuf.EnumValueDescriptorProto + * @memberof google.protobuf.OneofDescriptorProto * @instance */ - EnumValueDescriptorProto.prototype.name = ""; - + OneofDescriptorProto.prototype.name = ""; + /** - * EnumValueDescriptorProto number. - * @member {number} number - * @memberof google.protobuf.EnumValueDescriptorProto + * OneofDescriptorProto options. + * @member {google.protobuf.IOneofOptions|null|undefined} options + * @memberof google.protobuf.OneofDescriptorProto * @instance */ - EnumValueDescriptorProto.prototype.number = 0; - + OneofDescriptorProto.prototype.options = null; + /** - * EnumValueDescriptorProto options. - * @member {google.protobuf.IEnumValueOptions|null|undefined} options - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance + * 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 */ - EnumValueDescriptorProto.prototype.options = null; - + OneofDescriptorProto.create = function create(properties) { + return new OneofDescriptorProto(properties); + }; + /** - * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * 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) { + 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(); + 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.} 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.EnumValueDescriptorProto + * @memberof google.protobuf.OneofDescriptorProto * @static * @param {Object.} object Plain object - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto */ - EnumValueDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumValueDescriptorProto) + OneofDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofDescriptorProto) return object; - var message = new $root.google.protobuf.EnumValueDescriptorProto(); + var message = new $root.google.protobuf.OneofDescriptorProto(); 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); + 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 EnumValueDescriptorProto message. Also converts values to other types if specified. + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.EnumValueDescriptorProto + * @memberof google.protobuf.OneofDescriptorProto * @static - * @param {google.protobuf.EnumValueDescriptorProto} message EnumValueDescriptorProto + * @param {google.protobuf.OneofDescriptorProto} message OneofDescriptorProto * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - EnumValueDescriptorProto.toObject = function toObject(message, options) { + OneofDescriptorProto.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); + object.options = $root.google.protobuf.OneofOptions.toObject(message.options, options); return object; }; - + /** - * Converts this EnumValueDescriptorProto to JSON. + * Converts this OneofDescriptorProto to JSON. * @function toJSON - * @memberof google.protobuf.EnumValueDescriptorProto + * @memberof google.protobuf.OneofDescriptorProto * @instance * @returns {Object.} JSON object */ - EnumValueDescriptorProto.prototype.toJSON = function toJSON() { + OneofDescriptorProto.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - + /** - * Gets the default type url for EnumValueDescriptorProto + * Gets the default type url for OneofDescriptorProto * @function getTypeUrl - * @memberof google.protobuf.EnumValueDescriptorProto + * @memberof google.protobuf.OneofDescriptorProto * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - EnumValueDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + OneofDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.EnumValueDescriptorProto"; + return typeUrlPrefix + "/google.protobuf.OneofDescriptorProto"; }; - - return EnumValueDescriptorProto; + + return OneofDescriptorProto; })(); - - protobuf.ServiceDescriptorProto = (function() { - + + protobuf.EnumDescriptorProto = (function() { + /** - * Properties of a ServiceDescriptorProto. + * Properties of an EnumDescriptorProto. * @memberof google.protobuf - * @interface IServiceDescriptorProto - * @property {string|null} [name] ServiceDescriptorProto name - * @property {Array.|null} [method] ServiceDescriptorProto method - * @property {google.protobuf.IServiceOptions|null} [options] ServiceDescriptorProto options + * @interface IEnumDescriptorProto + * @property {string|null} [name] EnumDescriptorProto name + * @property {Array.|null} [value] EnumDescriptorProto value + * @property {google.protobuf.IEnumOptions|null} [options] EnumDescriptorProto options + * @property {Array.|null} [reservedRange] EnumDescriptorProto reservedRange + * @property {Array.|null} [reservedName] EnumDescriptorProto reservedName */ - + /** - * Constructs a new ServiceDescriptorProto. + * Constructs a new EnumDescriptorProto. * @memberof google.protobuf - * @classdesc Represents a ServiceDescriptorProto. - * @implements IServiceDescriptorProto + * @classdesc Represents an EnumDescriptorProto. + * @implements IEnumDescriptorProto * @constructor - * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set */ - function ServiceDescriptorProto(properties) { - this.method = []; + 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]]; } - + /** - * ServiceDescriptorProto name. + * EnumDescriptorProto name. * @member {string} name - * @memberof google.protobuf.ServiceDescriptorProto + * @memberof google.protobuf.EnumDescriptorProto * @instance */ - ServiceDescriptorProto.prototype.name = ""; - + EnumDescriptorProto.prototype.name = ""; + /** - * ServiceDescriptorProto method. - * @member {Array.} method - * @memberof google.protobuf.ServiceDescriptorProto + * EnumDescriptorProto value. + * @member {Array.} value + * @memberof google.protobuf.EnumDescriptorProto * @instance */ - ServiceDescriptorProto.prototype.method = $util.emptyArray; - + EnumDescriptorProto.prototype.value = $util.emptyArray; + /** - * ServiceDescriptorProto options. - * @member {google.protobuf.IServiceOptions|null|undefined} options - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - */ - ServiceDescriptorProto.prototype.options = null; - + * EnumDescriptorProto options. + * @member {google.protobuf.IEnumOptions|null|undefined} options + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.options = null; + /** - * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * EnumDescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * EnumDescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedName = $util.emptyArray; + + /** + * 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]); + 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) { + 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(); + 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; + } + 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.} 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"; + } + return null; + }; + + /** + * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.ServiceDescriptorProto + * @memberof google.protobuf.EnumDescriptorProto * @static * @param {Object.} object Plain object - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto */ - ServiceDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ServiceDescriptorProto) + EnumDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto) return object; - var message = new $root.google.protobuf.ServiceDescriptorProto(); + var message = new $root.google.protobuf.EnumDescriptorProto(); 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.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.ServiceDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.ServiceOptions.fromObject(object.options); + 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]); } return message; }; - + /** - * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.ServiceDescriptorProto + * @memberof google.protobuf.EnumDescriptorProto * @static - * @param {google.protobuf.ServiceDescriptorProto} message ServiceDescriptorProto + * @param {google.protobuf.EnumDescriptorProto} message EnumDescriptorProto * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ServiceDescriptorProto.toObject = function toObject(message, options) { + EnumDescriptorProto.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.method = []; + if (options.arrays || options.defaults) { + object.value = []; + object.reservedRange = []; + object.reservedName = []; + } 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.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.ServiceOptions.toObject(message.options, 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]; + } return object; }; - + /** - * Converts this ServiceDescriptorProto to JSON. + * Converts this EnumDescriptorProto to JSON. * @function toJSON - * @memberof google.protobuf.ServiceDescriptorProto + * @memberof google.protobuf.EnumDescriptorProto * @instance * @returns {Object.} JSON object */ - ServiceDescriptorProto.prototype.toJSON = function toJSON() { + EnumDescriptorProto.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - + /** - * Gets the default type url for ServiceDescriptorProto + * Gets the default type url for EnumDescriptorProto * @function getTypeUrl - * @memberof google.protobuf.ServiceDescriptorProto + * @memberof google.protobuf.EnumDescriptorProto * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ServiceDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + EnumDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.ServiceDescriptorProto"; + return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto"; }; - - 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 MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {Object.} 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.} 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.} 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"; + + 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]]; } - return typeUrlPrefix + "/google.protobuf.MethodDescriptorProto"; - }; - - return MethodDescriptorProto; + + /** + * 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) { + 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(); + 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.} 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.} 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.} 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.} 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.FileOptions = (function() { - + + protobuf.EnumValueDescriptorProto = (function() { + /** - * Properties of a FileOptions. + * Properties of an EnumValueDescriptorProto. * @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 {Array.|null} [uninterpretedOption] FileOptions uninterpretedOption - * @property {Array.|null} [".google.api.resourceDefinition"] FileOptions .google.api.resourceDefinition + * @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 FileOptions. + * Constructs a new EnumValueDescriptorProto. * @memberof google.protobuf - * @classdesc Represents a FileOptions. - * @implements IFileOptions + * @classdesc Represents an EnumValueDescriptorProto. + * @implements IEnumValueDescriptorProto * @constructor - * @param {google.protobuf.IFileOptions=} [properties] Properties to set + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set */ - function FileOptions(properties) { - this.uninterpretedOption = []; - this[".google.api.resourceDefinition"] = []; + 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]]; } - + /** - * FileOptions javaPackage. - * @member {string} javaPackage - * @memberof google.protobuf.FileOptions + * EnumValueDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumValueDescriptorProto * @instance */ - FileOptions.prototype.javaPackage = ""; - + EnumValueDescriptorProto.prototype.name = ""; + /** - * FileOptions javaOuterClassname. - * @member {string} javaOuterClassname - * @memberof google.protobuf.FileOptions + * EnumValueDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.EnumValueDescriptorProto * @instance */ - FileOptions.prototype.javaOuterClassname = ""; - + EnumValueDescriptorProto.prototype.number = 0; + /** - * FileOptions javaMultipleFiles. - * @member {boolean} javaMultipleFiles - * @memberof google.protobuf.FileOptions + * EnumValueDescriptorProto options. + * @member {google.protobuf.IEnumValueOptions|null|undefined} options + * @memberof google.protobuf.EnumValueDescriptorProto * @instance */ - FileOptions.prototype.javaMultipleFiles = false; - + EnumValueDescriptorProto.prototype.options = null; + /** - * 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 + * 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 */ - FileOptions.prototype.deprecated = false; - + EnumValueDescriptorProto.create = function create(properties) { + return new EnumValueDescriptorProto(properties); + }; + /** - * FileOptions ccEnableArenas. - * @member {boolean} ccEnableArenas - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.ccEnableArenas = false; - + * 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; + }; + /** - * FileOptions objcClassPrefix. - * @member {string} objcClassPrefix - * @memberof google.protobuf.FileOptions - * @instance + * 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 */ - FileOptions.prototype.objcClassPrefix = ""; - + EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + /** - * FileOptions csharpNamespace. - * @member {string} csharpNamespace - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.csharpNamespace = ""; - + * 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) { + 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(); + 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; + }; + /** - * FileOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.FileOptions - * @instance + * 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 */ - FileOptions.prototype.uninterpretedOption = $util.emptyArray; - + EnumValueDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + /** - * FileOptions .google.api.resourceDefinition. - * @member {Array.} .google.api.resourceDefinition - * @memberof google.protobuf.FileOptions - * @instance + * Verifies an EnumValueDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - FileOptions.prototype[".google.api.resourceDefinition"] = $util.emptyArray; - + 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 a FileOptions message from a plain object. Also converts values to their respective internal types. + * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.FileOptions + * @memberof google.protobuf.EnumValueDescriptorProto * @static * @param {Object.} object Plain object - * @returns {google.protobuf.FileOptions} FileOptions + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto */ - FileOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FileOptions) + EnumValueDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueDescriptorProto) 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.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]); - } - } - if (object[".google.api.resourceDefinition"]) { - if (!Array.isArray(object[".google.api.resourceDefinition"])) - throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: array expected"); - message[".google.api.resourceDefinition"] = []; - for (var i = 0; i < object[".google.api.resourceDefinition"].length; ++i) { - if (typeof object[".google.api.resourceDefinition"][i] !== "object") - throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: object expected"); - message[".google.api.resourceDefinition"][i] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resourceDefinition"][i]); - } + 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 a FileOptions message. Also converts values to other types if specified. + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.FileOptions + * @memberof google.protobuf.EnumValueDescriptorProto * @static - * @param {google.protobuf.FileOptions} message FileOptions + * @param {google.protobuf.EnumValueDescriptorProto} message EnumValueDescriptorProto * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - FileOptions.toObject = function toObject(message, options) { + EnumValueDescriptorProto.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.uninterpretedOption = []; - object[".google.api.resourceDefinition"] = []; - } 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 = false; - object.objcClassPrefix = ""; - object.csharpNamespace = ""; - } - 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.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); - } - if (message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length) { - object[".google.api.resourceDefinition"] = []; - for (var j = 0; j < message[".google.api.resourceDefinition"].length; ++j) - object[".google.api.resourceDefinition"][j] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resourceDefinition"][j], options); + 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 FileOptions to JSON. + * Converts this EnumValueDescriptorProto to JSON. * @function toJSON - * @memberof google.protobuf.FileOptions + * @memberof google.protobuf.EnumValueDescriptorProto * @instance * @returns {Object.} JSON object */ - FileOptions.prototype.toJSON = function toJSON() { + EnumValueDescriptorProto.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - + /** - * Gets the default type url for FileOptions + * Gets the default type url for EnumValueDescriptorProto * @function getTypeUrl - * @memberof google.protobuf.FileOptions + * @memberof google.protobuf.EnumValueDescriptorProto * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - FileOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + EnumValueDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.FileOptions"; + return typeUrlPrefix + "/google.protobuf.EnumValueDescriptorProto"; }; - - /** - * OptimizeMode enum. - * @name google.protobuf.FileOptions.OptimizeMode - * @enum {string} - * @property {string} SPEED=SPEED SPEED value - * @property {string} CODE_SIZE=CODE_SIZE CODE_SIZE value - * @property {string} LITE_RUNTIME=LITE_RUNTIME LITE_RUNTIME value - */ - FileOptions.OptimizeMode = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[1] = "SPEED"] = "SPEED"; - values[valuesById[2] = "CODE_SIZE"] = "CODE_SIZE"; - values[valuesById[3] = "LITE_RUNTIME"] = "LITE_RUNTIME"; - return values; - })(); - - return FileOptions; + + return EnumValueDescriptorProto; })(); - - protobuf.MessageOptions = (function() { - + + protobuf.ServiceDescriptorProto = (function() { + /** - * Properties of a MessageOptions. + * Properties of a ServiceDescriptorProto. * @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 {Array.|null} [uninterpretedOption] MessageOptions uninterpretedOption - * @property {google.api.IResourceDescriptor|null} [".google.api.resource"] MessageOptions .google.api.resource + * @interface IServiceDescriptorProto + * @property {string|null} [name] ServiceDescriptorProto name + * @property {Array.|null} [method] ServiceDescriptorProto method + * @property {google.protobuf.IServiceOptions|null} [options] ServiceDescriptorProto options */ - + /** - * Constructs a new MessageOptions. + * Constructs a new ServiceDescriptorProto. * @memberof google.protobuf - * @classdesc Represents a MessageOptions. - * @implements IMessageOptions + * @classdesc Represents a ServiceDescriptorProto. + * @implements IServiceDescriptorProto * @constructor - * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set */ - function MessageOptions(properties) { - this.uninterpretedOption = []; + 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]]; } - + /** - * MessageOptions messageSetWireFormat. - * @member {boolean} messageSetWireFormat - * @memberof google.protobuf.MessageOptions + * ServiceDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.ServiceDescriptorProto * @instance */ - MessageOptions.prototype.messageSetWireFormat = false; - + ServiceDescriptorProto.prototype.name = ""; + /** - * MessageOptions noStandardDescriptorAccessor. - * @member {boolean} noStandardDescriptorAccessor - * @memberof google.protobuf.MessageOptions + * ServiceDescriptorProto method. + * @member {Array.} method + * @memberof google.protobuf.ServiceDescriptorProto * @instance */ - MessageOptions.prototype.noStandardDescriptorAccessor = false; - + ServiceDescriptorProto.prototype.method = $util.emptyArray; + /** - * MessageOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.MessageOptions + * ServiceDescriptorProto options. + * @member {google.protobuf.IServiceOptions|null|undefined} options + * @memberof google.protobuf.ServiceDescriptorProto * @instance */ - MessageOptions.prototype.deprecated = false; - + ServiceDescriptorProto.prototype.options = null; + /** - * MessageOptions mapEntry. - * @member {boolean} mapEntry - * @memberof google.protobuf.MessageOptions - * @instance + * 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 */ - MessageOptions.prototype.mapEntry = false; - + ServiceDescriptorProto.create = function create(properties) { + return new ServiceDescriptorProto(properties); + }; + /** - * MessageOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.MessageOptions - * @instance + * 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 */ - MessageOptions.prototype.uninterpretedOption = $util.emptyArray; - + ServiceDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + /** - * MessageOptions .google.api.resource. - * @member {google.api.IResourceDescriptor|null|undefined} .google.api.resource - * @memberof google.protobuf.MessageOptions - * @instance + * 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) { + 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(); + 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 */ - MessageOptions.prototype[".google.api.resource"] = null; - + ServiceDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + /** - * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. + * Verifies a ServiceDescriptorProto message. + * @function verify + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} 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.MessageOptions + * @memberof google.protobuf.ServiceDescriptorProto * @static * @param {Object.} object Plain object - * @returns {google.protobuf.MessageOptions} MessageOptions + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto */ - MessageOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.MessageOptions) + ServiceDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceDescriptorProto) 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.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]); + 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[".google.api.resource"] != null) { - if (typeof object[".google.api.resource"] !== "object") - throw TypeError(".google.protobuf.MessageOptions..google.api.resource: object expected"); - message[".google.api.resource"] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resource"]); + 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 MessageOptions message. Also converts values to other types if specified. + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.MessageOptions + * @memberof google.protobuf.ServiceDescriptorProto * @static - * @param {google.protobuf.MessageOptions} message MessageOptions + * @param {google.protobuf.ServiceDescriptorProto} message ServiceDescriptorProto * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - MessageOptions.toObject = function toObject(message, options) { + ServiceDescriptorProto.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) - object.uninterpretedOption = []; + object.method = []; if (options.defaults) { - object.messageSetWireFormat = false; - object.noStandardDescriptorAccessor = false; - object.deprecated = false; - object.mapEntry = false; - object[".google.api.resource"] = null; + object.name = ""; + object.options = 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.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); + 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[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) - object[".google.api.resource"] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resource"], options); + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ServiceOptions.toObject(message.options, options); return object; }; - + /** - * Converts this MessageOptions to JSON. + * Converts this ServiceDescriptorProto to JSON. * @function toJSON - * @memberof google.protobuf.MessageOptions + * @memberof google.protobuf.ServiceDescriptorProto * @instance * @returns {Object.} JSON object */ - MessageOptions.prototype.toJSON = function toJSON() { + ServiceDescriptorProto.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - + /** - * Gets the default type url for MessageOptions + * Gets the default type url for ServiceDescriptorProto * @function getTypeUrl - * @memberof google.protobuf.MessageOptions + * @memberof google.protobuf.ServiceDescriptorProto * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - MessageOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ServiceDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.MessageOptions"; + return typeUrlPrefix + "/google.protobuf.ServiceDescriptorProto"; }; - - return MessageOptions; + + return ServiceDescriptorProto; })(); - - protobuf.FieldOptions = (function() { - + + protobuf.MethodDescriptorProto = (function() { + /** - * Properties of a FieldOptions. + * Properties of a MethodDescriptorProto. * @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} [deprecated] FieldOptions deprecated - * @property {boolean|null} [weak] FieldOptions weak - * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption - * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior - * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference + * @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 FieldOptions. + * Constructs a new MethodDescriptorProto. * @memberof google.protobuf - * @classdesc Represents a FieldOptions. - * @implements IFieldOptions + * @classdesc Represents a MethodDescriptorProto. + * @implements IMethodDescriptorProto * @constructor - * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set */ - function FieldOptions(properties) { - this.uninterpretedOption = []; - this[".google.api.fieldBehavior"] = []; + 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]]; } - + /** - * FieldOptions ctype. - * @member {google.protobuf.FieldOptions.CType} ctype - * @memberof google.protobuf.FieldOptions + * MethodDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.MethodDescriptorProto * @instance */ - FieldOptions.prototype.ctype = 0; - + MethodDescriptorProto.prototype.name = ""; + /** - * FieldOptions packed. - * @member {boolean} packed - * @memberof google.protobuf.FieldOptions + * MethodDescriptorProto inputType. + * @member {string} inputType + * @memberof google.protobuf.MethodDescriptorProto * @instance */ - FieldOptions.prototype.packed = false; - + MethodDescriptorProto.prototype.inputType = ""; + /** - * FieldOptions jstype. - * @member {google.protobuf.FieldOptions.JSType} jstype - * @memberof google.protobuf.FieldOptions + * MethodDescriptorProto outputType. + * @member {string} outputType + * @memberof google.protobuf.MethodDescriptorProto * @instance */ - FieldOptions.prototype.jstype = 0; - + MethodDescriptorProto.prototype.outputType = ""; + /** - * FieldOptions lazy. - * @member {boolean} lazy - * @memberof google.protobuf.FieldOptions + * MethodDescriptorProto options. + * @member {google.protobuf.IMethodOptions|null|undefined} options + * @memberof google.protobuf.MethodDescriptorProto * @instance */ - FieldOptions.prototype.lazy = false; - + MethodDescriptorProto.prototype.options = null; + /** - * FieldOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.FieldOptions + * MethodDescriptorProto clientStreaming. + * @member {boolean} clientStreaming + * @memberof google.protobuf.MethodDescriptorProto * @instance */ - FieldOptions.prototype.deprecated = false; - + MethodDescriptorProto.prototype.clientStreaming = false; + /** - * FieldOptions weak. - * @member {boolean} weak - * @memberof google.protobuf.FieldOptions + * MethodDescriptorProto serverStreaming. + * @member {boolean} serverStreaming + * @memberof google.protobuf.MethodDescriptorProto * @instance */ - FieldOptions.prototype.weak = false; - + MethodDescriptorProto.prototype.serverStreaming = false; + /** - * FieldOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.FieldOptions - * @instance + * 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 */ - FieldOptions.prototype.uninterpretedOption = $util.emptyArray; - + MethodDescriptorProto.create = function create(properties) { + return new MethodDescriptorProto(properties); + }; + /** - * FieldOptions .google.api.fieldBehavior. - * @member {Array.} .google.api.fieldBehavior - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; - + * 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; + }; + /** - * FieldOptions .google.api.resourceReference. - * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference - * @memberof google.protobuf.FieldOptions - * @instance + * 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 */ - FieldOptions.prototype[".google.api.resourceReference"] = null; - + MethodDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + /** - * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FieldOptions + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodDescriptorProto * @static - * @param {Object.} 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.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.weak != null) - message.weak = Boolean(object.weak); - 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]); - } - } - if (object[".google.api.fieldBehavior"]) { - if (!Array.isArray(object[".google.api.fieldBehavior"])) - throw TypeError(".google.protobuf.FieldOptions..google.api.fieldBehavior: array expected"); - message[".google.api.fieldBehavior"] = []; - for (var i = 0; i < object[".google.api.fieldBehavior"].length; ++i) - switch (object[".google.api.fieldBehavior"][i]) { - default: - if (typeof object[".google.api.fieldBehavior"][i] === "number") { - message[".google.api.fieldBehavior"][i] = object[".google.api.fieldBehavior"][i]; - break; - } - case "FIELD_BEHAVIOR_UNSPECIFIED": - case 0: - message[".google.api.fieldBehavior"][i] = 0; - break; - case "OPTIONAL": - case 1: - message[".google.api.fieldBehavior"][i] = 1; - break; - case "REQUIRED": - case 2: - message[".google.api.fieldBehavior"][i] = 2; - break; - case "OUTPUT_ONLY": - case 3: - message[".google.api.fieldBehavior"][i] = 3; + * @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) { + 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(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); break; - case "INPUT_ONLY": - case 4: - message[".google.api.fieldBehavior"][i] = 4; + } + case 2: { + message.inputType = reader.string(); break; - case "IMMUTABLE": - case 5: - message[".google.api.fieldBehavior"][i] = 5; + } + case 3: { + message.outputType = reader.string(); break; - case "UNORDERED_LIST": - case 6: - message[".google.api.fieldBehavior"][i] = 6; + } + case 4: { + message.options = $root.google.protobuf.MethodOptions.decode(reader, reader.uint32()); break; - case "NON_EMPTY_DEFAULT": - case 7: - message[".google.api.fieldBehavior"][i] = 7; + } + case 5: { + message.clientStreaming = reader.bool(); break; - case "IDENTIFIER": - case 8: - message[".google.api.fieldBehavior"][i] = 8; + } + case 6: { + message.serverStreaming = reader.bool(); break; } - } - if (object[".google.api.resourceReference"] != null) { - if (typeof object[".google.api.resourceReference"] !== "object") - throw TypeError(".google.protobuf.FieldOptions..google.api.resourceReference: object expected"); - message[".google.api.resourceReference"] = $root.google.api.ResourceReference.fromObject(object[".google.api.resourceReference"]); + default: + reader.skipType(tag & 7); + break; + } } return message; }; - + /** - * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FieldOptions + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodDescriptorProto * @static - * @param {google.protobuf.FieldOptions} message FieldOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * @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 */ - FieldOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.uninterpretedOption = []; - object[".google.api.fieldBehavior"] = []; - } - 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[".google.api.resourceReference"] = 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.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); - } - if (message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length) { - object[".google.api.fieldBehavior"] = []; - for (var j = 0; j < message[".google.api.fieldBehavior"].length; ++j) - object[".google.api.fieldBehavior"][j] = options.enums === String ? $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] === undefined ? message[".google.api.fieldBehavior"][j] : $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] : message[".google.api.fieldBehavior"][j]; - } - if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) - object[".google.api.resourceReference"] = $root.google.api.ResourceReference.toObject(message[".google.api.resourceReference"], options); - return object; + MethodDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); }; - + /** - * Converts this FieldOptions to JSON. - * @function toJSON - * @memberof google.protobuf.FieldOptions - * @instance - * @returns {Object.} JSON object + * Verifies a MethodDescriptorProto message. + * @function verify + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - FieldOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + 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; }; - + /** - * Gets the default type url for FieldOptions - * @function getTypeUrl - * @memberof google.protobuf.FieldOptions + * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodDescriptorProto * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto */ - FieldOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; + 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); } - return typeUrlPrefix + "/google.protobuf.FieldOptions"; + if (object.clientStreaming != null) + message.clientStreaming = Boolean(object.clientStreaming); + if (object.serverStreaming != null) + message.serverStreaming = Boolean(object.serverStreaming); + return message; }; - + /** - * CType enum. - * @name google.protobuf.FieldOptions.CType - * @enum {string} - * @property {string} STRING=STRING STRING value - * @property {string} CORD=CORD CORD value - * @property {string} STRING_PIECE=STRING_PIECE STRING_PIECE value - */ - FieldOptions.CType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STRING"] = "STRING"; - values[valuesById[1] = "CORD"] = "CORD"; - values[valuesById[2] = "STRING_PIECE"] = "STRING_PIECE"; - return values; - })(); - - /** - * JSType enum. - * @name google.protobuf.FieldOptions.JSType - * @enum {string} - * @property {string} JS_NORMAL=JS_NORMAL JS_NORMAL value - * @property {string} JS_STRING=JS_STRING JS_STRING value - * @property {string} JS_NUMBER=JS_NUMBER JS_NUMBER value - */ - FieldOptions.JSType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "JS_NORMAL"] = "JS_NORMAL"; - values[valuesById[1] = "JS_STRING"] = "JS_STRING"; - values[valuesById[2] = "JS_NUMBER"] = "JS_NUMBER"; - return values; - })(); - - return FieldOptions; - })(); - - protobuf.OneofOptions = (function() { - - /** - * Properties of an OneofOptions. - * @memberof google.protobuf - * @interface IOneofOptions - * @property {Array.|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 uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.OneofOptions - * @instance - */ - OneofOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * 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.} 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.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. + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.OneofOptions + * @memberof google.protobuf.MethodDescriptorProto * @static - * @param {google.protobuf.OneofOptions} message OneofOptions + * @param {google.protobuf.MethodDescriptorProto} message MethodDescriptorProto * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - OneofOptions.toObject = function toObject(message, options) { + MethodDescriptorProto.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - 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); + 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 OneofOptions to JSON. + * Converts this MethodDescriptorProto to JSON. * @function toJSON - * @memberof google.protobuf.OneofOptions + * @memberof google.protobuf.MethodDescriptorProto * @instance * @returns {Object.} JSON object */ - OneofOptions.prototype.toJSON = function toJSON() { + MethodDescriptorProto.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - + /** - * Gets the default type url for OneofOptions + * Gets the default type url for MethodDescriptorProto * @function getTypeUrl - * @memberof google.protobuf.OneofOptions + * @memberof google.protobuf.MethodDescriptorProto * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - OneofOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + MethodDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.OneofOptions"; + return typeUrlPrefix + "/google.protobuf.MethodDescriptorProto"; }; - - return OneofOptions; + + return MethodDescriptorProto; })(); - - protobuf.EnumOptions = (function() { - + + protobuf.FileOptions = (function() { + /** - * Properties of an EnumOptions. + * Properties of a FileOptions. * @memberof google.protobuf - * @interface IEnumOptions - * @property {boolean|null} [allowAlias] EnumOptions allowAlias - * @property {boolean|null} [deprecated] EnumOptions deprecated - * @property {Array.|null} [uninterpretedOption] EnumOptions uninterpretedOption + * @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.|null} [uninterpretedOption] FileOptions uninterpretedOption */ - + /** - * Constructs a new EnumOptions. + * Constructs a new FileOptions. * @memberof google.protobuf - * @classdesc Represents an EnumOptions. - * @implements IEnumOptions + * @classdesc Represents a FileOptions. + * @implements IFileOptions * @constructor - * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + * @param {google.protobuf.IFileOptions=} [properties] Properties to set */ - function EnumOptions(properties) { + 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]]; } - + /** - * EnumOptions allowAlias. - * @member {boolean} allowAlias - * @memberof google.protobuf.EnumOptions + * FileOptions javaPackage. + * @member {string} javaPackage + * @memberof google.protobuf.FileOptions * @instance */ - EnumOptions.prototype.allowAlias = false; - + FileOptions.prototype.javaPackage = ""; + /** - * EnumOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.EnumOptions + * FileOptions javaOuterClassname. + * @member {string} javaOuterClassname + * @memberof google.protobuf.FileOptions * @instance */ - EnumOptions.prototype.deprecated = false; - + FileOptions.prototype.javaOuterClassname = ""; + /** - * EnumOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.EnumOptions + * FileOptions javaMultipleFiles. + * @member {boolean} javaMultipleFiles + * @memberof google.protobuf.FileOptions * @instance */ - EnumOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * 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.} 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.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; - }; - + FileOptions.prototype.javaMultipleFiles = false; + /** - * 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.} Plain object + * FileOptions javaGenerateEqualsAndHash. + * @member {boolean} javaGenerateEqualsAndHash + * @memberof google.protobuf.FileOptions + * @instance */ - 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; - } - if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) - object.allowAlias = message.allowAlias; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - 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; - }; - + FileOptions.prototype.javaGenerateEqualsAndHash = false; + /** - * Converts this EnumOptions to JSON. - * @function toJSON - * @memberof google.protobuf.EnumOptions + * FileOptions javaStringCheckUtf8. + * @member {boolean} javaStringCheckUtf8 + * @memberof google.protobuf.FileOptions * @instance - * @returns {Object.} JSON object */ - EnumOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - + FileOptions.prototype.javaStringCheckUtf8 = false; + /** - * 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 + * FileOptions optimizeFor. + * @member {google.protobuf.FileOptions.OptimizeMode} optimizeFor + * @memberof google.protobuf.FileOptions + * @instance */ - EnumOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.EnumOptions"; - }; - - return EnumOptions; - })(); - - protobuf.EnumValueOptions = (function() { - + FileOptions.prototype.optimizeFor = 1; + /** - * Properties of an EnumValueOptions. - * @memberof google.protobuf - * @interface IEnumValueOptions - * @property {boolean|null} [deprecated] EnumValueOptions deprecated - * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption + * FileOptions goPackage. + * @member {string} goPackage + * @memberof google.protobuf.FileOptions + * @instance */ - + FileOptions.prototype.goPackage = ""; + /** - * Constructs a new EnumValueOptions. - * @memberof google.protobuf - * @classdesc Represents an EnumValueOptions. - * @implements IEnumValueOptions - * @constructor - * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + * FileOptions ccGenericServices. + * @member {boolean} ccGenericServices + * @memberof google.protobuf.FileOptions + * @instance */ - 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]]; - } - + FileOptions.prototype.ccGenericServices = false; + /** - * EnumValueOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.EnumValueOptions + * FileOptions javaGenericServices. + * @member {boolean} javaGenericServices + * @memberof google.protobuf.FileOptions * @instance */ - EnumValueOptions.prototype.deprecated = false; - + FileOptions.prototype.javaGenericServices = false; + /** - * EnumValueOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.EnumValueOptions + * FileOptions pyGenericServices. + * @member {boolean} pyGenericServices + * @memberof google.protobuf.FileOptions * @instance */ - EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray; - + FileOptions.prototype.pyGenericServices = false; + /** - * 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.} object Plain object - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * FileOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FileOptions + * @instance */ - 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.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; - }; - + FileOptions.prototype.deprecated = false; + /** - * 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.} Plain object + * FileOptions ccEnableArenas. + * @member {boolean} ccEnableArenas + * @memberof google.protobuf.FileOptions + * @instance */ - EnumValueOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (options.defaults) - object.deprecated = false; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - 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; - }; - + FileOptions.prototype.ccEnableArenas = true; + /** - * Converts this EnumValueOptions to JSON. - * @function toJSON - * @memberof google.protobuf.EnumValueOptions + * FileOptions objcClassPrefix. + * @member {string} objcClassPrefix + * @memberof google.protobuf.FileOptions * @instance - * @returns {Object.} JSON object */ - EnumValueOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - + FileOptions.prototype.objcClassPrefix = ""; + /** - * 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 + * FileOptions csharpNamespace. + * @member {string} csharpNamespace + * @memberof google.protobuf.FileOptions + * @instance */ - EnumValueOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.EnumValueOptions"; - }; - - return EnumValueOptions; - })(); - - protobuf.ServiceOptions = (function() { - + FileOptions.prototype.csharpNamespace = ""; + /** - * Properties of a ServiceOptions. - * @memberof google.protobuf - * @interface IServiceOptions - * @property {boolean|null} [deprecated] ServiceOptions deprecated - * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption - * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost - * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes + * FileOptions swiftPrefix. + * @member {string} swiftPrefix + * @memberof google.protobuf.FileOptions + * @instance */ - + FileOptions.prototype.swiftPrefix = ""; + /** - * Constructs a new ServiceOptions. - * @memberof google.protobuf - * @classdesc Represents a ServiceOptions. - * @implements IServiceOptions - * @constructor - * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + * FileOptions phpClassPrefix. + * @member {string} phpClassPrefix + * @memberof google.protobuf.FileOptions + * @instance */ - 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]]; - } - + FileOptions.prototype.phpClassPrefix = ""; + /** - * ServiceOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.ServiceOptions + * FileOptions phpNamespace. + * @member {string} phpNamespace + * @memberof google.protobuf.FileOptions * @instance */ - ServiceOptions.prototype.deprecated = false; - + FileOptions.prototype.phpNamespace = ""; + /** - * ServiceOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.ServiceOptions + * FileOptions phpMetadataNamespace. + * @member {string} phpMetadataNamespace + * @memberof google.protobuf.FileOptions * @instance */ - ServiceOptions.prototype.uninterpretedOption = $util.emptyArray; - + FileOptions.prototype.phpMetadataNamespace = ""; + /** - * ServiceOptions .google.api.defaultHost. - * @member {string} .google.api.defaultHost - * @memberof google.protobuf.ServiceOptions + * FileOptions rubyPackage. + * @member {string} rubyPackage + * @memberof google.protobuf.FileOptions * @instance */ - ServiceOptions.prototype[".google.api.defaultHost"] = ""; - + FileOptions.prototype.rubyPackage = ""; + /** - * ServiceOptions .google.api.oauthScopes. - * @member {string} .google.api.oauthScopes - * @memberof google.protobuf.ServiceOptions + * FileOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.FileOptions * @instance */ - ServiceOptions.prototype[".google.api.oauthScopes"] = ""; - + FileOptions.prototype.features = null; + /** - * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.ServiceOptions + * FileOptions uninterpretedOption. + * @member {Array.} 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 {Object.} object Plain object - * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + * @returns {google.protobuf.FileOptions} FileOptions instance */ - ServiceOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ServiceOptions) - return object; - var message = new $root.google.protobuf.ServiceOptions(); - 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]); - } - } - if (object[".google.api.defaultHost"] != null) - message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]); - if (object[".google.api.oauthScopes"] != null) - message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]); - return message; + FileOptions.create = function create(properties) { + return new FileOptions(properties); }; - + /** - * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.ServiceOptions + * 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.ServiceOptions} message ServiceOptions + * @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) { + 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(); + 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.} 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.} 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.} Plain object */ - ServiceOptions.toObject = function toObject(message, options) { + 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[".google.api.defaultHost"] = ""; - object[".google.api.oauthScopes"] = ""; + 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); } - if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) - object[".google.api.defaultHost"] = message[".google.api.defaultHost"]; - if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) - object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"]; return object; }; - + /** - * Converts this ServiceOptions to JSON. + * Converts this FileOptions to JSON. * @function toJSON - * @memberof google.protobuf.ServiceOptions + * @memberof google.protobuf.FileOptions * @instance * @returns {Object.} JSON object */ - ServiceOptions.prototype.toJSON = function toJSON() { + FileOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - + /** - * Gets the default type url for ServiceOptions + * Gets the default type url for FileOptions * @function getTypeUrl - * @memberof google.protobuf.ServiceOptions + * @memberof google.protobuf.FileOptions * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ServiceOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + FileOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.ServiceOptions"; + return typeUrlPrefix + "/google.protobuf.FileOptions"; }; - - return ServiceOptions; + + /** + * 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.MethodOptions = (function() { - + + protobuf.MessageOptions = (function() { + /** - * Properties of a MethodOptions. + * Properties of a MessageOptions. * @memberof google.protobuf - * @interface IMethodOptions - * @property {boolean|null} [deprecated] MethodOptions deprecated - * @property {Array.|null} [uninterpretedOption] MethodOptions uninterpretedOption - * @property {google.api.IHttpRule|null} [".google.api.http"] MethodOptions .google.api.http - * @property {Array.|null} [".google.api.methodSignature"] MethodOptions .google.api.methodSignature - * @property {google.longrunning.IOperationInfo|null} [".google.longrunning.operationInfo"] MethodOptions .google.longrunning.operationInfo + * @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.|null} [uninterpretedOption] MessageOptions uninterpretedOption */ - + /** - * Constructs a new MethodOptions. + * Constructs a new MessageOptions. * @memberof google.protobuf - * @classdesc Represents a MethodOptions. - * @implements IMethodOptions + * @classdesc Represents a MessageOptions. + * @implements IMessageOptions * @constructor - * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set */ - function MethodOptions(properties) { + function MessageOptions(properties) { this.uninterpretedOption = []; - this[".google.api.methodSignature"] = []; 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. + * 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.MethodOptions + * @memberof google.protobuf.MessageOptions * @instance */ - MethodOptions.prototype.deprecated = false; - + MessageOptions.prototype.deprecated = false; + /** - * MethodOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.MethodOptions + * MessageOptions mapEntry. + * @member {boolean} mapEntry + * @memberof google.protobuf.MessageOptions * @instance */ - MethodOptions.prototype.uninterpretedOption = $util.emptyArray; - + MessageOptions.prototype.mapEntry = false; + /** - * MethodOptions .google.api.http. - * @member {google.api.IHttpRule|null|undefined} .google.api.http - * @memberof google.protobuf.MethodOptions + * MessageOptions deprecatedLegacyJsonFieldConflicts. + * @member {boolean} deprecatedLegacyJsonFieldConflicts + * @memberof google.protobuf.MessageOptions * @instance */ - MethodOptions.prototype[".google.api.http"] = null; - + MessageOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; + /** - * MethodOptions .google.api.methodSignature. - * @member {Array.} .google.api.methodSignature - * @memberof google.protobuf.MethodOptions + * MessageOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.MessageOptions * @instance */ - MethodOptions.prototype[".google.api.methodSignature"] = $util.emptyArray; - + MessageOptions.prototype.features = null; + /** - * MethodOptions .google.longrunning.operationInfo. - * @member {google.longrunning.IOperationInfo|null|undefined} .google.longrunning.operationInfo - * @memberof google.protobuf.MethodOptions + * MessageOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MessageOptions * @instance */ - MethodOptions.prototype[".google.longrunning.operationInfo"] = null; - + MessageOptions.prototype.uninterpretedOption = $util.emptyArray; + /** - * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * 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) { + 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(); + 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.} 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.MethodOptions + * @memberof google.protobuf.MessageOptions * @static * @param {Object.} object Plain object - * @returns {google.protobuf.MethodOptions} MethodOptions + * @returns {google.protobuf.MessageOptions} MessageOptions */ - MethodOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.MethodOptions) + MessageOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MessageOptions) return object; - var message = new $root.google.protobuf.MethodOptions(); + 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.MethodOptions.uninterpretedOption: array expected"); + 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.MethodOptions.uninterpretedOption: object expected"); + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: object expected"); message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); } } - if (object[".google.api.http"] != null) { - if (typeof object[".google.api.http"] !== "object") - throw TypeError(".google.protobuf.MethodOptions..google.api.http: object expected"); - message[".google.api.http"] = $root.google.api.HttpRule.fromObject(object[".google.api.http"]); - } - if (object[".google.api.methodSignature"]) { - if (!Array.isArray(object[".google.api.methodSignature"])) - throw TypeError(".google.protobuf.MethodOptions..google.api.methodSignature: array expected"); - message[".google.api.methodSignature"] = []; - for (var i = 0; i < object[".google.api.methodSignature"].length; ++i) - message[".google.api.methodSignature"][i] = String(object[".google.api.methodSignature"][i]); - } - if (object[".google.longrunning.operationInfo"] != null) { - if (typeof object[".google.longrunning.operationInfo"] !== "object") - throw TypeError(".google.protobuf.MethodOptions..google.longrunning.operationInfo: object expected"); - message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.fromObject(object[".google.longrunning.operationInfo"]); - } return message; }; - + /** - * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.MethodOptions + * @memberof google.protobuf.MessageOptions * @static - * @param {google.protobuf.MethodOptions} message MethodOptions + * @param {google.protobuf.MessageOptions} message MessageOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - MethodOptions.toObject = function toObject(message, options) { + MessageOptions.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { + if (options.arrays || options.defaults) object.uninterpretedOption = []; - object[".google.api.methodSignature"] = []; - } if (options.defaults) { + object.messageSetWireFormat = false; + object.noStandardDescriptorAccessor = false; object.deprecated = false; - object[".google.longrunning.operationInfo"] = null; - object[".google.api.http"] = null; + 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); } - if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) - object[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.toObject(message[".google.longrunning.operationInfo"], options); - if (message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length) { - object[".google.api.methodSignature"] = []; - for (var j = 0; j < message[".google.api.methodSignature"].length; ++j) - object[".google.api.methodSignature"][j] = message[".google.api.methodSignature"][j]; - } - if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) - object[".google.api.http"] = $root.google.api.HttpRule.toObject(message[".google.api.http"], options); return object; }; - + /** - * Converts this MethodOptions to JSON. + * Converts this MessageOptions to JSON. * @function toJSON - * @memberof google.protobuf.MethodOptions + * @memberof google.protobuf.MessageOptions * @instance * @returns {Object.} JSON object */ - MethodOptions.prototype.toJSON = function toJSON() { + MessageOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - + /** - * Gets the default type url for MethodOptions + * Gets the default type url for MessageOptions * @function getTypeUrl - * @memberof google.protobuf.MethodOptions + * @memberof google.protobuf.MessageOptions * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - MethodOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + MessageOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.MethodOptions"; + return typeUrlPrefix + "/google.protobuf.MessageOptions"; }; - - return MethodOptions; + + return MessageOptions; })(); - - protobuf.UninterpretedOption = (function() { - + + protobuf.FieldOptions = (function() { + /** - * Properties of an UninterpretedOption. + * Properties of a FieldOptions. * @memberof google.protobuf - * @interface IUninterpretedOption - * @property {Array.|null} [name] UninterpretedOption name - * @property {string|null} [identifierValue] UninterpretedOption identifierValue - * @property {number|string|null} [positiveIntValue] UninterpretedOption positiveIntValue - * @property {number|string|null} [negativeIntValue] UninterpretedOption negativeIntValue - * @property {number|null} [doubleValue] UninterpretedOption doubleValue - * @property {Uint8Array|null} [stringValue] UninterpretedOption stringValue - * @property {string|null} [aggregateValue] UninterpretedOption aggregateValue + * @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.|null} [targets] FieldOptions targets + * @property {Array.|null} [editionDefaults] FieldOptions editionDefaults + * @property {google.protobuf.IFeatureSet|null} [features] FieldOptions features + * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption + * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior */ - + /** - * Constructs a new UninterpretedOption. + * Constructs a new FieldOptions. * @memberof google.protobuf - * @classdesc Represents an UninterpretedOption. - * @implements IUninterpretedOption + * @classdesc Represents a FieldOptions. + * @implements IFieldOptions * @constructor - * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set */ - function UninterpretedOption(properties) { - this.name = []; + function FieldOptions(properties) { + this.targets = []; + this.editionDefaults = []; + this.uninterpretedOption = []; + this[".google.api.fieldBehavior"] = []; 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.} name - * @memberof google.protobuf.UninterpretedOption + * FieldOptions ctype. + * @member {google.protobuf.FieldOptions.CType} ctype + * @memberof google.protobuf.FieldOptions * @instance */ - UninterpretedOption.prototype.name = $util.emptyArray; - + FieldOptions.prototype.ctype = 0; + /** - * UninterpretedOption identifierValue. - * @member {string} identifierValue - * @memberof google.protobuf.UninterpretedOption - * @instance + * FieldOptions packed. + * @member {boolean} packed + * @memberof google.protobuf.FieldOptions + * @instance */ - UninterpretedOption.prototype.identifierValue = ""; - + FieldOptions.prototype.packed = false; + /** - * UninterpretedOption positiveIntValue. - * @member {number|string} positiveIntValue - * @memberof google.protobuf.UninterpretedOption + * FieldOptions jstype. + * @member {google.protobuf.FieldOptions.JSType} jstype + * @memberof google.protobuf.FieldOptions * @instance */ - UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - + FieldOptions.prototype.jstype = 0; + /** - * UninterpretedOption negativeIntValue. - * @member {number|string} negativeIntValue - * @memberof google.protobuf.UninterpretedOption + * FieldOptions lazy. + * @member {boolean} lazy + * @memberof google.protobuf.FieldOptions * @instance */ - UninterpretedOption.prototype.negativeIntValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - + FieldOptions.prototype.lazy = false; + /** - * UninterpretedOption doubleValue. - * @member {number} doubleValue - * @memberof google.protobuf.UninterpretedOption + * FieldOptions unverifiedLazy. + * @member {boolean} unverifiedLazy + * @memberof google.protobuf.FieldOptions * @instance */ - UninterpretedOption.prototype.doubleValue = 0; - + FieldOptions.prototype.unverifiedLazy = false; + /** - * UninterpretedOption stringValue. - * @member {Uint8Array} stringValue - * @memberof google.protobuf.UninterpretedOption + * FieldOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FieldOptions * @instance */ - UninterpretedOption.prototype.stringValue = $util.newBuffer([]); - + FieldOptions.prototype.deprecated = false; + /** - * UninterpretedOption aggregateValue. - * @member {string} aggregateValue - * @memberof google.protobuf.UninterpretedOption + * FieldOptions weak. + * @member {boolean} weak + * @memberof google.protobuf.FieldOptions * @instance */ - UninterpretedOption.prototype.aggregateValue = ""; - + FieldOptions.prototype.weak = false; + /** - * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.UninterpretedOption + * 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.} targets + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.targets = $util.emptyArray; + + /** + * FieldOptions editionDefaults. + * @member {Array.} 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 uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * FieldOptions .google.api.fieldBehavior. + * @member {Array.} .google.api.fieldBehavior + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions} FieldOptions instance */ - 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; + FieldOptions.create = function create(properties) { + return new FieldOptions(properties); }; - + /** - * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.UninterpretedOption + * 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.UninterpretedOption} message UninterpretedOption - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * @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.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(); + if (message[".google.api.fieldBehavior"] != null && message[".google.api.fieldBehavior"].length) { + writer.uint32(/* id 1052, wireType 2 =*/8418).fork(); + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + writer.int32(message[".google.api.fieldBehavior"][i]); + writer.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 */ - 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); + 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) { + 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(); + 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 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1052: { + if (!(message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length)) + message[".google.api.fieldBehavior"] = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message[".google.api.fieldBehavior"].push(reader.int32()); + } else + message[".google.api.fieldBehavior"].push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; } - 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; + return message; }; - + /** - * Converts this UninterpretedOption to JSON. - * @function toJSON - * @memberof google.protobuf.UninterpretedOption - * @instance - * @returns {Object.} JSON object + * 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 */ - UninterpretedOption.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + FieldOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); }; - + /** - * Gets the default type url for UninterpretedOption - * @function getTypeUrl - * @memberof google.protobuf.UninterpretedOption + * Verifies a FieldOptions message. + * @function verify + * @memberof google.protobuf.FieldOptions * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @param {Object.} 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.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[".google.api.fieldBehavior"] != null && message.hasOwnProperty(".google.api.fieldBehavior")) { + if (!Array.isArray(message[".google.api.fieldBehavior"])) + return ".google.api.fieldBehavior: array expected"; + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + switch (message[".google.api.fieldBehavior"][i]) { + default: + return ".google.api.fieldBehavior: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + break; + } + } + 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.} 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.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]); + } + } + if (object[".google.api.fieldBehavior"]) { + if (!Array.isArray(object[".google.api.fieldBehavior"])) + throw TypeError(".google.protobuf.FieldOptions..google.api.fieldBehavior: array expected"); + message[".google.api.fieldBehavior"] = []; + for (var i = 0; i < object[".google.api.fieldBehavior"].length; ++i) + switch (object[".google.api.fieldBehavior"][i]) { + default: + if (typeof object[".google.api.fieldBehavior"][i] === "number") { + message[".google.api.fieldBehavior"][i] = object[".google.api.fieldBehavior"][i]; + break; + } + case "FIELD_BEHAVIOR_UNSPECIFIED": + case 0: + message[".google.api.fieldBehavior"][i] = 0; + break; + case "OPTIONAL": + case 1: + message[".google.api.fieldBehavior"][i] = 1; + break; + case "REQUIRED": + case 2: + message[".google.api.fieldBehavior"][i] = 2; + break; + case "OUTPUT_ONLY": + case 3: + message[".google.api.fieldBehavior"][i] = 3; + break; + case "INPUT_ONLY": + case 4: + message[".google.api.fieldBehavior"][i] = 4; + break; + case "IMMUTABLE": + case 5: + message[".google.api.fieldBehavior"][i] = 5; + break; + case "UNORDERED_LIST": + case 6: + message[".google.api.fieldBehavior"][i] = 6; + break; + case "NON_EMPTY_DEFAULT": + case 7: + message[".google.api.fieldBehavior"][i] = 7; + break; + case "IDENTIFIER": + case 8: + message[".google.api.fieldBehavior"][i] = 8; + break; + } + } + 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.} Plain object + */ + FieldOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.targets = []; + object.editionDefaults = []; + object.uninterpretedOption = []; + object[".google.api.fieldBehavior"] = []; + } + 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; + } + 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.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); + } + if (message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length) { + object[".google.api.fieldBehavior"] = []; + for (var j = 0; j < message[".google.api.fieldBehavior"].length; ++j) + object[".google.api.fieldBehavior"][j] = options.enums === String ? $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] === undefined ? message[".google.api.fieldBehavior"][j] : $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] : message[".google.api.fieldBehavior"][j]; + } + return object; + }; + + /** + * Converts this FieldOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions + * @instance + * @returns {Object.} 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 */ - UninterpretedOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + FieldOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.UninterpretedOption"; + return typeUrlPrefix + "/google.protobuf.FieldOptions"; }; - - UninterpretedOption.NamePart = (function() { - + + /** + * 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 a NamePart. - * @memberof google.protobuf.UninterpretedOption - * @interface INamePart - * @property {string} namePart NamePart namePart - * @property {boolean} isExtension NamePart isExtension + * 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 NamePart. - * @memberof google.protobuf.UninterpretedOption - * @classdesc Represents a NamePart. - * @implements INamePart + * Constructs a new EditionDefault. + * @memberof google.protobuf.FieldOptions + * @classdesc Represents an EditionDefault. + * @implements IEditionDefault * @constructor - * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set */ - function NamePart(properties) { + 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]]; } - + /** - * NamePart namePart. - * @member {string} namePart - * @memberof google.protobuf.UninterpretedOption.NamePart + * EditionDefault edition. + * @member {google.protobuf.Edition} edition + * @memberof google.protobuf.FieldOptions.EditionDefault * @instance */ - NamePart.prototype.namePart = ""; - + EditionDefault.prototype.edition = 0; + /** - * NamePart isExtension. - * @member {boolean} isExtension - * @memberof google.protobuf.UninterpretedOption.NamePart + * EditionDefault value. + * @member {string} value + * @memberof google.protobuf.FieldOptions.EditionDefault * @instance */ - NamePart.prototype.isExtension = false; - + EditionDefault.prototype.value = ""; + /** - * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * 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) { + 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(); + 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.} 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 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.UninterpretedOption.NamePart + * @memberof google.protobuf.FieldOptions.EditionDefault * @static * @param {Object.} object Plain object - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault */ - NamePart.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.UninterpretedOption.NamePart) + EditionDefault.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions.EditionDefault) 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); + 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_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 a NamePart message. Also converts values to other types if specified. + * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.UninterpretedOption.NamePart + * @memberof google.protobuf.FieldOptions.EditionDefault * @static - * @param {google.protobuf.UninterpretedOption.NamePart} message NamePart + * @param {google.protobuf.FieldOptions.EditionDefault} message EditionDefault * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - NamePart.toObject = function toObject(message, options) { + EditionDefault.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.namePart = ""; - object.isExtension = false; + object.value = ""; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; } - if (message.namePart != null && message.hasOwnProperty("namePart")) - object.namePart = message.namePart; - if (message.isExtension != null && message.hasOwnProperty("isExtension")) - object.isExtension = message.isExtension; + 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 NamePart to JSON. + * Converts this EditionDefault to JSON. * @function toJSON - * @memberof google.protobuf.UninterpretedOption.NamePart + * @memberof google.protobuf.FieldOptions.EditionDefault * @instance * @returns {Object.} JSON object */ - NamePart.prototype.toJSON = function toJSON() { + EditionDefault.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - + /** - * Gets the default type url for NamePart + * Gets the default type url for EditionDefault * @function getTypeUrl - * @memberof google.protobuf.UninterpretedOption.NamePart + * @memberof google.protobuf.FieldOptions.EditionDefault * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - NamePart.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + EditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.UninterpretedOption.NamePart"; + return typeUrlPrefix + "/google.protobuf.FieldOptions.EditionDefault"; }; - - return NamePart; + + return EditionDefault; })(); - - return UninterpretedOption; + + return FieldOptions; })(); - - protobuf.SourceCodeInfo = (function() { - + + protobuf.OneofOptions = (function() { + /** - * Properties of a SourceCodeInfo. + * Properties of an OneofOptions. * @memberof google.protobuf - * @interface ISourceCodeInfo - * @property {Array.|null} [location] SourceCodeInfo location + * @interface IOneofOptions + * @property {google.protobuf.IFeatureSet|null} [features] OneofOptions features + * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption */ - + /** - * Constructs a new SourceCodeInfo. + * Constructs a new OneofOptions. * @memberof google.protobuf - * @classdesc Represents a SourceCodeInfo. - * @implements ISourceCodeInfo + * @classdesc Represents an OneofOptions. + * @implements IOneofOptions * @constructor - * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set */ - function SourceCodeInfo(properties) { - this.location = []; + 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]]; } - + /** - * SourceCodeInfo location. - * @member {Array.} location - * @memberof google.protobuf.SourceCodeInfo + * OneofOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.OneofOptions * @instance */ - SourceCodeInfo.prototype.location = $util.emptyArray; - + OneofOptions.prototype.features = null; + /** - * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * OneofOptions uninterpretedOption. + * @member {Array.} 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) { + 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(); + 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.} 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.SourceCodeInfo + * @memberof google.protobuf.OneofOptions * @static * @param {Object.} object Plain object - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @returns {google.protobuf.OneofOptions} OneofOptions */ - SourceCodeInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.SourceCodeInfo) + OneofOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofOptions) 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]); + 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 a SourceCodeInfo message. Also converts values to other types if specified. + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.SourceCodeInfo + * @memberof google.protobuf.OneofOptions * @static - * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo + * @param {google.protobuf.OneofOptions} message OneofOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SourceCodeInfo.toObject = function toObject(message, options) { + OneofOptions.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); + 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 SourceCodeInfo to JSON. + * Converts this OneofOptions to JSON. * @function toJSON - * @memberof google.protobuf.SourceCodeInfo + * @memberof google.protobuf.OneofOptions * @instance * @returns {Object.} JSON object */ - SourceCodeInfo.prototype.toJSON = function toJSON() { + OneofOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - + /** - * Gets the default type url for SourceCodeInfo + * Gets the default type url for OneofOptions * @function getTypeUrl - * @memberof google.protobuf.SourceCodeInfo + * @memberof google.protobuf.OneofOptions * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - SourceCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + OneofOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.SourceCodeInfo"; + return typeUrlPrefix + "/google.protobuf.OneofOptions"; }; - - SourceCodeInfo.Location = (function() { - - /** - * Properties of a Location. - * @memberof google.protobuf.SourceCodeInfo - * @interface ILocation - * @property {Array.|null} [path] Location path - * @property {Array.|null} [span] Location span - * @property {string|null} [leadingComments] Location leadingComments - * @property {string|null} [trailingComments] Location trailingComments - * @property {Array.|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.} path - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.path = $util.emptyArray; - - /** - * Location span. - * @member {Array.} 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.} leadingDetachedComments - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.leadingDetachedComments = $util.emptyArray; - - /** - * 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.} 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.} 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.} 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; + + return OneofOptions; })(); - - protobuf.GeneratedCodeInfo = (function() { - + + protobuf.EnumOptions = (function() { + /** - * Properties of a GeneratedCodeInfo. + * Properties of an EnumOptions. * @memberof google.protobuf - * @interface IGeneratedCodeInfo - * @property {Array.|null} [annotation] GeneratedCodeInfo annotation + * @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.|null} [uninterpretedOption] EnumOptions uninterpretedOption */ - + /** - * Constructs a new GeneratedCodeInfo. + * Constructs a new EnumOptions. * @memberof google.protobuf - * @classdesc Represents a GeneratedCodeInfo. - * @implements IGeneratedCodeInfo + * @classdesc Represents an EnumOptions. + * @implements IEnumOptions * @constructor - * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set */ - function GeneratedCodeInfo(properties) { - this.annotation = []; + 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]]; } - + /** - * GeneratedCodeInfo annotation. - * @member {Array.} annotation - * @memberof google.protobuf.GeneratedCodeInfo + * EnumOptions allowAlias. + * @member {boolean} allowAlias + * @memberof google.protobuf.EnumOptions * @instance */ - GeneratedCodeInfo.prototype.annotation = $util.emptyArray; - + EnumOptions.prototype.allowAlias = false; + /** - * 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.} object Plain object - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * EnumOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumOptions + * @instance */ - 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; - }; - + EnumOptions.prototype.deprecated = false; + /** - * 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.} Plain object + * EnumOptions deprecatedLegacyJsonFieldConflicts. + * @member {boolean} deprecatedLegacyJsonFieldConflicts + * @memberof google.protobuf.EnumOptions + * @instance */ - 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; - }; - + EnumOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; + /** - * Converts this GeneratedCodeInfo to JSON. - * @function toJSON - * @memberof google.protobuf.GeneratedCodeInfo + * EnumOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.EnumOptions * @instance - * @returns {Object.} JSON object */ - GeneratedCodeInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + EnumOptions.prototype.features = null; + + /** + * EnumOptions uninterpretedOption. + * @member {Array.} 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; }; - + /** - * Gets the default type url for GeneratedCodeInfo - * @function getTypeUrl - * @memberof google.protobuf.GeneratedCodeInfo + * 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 {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - GeneratedCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo"; + EnumOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); }; - - GeneratedCodeInfo.Annotation = (function() { - - /** - * Properties of an Annotation. - * @memberof google.protobuf.GeneratedCodeInfo - * @interface IAnnotation - * @property {Array.|null} [path] Annotation path - * @property {string|null} [sourceFile] Annotation sourceFile - * @property {number|null} [begin] Annotation begin - * @property {number|null} [end] Annotation end - */ - - /** - * 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.} 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; - - /** - * 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.} 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; - 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.} 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; - } - 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; - return object; - }; - - /** - * Converts this Annotation to JSON. - * @function toJSON - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - * @returns {Object.} 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"; + + /** + * 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) { + 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(); + 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 typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo.Annotation"; - }; - - return Annotation; - })(); - - return GeneratedCodeInfo; - })(); - - protobuf.Empty = (function() { - + } + return message; + }; + /** - * Properties of an Empty. - * @memberof google.protobuf - * @interface IEmpty + * 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()); + }; + /** - * Constructs a new Empty. - * @memberof google.protobuf - * @classdesc Represents an Empty. - * @implements IEmpty - * @constructor - * @param {google.protobuf.IEmpty=} [properties] Properties to set + * Verifies an EnumOptions message. + * @function verify + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - function Empty(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]]; - } - + 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 Empty message from a plain object. Also converts values to their respective internal types. + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.Empty + * @memberof google.protobuf.EnumOptions * @static * @param {Object.} object Plain object - * @returns {google.protobuf.Empty} Empty + * @returns {google.protobuf.EnumOptions} EnumOptions */ - Empty.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Empty) + EnumOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumOptions) return object; - return new $root.google.protobuf.Empty(); + 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 Empty message. Also converts values to other types if specified. + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.Empty + * @memberof google.protobuf.EnumOptions * @static - * @param {google.protobuf.Empty} message Empty + * @param {google.protobuf.EnumOptions} message EnumOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Empty.toObject = function toObject() { - return {}; + 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 Empty to JSON. + * Converts this EnumOptions to JSON. * @function toJSON - * @memberof google.protobuf.Empty + * @memberof google.protobuf.EnumOptions * @instance * @returns {Object.} JSON object */ - Empty.prototype.toJSON = function toJSON() { + EnumOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - + /** - * Gets the default type url for Empty + * Gets the default type url for EnumOptions * @function getTypeUrl - * @memberof google.protobuf.Empty + * @memberof google.protobuf.EnumOptions * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - Empty.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + EnumOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.Empty"; + return typeUrlPrefix + "/google.protobuf.EnumOptions"; }; - - return Empty; + + return EnumOptions; })(); - - protobuf.DoubleValue = (function() { - + + protobuf.EnumValueOptions = (function() { + /** - * Properties of a DoubleValue. + * Properties of an EnumValueOptions. * @memberof google.protobuf - * @interface IDoubleValue - * @property {number|null} [value] DoubleValue value + * @interface IEnumValueOptions + * @property {boolean|null} [deprecated] EnumValueOptions deprecated + * @property {google.protobuf.IFeatureSet|null} [features] EnumValueOptions features + * @property {boolean|null} [debugRedact] EnumValueOptions debugRedact + * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption */ - + /** - * Constructs a new DoubleValue. + * Constructs a new EnumValueOptions. * @memberof google.protobuf - * @classdesc Represents a DoubleValue. - * @implements IDoubleValue + * @classdesc Represents an EnumValueOptions. + * @implements IEnumValueOptions * @constructor - * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set */ - function DoubleValue(properties) { + 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]]; } - + /** - * DoubleValue value. - * @member {number} value - * @memberof google.protobuf.DoubleValue + * EnumValueOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumValueOptions * @instance */ - DoubleValue.prototype.value = 0; - + EnumValueOptions.prototype.deprecated = false; + /** - * Creates a DoubleValue message from a plain object. Also converts values to their respective internal types. + * 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 uninterpretedOption. + * @member {Array.} 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.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) { + 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(); + 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 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.} 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.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.DoubleValue + * @memberof google.protobuf.EnumValueOptions * @static * @param {Object.} object Plain object - * @returns {google.protobuf.DoubleValue} DoubleValue + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions */ - DoubleValue.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.DoubleValue) + EnumValueOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueOptions) return object; - var message = new $root.google.protobuf.DoubleValue(); - if (object.value != null) - message.value = Number(object.value); + 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.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 a DoubleValue message. Also converts values to other types if specified. + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.DoubleValue + * @memberof google.protobuf.EnumValueOptions * @static - * @param {google.protobuf.DoubleValue} message DoubleValue + * @param {google.protobuf.EnumValueOptions} message EnumValueOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DoubleValue.toObject = function toObject(message, options) { + EnumValueOptions.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; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.deprecated = false; + object.features = null; + object.debugRedact = false; + } + 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.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 DoubleValue to JSON. + * Converts this EnumValueOptions to JSON. * @function toJSON - * @memberof google.protobuf.DoubleValue + * @memberof google.protobuf.EnumValueOptions * @instance * @returns {Object.} JSON object */ - DoubleValue.prototype.toJSON = function toJSON() { + EnumValueOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - + /** - * Gets the default type url for DoubleValue + * Gets the default type url for EnumValueOptions * @function getTypeUrl - * @memberof google.protobuf.DoubleValue + * @memberof google.protobuf.EnumValueOptions * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - DoubleValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + EnumValueOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.DoubleValue"; + return typeUrlPrefix + "/google.protobuf.EnumValueOptions"; }; - - return DoubleValue; + + return EnumValueOptions; })(); - - protobuf.FloatValue = (function() { - + + protobuf.ServiceOptions = (function() { + /** - * Properties of a FloatValue. + * Properties of a ServiceOptions. * @memberof google.protobuf - * @interface IFloatValue - * @property {number|null} [value] FloatValue value + * @interface IServiceOptions + * @property {google.protobuf.IFeatureSet|null} [features] ServiceOptions features + * @property {boolean|null} [deprecated] ServiceOptions deprecated + * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption + * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost + * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes */ - + /** - * Constructs a new FloatValue. + * Constructs a new ServiceOptions. * @memberof google.protobuf - * @classdesc Represents a FloatValue. - * @implements IFloatValue + * @classdesc Represents a ServiceOptions. + * @implements IServiceOptions * @constructor - * @param {google.protobuf.IFloatValue=} [properties] Properties to set + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set */ - function FloatValue(properties) { + 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]]; } - + /** - * FloatValue value. - * @member {number} value - * @memberof google.protobuf.FloatValue + * ServiceOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.ServiceOptions * @instance */ - FloatValue.prototype.value = 0; - + ServiceOptions.prototype.features = 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.} object Plain object - * @returns {google.protobuf.FloatValue} FloatValue + * ServiceOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.ServiceOptions + * @instance */ - 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; - }; - + ServiceOptions.prototype.deprecated = false; + /** - * 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.} Plain object + * ServiceOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ServiceOptions + * @instance */ - 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; - }; - + ServiceOptions.prototype.uninterpretedOption = $util.emptyArray; + /** - * Converts this FloatValue to JSON. - * @function toJSON - * @memberof google.protobuf.FloatValue + * ServiceOptions .google.api.defaultHost. + * @member {string} .google.api.defaultHost + * @memberof google.protobuf.ServiceOptions * @instance - * @returns {Object.} JSON object */ - FloatValue.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - + ServiceOptions.prototype[".google.api.defaultHost"] = ""; + /** - * Gets the default type url for FloatValue - * @function getTypeUrl - * @memberof google.protobuf.FloatValue + * ServiceOptions .google.api.oauthScopes. + * @member {string} .google.api.oauthScopes + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.oauthScopes"] = ""; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceOptions * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + * @returns {google.protobuf.ServiceOptions} ServiceOptions instance */ - FloatValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FloatValue"; + ServiceOptions.create = function create(properties) { + return new ServiceOptions(properties); }; - - return FloatValue; - })(); - - protobuf.Int64Value = (function() { - + /** - * Properties of an Int64Value. - * @memberof google.protobuf - * @interface IInt64Value - * @property {number|string|null} [value] Int64Value value + * 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(); + if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) + writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); + if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) + writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); + 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(); + }; + /** - * Constructs a new Int64Value. - * @memberof google.protobuf - * @classdesc Represents an Int64Value. - * @implements IInt64Value - * @constructor - * @param {google.protobuf.IInt64Value=} [properties] Properties to set + * 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) { + 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(); + 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; + } + case 1049: { + message[".google.api.defaultHost"] = reader.string(); + break; + } + case 1050: { + message[".google.api.oauthScopes"] = reader.string(); + 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 */ - 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]]; - } - + ServiceOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + /** - * Int64Value value. - * @member {number|string} value - * @memberof google.protobuf.Int64Value - * @instance + * Verifies a ServiceOptions message. + * @function verify + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Int64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - + 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; + } + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + if (!$util.isString(message[".google.api.defaultHost"])) + return ".google.api.defaultHost: string expected"; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + if (!$util.isString(message[".google.api.oauthScopes"])) + return ".google.api.oauthScopes: string expected"; + return null; + }; + /** - * Creates an Int64Value message from a plain object. Also converts values to their respective internal types. + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.Int64Value + * @memberof google.protobuf.ServiceOptions * @static * @param {Object.} object Plain object - * @returns {google.protobuf.Int64Value} Int64Value + * @returns {google.protobuf.ServiceOptions} ServiceOptions */ - Int64Value.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Int64Value) + ServiceOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceOptions) 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(); + 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]); + } + } + if (object[".google.api.defaultHost"] != null) + message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]); + if (object[".google.api.oauthScopes"] != null) + message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]); return message; }; - + /** - * Creates a plain object from an Int64Value message. Also converts values to other types if specified. + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.Int64Value + * @memberof google.protobuf.ServiceOptions * @static - * @param {google.protobuf.Int64Value} message Int64Value + * @param {google.protobuf.ServiceOptions} message ServiceOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Int64Value.toObject = function toObject(message, options) { + ServiceOptions.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; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.deprecated = false; + object.features = null; + object[".google.api.defaultHost"] = ""; + object[".google.api.oauthScopes"] = ""; + } + 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); + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + object[".google.api.defaultHost"] = message[".google.api.defaultHost"]; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"]; return object; }; - + /** - * Converts this Int64Value to JSON. + * Converts this ServiceOptions to JSON. * @function toJSON - * @memberof google.protobuf.Int64Value + * @memberof google.protobuf.ServiceOptions * @instance * @returns {Object.} JSON object */ - Int64Value.prototype.toJSON = function toJSON() { + ServiceOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - + /** - * Gets the default type url for Int64Value + * Gets the default type url for ServiceOptions * @function getTypeUrl - * @memberof google.protobuf.Int64Value + * @memberof google.protobuf.ServiceOptions * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - Int64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ServiceOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.Int64Value"; + return typeUrlPrefix + "/google.protobuf.ServiceOptions"; }; - - return Int64Value; + + return ServiceOptions; })(); - - protobuf.UInt64Value = (function() { - + + protobuf.MethodOptions = (function() { + /** - * Properties of a UInt64Value. + * Properties of a MethodOptions. * @memberof google.protobuf - * @interface IUInt64Value - * @property {number|string|null} [value] UInt64Value value + * @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.|null} [uninterpretedOption] MethodOptions uninterpretedOption + * @property {google.api.IHttpRule|null} [".google.api.http"] MethodOptions .google.api.http + * @property {Array.|null} [".google.api.methodSignature"] MethodOptions .google.api.methodSignature */ - + /** - * Constructs a new UInt64Value. + * Constructs a new MethodOptions. * @memberof google.protobuf - * @classdesc Represents a UInt64Value. - * @implements IUInt64Value + * @classdesc Represents a MethodOptions. + * @implements IMethodOptions * @constructor - * @param {google.protobuf.IUInt64Value=} [properties] Properties to set + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set */ - function UInt64Value(properties) { + function MethodOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.methodSignature"] = []; 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|string} value - * @memberof google.protobuf.UInt64Value - * @instance + * MethodOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MethodOptions + * @instance */ - UInt64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - + MethodOptions.prototype.deprecated = false; + /** - * Creates a UInt64Value message from a plain object. Also converts values to their respective internal types. + * 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.} uninterpretedOption + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * MethodOptions .google.api.http. + * @member {google.api.IHttpRule|null|undefined} .google.api.http + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.http"] = null; + + /** + * MethodOptions .google.api.methodSignature. + * @member {Array.} .google.api.methodSignature + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.methodSignature"] = $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(); + if (message[".google.api.methodSignature"] != null && message[".google.api.methodSignature"].length) + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + writer.uint32(/* id 1051, wireType 2 =*/8410).string(message[".google.api.methodSignature"][i]); + if (message[".google.api.http"] != null && Object.hasOwnProperty.call(message, ".google.api.http")) + $root.google.api.HttpRule.encode(message[".google.api.http"], writer.uint32(/* id 72295728, wireType 2 =*/578365826).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) { + 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(); + 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; + } + case 72295728: { + message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32()); + break; + } + case 1051: { + if (!(message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length)) + message[".google.api.methodSignature"] = []; + message[".google.api.methodSignature"].push(reader.string()); + 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.} 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; + } + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) { + var error = $root.google.api.HttpRule.verify(message[".google.api.http"]); + if (error) + return ".google.api.http." + error; + } + if (message[".google.api.methodSignature"] != null && message.hasOwnProperty(".google.api.methodSignature")) { + if (!Array.isArray(message[".google.api.methodSignature"])) + return ".google.api.methodSignature: array expected"; + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + if (!$util.isString(message[".google.api.methodSignature"][i])) + return ".google.api.methodSignature: string[] expected"; + } + return null; + }; + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.UInt64Value + * @memberof google.protobuf.MethodOptions * @static * @param {Object.} object Plain object - * @returns {google.protobuf.UInt64Value} UInt64Value + * @returns {google.protobuf.MethodOptions} MethodOptions */ - UInt64Value.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.UInt64Value) + MethodOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodOptions) 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); + 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]); + } + } + if (object[".google.api.http"] != null) { + if (typeof object[".google.api.http"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.api.http: object expected"); + message[".google.api.http"] = $root.google.api.HttpRule.fromObject(object[".google.api.http"]); + } + if (object[".google.api.methodSignature"]) { + if (!Array.isArray(object[".google.api.methodSignature"])) + throw TypeError(".google.protobuf.MethodOptions..google.api.methodSignature: array expected"); + message[".google.api.methodSignature"] = []; + for (var i = 0; i < object[".google.api.methodSignature"].length; ++i) + message[".google.api.methodSignature"][i] = String(object[".google.api.methodSignature"][i]); + } return message; }; - + /** - * Creates a plain object from a UInt64Value message. Also converts values to other types if specified. + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.UInt64Value + * @memberof google.protobuf.MethodOptions * @static - * @param {google.protobuf.UInt64Value} message UInt64Value + * @param {google.protobuf.MethodOptions} message MethodOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UInt64Value.toObject = function toObject(message, options) { + MethodOptions.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; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.methodSignature"] = []; + } + if (options.defaults) { + object.deprecated = false; + object.idempotencyLevel = options.enums === String ? "IDEMPOTENCY_UNKNOWN" : 0; + object.features = null; + object[".google.api.http"] = 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); + } + if (message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length) { + object[".google.api.methodSignature"] = []; + for (var j = 0; j < message[".google.api.methodSignature"].length; ++j) + object[".google.api.methodSignature"][j] = message[".google.api.methodSignature"][j]; + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) + object[".google.api.http"] = $root.google.api.HttpRule.toObject(message[".google.api.http"], options); return object; }; - + /** - * Converts this UInt64Value to JSON. + * Converts this MethodOptions to JSON. * @function toJSON - * @memberof google.protobuf.UInt64Value + * @memberof google.protobuf.MethodOptions * @instance * @returns {Object.} JSON object */ - UInt64Value.prototype.toJSON = function toJSON() { + MethodOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - + /** - * Gets the default type url for UInt64Value + * Gets the default type url for MethodOptions * @function getTypeUrl - * @memberof google.protobuf.UInt64Value + * @memberof google.protobuf.MethodOptions * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - UInt64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + MethodOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.UInt64Value"; + return typeUrlPrefix + "/google.protobuf.MethodOptions"; }; - - return UInt64Value; + + /** + * 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.Int32Value = (function() { - + + protobuf.UninterpretedOption = (function() { + /** - * Properties of an Int32Value. + * Properties of an UninterpretedOption. * @memberof google.protobuf - * @interface IInt32Value - * @property {number|null} [value] Int32Value value + * @interface IUninterpretedOption + * @property {Array.|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 Int32Value. + * Constructs a new UninterpretedOption. * @memberof google.protobuf - * @classdesc Represents an Int32Value. - * @implements IInt32Value + * @classdesc Represents an UninterpretedOption. + * @implements IUninterpretedOption * @constructor - * @param {google.protobuf.IInt32Value=} [properties] Properties to set + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set */ - function Int32Value(properties) { - if (properties) + 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]]; } - + /** - * Int32Value value. - * @member {number} value - * @memberof google.protobuf.Int32Value + * UninterpretedOption name. + * @member {Array.} name + * @memberof google.protobuf.UninterpretedOption * @instance */ - Int32Value.prototype.value = 0; - - /** - * Creates an Int32Value message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Int32Value - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Int32Value} Int32Value - */ - Int32Value.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Int32Value) - return object; - var message = new $root.google.protobuf.Int32Value(); - if (object.value != null) - message.value = object.value | 0; - return message; - }; - + UninterpretedOption.prototype.name = $util.emptyArray; + /** - * Creates a plain object from an Int32Value message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Int32Value - * @static - * @param {google.protobuf.Int32Value} message Int32Value - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * UninterpretedOption identifierValue. + * @member {string} identifierValue + * @memberof google.protobuf.UninterpretedOption + * @instance */ - Int32Value.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 = message.value; - return object; - }; - + UninterpretedOption.prototype.identifierValue = ""; + /** - * Converts this Int32Value to JSON. - * @function toJSON - * @memberof google.protobuf.Int32Value + * UninterpretedOption positiveIntValue. + * @member {number|Long} positiveIntValue + * @memberof google.protobuf.UninterpretedOption * @instance - * @returns {Object.} JSON object */ - Int32Value.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - + UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + /** - * Gets the default type url for Int32Value - * @function getTypeUrl - * @memberof google.protobuf.Int32Value - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url + * UninterpretedOption negativeIntValue. + * @member {number|Long} negativeIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance */ - Int32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.Int32Value"; - }; - - return Int32Value; - })(); - - protobuf.UInt32Value = (function() { - + UninterpretedOption.prototype.negativeIntValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + /** - * Properties of a UInt32Value. - * @memberof google.protobuf - * @interface IUInt32Value - * @property {number|null} [value] UInt32Value value + * UninterpretedOption doubleValue. + * @member {number} doubleValue + * @memberof google.protobuf.UninterpretedOption + * @instance */ - + UninterpretedOption.prototype.doubleValue = 0; + /** - * Constructs a new UInt32Value. - * @memberof google.protobuf - * @classdesc Represents a UInt32Value. - * @implements IUInt32Value - * @constructor - * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + * UninterpretedOption stringValue. + * @member {Uint8Array} stringValue + * @memberof google.protobuf.UninterpretedOption + * @instance */ - function UInt32Value(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]]; - } - + UninterpretedOption.prototype.stringValue = $util.newBuffer([]); + /** - * UInt32Value value. - * @member {number} value - * @memberof google.protobuf.UInt32Value + * UninterpretedOption aggregateValue. + * @member {string} aggregateValue + * @memberof google.protobuf.UninterpretedOption * @instance */ - UInt32Value.prototype.value = 0; - + UninterpretedOption.prototype.aggregateValue = ""; + /** - * Creates a UInt32Value message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.UInt32Value + * Creates a new UninterpretedOption instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.UInt32Value} UInt32Value + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption instance */ - UInt32Value.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.UInt32Value) - return object; - var message = new $root.google.protobuf.UInt32Value(); - if (object.value != null) - message.value = object.value >>> 0; - return message; + UninterpretedOption.create = function create(properties) { + return new UninterpretedOption(properties); }; - + /** - * Creates a plain object from a UInt32Value message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.UInt32Value + * 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.UInt32Value} message UInt32Value - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UInt32Value.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 = message.value; - return object; + * @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; }; - + /** - * Converts this UInt32Value to JSON. - * @function toJSON - * @memberof google.protobuf.UInt32Value - * @instance - * @returns {Object.} JSON object + * 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 */ - UInt32Value.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); }; - + /** - * Gets the default type url for UInt32Value - * @function getTypeUrl - * @memberof google.protobuf.UInt32Value + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UInt32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; + * @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) { + 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(); + 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 typeUrlPrefix + "/google.protobuf.UInt32Value"; + return message; }; - - return UInt32Value; - })(); - - protobuf.BoolValue = (function() { - - /** - * Properties of a BoolValue. - * @memberof google.protobuf - * @interface IBoolValue - * @property {boolean|null} [value] BoolValue value - */ - + /** - * Constructs a new BoolValue. - * @memberof google.protobuf - * @classdesc Represents a BoolValue. - * @implements IBoolValue - * @constructor - * @param {google.protobuf.IBoolValue=} [properties] Properties to set + * 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 */ - function BoolValue(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]]; - } - + UninterpretedOption.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + /** - * BoolValue value. - * @member {boolean} value - * @memberof google.protobuf.BoolValue - * @instance + * Verifies an UninterpretedOption message. + * @function verify + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - BoolValue.prototype.value = false; - + 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 a BoolValue message from a plain object. Also converts values to their respective internal types. + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.BoolValue + * @memberof google.protobuf.UninterpretedOption * @static * @param {Object.} object Plain object - * @returns {google.protobuf.BoolValue} BoolValue + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption */ - BoolValue.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.BoolValue) + UninterpretedOption.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption) return object; - var message = new $root.google.protobuf.BoolValue(); - if (object.value != null) - message.value = Boolean(object.value); - return message; - }; - - /** - * Creates a plain object from a BoolValue message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.BoolValue - * @static - * @param {google.protobuf.BoolValue} message BoolValue - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BoolValue.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.value = false; - if (message.value != null && message.hasOwnProperty("value")) - object.value = message.value; - return object; - }; - - /** - * Converts this BoolValue to JSON. - * @function toJSON - * @memberof google.protobuf.BoolValue - * @instance - * @returns {Object.} JSON object - */ - BoolValue.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BoolValue - * @function getTypeUrl - * @memberof google.protobuf.BoolValue - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BoolValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; + 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]); + } } - return typeUrlPrefix + "/google.protobuf.BoolValue"; - }; - - return BoolValue; - })(); - - protobuf.StringValue = (function() { - - /** - * Properties of a StringValue. - * @memberof google.protobuf - * @interface IStringValue - * @property {string|null} [value] StringValue value - */ - - /** - * Constructs a new StringValue. - * @memberof google.protobuf - * @classdesc Represents a StringValue. - * @implements IStringValue - * @constructor - * @param {google.protobuf.IStringValue=} [properties] Properties to set - */ - function StringValue(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]]; - } - - /** - * StringValue value. - * @member {string} value - * @memberof google.protobuf.StringValue - * @instance - */ - StringValue.prototype.value = ""; - - /** - * Creates a StringValue message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.StringValue - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.StringValue} StringValue - */ - StringValue.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.StringValue) - return object; - var message = new $root.google.protobuf.StringValue(); - if (object.value != null) - message.value = String(object.value); + 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 a StringValue message. Also converts values to other types if specified. + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.StringValue + * @memberof google.protobuf.UninterpretedOption * @static - * @param {google.protobuf.StringValue} message StringValue + * @param {google.protobuf.UninterpretedOption} message UninterpretedOption * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - StringValue.toObject = function toObject(message, options) { + UninterpretedOption.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.value = ""; - if (message.value != null && message.hasOwnProperty("value")) - object.value = message.value; + 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 StringValue to JSON. + * Converts this UninterpretedOption to JSON. * @function toJSON - * @memberof google.protobuf.StringValue + * @memberof google.protobuf.UninterpretedOption * @instance * @returns {Object.} JSON object */ - StringValue.prototype.toJSON = function toJSON() { + UninterpretedOption.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - + /** - * Gets the default type url for StringValue + * Gets the default type url for UninterpretedOption * @function getTypeUrl - * @memberof google.protobuf.StringValue + * @memberof google.protobuf.UninterpretedOption * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - StringValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + UninterpretedOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.StringValue"; - }; - - return StringValue; - })(); - - protobuf.BytesValue = (function() { - - /** - * Properties of a BytesValue. - * @memberof google.protobuf - * @interface IBytesValue - * @property {Uint8Array|null} [value] BytesValue value - */ - - /** - * Constructs a new BytesValue. - * @memberof google.protobuf - * @classdesc Represents a BytesValue. - * @implements IBytesValue - * @constructor - * @param {google.protobuf.IBytesValue=} [properties] Properties to set - */ - function BytesValue(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]]; - } - - /** - * BytesValue value. - * @member {Uint8Array} value - * @memberof google.protobuf.BytesValue - * @instance - */ - BytesValue.prototype.value = $util.newBuffer([]); - - /** - * Creates a BytesValue message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.BytesValue - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.BytesValue} BytesValue - */ - BytesValue.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.BytesValue) - return object; - var message = new $root.google.protobuf.BytesValue(); - if (object.value != null) - if (typeof object.value === "string") - $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); - else if (object.value.length >= 0) - message.value = object.value; - return message; + return typeUrlPrefix + "/google.protobuf.UninterpretedOption"; }; - - /** - * Creates a plain object from a BytesValue message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.BytesValue - * @static - * @param {google.protobuf.BytesValue} message BytesValue - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BytesValue.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - if (options.bytes === String) - object.value = ""; - else { - object.value = []; - if (options.bytes !== Array) - object.value = $util.newBuffer(object.value); - } - if (message.value != null && message.hasOwnProperty("value")) - object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; - return object; - }; - - /** - * Converts this BytesValue to JSON. - * @function toJSON - * @memberof google.protobuf.BytesValue - * @instance - * @returns {Object.} JSON object - */ - BytesValue.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BytesValue - * @function getTypeUrl - * @memberof google.protobuf.BytesValue - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BytesValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; + + 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]]; } - return typeUrlPrefix + "/google.protobuf.BytesValue"; - }; - - return BytesValue; + + /** + * 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) { + 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(); + 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.} 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.} 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.} 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.} 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.Any = (function() { - + + protobuf.FeatureSet = (function() { + /** - * Properties of an Any. + * Properties of a FeatureSet. * @memberof google.protobuf - * @interface IAny - * @property {string|null} [type_url] Any type_url - * @property {Uint8Array|null} [value] Any value + * @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 */ - + /** - * Constructs a new Any. + * Constructs a new FeatureSet. * @memberof google.protobuf - * @classdesc Represents an Any. - * @implements IAny + * @classdesc Represents a FeatureSet. + * @implements IFeatureSet * @constructor - * @param {google.protobuf.IAny=} [properties] Properties to set + * @param {google.protobuf.IFeatureSet=} [properties] Properties to set */ - function Any(properties) { + 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]]; } - + /** - * Any type_url. - * @member {string} type_url - * @memberof google.protobuf.Any + * FeatureSet fieldPresence. + * @member {google.protobuf.FeatureSet.FieldPresence} fieldPresence + * @memberof google.protobuf.FeatureSet * @instance */ - Any.prototype.type_url = ""; - + FeatureSet.prototype.fieldPresence = 0; + /** - * Any value. - * @member {Uint8Array} value - * @memberof google.protobuf.Any + * FeatureSet enumType. + * @member {google.protobuf.FeatureSet.EnumType} enumType + * @memberof google.protobuf.FeatureSet * @instance */ - Any.prototype.value = $util.newBuffer([]); - + FeatureSet.prototype.enumType = 0; + /** - * Creates an Any message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Any + * 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; + + /** + * Creates a new FeatureSet instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSet * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Any} Any + * @param {google.protobuf.IFeatureSet=} [properties] Properties to set + * @returns {google.protobuf.FeatureSet} FeatureSet instance */ - Any.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Any) - return object; - var message = new $root.google.protobuf.Any(); - if (object.type_url != null) - message.type_url = String(object.type_url); - if (object.value != null) - if (typeof object.value === "string") - $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); - else if (object.value.length >= 0) - message.value = object.value; - return message; + FeatureSet.create = function create(properties) { + return new FeatureSet(properties); }; - + /** - * Creates a plain object from an Any message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Any + * 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.Any} message Any - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Any.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.type_url = ""; - if (options.bytes === String) - object.value = ""; - else { - object.value = []; - if (options.bytes !== Array) - object.value = $util.newBuffer(object.value); - } - } - if (message.type_url != null && message.hasOwnProperty("type_url")) - object.type_url = message.type_url; - if (message.value != null && message.hasOwnProperty("value")) - object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; - return object; + * @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); + return writer; }; - + /** - * Converts this Any to JSON. - * @function toJSON - * @memberof google.protobuf.Any - * @instance - * @returns {Object.} JSON object + * 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 */ - Any.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + FeatureSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); }; - + /** - * Gets the default type url for Any - * @function getTypeUrl - * @memberof google.protobuf.Any + * Decodes a FeatureSet message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSet * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Any.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; + * @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) { + 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(); + 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; + } + default: + reader.skipType(tag & 7); + break; + } } - return typeUrlPrefix + "/google.protobuf.Any"; + return message; }; - - return Any; - })(); - - protobuf.FieldMask = (function() { - - /** - * Properties of a FieldMask. - * @memberof google.protobuf - * @interface IFieldMask - * @property {Array.|null} [paths] FieldMask paths - */ - + /** - * Constructs a new FieldMask. - * @memberof google.protobuf - * @classdesc Represents a FieldMask. - * @implements IFieldMask - * @constructor - * @param {google.protobuf.IFieldMask=} [properties] Properties to set + * 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 */ - function FieldMask(properties) { - this.paths = []; - 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.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + /** - * FieldMask paths. - * @member {Array.} paths - * @memberof google.protobuf.FieldMask - * @instance - */ - FieldMask.prototype.paths = $util.emptyArray; - + * Verifies a FeatureSet message. + * @function verify + * @memberof google.protobuf.FeatureSet + * @static + * @param {Object.} 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; + } + return null; + }; + /** - * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. + * Creates a FeatureSet message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.FieldMask + * @memberof google.protobuf.FeatureSet * @static * @param {Object.} object Plain object - * @returns {google.protobuf.FieldMask} FieldMask + * @returns {google.protobuf.FeatureSet} FeatureSet */ - FieldMask.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FieldMask) + FeatureSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSet) return object; - var message = new $root.google.protobuf.FieldMask(); - if (object.paths) { - if (!Array.isArray(object.paths)) - throw TypeError(".google.protobuf.FieldMask.paths: array expected"); - message.paths = []; - for (var i = 0; i < object.paths.length; ++i) - message.paths[i] = String(object.paths[i]); + 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; } return message; }; - + /** - * Creates a plain object from a FieldMask message. Also converts values to other types if specified. + * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.FieldMask + * @memberof google.protobuf.FeatureSet * @static - * @param {google.protobuf.FieldMask} message FieldMask + * @param {google.protobuf.FeatureSet} message FeatureSet * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - FieldMask.toObject = function toObject(message, options) { + FeatureSet.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.paths = []; - if (message.paths && message.paths.length) { - object.paths = []; - for (var j = 0; j < message.paths.length; ++j) - object.paths[j] = message.paths[j]; - } + 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; + } + 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; return object; }; - + /** - * Converts this FieldMask to JSON. + * Converts this FeatureSet to JSON. * @function toJSON - * @memberof google.protobuf.FieldMask + * @memberof google.protobuf.FeatureSet * @instance * @returns {Object.} JSON object */ - FieldMask.prototype.toJSON = function toJSON() { + FeatureSet.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - + /** - * Gets the default type url for FieldMask + * Gets the default type url for FeatureSet * @function getTypeUrl - * @memberof google.protobuf.FieldMask + * @memberof google.protobuf.FeatureSet * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - FieldMask.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + FeatureSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.FieldMask"; + return typeUrlPrefix + "/google.protobuf.FeatureSet"; }; - - return FieldMask; + + /** + * 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; + })(); + + return FeatureSet; })(); - - protobuf.Duration = (function() { - + + protobuf.FeatureSetDefaults = (function() { + /** - * Properties of a Duration. + * Properties of a FeatureSetDefaults. * @memberof google.protobuf - * @interface IDuration - * @property {number|string|null} [seconds] Duration seconds - * @property {number|null} [nanos] Duration nanos + * @interface IFeatureSetDefaults + * @property {Array.|null} [defaults] FeatureSetDefaults defaults + * @property {google.protobuf.Edition|null} [minimumEdition] FeatureSetDefaults minimumEdition + * @property {google.protobuf.Edition|null} [maximumEdition] FeatureSetDefaults maximumEdition */ - + /** - * Constructs a new Duration. + * Constructs a new FeatureSetDefaults. * @memberof google.protobuf - * @classdesc Represents a Duration. - * @implements IDuration + * @classdesc Represents a FeatureSetDefaults. + * @implements IFeatureSetDefaults * @constructor - * @param {google.protobuf.IDuration=} [properties] Properties to set + * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set */ - function Duration(properties) { + 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]]; } - + /** - * Duration seconds. - * @member {number|string} seconds - * @memberof google.protobuf.Duration + * FeatureSetDefaults defaults. + * @member {Array.} defaults + * @memberof google.protobuf.FeatureSetDefaults * @instance */ - Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - + FeatureSetDefaults.prototype.defaults = $util.emptyArray; + /** - * Duration nanos. - * @member {number} nanos - * @memberof google.protobuf.Duration + * FeatureSetDefaults minimumEdition. + * @member {google.protobuf.Edition} minimumEdition + * @memberof google.protobuf.FeatureSetDefaults * @instance */ - Duration.prototype.nanos = 0; - + FeatureSetDefaults.prototype.minimumEdition = 0; + /** - * Creates a Duration message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Duration - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Duration} Duration + * FeatureSetDefaults maximumEdition. + * @member {google.protobuf.Edition} maximumEdition + * @memberof google.protobuf.FeatureSetDefaults + * @instance */ - Duration.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Duration) + 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) { + 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(); + 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.} 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 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 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.} 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.Duration(); - if (object.seconds != null) - if ($util.Long) - (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; - else if (typeof object.seconds === "string") - message.seconds = parseInt(object.seconds, 10); - else if (typeof object.seconds === "number") - message.seconds = object.seconds; - else if (typeof object.seconds === "object") - message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); - if (object.nanos != null) - message.nanos = object.nanos | 0; + 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_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_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 Duration message. Also converts values to other types if specified. + * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.Duration + * @memberof google.protobuf.FeatureSetDefaults * @static - * @param {google.protobuf.Duration} message Duration + * @param {google.protobuf.FeatureSetDefaults} message FeatureSetDefaults * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Duration.toObject = function toObject(message, options) { + FeatureSetDefaults.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.defaults = []; if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.seconds = options.longs === String ? "0" : 0; - object.nanos = 0; - } - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (typeof message.seconds === "number") - object.seconds = options.longs === String ? String(message.seconds) : message.seconds; - else - object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; - if (message.nanos != null && message.hasOwnProperty("nanos")) - object.nanos = message.nanos; + 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 Duration to JSON. + * Converts this FeatureSetDefaults to JSON. * @function toJSON - * @memberof google.protobuf.Duration + * @memberof google.protobuf.FeatureSetDefaults * @instance * @returns {Object.} JSON object */ - Duration.prototype.toJSON = function toJSON() { + FeatureSetDefaults.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - + /** - * Gets the default type url for Duration + * Gets the default type url for FeatureSetDefaults * @function getTypeUrl - * @memberof google.protobuf.Duration + * @memberof google.protobuf.FeatureSetDefaults * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + FeatureSetDefaults.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.Duration"; + return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults"; }; - - return Duration; - })(); - - return protobuf; - })(); - - google.firestore = (function() { - - /** - * Namespace firestore. - * @memberof google - * @namespace - */ - var firestore = {}; - - firestore.v1 = (function() { - - /** - * Namespace v1. - * @memberof google.firestore - * @namespace - */ - var v1 = {}; - - v1.AggregationResult = (function() { - + + FeatureSetDefaults.FeatureSetEditionDefault = (function() { + /** - * Properties of an AggregationResult. - * @memberof google.firestore.v1 - * @interface IAggregationResult - * @property {Object.|null} [aggregateFields] AggregationResult aggregateFields + * Properties of a FeatureSetEditionDefault. + * @memberof google.protobuf.FeatureSetDefaults + * @interface IFeatureSetEditionDefault + * @property {google.protobuf.Edition|null} [edition] FeatureSetEditionDefault edition + * @property {google.protobuf.IFeatureSet|null} [features] FeatureSetEditionDefault features */ - + /** - * Constructs a new AggregationResult. - * @memberof google.firestore.v1 - * @classdesc Represents an AggregationResult. - * @implements IAggregationResult + * Constructs a new FeatureSetEditionDefault. + * @memberof google.protobuf.FeatureSetDefaults + * @classdesc Represents a FeatureSetEditionDefault. + * @implements IFeatureSetEditionDefault * @constructor - * @param {google.firestore.v1.IAggregationResult=} [properties] Properties to set + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set */ - function AggregationResult(properties) { - this.aggregateFields = {}; + 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]]; } - + /** - * AggregationResult aggregateFields. - * @member {Object.} aggregateFields - * @memberof google.firestore.v1.AggregationResult + * FeatureSetEditionDefault edition. + * @member {google.protobuf.Edition} edition + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault * @instance */ - AggregationResult.prototype.aggregateFields = $util.emptyObject; - + FeatureSetEditionDefault.prototype.edition = 0; + /** - * Creates an AggregationResult message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.firestore.v1.AggregationResult + * FeatureSetEditionDefault features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + */ + FeatureSetEditionDefault.prototype.features = null; + + /** + * Creates a new FeatureSetEditionDefault instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault * @static - * @param {Object.} object Plain object - * @returns {google.firestore.v1.AggregationResult} AggregationResult + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault instance */ - AggregationResult.fromObject = function fromObject(object) { - if (object instanceof $root.google.firestore.v1.AggregationResult) - return object; - var message = new $root.google.firestore.v1.AggregationResult(); - if (object.aggregateFields) { - if (typeof object.aggregateFields !== "object") - throw TypeError(".google.firestore.v1.AggregationResult.aggregateFields: object expected"); - message.aggregateFields = {}; - for (var keys = Object.keys(object.aggregateFields), i = 0; i < keys.length; ++i) { - if (typeof object.aggregateFields[keys[i]] !== "object") - throw TypeError(".google.firestore.v1.AggregationResult.aggregateFields: object expected"); - message.aggregateFields[keys[i]] = $root.google.firestore.v1.Value.fromObject(object.aggregateFields[keys[i]]); - } - } - return message; + FeatureSetEditionDefault.create = function create(properties) { + return new FeatureSetEditionDefault(properties); }; - + /** - * Creates a plain object from an AggregationResult message. Also converts values to other types if specified. - * @function toObject - * @memberof google.firestore.v1.AggregationResult + * 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.firestore.v1.AggregationResult} message AggregationResult - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AggregationResult.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.aggregateFields = {}; - var keys2; - if (message.aggregateFields && (keys2 = Object.keys(message.aggregateFields)).length) { - object.aggregateFields = {}; - for (var j = 0; j < keys2.length; ++j) - object.aggregateFields[keys2[j]] = $root.google.firestore.v1.Value.toObject(message.aggregateFields[keys2[j]], options); - } - return object; + * @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.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.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); + return writer; }; - + /** - * Converts this AggregationResult to JSON. - * @function toJSON - * @memberof google.firestore.v1.AggregationResult - * @instance - * @returns {Object.} JSON object + * 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 */ - AggregationResult.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + FeatureSetEditionDefault.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); }; - + /** - * Gets the default type url for AggregationResult - * @function getTypeUrl - * @memberof google.firestore.v1.AggregationResult + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AggregationResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; + * @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) { + 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(); + switch (tag >>> 3) { + case 3: { + message.edition = reader.int32(); + break; + } + case 2: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } } - return typeUrlPrefix + "/google.firestore.v1.AggregationResult"; + return message; }; - - return AggregationResult; - })(); - - v1.BitSequence = (function() { - + /** - * Properties of a BitSequence. - * @memberof google.firestore.v1 - * @interface IBitSequence - * @property {Uint8Array|null} [bitmap] BitSequence bitmap - * @property {number|null} [padding] BitSequence padding - */ - - /** - * Constructs a new BitSequence. - * @memberof google.firestore.v1 - * @classdesc Represents a BitSequence. - * @implements IBitSequence - * @constructor - * @param {google.firestore.v1.IBitSequence=} [properties] Properties to set - */ - function BitSequence(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]]; - } - - /** - * BitSequence bitmap. - * @member {Uint8Array} bitmap - * @memberof google.firestore.v1.BitSequence - * @instance - */ - BitSequence.prototype.bitmap = $util.newBuffer([]); - - /** - * BitSequence padding. - * @member {number} padding - * @memberof google.firestore.v1.BitSequence - * @instance - */ - BitSequence.prototype.padding = 0; - - /** - * Creates a BitSequence message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.firestore.v1.BitSequence + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault * @static - * @param {Object.} object Plain object - * @returns {google.firestore.v1.BitSequence} BitSequence - */ - BitSequence.fromObject = function fromObject(object) { - if (object instanceof $root.google.firestore.v1.BitSequence) - return object; - var message = new $root.google.firestore.v1.BitSequence(); - if (object.bitmap != null) - if (typeof object.bitmap === "string") - $util.base64.decode(object.bitmap, message.bitmap = $util.newBuffer($util.base64.length(object.bitmap)), 0); - else if (object.bitmap.length >= 0) - message.bitmap = object.bitmap; - if (object.padding != null) - message.padding = object.padding | 0; - return message; + * @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()); }; - + /** - * Creates a plain object from a BitSequence message. Also converts values to other types if specified. - * @function toObject - * @memberof google.firestore.v1.BitSequence + * Verifies a FeatureSetEditionDefault message. + * @function verify + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault * @static - * @param {google.firestore.v1.BitSequence} message BitSequence - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BitSequence.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.bitmap = ""; - else { - object.bitmap = []; - if (options.bytes !== Array) - object.bitmap = $util.newBuffer(object.bitmap); + * @param {Object.} 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 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; } - object.padding = 0; - } - if (message.bitmap != null && message.hasOwnProperty("bitmap")) - object.bitmap = options.bytes === String ? $util.base64.encode(message.bitmap, 0, message.bitmap.length) : options.bytes === Array ? Array.prototype.slice.call(message.bitmap) : message.bitmap; - if (message.padding != null && message.hasOwnProperty("padding")) - object.padding = message.padding; - return object; - }; - - /** - * Converts this BitSequence to JSON. - * @function toJSON - * @memberof google.firestore.v1.BitSequence - * @instance - * @returns {Object.} JSON object - */ - BitSequence.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BitSequence - * @function getTypeUrl - * @memberof google.firestore.v1.BitSequence - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BitSequence.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; } - return typeUrlPrefix + "/google.firestore.v1.BitSequence"; + return null; }; - - return BitSequence; - })(); - - v1.BloomFilter = (function() { - - /** - * Properties of a BloomFilter. - * @memberof google.firestore.v1 - * @interface IBloomFilter - * @property {google.firestore.v1.IBitSequence|null} [bits] BloomFilter bits - * @property {number|null} [hashCount] BloomFilter hashCount - */ - - /** - * Constructs a new BloomFilter. - * @memberof google.firestore.v1 - * @classdesc Represents a BloomFilter. - * @implements IBloomFilter - * @constructor - * @param {google.firestore.v1.IBloomFilter=} [properties] Properties to set - */ - function BloomFilter(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]]; - } - - /** - * BloomFilter bits. - * @member {google.firestore.v1.IBitSequence|null|undefined} bits - * @memberof google.firestore.v1.BloomFilter - * @instance - */ - BloomFilter.prototype.bits = null; - - /** - * BloomFilter hashCount. - * @member {number} hashCount - * @memberof google.firestore.v1.BloomFilter - * @instance - */ - BloomFilter.prototype.hashCount = 0; - + /** - * Creates a BloomFilter message from a plain object. Also converts values to their respective internal types. + * Creates a FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.firestore.v1.BloomFilter + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault * @static * @param {Object.} object Plain object - * @returns {google.firestore.v1.BloomFilter} BloomFilter + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault */ - BloomFilter.fromObject = function fromObject(object) { - if (object instanceof $root.google.firestore.v1.BloomFilter) + FeatureSetEditionDefault.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault) return object; - var message = new $root.google.firestore.v1.BloomFilter(); - if (object.bits != null) { - if (typeof object.bits !== "object") - throw TypeError(".google.firestore.v1.BloomFilter.bits: object expected"); - message.bits = $root.google.firestore.v1.BitSequence.fromObject(object.bits); + 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_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.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); } - if (object.hashCount != null) - message.hashCount = object.hashCount | 0; return message; }; - + /** - * Creates a plain object from a BloomFilter message. Also converts values to other types if specified. + * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. * @function toObject - * @memberof google.firestore.v1.BloomFilter + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault * @static - * @param {google.firestore.v1.BloomFilter} message BloomFilter + * @param {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} message FeatureSetEditionDefault * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BloomFilter.toObject = function toObject(message, options) { + FeatureSetEditionDefault.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.bits = null; - object.hashCount = 0; + object.features = null; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; } - if (message.bits != null && message.hasOwnProperty("bits")) - object.bits = $root.google.firestore.v1.BitSequence.toObject(message.bits, options); - if (message.hashCount != null && message.hasOwnProperty("hashCount")) - object.hashCount = message.hashCount; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + 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 BloomFilter to JSON. + * Converts this FeatureSetEditionDefault to JSON. * @function toJSON - * @memberof google.firestore.v1.BloomFilter + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault * @instance * @returns {Object.} JSON object */ - BloomFilter.prototype.toJSON = function toJSON() { + FeatureSetEditionDefault.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - + /** - * Gets the default type url for BloomFilter + * Gets the default type url for FeatureSetEditionDefault * @function getTypeUrl - * @memberof google.firestore.v1.BloomFilter + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - BloomFilter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + FeatureSetEditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.firestore.v1.BloomFilter"; + return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault"; }; - - return BloomFilter; + + return FeatureSetEditionDefault; })(); - - v1.DocumentMask = (function() { - - /** - * Properties of a DocumentMask. - * @memberof google.firestore.v1 - * @interface IDocumentMask - * @property {Array.|null} [fieldPaths] DocumentMask fieldPaths - */ - - /** - * Constructs a new DocumentMask. - * @memberof google.firestore.v1 - * @classdesc Represents a DocumentMask. - * @implements IDocumentMask - * @constructor - * @param {google.firestore.v1.IDocumentMask=} [properties] Properties to set - */ - function DocumentMask(properties) { - this.fieldPaths = []; - 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]]; - } - - /** - * DocumentMask fieldPaths. - * @member {Array.} fieldPaths - * @memberof google.firestore.v1.DocumentMask - * @instance - */ - DocumentMask.prototype.fieldPaths = $util.emptyArray; - - /** - * Creates a DocumentMask message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.firestore.v1.DocumentMask - * @static - * @param {Object.} object Plain object - * @returns {google.firestore.v1.DocumentMask} DocumentMask - */ - DocumentMask.fromObject = function fromObject(object) { - if (object instanceof $root.google.firestore.v1.DocumentMask) - return object; - var message = new $root.google.firestore.v1.DocumentMask(); - if (object.fieldPaths) { - if (!Array.isArray(object.fieldPaths)) - throw TypeError(".google.firestore.v1.DocumentMask.fieldPaths: array expected"); - message.fieldPaths = []; - for (var i = 0; i < object.fieldPaths.length; ++i) - message.fieldPaths[i] = String(object.fieldPaths[i]); - } - return message; - }; - - /** - * Creates a plain object from a DocumentMask message. Also converts values to other types if specified. - * @function toObject - * @memberof google.firestore.v1.DocumentMask - * @static - * @param {google.firestore.v1.DocumentMask} message DocumentMask - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DocumentMask.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.fieldPaths = []; - if (message.fieldPaths && message.fieldPaths.length) { - object.fieldPaths = []; - for (var j = 0; j < message.fieldPaths.length; ++j) - object.fieldPaths[j] = message.fieldPaths[j]; + + return FeatureSetDefaults; + })(); + + protobuf.SourceCodeInfo = (function() { + + /** + * Properties of a SourceCodeInfo. + * @memberof google.protobuf + * @interface ISourceCodeInfo + * @property {Array.|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.} 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) { + 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(); + 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.} 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.} object Plain object + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + */ + SourceCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo) return object; - }; - - /** - * Converts this DocumentMask to JSON. - * @function toJSON - * @memberof google.firestore.v1.DocumentMask - * @instance - * @returns {Object.} JSON object - */ - DocumentMask.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DocumentMask - * @function getTypeUrl - * @memberof google.firestore.v1.DocumentMask - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DocumentMask.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; + 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 typeUrlPrefix + "/google.firestore.v1.DocumentMask"; - }; - - return DocumentMask; - })(); - - v1.Precondition = (function() { - + } + 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.} 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.} 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 Precondition. - * @memberof google.firestore.v1 - * @interface IPrecondition - * @property {boolean|null} [exists] Precondition exists - * @property {google.protobuf.ITimestamp|null} [updateTime] Precondition updateTime + * Properties of a Location. + * @memberof google.protobuf.SourceCodeInfo + * @interface ILocation + * @property {Array.|null} [path] Location path + * @property {Array.|null} [span] Location span + * @property {string|null} [leadingComments] Location leadingComments + * @property {string|null} [trailingComments] Location trailingComments + * @property {Array.|null} [leadingDetachedComments] Location leadingDetachedComments */ - + /** - * Constructs a new Precondition. - * @memberof google.firestore.v1 - * @classdesc Represents a Precondition. - * @implements IPrecondition + * Constructs a new Location. + * @memberof google.protobuf.SourceCodeInfo + * @classdesc Represents a Location. + * @implements ILocation * @constructor - * @param {google.firestore.v1.IPrecondition=} [properties] Properties to set + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set */ - function Precondition(properties) { + 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]]; } - + /** - * Precondition exists. - * @member {boolean|null|undefined} exists - * @memberof google.firestore.v1.Precondition + * Location path. + * @member {Array.} path + * @memberof google.protobuf.SourceCodeInfo.Location * @instance */ - Precondition.prototype.exists = null; - + Location.prototype.path = $util.emptyArray; + /** - * Precondition updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.firestore.v1.Precondition + * Location span. + * @member {Array.} span + * @memberof google.protobuf.SourceCodeInfo.Location * @instance */ - Precondition.prototype.updateTime = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - + Location.prototype.span = $util.emptyArray; + /** - * Precondition conditionType. - * @member {"exists"|"updateTime"|undefined} conditionType - * @memberof google.firestore.v1.Precondition + * Location leadingComments. + * @member {string} leadingComments + * @memberof google.protobuf.SourceCodeInfo.Location * @instance */ - Object.defineProperty(Precondition.prototype, "conditionType", { - get: $util.oneOfGetter($oneOfFields = ["exists", "updateTime"]), - set: $util.oneOfSetter($oneOfFields) - }); - + Location.prototype.leadingComments = ""; + /** - * Creates a Precondition message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.firestore.v1.Precondition - * @static - * @param {Object.} object Plain object - * @returns {google.firestore.v1.Precondition} Precondition - */ - Precondition.fromObject = function fromObject(object) { - if (object instanceof $root.google.firestore.v1.Precondition) - return object; - var message = new $root.google.firestore.v1.Precondition(); - if (object.exists != null) - message.exists = Boolean(object.exists); - if (object.updateTime != null) { - if (typeof object.updateTime !== "object") - throw TypeError(".google.firestore.v1.Precondition.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - return message; - }; - - /** - * Creates a plain object from a Precondition message. Also converts values to other types if specified. - * @function toObject - * @memberof google.firestore.v1.Precondition - * @static - * @param {google.firestore.v1.Precondition} message Precondition - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * Location trailingComments. + * @member {string} trailingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance */ - Precondition.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.exists != null && message.hasOwnProperty("exists")) { - object.exists = message.exists; - if (options.oneofs) - object.conditionType = "exists"; - } - if (message.updateTime != null && message.hasOwnProperty("updateTime")) { - object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); - if (options.oneofs) - object.conditionType = "updateTime"; - } - return object; - }; - + Location.prototype.trailingComments = ""; + /** - * Converts this Precondition to JSON. - * @function toJSON - * @memberof google.firestore.v1.Precondition + * Location leadingDetachedComments. + * @member {Array.} leadingDetachedComments + * @memberof google.protobuf.SourceCodeInfo.Location * @instance - * @returns {Object.} JSON object */ - Precondition.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - + Location.prototype.leadingDetachedComments = $util.emptyArray; + /** - * Gets the default type url for Precondition - * @function getTypeUrl - * @memberof google.firestore.v1.Precondition + * Creates a new Location instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo.Location * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo.Location} Location instance */ - Precondition.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.firestore.v1.Precondition"; + Location.create = function create(properties) { + return new Location(properties); }; - - return Precondition; - })(); - - v1.TransactionOptions = (function() { - + /** - * Properties of a TransactionOptions. - * @memberof google.firestore.v1 - * @interface ITransactionOptions - * @property {google.firestore.v1.TransactionOptions.IReadOnly|null} [readOnly] TransactionOptions readOnly - * @property {google.firestore.v1.TransactionOptions.IReadWrite|null} [readWrite] TransactionOptions readWrite - */ - + * 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; + }; + /** - * Constructs a new TransactionOptions. - * @memberof google.firestore.v1 - * @classdesc Represents a TransactionOptions. - * @implements ITransactionOptions - * @constructor - * @param {google.firestore.v1.ITransactionOptions=} [properties] Properties to set + * 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 */ - function TransactionOptions(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]]; - } - + Location.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + /** - * TransactionOptions readOnly. - * @member {google.firestore.v1.TransactionOptions.IReadOnly|null|undefined} readOnly - * @memberof google.firestore.v1.TransactionOptions - * @instance - */ - TransactionOptions.prototype.readOnly = null; - + * 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) { + 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(); + 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; + }; + /** - * TransactionOptions readWrite. - * @member {google.firestore.v1.TransactionOptions.IReadWrite|null|undefined} readWrite - * @memberof google.firestore.v1.TransactionOptions - * @instance + * 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 */ - TransactionOptions.prototype.readWrite = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - + Location.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + /** - * TransactionOptions mode. - * @member {"readOnly"|"readWrite"|undefined} mode - * @memberof google.firestore.v1.TransactionOptions - * @instance - */ - Object.defineProperty(TransactionOptions.prototype, "mode", { - get: $util.oneOfGetter($oneOfFields = ["readOnly", "readWrite"]), - set: $util.oneOfSetter($oneOfFields) - }); - + * Verifies a Location message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} 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 TransactionOptions message from a plain object. Also converts values to their respective internal types. + * Creates a Location message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.firestore.v1.TransactionOptions + * @memberof google.protobuf.SourceCodeInfo.Location * @static * @param {Object.} object Plain object - * @returns {google.firestore.v1.TransactionOptions} TransactionOptions + * @returns {google.protobuf.SourceCodeInfo.Location} Location */ - TransactionOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.firestore.v1.TransactionOptions) + Location.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo.Location) return object; - var message = new $root.google.firestore.v1.TransactionOptions(); - if (object.readOnly != null) { - if (typeof object.readOnly !== "object") - throw TypeError(".google.firestore.v1.TransactionOptions.readOnly: object expected"); - message.readOnly = $root.google.firestore.v1.TransactionOptions.ReadOnly.fromObject(object.readOnly); + 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.readWrite != null) { - if (typeof object.readWrite !== "object") - throw TypeError(".google.firestore.v1.TransactionOptions.readWrite: object expected"); - message.readWrite = $root.google.firestore.v1.TransactionOptions.ReadWrite.fromObject(object.readWrite); + 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 TransactionOptions message. Also converts values to other types if specified. + * Creates a plain object from a Location message. Also converts values to other types if specified. * @function toObject - * @memberof google.firestore.v1.TransactionOptions + * @memberof google.protobuf.SourceCodeInfo.Location * @static - * @param {google.firestore.v1.TransactionOptions} message TransactionOptions + * @param {google.protobuf.SourceCodeInfo.Location} message Location * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - TransactionOptions.toObject = function toObject(message, options) { + Location.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (message.readOnly != null && message.hasOwnProperty("readOnly")) { - object.readOnly = $root.google.firestore.v1.TransactionOptions.ReadOnly.toObject(message.readOnly, options); - if (options.oneofs) - object.mode = "readOnly"; + if (options.arrays || options.defaults) { + object.path = []; + object.span = []; + object.leadingDetachedComments = []; } - if (message.readWrite != null && message.hasOwnProperty("readWrite")) { - object.readWrite = $root.google.firestore.v1.TransactionOptions.ReadWrite.toObject(message.readWrite, options); - if (options.oneofs) - object.mode = "readWrite"; + 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 TransactionOptions to JSON. + * Converts this Location to JSON. * @function toJSON - * @memberof google.firestore.v1.TransactionOptions + * @memberof google.protobuf.SourceCodeInfo.Location * @instance * @returns {Object.} JSON object */ - TransactionOptions.prototype.toJSON = function toJSON() { + Location.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - + /** - * Gets the default type url for TransactionOptions + * Gets the default type url for Location * @function getTypeUrl - * @memberof google.firestore.v1.TransactionOptions + * @memberof google.protobuf.SourceCodeInfo.Location * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - TransactionOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Location.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.firestore.v1.TransactionOptions"; + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo.Location"; }; - - TransactionOptions.ReadWrite = (function() { - - /** - * Properties of a ReadWrite. - * @memberof google.firestore.v1.TransactionOptions - * @interface IReadWrite - * @property {Uint8Array|null} [retryTransaction] ReadWrite retryTransaction - */ - - /** - * Constructs a new ReadWrite. - * @memberof google.firestore.v1.TransactionOptions - * @classdesc Represents a ReadWrite. - * @implements IReadWrite - * @constructor - * @param {google.firestore.v1.TransactionOptions.IReadWrite=} [properties] Properties to set - */ - function ReadWrite(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]]; + + return Location; + })(); + + return SourceCodeInfo; + })(); + + protobuf.GeneratedCodeInfo = (function() { + + /** + * Properties of a GeneratedCodeInfo. + * @memberof google.protobuf + * @interface IGeneratedCodeInfo + * @property {Array.|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.} 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) { + 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(); + 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.} 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.} 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.} 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.} 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.|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.} 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) { + 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(); + 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.} 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.} 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.} 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.} 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; + })(); + + protobuf.Duration = (function() { + + /** + * Properties of a Duration. + * @memberof google.protobuf + * @interface IDuration + * @property {number|Long|null} [seconds] Duration seconds + * @property {number|null} [nanos] Duration nanos + */ + + /** + * Constructs a new Duration. + * @memberof google.protobuf + * @classdesc Represents a Duration. + * @implements IDuration + * @constructor + * @param {google.protobuf.IDuration=} [properties] Properties to set + */ + function Duration(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]]; + } + + /** + * Duration seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Duration nanos. + * @member {number} nanos + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.nanos = 0; + + /** + * Creates a new Duration instance using the specified properties. + * @function create + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration=} [properties] Properties to set + * @returns {google.protobuf.Duration} Duration instance + */ + Duration.create = function create(properties) { + return new Duration(properties); + }; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Duration(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Duration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Duration message. + * @function verify + * @memberof google.protobuf.Duration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Duration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Duration + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Duration} Duration + */ + Duration.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Duration) + return object; + var message = new $root.google.protobuf.Duration(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.Duration} message Duration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Duration.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.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Duration to JSON. + * @function toJSON + * @memberof google.protobuf.Duration + * @instance + * @returns {Object.} JSON object + */ + Duration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Duration + * @function getTypeUrl + * @memberof google.protobuf.Duration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Duration"; + }; + + return Duration; + })(); + + 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) { + 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(); + 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.} 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.} 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.} 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.} 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) { + 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(); + 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.} 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.} 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.} 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.} 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) { + 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(); + 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.} 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.} 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.} 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.} 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) { + 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(); + 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.} 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.} 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.} 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.} 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) { + 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(); + 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); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Int32Value message. + * @function verify + * @memberof google.protobuf.Int32Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Int32Value.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)) + return "value: integer expected"; + return null; + }; + + /** + * Creates an Int32Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Int32Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Int32Value} Int32Value + */ + Int32Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Int32Value) + return object; + var message = new $root.google.protobuf.Int32Value(); + if (object.value != null) + message.value = object.value | 0; + return message; + }; + + /** + * Creates a plain object from an Int32Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.Int32Value} message Int32Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Int32Value.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 = message.value; + return object; + }; + + /** + * Converts this Int32Value to JSON. + * @function toJSON + * @memberof google.protobuf.Int32Value + * @instance + * @returns {Object.} JSON object + */ + Int32Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Int32Value + * @function getTypeUrl + * @memberof google.protobuf.Int32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int32Value"; + }; + + return Int32Value; + })(); + + protobuf.UInt32Value = (function() { + + /** + * Properties of a UInt32Value. + * @memberof google.protobuf + * @interface IUInt32Value + * @property {number|null} [value] UInt32Value value + */ + + /** + * Constructs a new UInt32Value. + * @memberof google.protobuf + * @classdesc Represents a UInt32Value. + * @implements IUInt32Value + * @constructor + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + */ + function UInt32Value(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]]; + } + + /** + * UInt32Value value. + * @member {number} value + * @memberof google.protobuf.UInt32Value + * @instance + */ + UInt32Value.prototype.value = 0; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + * @returns {google.protobuf.UInt32Value} UInt32Value instance + */ + UInt32Value.create = function create(properties) { + return new UInt32Value(properties); + }; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value} message UInt32Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt32Value.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).uint32(message.value); + return writer; + }; + + /** + * Encodes the specified UInt32Value message, length delimited. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value} message UInt32Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt32Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt32Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UInt32Value} UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt32Value.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UInt32Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.value = reader.uint32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a UInt32Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UInt32Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UInt32Value} UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt32Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a UInt32Value message. + * @function verify + * @memberof google.protobuf.UInt32Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UInt32Value.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)) + return "value: integer expected"; + return null; + }; + + /** + * Creates a UInt32Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UInt32Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UInt32Value} UInt32Value + */ + UInt32Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UInt32Value) + return object; + var message = new $root.google.protobuf.UInt32Value(); + if (object.value != null) + message.value = object.value >>> 0; + return message; + }; + + /** + * Creates a plain object from a UInt32Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.UInt32Value} message UInt32Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UInt32Value.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 = message.value; + return object; + }; + + /** + * Converts this UInt32Value to JSON. + * @function toJSON + * @memberof google.protobuf.UInt32Value + * @instance + * @returns {Object.} JSON object + */ + UInt32Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UInt32Value + * @function getTypeUrl + * @memberof google.protobuf.UInt32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt32Value"; + }; + + return UInt32Value; + })(); + + protobuf.BoolValue = (function() { + + /** + * Properties of a BoolValue. + * @memberof google.protobuf + * @interface IBoolValue + * @property {boolean|null} [value] BoolValue value + */ + + /** + * Constructs a new BoolValue. + * @memberof google.protobuf + * @classdesc Represents a BoolValue. + * @implements IBoolValue + * @constructor + * @param {google.protobuf.IBoolValue=} [properties] Properties to set + */ + function BoolValue(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]]; + } + + /** + * BoolValue value. + * @member {boolean} value + * @memberof google.protobuf.BoolValue + * @instance + */ + BoolValue.prototype.value = false; + + /** + * Creates a new BoolValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue=} [properties] Properties to set + * @returns {google.protobuf.BoolValue} BoolValue instance + */ + BoolValue.create = function create(properties) { + return new BoolValue(properties); + }; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue} message BoolValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoolValue.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).bool(message.value); + return writer; + }; + + /** + * Encodes the specified BoolValue message, length delimited. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue} message BoolValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoolValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BoolValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.BoolValue} BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoolValue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.BoolValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.value = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BoolValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.BoolValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.BoolValue} BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoolValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BoolValue message. + * @function verify + * @memberof google.protobuf.BoolValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BoolValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value !== "boolean") + return "value: boolean expected"; + return null; + }; + + /** + * Creates a BoolValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.BoolValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.BoolValue} BoolValue + */ + BoolValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.BoolValue) + return object; + var message = new $root.google.protobuf.BoolValue(); + if (object.value != null) + message.value = Boolean(object.value); + return message; + }; + + /** + * Creates a plain object from a BoolValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.BoolValue} message BoolValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BoolValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = false; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this BoolValue to JSON. + * @function toJSON + * @memberof google.protobuf.BoolValue + * @instance + * @returns {Object.} JSON object + */ + BoolValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BoolValue + * @function getTypeUrl + * @memberof google.protobuf.BoolValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BoolValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BoolValue"; + }; + + return BoolValue; + })(); + + protobuf.StringValue = (function() { + + /** + * Properties of a StringValue. + * @memberof google.protobuf + * @interface IStringValue + * @property {string|null} [value] StringValue value + */ + + /** + * Constructs a new StringValue. + * @memberof google.protobuf + * @classdesc Represents a StringValue. + * @implements IStringValue + * @constructor + * @param {google.protobuf.IStringValue=} [properties] Properties to set + */ + function StringValue(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]]; + } + + /** + * StringValue value. + * @member {string} value + * @memberof google.protobuf.StringValue + * @instance + */ + StringValue.prototype.value = ""; + + /** + * Creates a new StringValue instance using the specified properties. + * @function create + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue=} [properties] Properties to set + * @returns {google.protobuf.StringValue} StringValue instance + */ + StringValue.create = function create(properties) { + return new StringValue(properties); + }; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue} message StringValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.value); + return writer; + }; + + /** + * Encodes the specified StringValue message, length delimited. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue} message StringValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.StringValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.StringValue} StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringValue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.StringValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.value = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StringValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.StringValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.StringValue} StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StringValue message. + * @function verify + * @memberof google.protobuf.StringValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StringValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + return null; + }; + + /** + * Creates a StringValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.StringValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.StringValue} StringValue + */ + StringValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.StringValue) + return object; + var message = new $root.google.protobuf.StringValue(); + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from a StringValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.StringValue} message StringValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StringValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = ""; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this StringValue to JSON. + * @function toJSON + * @memberof google.protobuf.StringValue + * @instance + * @returns {Object.} JSON object + */ + StringValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StringValue + * @function getTypeUrl + * @memberof google.protobuf.StringValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StringValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.StringValue"; + }; + + return StringValue; + })(); + + protobuf.BytesValue = (function() { + + /** + * Properties of a BytesValue. + * @memberof google.protobuf + * @interface IBytesValue + * @property {Uint8Array|null} [value] BytesValue value + */ + + /** + * Constructs a new BytesValue. + * @memberof google.protobuf + * @classdesc Represents a BytesValue. + * @implements IBytesValue + * @constructor + * @param {google.protobuf.IBytesValue=} [properties] Properties to set + */ + function BytesValue(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]]; + } + + /** + * BytesValue value. + * @member {Uint8Array} value + * @memberof google.protobuf.BytesValue + * @instance + */ + BytesValue.prototype.value = $util.newBuffer([]); + + /** + * Creates a new BytesValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue=} [properties] Properties to set + * @returns {google.protobuf.BytesValue} BytesValue instance + */ + BytesValue.create = function create(properties) { + return new BytesValue(properties); + }; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue} message BytesValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BytesValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.value); + return writer; + }; + + /** + * Encodes the specified BytesValue message, length delimited. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue} message BytesValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BytesValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BytesValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.BytesValue} BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BytesValue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.BytesValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.value = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BytesValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.BytesValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.BytesValue} BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BytesValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BytesValue message. + * @function verify + * @memberof google.protobuf.BytesValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BytesValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + return null; + }; + + /** + * Creates a BytesValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.BytesValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.BytesValue} BytesValue + */ + BytesValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.BytesValue) + return object; + var message = new $root.google.protobuf.BytesValue(); + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length >= 0) + message.value = object.value; + return message; + }; + + /** + * Creates a plain object from a BytesValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.BytesValue} message BytesValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BytesValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + return object; + }; + + /** + * Converts this BytesValue to JSON. + * @function toJSON + * @memberof google.protobuf.BytesValue + * @instance + * @returns {Object.} JSON object + */ + BytesValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BytesValue + * @function getTypeUrl + * @memberof google.protobuf.BytesValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BytesValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BytesValue"; + }; + + return BytesValue; + })(); + + protobuf.Empty = (function() { + + /** + * Properties of an Empty. + * @memberof google.protobuf + * @interface IEmpty + */ + + /** + * Constructs a new Empty. + * @memberof google.protobuf + * @classdesc Represents an Empty. + * @implements IEmpty + * @constructor + * @param {google.protobuf.IEmpty=} [properties] Properties to set + */ + function Empty(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 Empty instance using the specified properties. + * @function create + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty=} [properties] Properties to set + * @returns {google.protobuf.Empty} Empty instance + */ + Empty.create = function create(properties) { + return new Empty(properties); + }; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Empty(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Empty message. + * @function verify + * @memberof google.protobuf.Empty + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Empty.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Empty + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Empty} Empty + */ + Empty.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Empty) + return object; + return new $root.google.protobuf.Empty(); + }; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.Empty} message Empty + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Empty.toObject = function toObject() { + return {}; + }; + + /** + * Converts this Empty to JSON. + * @function toJSON + * @memberof google.protobuf.Empty + * @instance + * @returns {Object.} JSON object + */ + Empty.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Empty + * @function getTypeUrl + * @memberof google.protobuf.Empty + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Empty.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Empty"; + }; + + return Empty; + })(); + + protobuf.Any = (function() { + + /** + * Properties of an Any. + * @memberof google.protobuf + * @interface IAny + * @property {string|null} [type_url] Any type_url + * @property {Uint8Array|null} [value] Any value + */ + + /** + * Constructs a new Any. + * @memberof google.protobuf + * @classdesc Represents an Any. + * @implements IAny + * @constructor + * @param {google.protobuf.IAny=} [properties] Properties to set + */ + function Any(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]]; + } + + /** + * Any type_url. + * @member {string} type_url + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.type_url = ""; + + /** + * Any value. + * @member {Uint8Array} value + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.value = $util.newBuffer([]); + + /** + * Creates a new Any instance using the specified properties. + * @function create + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny=} [properties] Properties to set + * @returns {google.protobuf.Any} Any instance + */ + Any.create = function create(properties) { + return new Any(properties); + }; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type_url != null && Object.hasOwnProperty.call(message, "type_url")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); + return writer; + }; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Any message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Any(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type_url = reader.string(); + break; + } + case 2: { + message.value = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Any message. + * @function verify + * @memberof google.protobuf.Any + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Any.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type_url != null && message.hasOwnProperty("type_url")) + if (!$util.isString(message.type_url)) + return "type_url: string expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + return null; + }; + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Any + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Any} Any + */ + Any.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Any) + return object; + var message = new $root.google.protobuf.Any(); + if (object.type_url != null) + message.type_url = String(object.type_url); + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length >= 0) + message.value = object.value; + return message; + }; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.Any} message Any + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Any.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type_url = ""; + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + } + if (message.type_url != null && message.hasOwnProperty("type_url")) + object.type_url = message.type_url; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + return object; + }; + + /** + * Converts this Any to JSON. + * @function toJSON + * @memberof google.protobuf.Any + * @instance + * @returns {Object.} JSON object + */ + Any.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Any + * @function getTypeUrl + * @memberof google.protobuf.Any + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Any.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Any"; + }; + + return Any; + })(); + + return protobuf; + })(); + + google.firestore = (function() { + + /** + * Namespace firestore. + * @memberof google + * @namespace + */ + var firestore = {}; + + firestore.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.firestore + * @namespace + */ + var v1 = {}; + + v1.AggregationResult = (function() { + + /** + * Properties of an AggregationResult. + * @memberof google.firestore.v1 + * @interface IAggregationResult + * @property {Object.|null} [aggregateFields] AggregationResult aggregateFields + */ + + /** + * Constructs a new AggregationResult. + * @memberof google.firestore.v1 + * @classdesc Represents an AggregationResult. + * @implements IAggregationResult + * @constructor + * @param {google.firestore.v1.IAggregationResult=} [properties] Properties to set + */ + function AggregationResult(properties) { + this.aggregateFields = {}; + 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]]; + } + + /** + * AggregationResult aggregateFields. + * @member {Object.} aggregateFields + * @memberof google.firestore.v1.AggregationResult + * @instance + */ + AggregationResult.prototype.aggregateFields = $util.emptyObject; + + /** + * Creates a new AggregationResult instance using the specified properties. + * @function create + * @memberof google.firestore.v1.AggregationResult + * @static + * @param {google.firestore.v1.IAggregationResult=} [properties] Properties to set + * @returns {google.firestore.v1.AggregationResult} AggregationResult instance + */ + AggregationResult.create = function create(properties) { + return new AggregationResult(properties); + }; + + /** + * Encodes the specified AggregationResult message. Does not implicitly {@link google.firestore.v1.AggregationResult.verify|verify} messages. + * @function encode + * @memberof google.firestore.v1.AggregationResult + * @static + * @param {google.firestore.v1.IAggregationResult} message AggregationResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AggregationResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.aggregateFields != null && Object.hasOwnProperty.call(message, "aggregateFields")) + for (var keys = Object.keys(message.aggregateFields), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.firestore.v1.Value.encode(message.aggregateFields[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified AggregationResult message, length delimited. Does not implicitly {@link google.firestore.v1.AggregationResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.firestore.v1.AggregationResult + * @static + * @param {google.firestore.v1.IAggregationResult} message AggregationResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AggregationResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AggregationResult message from the specified reader or buffer. + * @function decode + * @memberof google.firestore.v1.AggregationResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.firestore.v1.AggregationResult} AggregationResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AggregationResult.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.firestore.v1.AggregationResult(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + if (message.aggregateFields === $util.emptyObject) + message.aggregateFields = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.firestore.v1.Value.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.aggregateFields[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AggregationResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.firestore.v1.AggregationResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.firestore.v1.AggregationResult} AggregationResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AggregationResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AggregationResult message. + * @function verify + * @memberof google.firestore.v1.AggregationResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AggregationResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.aggregateFields != null && message.hasOwnProperty("aggregateFields")) { + if (!$util.isObject(message.aggregateFields)) + return "aggregateFields: object expected"; + var key = Object.keys(message.aggregateFields); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.firestore.v1.Value.verify(message.aggregateFields[key[i]]); + if (error) + return "aggregateFields." + error; + } + } + return null; + }; + + /** + * Creates an AggregationResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.firestore.v1.AggregationResult + * @static + * @param {Object.} object Plain object + * @returns {google.firestore.v1.AggregationResult} AggregationResult + */ + AggregationResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.firestore.v1.AggregationResult) + return object; + var message = new $root.google.firestore.v1.AggregationResult(); + if (object.aggregateFields) { + if (typeof object.aggregateFields !== "object") + throw TypeError(".google.firestore.v1.AggregationResult.aggregateFields: object expected"); + message.aggregateFields = {}; + for (var keys = Object.keys(object.aggregateFields), i = 0; i < keys.length; ++i) { + if (typeof object.aggregateFields[keys[i]] !== "object") + throw TypeError(".google.firestore.v1.AggregationResult.aggregateFields: object expected"); + message.aggregateFields[keys[i]] = $root.google.firestore.v1.Value.fromObject(object.aggregateFields[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from an AggregationResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.firestore.v1.AggregationResult + * @static + * @param {google.firestore.v1.AggregationResult} message AggregationResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AggregationResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.aggregateFields = {}; + var keys2; + if (message.aggregateFields && (keys2 = Object.keys(message.aggregateFields)).length) { + object.aggregateFields = {}; + for (var j = 0; j < keys2.length; ++j) + object.aggregateFields[keys2[j]] = $root.google.firestore.v1.Value.toObject(message.aggregateFields[keys2[j]], options); + } + return object; + }; + + /** + * Converts this AggregationResult to JSON. + * @function toJSON + * @memberof google.firestore.v1.AggregationResult + * @instance + * @returns {Object.} JSON object + */ + AggregationResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AggregationResult + * @function getTypeUrl + * @memberof google.firestore.v1.AggregationResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AggregationResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.firestore.v1.AggregationResult"; + }; + + return AggregationResult; + })(); + + v1.Document = (function() { + + /** + * Properties of a Document. + * @memberof google.firestore.v1 + * @interface IDocument + * @property {string|null} [name] Document name + * @property {Object.|null} [fields] Document fields + * @property {google.protobuf.ITimestamp|null} [createTime] Document createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Document updateTime + */ + + /** + * Constructs a new Document. + * @memberof google.firestore.v1 + * @classdesc Represents a Document. + * @implements IDocument + * @constructor + * @param {google.firestore.v1.IDocument=} [properties] Properties to set + */ + function Document(properties) { + this.fields = {}; + 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]]; + } + + /** + * Document name. + * @member {string} name + * @memberof google.firestore.v1.Document + * @instance + */ + Document.prototype.name = ""; + + /** + * Document fields. + * @member {Object.} fields + * @memberof google.firestore.v1.Document + * @instance + */ + Document.prototype.fields = $util.emptyObject; + + /** + * Document createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.firestore.v1.Document + * @instance + */ + Document.prototype.createTime = null; + + /** + * Document updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.firestore.v1.Document + * @instance + */ + Document.prototype.updateTime = null; + + /** + * Creates a new Document instance using the specified properties. + * @function create + * @memberof google.firestore.v1.Document + * @static + * @param {google.firestore.v1.IDocument=} [properties] Properties to set + * @returns {google.firestore.v1.Document} Document instance + */ + Document.create = function create(properties) { + return new Document(properties); + }; + + /** + * Encodes the specified Document message. Does not implicitly {@link google.firestore.v1.Document.verify|verify} messages. + * @function encode + * @memberof google.firestore.v1.Document + * @static + * @param {google.firestore.v1.IDocument} message Document message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Document.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.fields != null && Object.hasOwnProperty.call(message, "fields")) + for (var keys = Object.keys(message.fields), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.firestore.v1.Value.encode(message.fields[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Document message, length delimited. Does not implicitly {@link google.firestore.v1.Document.verify|verify} messages. + * @function encodeDelimited + * @memberof google.firestore.v1.Document + * @static + * @param {google.firestore.v1.IDocument} message Document message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Document.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Document message from the specified reader or buffer. + * @function decode + * @memberof google.firestore.v1.Document + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.firestore.v1.Document} Document + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Document.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.firestore.v1.Document(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (message.fields === $util.emptyObject) + message.fields = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.firestore.v1.Value.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.fields[key] = value; + break; + } + case 3: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Document message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.firestore.v1.Document + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.firestore.v1.Document} Document + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Document.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Document message. + * @function verify + * @memberof google.firestore.v1.Document + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Document.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.fields != null && message.hasOwnProperty("fields")) { + if (!$util.isObject(message.fields)) + return "fields: object expected"; + var key = Object.keys(message.fields); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.firestore.v1.Value.verify(message.fields[key[i]]); + if (error) + return "fields." + error; + } + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + return null; + }; + + /** + * Creates a Document message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.firestore.v1.Document + * @static + * @param {Object.} object Plain object + * @returns {google.firestore.v1.Document} Document + */ + Document.fromObject = function fromObject(object) { + if (object instanceof $root.google.firestore.v1.Document) + return object; + var message = new $root.google.firestore.v1.Document(); + if (object.name != null) + message.name = String(object.name); + if (object.fields) { + if (typeof object.fields !== "object") + throw TypeError(".google.firestore.v1.Document.fields: object expected"); + message.fields = {}; + for (var keys = Object.keys(object.fields), i = 0; i < keys.length; ++i) { + if (typeof object.fields[keys[i]] !== "object") + throw TypeError(".google.firestore.v1.Document.fields: object expected"); + message.fields[keys[i]] = $root.google.firestore.v1.Value.fromObject(object.fields[keys[i]]); + } + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.firestore.v1.Document.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.firestore.v1.Document.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + return message; + }; + + /** + * Creates a plain object from a Document message. Also converts values to other types if specified. + * @function toObject + * @memberof google.firestore.v1.Document + * @static + * @param {google.firestore.v1.Document} message Document + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Document.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.fields = {}; + if (options.defaults) { + object.name = ""; + object.createTime = null; + object.updateTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + var keys2; + if (message.fields && (keys2 = Object.keys(message.fields)).length) { + object.fields = {}; + for (var j = 0; j < keys2.length; ++j) + object.fields[keys2[j]] = $root.google.firestore.v1.Value.toObject(message.fields[keys2[j]], options); + } + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + return object; + }; + + /** + * Converts this Document to JSON. + * @function toJSON + * @memberof google.firestore.v1.Document + * @instance + * @returns {Object.} JSON object + */ + Document.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Document + * @function getTypeUrl + * @memberof google.firestore.v1.Document + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Document.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.firestore.v1.Document"; + }; + + return Document; + })(); + + v1.Value = (function() { + + /** + * Properties of a Value. + * @memberof google.firestore.v1 + * @interface IValue + * @property {google.protobuf.NullValue|null} [nullValue] Value nullValue + * @property {boolean|null} [booleanValue] Value booleanValue + * @property {number|Long|null} [integerValue] Value integerValue + * @property {number|null} [doubleValue] Value doubleValue + * @property {google.protobuf.ITimestamp|null} [timestampValue] Value timestampValue + * @property {string|null} [stringValue] Value stringValue + * @property {Uint8Array|null} [bytesValue] Value bytesValue + * @property {string|null} [referenceValue] Value referenceValue + * @property {google.type.ILatLng|null} [geoPointValue] Value geoPointValue + * @property {google.firestore.v1.IArrayValue|null} [arrayValue] Value arrayValue + * @property {google.firestore.v1.IMapValue|null} [mapValue] Value mapValue + */ + + /** + * Constructs a new Value. + * @memberof google.firestore.v1 + * @classdesc Represents a Value. + * @implements IValue + * @constructor + * @param {google.firestore.v1.IValue=} [properties] Properties to set + */ + function Value(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]]; + } + + /** + * Value nullValue. + * @member {google.protobuf.NullValue|null|undefined} nullValue + * @memberof google.firestore.v1.Value + * @instance + */ + Value.prototype.nullValue = null; + + /** + * Value booleanValue. + * @member {boolean|null|undefined} booleanValue + * @memberof google.firestore.v1.Value + * @instance + */ + Value.prototype.booleanValue = null; + + /** + * Value integerValue. + * @member {number|Long|null|undefined} integerValue + * @memberof google.firestore.v1.Value + * @instance + */ + Value.prototype.integerValue = null; + + /** + * Value doubleValue. + * @member {number|null|undefined} doubleValue + * @memberof google.firestore.v1.Value + * @instance + */ + Value.prototype.doubleValue = null; + + /** + * Value timestampValue. + * @member {google.protobuf.ITimestamp|null|undefined} timestampValue + * @memberof google.firestore.v1.Value + * @instance + */ + Value.prototype.timestampValue = null; + + /** + * Value stringValue. + * @member {string|null|undefined} stringValue + * @memberof google.firestore.v1.Value + * @instance + */ + Value.prototype.stringValue = null; + + /** + * Value bytesValue. + * @member {Uint8Array|null|undefined} bytesValue + * @memberof google.firestore.v1.Value + * @instance + */ + Value.prototype.bytesValue = null; + + /** + * Value referenceValue. + * @member {string|null|undefined} referenceValue + * @memberof google.firestore.v1.Value + * @instance + */ + Value.prototype.referenceValue = null; + + /** + * Value geoPointValue. + * @member {google.type.ILatLng|null|undefined} geoPointValue + * @memberof google.firestore.v1.Value + * @instance + */ + Value.prototype.geoPointValue = null; + + /** + * Value arrayValue. + * @member {google.firestore.v1.IArrayValue|null|undefined} arrayValue + * @memberof google.firestore.v1.Value + * @instance + */ + Value.prototype.arrayValue = null; + + /** + * Value mapValue. + * @member {google.firestore.v1.IMapValue|null|undefined} mapValue + * @memberof google.firestore.v1.Value + * @instance + */ + Value.prototype.mapValue = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Value valueType. + * @member {"nullValue"|"booleanValue"|"integerValue"|"doubleValue"|"timestampValue"|"stringValue"|"bytesValue"|"referenceValue"|"geoPointValue"|"arrayValue"|"mapValue"|undefined} valueType + * @memberof google.firestore.v1.Value + * @instance + */ + Object.defineProperty(Value.prototype, "valueType", { + get: $util.oneOfGetter($oneOfFields = ["nullValue", "booleanValue", "integerValue", "doubleValue", "timestampValue", "stringValue", "bytesValue", "referenceValue", "geoPointValue", "arrayValue", "mapValue"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Value instance using the specified properties. + * @function create + * @memberof google.firestore.v1.Value + * @static + * @param {google.firestore.v1.IValue=} [properties] Properties to set + * @returns {google.firestore.v1.Value} Value instance + */ + Value.create = function create(properties) { + return new Value(properties); + }; + + /** + * Encodes the specified Value message. Does not implicitly {@link google.firestore.v1.Value.verify|verify} messages. + * @function encode + * @memberof google.firestore.v1.Value + * @static + * @param {google.firestore.v1.IValue} message Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.booleanValue != null && Object.hasOwnProperty.call(message, "booleanValue")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.booleanValue); + if (message.integerValue != null && Object.hasOwnProperty.call(message, "integerValue")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.integerValue); + if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) + writer.uint32(/* id 3, wireType 1 =*/25).double(message.doubleValue); + if (message.referenceValue != null && Object.hasOwnProperty.call(message, "referenceValue")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.referenceValue); + if (message.mapValue != null && Object.hasOwnProperty.call(message, "mapValue")) + $root.google.firestore.v1.MapValue.encode(message.mapValue, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.geoPointValue != null && Object.hasOwnProperty.call(message, "geoPointValue")) + $root.google.type.LatLng.encode(message.geoPointValue, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.arrayValue != null && Object.hasOwnProperty.call(message, "arrayValue")) + $root.google.firestore.v1.ArrayValue.encode(message.arrayValue, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.timestampValue != null && Object.hasOwnProperty.call(message, "timestampValue")) + $root.google.protobuf.Timestamp.encode(message.timestampValue, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.nullValue != null && Object.hasOwnProperty.call(message, "nullValue")) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.nullValue); + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + writer.uint32(/* id 17, wireType 2 =*/138).string(message.stringValue); + if (message.bytesValue != null && Object.hasOwnProperty.call(message, "bytesValue")) + writer.uint32(/* id 18, wireType 2 =*/146).bytes(message.bytesValue); + return writer; + }; + + /** + * Encodes the specified Value message, length delimited. Does not implicitly {@link google.firestore.v1.Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.firestore.v1.Value + * @static + * @param {google.firestore.v1.IValue} message Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Value message from the specified reader or buffer. + * @function decode + * @memberof google.firestore.v1.Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.firestore.v1.Value} Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Value.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.firestore.v1.Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 11: { + message.nullValue = reader.int32(); + break; + } + case 1: { + message.booleanValue = reader.bool(); + break; + } + case 2: { + message.integerValue = reader.int64(); + break; + } + case 3: { + message.doubleValue = reader.double(); + break; + } + case 10: { + message.timestampValue = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 17: { + message.stringValue = reader.string(); + break; + } + case 18: { + message.bytesValue = reader.bytes(); + break; + } + case 5: { + message.referenceValue = reader.string(); + break; + } + case 8: { + message.geoPointValue = $root.google.type.LatLng.decode(reader, reader.uint32()); + break; + } + case 9: { + message.arrayValue = $root.google.firestore.v1.ArrayValue.decode(reader, reader.uint32()); + break; + } + case 6: { + message.mapValue = $root.google.firestore.v1.MapValue.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.firestore.v1.Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.firestore.v1.Value} Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Value message. + * @function verify + * @memberof google.firestore.v1.Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.nullValue != null && message.hasOwnProperty("nullValue")) { + properties.valueType = 1; + switch (message.nullValue) { + default: + return "nullValue: enum value expected"; + case 0: + break; + } + } + if (message.booleanValue != null && message.hasOwnProperty("booleanValue")) { + if (properties.valueType === 1) + return "valueType: multiple values"; + properties.valueType = 1; + if (typeof message.booleanValue !== "boolean") + return "booleanValue: boolean expected"; + } + if (message.integerValue != null && message.hasOwnProperty("integerValue")) { + if (properties.valueType === 1) + return "valueType: multiple values"; + properties.valueType = 1; + if (!$util.isInteger(message.integerValue) && !(message.integerValue && $util.isInteger(message.integerValue.low) && $util.isInteger(message.integerValue.high))) + return "integerValue: integer|Long expected"; + } + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) { + if (properties.valueType === 1) + return "valueType: multiple values"; + properties.valueType = 1; + if (typeof message.doubleValue !== "number") + return "doubleValue: number expected"; + } + if (message.timestampValue != null && message.hasOwnProperty("timestampValue")) { + if (properties.valueType === 1) + return "valueType: multiple values"; + properties.valueType = 1; + { + var error = $root.google.protobuf.Timestamp.verify(message.timestampValue); + if (error) + return "timestampValue." + error; + } + } + if (message.stringValue != null && message.hasOwnProperty("stringValue")) { + if (properties.valueType === 1) + return "valueType: multiple values"; + properties.valueType = 1; + if (!$util.isString(message.stringValue)) + return "stringValue: string expected"; + } + if (message.bytesValue != null && message.hasOwnProperty("bytesValue")) { + if (properties.valueType === 1) + return "valueType: multiple values"; + properties.valueType = 1; + if (!(message.bytesValue && typeof message.bytesValue.length === "number" || $util.isString(message.bytesValue))) + return "bytesValue: buffer expected"; + } + if (message.referenceValue != null && message.hasOwnProperty("referenceValue")) { + if (properties.valueType === 1) + return "valueType: multiple values"; + properties.valueType = 1; + if (!$util.isString(message.referenceValue)) + return "referenceValue: string expected"; + } + if (message.geoPointValue != null && message.hasOwnProperty("geoPointValue")) { + if (properties.valueType === 1) + return "valueType: multiple values"; + properties.valueType = 1; + { + var error = $root.google.type.LatLng.verify(message.geoPointValue); + if (error) + return "geoPointValue." + error; + } + } + if (message.arrayValue != null && message.hasOwnProperty("arrayValue")) { + if (properties.valueType === 1) + return "valueType: multiple values"; + properties.valueType = 1; + { + var error = $root.google.firestore.v1.ArrayValue.verify(message.arrayValue); + if (error) + return "arrayValue." + error; + } + } + if (message.mapValue != null && message.hasOwnProperty("mapValue")) { + if (properties.valueType === 1) + return "valueType: multiple values"; + properties.valueType = 1; + { + var error = $root.google.firestore.v1.MapValue.verify(message.mapValue); + if (error) + return "mapValue." + error; + } + } + return null; + }; + + /** + * Creates a Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.firestore.v1.Value + * @static + * @param {Object.} object Plain object + * @returns {google.firestore.v1.Value} Value + */ + Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.firestore.v1.Value) + return object; + var message = new $root.google.firestore.v1.Value(); + switch (object.nullValue) { + default: + if (typeof object.nullValue === "number") { + message.nullValue = object.nullValue; + break; + } + break; + case "NULL_VALUE": + case 0: + message.nullValue = 0; + break; + } + if (object.booleanValue != null) + message.booleanValue = Boolean(object.booleanValue); + if (object.integerValue != null) + if ($util.Long) + (message.integerValue = $util.Long.fromValue(object.integerValue)).unsigned = false; + else if (typeof object.integerValue === "string") + message.integerValue = parseInt(object.integerValue, 10); + else if (typeof object.integerValue === "number") + message.integerValue = object.integerValue; + else if (typeof object.integerValue === "object") + message.integerValue = new $util.LongBits(object.integerValue.low >>> 0, object.integerValue.high >>> 0).toNumber(); + if (object.doubleValue != null) + message.doubleValue = Number(object.doubleValue); + if (object.timestampValue != null) { + if (typeof object.timestampValue !== "object") + throw TypeError(".google.firestore.v1.Value.timestampValue: object expected"); + message.timestampValue = $root.google.protobuf.Timestamp.fromObject(object.timestampValue); + } + if (object.stringValue != null) + message.stringValue = String(object.stringValue); + if (object.bytesValue != null) + if (typeof object.bytesValue === "string") + $util.base64.decode(object.bytesValue, message.bytesValue = $util.newBuffer($util.base64.length(object.bytesValue)), 0); + else if (object.bytesValue.length >= 0) + message.bytesValue = object.bytesValue; + if (object.referenceValue != null) + message.referenceValue = String(object.referenceValue); + if (object.geoPointValue != null) { + if (typeof object.geoPointValue !== "object") + throw TypeError(".google.firestore.v1.Value.geoPointValue: object expected"); + message.geoPointValue = $root.google.type.LatLng.fromObject(object.geoPointValue); + } + if (object.arrayValue != null) { + if (typeof object.arrayValue !== "object") + throw TypeError(".google.firestore.v1.Value.arrayValue: object expected"); + message.arrayValue = $root.google.firestore.v1.ArrayValue.fromObject(object.arrayValue); + } + if (object.mapValue != null) { + if (typeof object.mapValue !== "object") + throw TypeError(".google.firestore.v1.Value.mapValue: object expected"); + message.mapValue = $root.google.firestore.v1.MapValue.fromObject(object.mapValue); + } + return message; + }; + + /** + * Creates a plain object from a Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.firestore.v1.Value + * @static + * @param {google.firestore.v1.Value} message Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.booleanValue != null && message.hasOwnProperty("booleanValue")) { + object.booleanValue = message.booleanValue; + if (options.oneofs) + object.valueType = "booleanValue"; + } + if (message.integerValue != null && message.hasOwnProperty("integerValue")) { + if (typeof message.integerValue === "number") + object.integerValue = options.longs === String ? String(message.integerValue) : message.integerValue; + else + object.integerValue = options.longs === String ? $util.Long.prototype.toString.call(message.integerValue) : options.longs === Number ? new $util.LongBits(message.integerValue.low >>> 0, message.integerValue.high >>> 0).toNumber() : message.integerValue; + if (options.oneofs) + object.valueType = "integerValue"; + } + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) { + object.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue; + if (options.oneofs) + object.valueType = "doubleValue"; + } + if (message.referenceValue != null && message.hasOwnProperty("referenceValue")) { + object.referenceValue = message.referenceValue; + if (options.oneofs) + object.valueType = "referenceValue"; + } + if (message.mapValue != null && message.hasOwnProperty("mapValue")) { + object.mapValue = $root.google.firestore.v1.MapValue.toObject(message.mapValue, options); + if (options.oneofs) + object.valueType = "mapValue"; + } + if (message.geoPointValue != null && message.hasOwnProperty("geoPointValue")) { + object.geoPointValue = $root.google.type.LatLng.toObject(message.geoPointValue, options); + if (options.oneofs) + object.valueType = "geoPointValue"; + } + if (message.arrayValue != null && message.hasOwnProperty("arrayValue")) { + object.arrayValue = $root.google.firestore.v1.ArrayValue.toObject(message.arrayValue, options); + if (options.oneofs) + object.valueType = "arrayValue"; + } + if (message.timestampValue != null && message.hasOwnProperty("timestampValue")) { + object.timestampValue = $root.google.protobuf.Timestamp.toObject(message.timestampValue, options); + if (options.oneofs) + object.valueType = "timestampValue"; + } + if (message.nullValue != null && message.hasOwnProperty("nullValue")) { + object.nullValue = options.enums === String ? $root.google.protobuf.NullValue[message.nullValue] === undefined ? message.nullValue : $root.google.protobuf.NullValue[message.nullValue] : message.nullValue; + if (options.oneofs) + object.valueType = "nullValue"; + } + if (message.stringValue != null && message.hasOwnProperty("stringValue")) { + object.stringValue = message.stringValue; + if (options.oneofs) + object.valueType = "stringValue"; + } + if (message.bytesValue != null && message.hasOwnProperty("bytesValue")) { + object.bytesValue = options.bytes === String ? $util.base64.encode(message.bytesValue, 0, message.bytesValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.bytesValue) : message.bytesValue; + if (options.oneofs) + object.valueType = "bytesValue"; + } + return object; + }; + + /** + * Converts this Value to JSON. + * @function toJSON + * @memberof google.firestore.v1.Value + * @instance + * @returns {Object.} JSON object + */ + Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Value + * @function getTypeUrl + * @memberof google.firestore.v1.Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.firestore.v1.Value"; + }; + + return Value; + })(); + + v1.ArrayValue = (function() { + + /** + * Properties of an ArrayValue. + * @memberof google.firestore.v1 + * @interface IArrayValue + * @property {Array.|null} [values] ArrayValue values + */ + + /** + * Constructs a new ArrayValue. + * @memberof google.firestore.v1 + * @classdesc Represents an ArrayValue. + * @implements IArrayValue + * @constructor + * @param {google.firestore.v1.IArrayValue=} [properties] Properties to set + */ + function ArrayValue(properties) { + this.values = []; + 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]]; + } + + /** + * ArrayValue values. + * @member {Array.} values + * @memberof google.firestore.v1.ArrayValue + * @instance + */ + ArrayValue.prototype.values = $util.emptyArray; + + /** + * Creates a new ArrayValue instance using the specified properties. + * @function create + * @memberof google.firestore.v1.ArrayValue + * @static + * @param {google.firestore.v1.IArrayValue=} [properties] Properties to set + * @returns {google.firestore.v1.ArrayValue} ArrayValue instance + */ + ArrayValue.create = function create(properties) { + return new ArrayValue(properties); + }; + + /** + * Encodes the specified ArrayValue message. Does not implicitly {@link google.firestore.v1.ArrayValue.verify|verify} messages. + * @function encode + * @memberof google.firestore.v1.ArrayValue + * @static + * @param {google.firestore.v1.IArrayValue} message ArrayValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ArrayValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.values != null && message.values.length) + for (var i = 0; i < message.values.length; ++i) + $root.google.firestore.v1.Value.encode(message.values[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ArrayValue message, length delimited. Does not implicitly {@link google.firestore.v1.ArrayValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.firestore.v1.ArrayValue + * @static + * @param {google.firestore.v1.IArrayValue} message ArrayValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ArrayValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ArrayValue message from the specified reader or buffer. + * @function decode + * @memberof google.firestore.v1.ArrayValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.firestore.v1.ArrayValue} ArrayValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ArrayValue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.firestore.v1.ArrayValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.values && message.values.length)) + message.values = []; + message.values.push($root.google.firestore.v1.Value.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ArrayValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.firestore.v1.ArrayValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.firestore.v1.ArrayValue} ArrayValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ArrayValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ArrayValue message. + * @function verify + * @memberof google.firestore.v1.ArrayValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ArrayValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.values != null && message.hasOwnProperty("values")) { + if (!Array.isArray(message.values)) + return "values: array expected"; + for (var i = 0; i < message.values.length; ++i) { + var error = $root.google.firestore.v1.Value.verify(message.values[i]); + if (error) + return "values." + error; + } + } + return null; + }; + + /** + * Creates an ArrayValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.firestore.v1.ArrayValue + * @static + * @param {Object.} object Plain object + * @returns {google.firestore.v1.ArrayValue} ArrayValue + */ + ArrayValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.firestore.v1.ArrayValue) + return object; + var message = new $root.google.firestore.v1.ArrayValue(); + if (object.values) { + if (!Array.isArray(object.values)) + throw TypeError(".google.firestore.v1.ArrayValue.values: array expected"); + message.values = []; + for (var i = 0; i < object.values.length; ++i) { + if (typeof object.values[i] !== "object") + throw TypeError(".google.firestore.v1.ArrayValue.values: object expected"); + message.values[i] = $root.google.firestore.v1.Value.fromObject(object.values[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an ArrayValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.firestore.v1.ArrayValue + * @static + * @param {google.firestore.v1.ArrayValue} message ArrayValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ArrayValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.values = []; + if (message.values && message.values.length) { + object.values = []; + for (var j = 0; j < message.values.length; ++j) + object.values[j] = $root.google.firestore.v1.Value.toObject(message.values[j], options); } - - /** - * ReadWrite retryTransaction. - * @member {Uint8Array} retryTransaction - * @memberof google.firestore.v1.TransactionOptions.ReadWrite - * @instance - */ - ReadWrite.prototype.retryTransaction = $util.newBuffer([]); - - /** - * Creates a ReadWrite message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.firestore.v1.TransactionOptions.ReadWrite - * @static - * @param {Object.} object Plain object - * @returns {google.firestore.v1.TransactionOptions.ReadWrite} ReadWrite - */ - ReadWrite.fromObject = function fromObject(object) { - if (object instanceof $root.google.firestore.v1.TransactionOptions.ReadWrite) - return object; - var message = new $root.google.firestore.v1.TransactionOptions.ReadWrite(); - if (object.retryTransaction != null) - if (typeof object.retryTransaction === "string") - $util.base64.decode(object.retryTransaction, message.retryTransaction = $util.newBuffer($util.base64.length(object.retryTransaction)), 0); - else if (object.retryTransaction.length >= 0) - message.retryTransaction = object.retryTransaction; - return message; - }; - - /** - * Creates a plain object from a ReadWrite message. Also converts values to other types if specified. - * @function toObject - * @memberof google.firestore.v1.TransactionOptions.ReadWrite - * @static - * @param {google.firestore.v1.TransactionOptions.ReadWrite} message ReadWrite - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ReadWrite.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - if (options.bytes === String) - object.retryTransaction = ""; - else { - object.retryTransaction = []; - if (options.bytes !== Array) - object.retryTransaction = $util.newBuffer(object.retryTransaction); + return object; + }; + + /** + * Converts this ArrayValue to JSON. + * @function toJSON + * @memberof google.firestore.v1.ArrayValue + * @instance + * @returns {Object.} JSON object + */ + ArrayValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ArrayValue + * @function getTypeUrl + * @memberof google.firestore.v1.ArrayValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ArrayValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.firestore.v1.ArrayValue"; + }; + + return ArrayValue; + })(); + + v1.MapValue = (function() { + + /** + * Properties of a MapValue. + * @memberof google.firestore.v1 + * @interface IMapValue + * @property {Object.|null} [fields] MapValue fields + */ + + /** + * Constructs a new MapValue. + * @memberof google.firestore.v1 + * @classdesc Represents a MapValue. + * @implements IMapValue + * @constructor + * @param {google.firestore.v1.IMapValue=} [properties] Properties to set + */ + function MapValue(properties) { + this.fields = {}; + 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]]; + } + + /** + * MapValue fields. + * @member {Object.} fields + * @memberof google.firestore.v1.MapValue + * @instance + */ + MapValue.prototype.fields = $util.emptyObject; + + /** + * Creates a new MapValue instance using the specified properties. + * @function create + * @memberof google.firestore.v1.MapValue + * @static + * @param {google.firestore.v1.IMapValue=} [properties] Properties to set + * @returns {google.firestore.v1.MapValue} MapValue instance + */ + MapValue.create = function create(properties) { + return new MapValue(properties); + }; + + /** + * Encodes the specified MapValue message. Does not implicitly {@link google.firestore.v1.MapValue.verify|verify} messages. + * @function encode + * @memberof google.firestore.v1.MapValue + * @static + * @param {google.firestore.v1.IMapValue} message MapValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MapValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fields != null && Object.hasOwnProperty.call(message, "fields")) + for (var keys = Object.keys(message.fields), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.firestore.v1.Value.encode(message.fields[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified MapValue message, length delimited. Does not implicitly {@link google.firestore.v1.MapValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.firestore.v1.MapValue + * @static + * @param {google.firestore.v1.IMapValue} message MapValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MapValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MapValue message from the specified reader or buffer. + * @function decode + * @memberof google.firestore.v1.MapValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.firestore.v1.MapValue} MapValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MapValue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.firestore.v1.MapValue(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (message.fields === $util.emptyObject) + message.fields = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.firestore.v1.Value.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.fields[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MapValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.firestore.v1.MapValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.firestore.v1.MapValue} MapValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MapValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MapValue message. + * @function verify + * @memberof google.firestore.v1.MapValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MapValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fields != null && message.hasOwnProperty("fields")) { + if (!$util.isObject(message.fields)) + return "fields: object expected"; + var key = Object.keys(message.fields); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.firestore.v1.Value.verify(message.fields[key[i]]); + if (error) + return "fields." + error; + } + } + return null; + }; + + /** + * Creates a MapValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.firestore.v1.MapValue + * @static + * @param {Object.} object Plain object + * @returns {google.firestore.v1.MapValue} MapValue + */ + MapValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.firestore.v1.MapValue) + return object; + var message = new $root.google.firestore.v1.MapValue(); + if (object.fields) { + if (typeof object.fields !== "object") + throw TypeError(".google.firestore.v1.MapValue.fields: object expected"); + message.fields = {}; + for (var keys = Object.keys(object.fields), i = 0; i < keys.length; ++i) { + if (typeof object.fields[keys[i]] !== "object") + throw TypeError(".google.firestore.v1.MapValue.fields: object expected"); + message.fields[keys[i]] = $root.google.firestore.v1.Value.fromObject(object.fields[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from a MapValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.firestore.v1.MapValue + * @static + * @param {google.firestore.v1.MapValue} message MapValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MapValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.fields = {}; + var keys2; + if (message.fields && (keys2 = Object.keys(message.fields)).length) { + object.fields = {}; + for (var j = 0; j < keys2.length; ++j) + object.fields[keys2[j]] = $root.google.firestore.v1.Value.toObject(message.fields[keys2[j]], options); + } + return object; + }; + + /** + * Converts this MapValue to JSON. + * @function toJSON + * @memberof google.firestore.v1.MapValue + * @instance + * @returns {Object.} JSON object + */ + MapValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MapValue + * @function getTypeUrl + * @memberof google.firestore.v1.MapValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MapValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.firestore.v1.MapValue"; + }; + + return MapValue; + })(); + + v1.BitSequence = (function() { + + /** + * Properties of a BitSequence. + * @memberof google.firestore.v1 + * @interface IBitSequence + * @property {Uint8Array|null} [bitmap] BitSequence bitmap + * @property {number|null} [padding] BitSequence padding + */ + + /** + * Constructs a new BitSequence. + * @memberof google.firestore.v1 + * @classdesc Represents a BitSequence. + * @implements IBitSequence + * @constructor + * @param {google.firestore.v1.IBitSequence=} [properties] Properties to set + */ + function BitSequence(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]]; + } + + /** + * BitSequence bitmap. + * @member {Uint8Array} bitmap + * @memberof google.firestore.v1.BitSequence + * @instance + */ + BitSequence.prototype.bitmap = $util.newBuffer([]); + + /** + * BitSequence padding. + * @member {number} padding + * @memberof google.firestore.v1.BitSequence + * @instance + */ + BitSequence.prototype.padding = 0; + + /** + * Creates a new BitSequence instance using the specified properties. + * @function create + * @memberof google.firestore.v1.BitSequence + * @static + * @param {google.firestore.v1.IBitSequence=} [properties] Properties to set + * @returns {google.firestore.v1.BitSequence} BitSequence instance + */ + BitSequence.create = function create(properties) { + return new BitSequence(properties); + }; + + /** + * Encodes the specified BitSequence message. Does not implicitly {@link google.firestore.v1.BitSequence.verify|verify} messages. + * @function encode + * @memberof google.firestore.v1.BitSequence + * @static + * @param {google.firestore.v1.IBitSequence} message BitSequence message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BitSequence.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bitmap != null && Object.hasOwnProperty.call(message, "bitmap")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.bitmap); + if (message.padding != null && Object.hasOwnProperty.call(message, "padding")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.padding); + return writer; + }; + + /** + * Encodes the specified BitSequence message, length delimited. Does not implicitly {@link google.firestore.v1.BitSequence.verify|verify} messages. + * @function encodeDelimited + * @memberof google.firestore.v1.BitSequence + * @static + * @param {google.firestore.v1.IBitSequence} message BitSequence message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BitSequence.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BitSequence message from the specified reader or buffer. + * @function decode + * @memberof google.firestore.v1.BitSequence + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.firestore.v1.BitSequence} BitSequence + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BitSequence.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.firestore.v1.BitSequence(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.bitmap = reader.bytes(); + break; } - if (message.retryTransaction != null && message.hasOwnProperty("retryTransaction")) - object.retryTransaction = options.bytes === String ? $util.base64.encode(message.retryTransaction, 0, message.retryTransaction.length) : options.bytes === Array ? Array.prototype.slice.call(message.retryTransaction) : message.retryTransaction; - return object; - }; - - /** - * Converts this ReadWrite to JSON. - * @function toJSON - * @memberof google.firestore.v1.TransactionOptions.ReadWrite - * @instance - * @returns {Object.} JSON object - */ - ReadWrite.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ReadWrite - * @function getTypeUrl - * @memberof google.firestore.v1.TransactionOptions.ReadWrite - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ReadWrite.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; + case 2: { + message.padding = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; } - return typeUrlPrefix + "/google.firestore.v1.TransactionOptions.ReadWrite"; - }; - - return ReadWrite; - })(); - - TransactionOptions.ReadOnly = (function() { - - /** - * Properties of a ReadOnly. - * @memberof google.firestore.v1.TransactionOptions - * @interface IReadOnly - * @property {google.protobuf.ITimestamp|null} [readTime] ReadOnly readTime - */ - - /** - * Constructs a new ReadOnly. - * @memberof google.firestore.v1.TransactionOptions - * @classdesc Represents a ReadOnly. - * @implements IReadOnly - * @constructor - * @param {google.firestore.v1.TransactionOptions.IReadOnly=} [properties] Properties to set - */ - function ReadOnly(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]]; } - - /** - * ReadOnly readTime. - * @member {google.protobuf.ITimestamp|null|undefined} readTime - * @memberof google.firestore.v1.TransactionOptions.ReadOnly - * @instance - */ - ReadOnly.prototype.readTime = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * ReadOnly consistencySelector. - * @member {"readTime"|undefined} consistencySelector - * @memberof google.firestore.v1.TransactionOptions.ReadOnly - * @instance - */ - Object.defineProperty(ReadOnly.prototype, "consistencySelector", { - get: $util.oneOfGetter($oneOfFields = ["readTime"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a ReadOnly message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.firestore.v1.TransactionOptions.ReadOnly - * @static - * @param {Object.} object Plain object - * @returns {google.firestore.v1.TransactionOptions.ReadOnly} ReadOnly - */ - ReadOnly.fromObject = function fromObject(object) { - if (object instanceof $root.google.firestore.v1.TransactionOptions.ReadOnly) - return object; - var message = new $root.google.firestore.v1.TransactionOptions.ReadOnly(); - if (object.readTime != null) { - if (typeof object.readTime !== "object") - throw TypeError(".google.firestore.v1.TransactionOptions.ReadOnly.readTime: object expected"); - message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); + return message; + }; + + /** + * Decodes a BitSequence message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.firestore.v1.BitSequence + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.firestore.v1.BitSequence} BitSequence + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BitSequence.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BitSequence message. + * @function verify + * @memberof google.firestore.v1.BitSequence + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BitSequence.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.bitmap != null && message.hasOwnProperty("bitmap")) + if (!(message.bitmap && typeof message.bitmap.length === "number" || $util.isString(message.bitmap))) + return "bitmap: buffer expected"; + if (message.padding != null && message.hasOwnProperty("padding")) + if (!$util.isInteger(message.padding)) + return "padding: integer expected"; + return null; + }; + + /** + * Creates a BitSequence message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.firestore.v1.BitSequence + * @static + * @param {Object.} object Plain object + * @returns {google.firestore.v1.BitSequence} BitSequence + */ + BitSequence.fromObject = function fromObject(object) { + if (object instanceof $root.google.firestore.v1.BitSequence) + return object; + var message = new $root.google.firestore.v1.BitSequence(); + if (object.bitmap != null) + if (typeof object.bitmap === "string") + $util.base64.decode(object.bitmap, message.bitmap = $util.newBuffer($util.base64.length(object.bitmap)), 0); + else if (object.bitmap.length >= 0) + message.bitmap = object.bitmap; + if (object.padding != null) + message.padding = object.padding | 0; + return message; + }; + + /** + * Creates a plain object from a BitSequence message. Also converts values to other types if specified. + * @function toObject + * @memberof google.firestore.v1.BitSequence + * @static + * @param {google.firestore.v1.BitSequence} message BitSequence + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BitSequence.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.bitmap = ""; + else { + object.bitmap = []; + if (options.bytes !== Array) + object.bitmap = $util.newBuffer(object.bitmap); } - return message; - }; - - /** - * Creates a plain object from a ReadOnly message. Also converts values to other types if specified. - * @function toObject - * @memberof google.firestore.v1.TransactionOptions.ReadOnly - * @static - * @param {google.firestore.v1.TransactionOptions.ReadOnly} message ReadOnly - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ReadOnly.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.readTime != null && message.hasOwnProperty("readTime")) { - object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); - if (options.oneofs) - object.consistencySelector = "readTime"; + object.padding = 0; + } + if (message.bitmap != null && message.hasOwnProperty("bitmap")) + object.bitmap = options.bytes === String ? $util.base64.encode(message.bitmap, 0, message.bitmap.length) : options.bytes === Array ? Array.prototype.slice.call(message.bitmap) : message.bitmap; + if (message.padding != null && message.hasOwnProperty("padding")) + object.padding = message.padding; + return object; + }; + + /** + * Converts this BitSequence to JSON. + * @function toJSON + * @memberof google.firestore.v1.BitSequence + * @instance + * @returns {Object.} JSON object + */ + BitSequence.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BitSequence + * @function getTypeUrl + * @memberof google.firestore.v1.BitSequence + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BitSequence.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.firestore.v1.BitSequence"; + }; + + return BitSequence; + })(); + + v1.BloomFilter = (function() { + + /** + * Properties of a BloomFilter. + * @memberof google.firestore.v1 + * @interface IBloomFilter + * @property {google.firestore.v1.IBitSequence|null} [bits] BloomFilter bits + * @property {number|null} [hashCount] BloomFilter hashCount + */ + + /** + * Constructs a new BloomFilter. + * @memberof google.firestore.v1 + * @classdesc Represents a BloomFilter. + * @implements IBloomFilter + * @constructor + * @param {google.firestore.v1.IBloomFilter=} [properties] Properties to set + */ + function BloomFilter(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]]; + } + + /** + * BloomFilter bits. + * @member {google.firestore.v1.IBitSequence|null|undefined} bits + * @memberof google.firestore.v1.BloomFilter + * @instance + */ + BloomFilter.prototype.bits = null; + + /** + * BloomFilter hashCount. + * @member {number} hashCount + * @memberof google.firestore.v1.BloomFilter + * @instance + */ + BloomFilter.prototype.hashCount = 0; + + /** + * Creates a new BloomFilter instance using the specified properties. + * @function create + * @memberof google.firestore.v1.BloomFilter + * @static + * @param {google.firestore.v1.IBloomFilter=} [properties] Properties to set + * @returns {google.firestore.v1.BloomFilter} BloomFilter instance + */ + BloomFilter.create = function create(properties) { + return new BloomFilter(properties); + }; + + /** + * Encodes the specified BloomFilter message. Does not implicitly {@link google.firestore.v1.BloomFilter.verify|verify} messages. + * @function encode + * @memberof google.firestore.v1.BloomFilter + * @static + * @param {google.firestore.v1.IBloomFilter} message BloomFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BloomFilter.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bits != null && Object.hasOwnProperty.call(message, "bits")) + $root.google.firestore.v1.BitSequence.encode(message.bits, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.hashCount != null && Object.hasOwnProperty.call(message, "hashCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.hashCount); + return writer; + }; + + /** + * Encodes the specified BloomFilter message, length delimited. Does not implicitly {@link google.firestore.v1.BloomFilter.verify|verify} messages. + * @function encodeDelimited + * @memberof google.firestore.v1.BloomFilter + * @static + * @param {google.firestore.v1.IBloomFilter} message BloomFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BloomFilter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BloomFilter message from the specified reader or buffer. + * @function decode + * @memberof google.firestore.v1.BloomFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.firestore.v1.BloomFilter} BloomFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BloomFilter.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.firestore.v1.BloomFilter(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.bits = $root.google.firestore.v1.BitSequence.decode(reader, reader.uint32()); + break; + } + case 2: { + message.hashCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; } + } + return message; + }; + + /** + * Decodes a BloomFilter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.firestore.v1.BloomFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.firestore.v1.BloomFilter} BloomFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BloomFilter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BloomFilter message. + * @function verify + * @memberof google.firestore.v1.BloomFilter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BloomFilter.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.bits != null && message.hasOwnProperty("bits")) { + var error = $root.google.firestore.v1.BitSequence.verify(message.bits); + if (error) + return "bits." + error; + } + if (message.hashCount != null && message.hasOwnProperty("hashCount")) + if (!$util.isInteger(message.hashCount)) + return "hashCount: integer expected"; + return null; + }; + + /** + * Creates a BloomFilter message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.firestore.v1.BloomFilter + * @static + * @param {Object.} object Plain object + * @returns {google.firestore.v1.BloomFilter} BloomFilter + */ + BloomFilter.fromObject = function fromObject(object) { + if (object instanceof $root.google.firestore.v1.BloomFilter) return object; - }; - - /** - * Converts this ReadOnly to JSON. - * @function toJSON - * @memberof google.firestore.v1.TransactionOptions.ReadOnly - * @instance - * @returns {Object.} JSON object - */ - ReadOnly.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ReadOnly - * @function getTypeUrl - * @memberof google.firestore.v1.TransactionOptions.ReadOnly - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ReadOnly.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; + var message = new $root.google.firestore.v1.BloomFilter(); + if (object.bits != null) { + if (typeof object.bits !== "object") + throw TypeError(".google.firestore.v1.BloomFilter.bits: object expected"); + message.bits = $root.google.firestore.v1.BitSequence.fromObject(object.bits); + } + if (object.hashCount != null) + message.hashCount = object.hashCount | 0; + return message; + }; + + /** + * Creates a plain object from a BloomFilter message. Also converts values to other types if specified. + * @function toObject + * @memberof google.firestore.v1.BloomFilter + * @static + * @param {google.firestore.v1.BloomFilter} message BloomFilter + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BloomFilter.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.bits = null; + object.hashCount = 0; + } + if (message.bits != null && message.hasOwnProperty("bits")) + object.bits = $root.google.firestore.v1.BitSequence.toObject(message.bits, options); + if (message.hashCount != null && message.hasOwnProperty("hashCount")) + object.hashCount = message.hashCount; + return object; + }; + + /** + * Converts this BloomFilter to JSON. + * @function toJSON + * @memberof google.firestore.v1.BloomFilter + * @instance + * @returns {Object.} JSON object + */ + BloomFilter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BloomFilter + * @function getTypeUrl + * @memberof google.firestore.v1.BloomFilter + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BloomFilter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.firestore.v1.BloomFilter"; + }; + + return BloomFilter; + })(); + + v1.DocumentMask = (function() { + + /** + * Properties of a DocumentMask. + * @memberof google.firestore.v1 + * @interface IDocumentMask + * @property {Array.|null} [fieldPaths] DocumentMask fieldPaths + */ + + /** + * Constructs a new DocumentMask. + * @memberof google.firestore.v1 + * @classdesc Represents a DocumentMask. + * @implements IDocumentMask + * @constructor + * @param {google.firestore.v1.IDocumentMask=} [properties] Properties to set + */ + function DocumentMask(properties) { + this.fieldPaths = []; + 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]]; + } + + /** + * DocumentMask fieldPaths. + * @member {Array.} fieldPaths + * @memberof google.firestore.v1.DocumentMask + * @instance + */ + DocumentMask.prototype.fieldPaths = $util.emptyArray; + + /** + * Creates a new DocumentMask instance using the specified properties. + * @function create + * @memberof google.firestore.v1.DocumentMask + * @static + * @param {google.firestore.v1.IDocumentMask=} [properties] Properties to set + * @returns {google.firestore.v1.DocumentMask} DocumentMask instance + */ + DocumentMask.create = function create(properties) { + return new DocumentMask(properties); + }; + + /** + * Encodes the specified DocumentMask message. Does not implicitly {@link google.firestore.v1.DocumentMask.verify|verify} messages. + * @function encode + * @memberof google.firestore.v1.DocumentMask + * @static + * @param {google.firestore.v1.IDocumentMask} message DocumentMask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DocumentMask.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fieldPaths != null && message.fieldPaths.length) + for (var i = 0; i < message.fieldPaths.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.fieldPaths[i]); + return writer; + }; + + /** + * Encodes the specified DocumentMask message, length delimited. Does not implicitly {@link google.firestore.v1.DocumentMask.verify|verify} messages. + * @function encodeDelimited + * @memberof google.firestore.v1.DocumentMask + * @static + * @param {google.firestore.v1.IDocumentMask} message DocumentMask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DocumentMask.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DocumentMask message from the specified reader or buffer. + * @function decode + * @memberof google.firestore.v1.DocumentMask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.firestore.v1.DocumentMask} DocumentMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DocumentMask.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.firestore.v1.DocumentMask(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.fieldPaths && message.fieldPaths.length)) + message.fieldPaths = []; + message.fieldPaths.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; } - return typeUrlPrefix + "/google.firestore.v1.TransactionOptions.ReadOnly"; - }; - - return ReadOnly; - })(); - - return TransactionOptions; + } + return message; + }; + + /** + * Decodes a DocumentMask message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.firestore.v1.DocumentMask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.firestore.v1.DocumentMask} DocumentMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DocumentMask.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DocumentMask message. + * @function verify + * @memberof google.firestore.v1.DocumentMask + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DocumentMask.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fieldPaths != null && message.hasOwnProperty("fieldPaths")) { + if (!Array.isArray(message.fieldPaths)) + return "fieldPaths: array expected"; + for (var i = 0; i < message.fieldPaths.length; ++i) + if (!$util.isString(message.fieldPaths[i])) + return "fieldPaths: string[] expected"; + } + return null; + }; + + /** + * Creates a DocumentMask message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.firestore.v1.DocumentMask + * @static + * @param {Object.} object Plain object + * @returns {google.firestore.v1.DocumentMask} DocumentMask + */ + DocumentMask.fromObject = function fromObject(object) { + if (object instanceof $root.google.firestore.v1.DocumentMask) + return object; + var message = new $root.google.firestore.v1.DocumentMask(); + if (object.fieldPaths) { + if (!Array.isArray(object.fieldPaths)) + throw TypeError(".google.firestore.v1.DocumentMask.fieldPaths: array expected"); + message.fieldPaths = []; + for (var i = 0; i < object.fieldPaths.length; ++i) + message.fieldPaths[i] = String(object.fieldPaths[i]); + } + return message; + }; + + /** + * Creates a plain object from a DocumentMask message. Also converts values to other types if specified. + * @function toObject + * @memberof google.firestore.v1.DocumentMask + * @static + * @param {google.firestore.v1.DocumentMask} message DocumentMask + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DocumentMask.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.fieldPaths = []; + if (message.fieldPaths && message.fieldPaths.length) { + object.fieldPaths = []; + for (var j = 0; j < message.fieldPaths.length; ++j) + object.fieldPaths[j] = message.fieldPaths[j]; + } + return object; + }; + + /** + * Converts this DocumentMask to JSON. + * @function toJSON + * @memberof google.firestore.v1.DocumentMask + * @instance + * @returns {Object.} JSON object + */ + DocumentMask.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DocumentMask + * @function getTypeUrl + * @memberof google.firestore.v1.DocumentMask + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DocumentMask.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.firestore.v1.DocumentMask"; + }; + + return DocumentMask; })(); - - v1.Document = (function() { - + + v1.Precondition = (function() { + /** - * Properties of a Document. + * Properties of a Precondition. * @memberof google.firestore.v1 - * @interface IDocument - * @property {string|null} [name] Document name - * @property {Object.|null} [fields] Document fields - * @property {google.protobuf.ITimestamp|null} [createTime] Document createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] Document updateTime + * @interface IPrecondition + * @property {boolean|null} [exists] Precondition exists + * @property {google.protobuf.ITimestamp|null} [updateTime] Precondition updateTime */ - + /** - * Constructs a new Document. + * Constructs a new Precondition. * @memberof google.firestore.v1 - * @classdesc Represents a Document. - * @implements IDocument + * @classdesc Represents a Precondition. + * @implements IPrecondition * @constructor - * @param {google.firestore.v1.IDocument=} [properties] Properties to set + * @param {google.firestore.v1.IPrecondition=} [properties] Properties to set */ - function Document(properties) { - this.fields = {}; + function Precondition(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]]; } - + /** - * Document name. - * @member {string} name - * @memberof google.firestore.v1.Document + * Precondition exists. + * @member {boolean|null|undefined} exists + * @memberof google.firestore.v1.Precondition * @instance */ - Document.prototype.name = ""; - + Precondition.prototype.exists = null; + /** - * Document fields. - * @member {Object.} fields - * @memberof google.firestore.v1.Document + * Precondition updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.firestore.v1.Precondition * @instance */ - Document.prototype.fields = $util.emptyObject; - + Precondition.prototype.updateTime = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + /** - * Document createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.firestore.v1.Document + * Precondition conditionType. + * @member {"exists"|"updateTime"|undefined} conditionType + * @memberof google.firestore.v1.Precondition * @instance */ - Document.prototype.createTime = null; - + Object.defineProperty(Precondition.prototype, "conditionType", { + get: $util.oneOfGetter($oneOfFields = ["exists", "updateTime"]), + set: $util.oneOfSetter($oneOfFields) + }); + /** - * Document updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.firestore.v1.Document - * @instance + * Creates a new Precondition instance using the specified properties. + * @function create + * @memberof google.firestore.v1.Precondition + * @static + * @param {google.firestore.v1.IPrecondition=} [properties] Properties to set + * @returns {google.firestore.v1.Precondition} Precondition instance */ - Document.prototype.updateTime = null; - + Precondition.create = function create(properties) { + return new Precondition(properties); + }; + /** - * Creates a Document message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.firestore.v1.Document + * Encodes the specified Precondition message. Does not implicitly {@link google.firestore.v1.Precondition.verify|verify} messages. + * @function encode + * @memberof google.firestore.v1.Precondition * @static - * @param {Object.} object Plain object - * @returns {google.firestore.v1.Document} Document + * @param {google.firestore.v1.IPrecondition} message Precondition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Precondition.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.exists != null && Object.hasOwnProperty.call(message, "exists")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.exists); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Precondition message, length delimited. Does not implicitly {@link google.firestore.v1.Precondition.verify|verify} messages. + * @function encodeDelimited + * @memberof google.firestore.v1.Precondition + * @static + * @param {google.firestore.v1.IPrecondition} message Precondition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Document.fromObject = function fromObject(object) { - if (object instanceof $root.google.firestore.v1.Document) - return object; - var message = new $root.google.firestore.v1.Document(); - if (object.name != null) - message.name = String(object.name); - if (object.fields) { - if (typeof object.fields !== "object") - throw TypeError(".google.firestore.v1.Document.fields: object expected"); - message.fields = {}; - for (var keys = Object.keys(object.fields), i = 0; i < keys.length; ++i) { - if (typeof object.fields[keys[i]] !== "object") - throw TypeError(".google.firestore.v1.Document.fields: object expected"); - message.fields[keys[i]] = $root.google.firestore.v1.Value.fromObject(object.fields[keys[i]]); + Precondition.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Precondition message from the specified reader or buffer. + * @function decode + * @memberof google.firestore.v1.Precondition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.firestore.v1.Precondition} Precondition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Precondition.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.firestore.v1.Precondition(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.exists = reader.bool(); + break; + } + case 2: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; } } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.firestore.v1.Document.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + return message; + }; + + /** + * Decodes a Precondition message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.firestore.v1.Precondition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.firestore.v1.Precondition} Precondition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Precondition.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Precondition message. + * @function verify + * @memberof google.firestore.v1.Precondition + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Precondition.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.exists != null && message.hasOwnProperty("exists")) { + properties.conditionType = 1; + if (typeof message.exists !== "boolean") + return "exists: boolean expected"; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + if (properties.conditionType === 1) + return "conditionType: multiple values"; + properties.conditionType = 1; + { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } } + return null; + }; + + /** + * Creates a Precondition message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.firestore.v1.Precondition + * @static + * @param {Object.} object Plain object + * @returns {google.firestore.v1.Precondition} Precondition + */ + Precondition.fromObject = function fromObject(object) { + if (object instanceof $root.google.firestore.v1.Precondition) + return object; + var message = new $root.google.firestore.v1.Precondition(); + if (object.exists != null) + message.exists = Boolean(object.exists); if (object.updateTime != null) { if (typeof object.updateTime !== "object") - throw TypeError(".google.firestore.v1.Document.updateTime: object expected"); + throw TypeError(".google.firestore.v1.Precondition.updateTime: object expected"); message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); } return message; }; - + /** - * Creates a plain object from a Document message. Also converts values to other types if specified. + * Creates a plain object from a Precondition message. Also converts values to other types if specified. * @function toObject - * @memberof google.firestore.v1.Document + * @memberof google.firestore.v1.Precondition * @static - * @param {google.firestore.v1.Document} message Document + * @param {google.firestore.v1.Precondition} message Precondition * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Document.toObject = function toObject(message, options) { + Precondition.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.objects || options.defaults) - object.fields = {}; - if (options.defaults) { - object.name = ""; - object.createTime = null; - object.updateTime = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - var keys2; - if (message.fields && (keys2 = Object.keys(message.fields)).length) { - object.fields = {}; - for (var j = 0; j < keys2.length; ++j) - object.fields[keys2[j]] = $root.google.firestore.v1.Value.toObject(message.fields[keys2[j]], options); + if (message.exists != null && message.hasOwnProperty("exists")) { + object.exists = message.exists; + if (options.oneofs) + object.conditionType = "exists"; } - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.updateTime != null && message.hasOwnProperty("updateTime")) + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (options.oneofs) + object.conditionType = "updateTime"; + } return object; }; - + /** - * Converts this Document to JSON. + * Converts this Precondition to JSON. * @function toJSON - * @memberof google.firestore.v1.Document + * @memberof google.firestore.v1.Precondition * @instance * @returns {Object.} JSON object */ - Document.prototype.toJSON = function toJSON() { + Precondition.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - + /** - * Gets the default type url for Document + * Gets the default type url for Precondition * @function getTypeUrl - * @memberof google.firestore.v1.Document + * @memberof google.firestore.v1.Precondition * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - Document.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Precondition.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.firestore.v1.Document"; + return typeUrlPrefix + "/google.firestore.v1.Precondition"; }; - - return Document; + + return Precondition; })(); - - v1.Value = (function() { - + + v1.TransactionOptions = (function() { + /** - * Properties of a Value. + * Properties of a TransactionOptions. * @memberof google.firestore.v1 - * @interface IValue - * @property {google.protobuf.NullValue|null} [nullValue] Value nullValue - * @property {boolean|null} [booleanValue] Value booleanValue - * @property {number|string|null} [integerValue] Value integerValue - * @property {number|null} [doubleValue] Value doubleValue - * @property {google.protobuf.ITimestamp|null} [timestampValue] Value timestampValue - * @property {string|null} [stringValue] Value stringValue - * @property {Uint8Array|null} [bytesValue] Value bytesValue - * @property {string|null} [referenceValue] Value referenceValue - * @property {google.type.ILatLng|null} [geoPointValue] Value geoPointValue - * @property {google.firestore.v1.IArrayValue|null} [arrayValue] Value arrayValue - * @property {google.firestore.v1.IMapValue|null} [mapValue] Value mapValue + * @interface ITransactionOptions + * @property {google.firestore.v1.TransactionOptions.IReadOnly|null} [readOnly] TransactionOptions readOnly + * @property {google.firestore.v1.TransactionOptions.IReadWrite|null} [readWrite] TransactionOptions readWrite */ - + /** - * Constructs a new Value. + * Constructs a new TransactionOptions. * @memberof google.firestore.v1 - * @classdesc Represents a Value. - * @implements IValue + * @classdesc Represents a TransactionOptions. + * @implements ITransactionOptions * @constructor - * @param {google.firestore.v1.IValue=} [properties] Properties to set + * @param {google.firestore.v1.ITransactionOptions=} [properties] Properties to set */ - function Value(properties) { + function TransactionOptions(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]]; } - - /** - * Value nullValue. - * @member {google.protobuf.NullValue|null|undefined} nullValue - * @memberof google.firestore.v1.Value - * @instance - */ - Value.prototype.nullValue = null; - - /** - * Value booleanValue. - * @member {boolean|null|undefined} booleanValue - * @memberof google.firestore.v1.Value - * @instance - */ - Value.prototype.booleanValue = null; - - /** - * Value integerValue. - * @member {number|string|null|undefined} integerValue - * @memberof google.firestore.v1.Value - * @instance - */ - Value.prototype.integerValue = null; - + /** - * Value doubleValue. - * @member {number|null|undefined} doubleValue - * @memberof google.firestore.v1.Value + * TransactionOptions readOnly. + * @member {google.firestore.v1.TransactionOptions.IReadOnly|null|undefined} readOnly + * @memberof google.firestore.v1.TransactionOptions * @instance */ - Value.prototype.doubleValue = null; - + TransactionOptions.prototype.readOnly = null; + /** - * Value timestampValue. - * @member {google.protobuf.ITimestamp|null|undefined} timestampValue - * @memberof google.firestore.v1.Value + * TransactionOptions readWrite. + * @member {google.firestore.v1.TransactionOptions.IReadWrite|null|undefined} readWrite + * @memberof google.firestore.v1.TransactionOptions * @instance */ - Value.prototype.timestampValue = null; - + TransactionOptions.prototype.readWrite = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + /** - * Value stringValue. - * @member {string|null|undefined} stringValue - * @memberof google.firestore.v1.Value + * TransactionOptions mode. + * @member {"readOnly"|"readWrite"|undefined} mode + * @memberof google.firestore.v1.TransactionOptions * @instance */ - Value.prototype.stringValue = null; - + Object.defineProperty(TransactionOptions.prototype, "mode", { + get: $util.oneOfGetter($oneOfFields = ["readOnly", "readWrite"]), + set: $util.oneOfSetter($oneOfFields) + }); + /** - * Value bytesValue. - * @member {Uint8Array|null|undefined} bytesValue - * @memberof google.firestore.v1.Value - * @instance + * Creates a new TransactionOptions instance using the specified properties. + * @function create + * @memberof google.firestore.v1.TransactionOptions + * @static + * @param {google.firestore.v1.ITransactionOptions=} [properties] Properties to set + * @returns {google.firestore.v1.TransactionOptions} TransactionOptions instance */ - Value.prototype.bytesValue = null; - + TransactionOptions.create = function create(properties) { + return new TransactionOptions(properties); + }; + /** - * Value referenceValue. - * @member {string|null|undefined} referenceValue - * @memberof google.firestore.v1.Value - * @instance - */ - Value.prototype.referenceValue = null; - + * Encodes the specified TransactionOptions message. Does not implicitly {@link google.firestore.v1.TransactionOptions.verify|verify} messages. + * @function encode + * @memberof google.firestore.v1.TransactionOptions + * @static + * @param {google.firestore.v1.ITransactionOptions} message TransactionOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.readOnly != null && Object.hasOwnProperty.call(message, "readOnly")) + $root.google.firestore.v1.TransactionOptions.ReadOnly.encode(message.readOnly, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.readWrite != null && Object.hasOwnProperty.call(message, "readWrite")) + $root.google.firestore.v1.TransactionOptions.ReadWrite.encode(message.readWrite, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + /** - * Value geoPointValue. - * @member {google.type.ILatLng|null|undefined} geoPointValue - * @memberof google.firestore.v1.Value - * @instance + * Encodes the specified TransactionOptions message, length delimited. Does not implicitly {@link google.firestore.v1.TransactionOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.firestore.v1.TransactionOptions + * @static + * @param {google.firestore.v1.ITransactionOptions} message TransactionOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Value.prototype.geoPointValue = null; - + TransactionOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + /** - * Value arrayValue. - * @member {google.firestore.v1.IArrayValue|null|undefined} arrayValue - * @memberof google.firestore.v1.Value - * @instance - */ - Value.prototype.arrayValue = null; - + * Decodes a TransactionOptions message from the specified reader or buffer. + * @function decode + * @memberof google.firestore.v1.TransactionOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.firestore.v1.TransactionOptions} TransactionOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.firestore.v1.TransactionOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.readOnly = $root.google.firestore.v1.TransactionOptions.ReadOnly.decode(reader, reader.uint32()); + break; + } + case 3: { + message.readWrite = $root.google.firestore.v1.TransactionOptions.ReadWrite.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + /** - * Value mapValue. - * @member {google.firestore.v1.IMapValue|null|undefined} mapValue - * @memberof google.firestore.v1.Value - * @instance + * Decodes a TransactionOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.firestore.v1.TransactionOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.firestore.v1.TransactionOptions} TransactionOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Value.prototype.mapValue = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - + TransactionOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + /** - * Value valueType. - * @member {"nullValue"|"booleanValue"|"integerValue"|"doubleValue"|"timestampValue"|"stringValue"|"bytesValue"|"referenceValue"|"geoPointValue"|"arrayValue"|"mapValue"|undefined} valueType - * @memberof google.firestore.v1.Value - * @instance + * Verifies a TransactionOptions message. + * @function verify + * @memberof google.firestore.v1.TransactionOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Object.defineProperty(Value.prototype, "valueType", { - get: $util.oneOfGetter($oneOfFields = ["nullValue", "booleanValue", "integerValue", "doubleValue", "timestampValue", "stringValue", "bytesValue", "referenceValue", "geoPointValue", "arrayValue", "mapValue"]), - set: $util.oneOfSetter($oneOfFields) - }); - + TransactionOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.readOnly != null && message.hasOwnProperty("readOnly")) { + properties.mode = 1; + { + var error = $root.google.firestore.v1.TransactionOptions.ReadOnly.verify(message.readOnly); + if (error) + return "readOnly." + error; + } + } + if (message.readWrite != null && message.hasOwnProperty("readWrite")) { + if (properties.mode === 1) + return "mode: multiple values"; + properties.mode = 1; + { + var error = $root.google.firestore.v1.TransactionOptions.ReadWrite.verify(message.readWrite); + if (error) + return "readWrite." + error; + } + } + return null; + }; + /** - * Creates a Value message from a plain object. Also converts values to their respective internal types. + * Creates a TransactionOptions message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.firestore.v1.Value + * @memberof google.firestore.v1.TransactionOptions * @static * @param {Object.} object Plain object - * @returns {google.firestore.v1.Value} Value + * @returns {google.firestore.v1.TransactionOptions} TransactionOptions */ - Value.fromObject = function fromObject(object) { - if (object instanceof $root.google.firestore.v1.Value) + TransactionOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.firestore.v1.TransactionOptions) return object; - var message = new $root.google.firestore.v1.Value(); - switch (object.nullValue) { - default: - if (typeof object.nullValue === "number") { - message.nullValue = object.nullValue; - break; - } - break; - case "NULL_VALUE": - case 0: - message.nullValue = 0; - break; - } - if (object.booleanValue != null) - message.booleanValue = Boolean(object.booleanValue); - if (object.integerValue != null) - if ($util.Long) - (message.integerValue = $util.Long.fromValue(object.integerValue)).unsigned = false; - else if (typeof object.integerValue === "string") - message.integerValue = parseInt(object.integerValue, 10); - else if (typeof object.integerValue === "number") - message.integerValue = object.integerValue; - else if (typeof object.integerValue === "object") - message.integerValue = new $util.LongBits(object.integerValue.low >>> 0, object.integerValue.high >>> 0).toNumber(); - if (object.doubleValue != null) - message.doubleValue = Number(object.doubleValue); - if (object.timestampValue != null) { - if (typeof object.timestampValue !== "object") - throw TypeError(".google.firestore.v1.Value.timestampValue: object expected"); - message.timestampValue = $root.google.protobuf.Timestamp.fromObject(object.timestampValue); - } - if (object.stringValue != null) - message.stringValue = String(object.stringValue); - if (object.bytesValue != null) - if (typeof object.bytesValue === "string") - $util.base64.decode(object.bytesValue, message.bytesValue = $util.newBuffer($util.base64.length(object.bytesValue)), 0); - else if (object.bytesValue.length >= 0) - message.bytesValue = object.bytesValue; - if (object.referenceValue != null) - message.referenceValue = String(object.referenceValue); - if (object.geoPointValue != null) { - if (typeof object.geoPointValue !== "object") - throw TypeError(".google.firestore.v1.Value.geoPointValue: object expected"); - message.geoPointValue = $root.google.type.LatLng.fromObject(object.geoPointValue); - } - if (object.arrayValue != null) { - if (typeof object.arrayValue !== "object") - throw TypeError(".google.firestore.v1.Value.arrayValue: object expected"); - message.arrayValue = $root.google.firestore.v1.ArrayValue.fromObject(object.arrayValue); + var message = new $root.google.firestore.v1.TransactionOptions(); + if (object.readOnly != null) { + if (typeof object.readOnly !== "object") + throw TypeError(".google.firestore.v1.TransactionOptions.readOnly: object expected"); + message.readOnly = $root.google.firestore.v1.TransactionOptions.ReadOnly.fromObject(object.readOnly); } - if (object.mapValue != null) { - if (typeof object.mapValue !== "object") - throw TypeError(".google.firestore.v1.Value.mapValue: object expected"); - message.mapValue = $root.google.firestore.v1.MapValue.fromObject(object.mapValue); + if (object.readWrite != null) { + if (typeof object.readWrite !== "object") + throw TypeError(".google.firestore.v1.TransactionOptions.readWrite: object expected"); + message.readWrite = $root.google.firestore.v1.TransactionOptions.ReadWrite.fromObject(object.readWrite); } return message; }; - + /** - * Creates a plain object from a Value message. Also converts values to other types if specified. + * Creates a plain object from a TransactionOptions message. Also converts values to other types if specified. * @function toObject - * @memberof google.firestore.v1.Value + * @memberof google.firestore.v1.TransactionOptions * @static - * @param {google.firestore.v1.Value} message Value + * @param {google.firestore.v1.TransactionOptions} message TransactionOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Value.toObject = function toObject(message, options) { + TransactionOptions.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (message.booleanValue != null && message.hasOwnProperty("booleanValue")) { - object.booleanValue = message.booleanValue; - if (options.oneofs) - object.valueType = "booleanValue"; - } - if (message.integerValue != null && message.hasOwnProperty("integerValue")) { - if (typeof message.integerValue === "number") - object.integerValue = options.longs === String ? String(message.integerValue) : message.integerValue; - else - object.integerValue = options.longs === String ? $util.Long.prototype.toString.call(message.integerValue) : options.longs === Number ? new $util.LongBits(message.integerValue.low >>> 0, message.integerValue.high >>> 0).toNumber() : message.integerValue; - if (options.oneofs) - object.valueType = "integerValue"; - } - if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) { - object.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue; - if (options.oneofs) - object.valueType = "doubleValue"; - } - if (message.referenceValue != null && message.hasOwnProperty("referenceValue")) { - object.referenceValue = message.referenceValue; - if (options.oneofs) - object.valueType = "referenceValue"; - } - if (message.mapValue != null && message.hasOwnProperty("mapValue")) { - object.mapValue = $root.google.firestore.v1.MapValue.toObject(message.mapValue, options); - if (options.oneofs) - object.valueType = "mapValue"; - } - if (message.geoPointValue != null && message.hasOwnProperty("geoPointValue")) { - object.geoPointValue = $root.google.type.LatLng.toObject(message.geoPointValue, options); - if (options.oneofs) - object.valueType = "geoPointValue"; - } - if (message.arrayValue != null && message.hasOwnProperty("arrayValue")) { - object.arrayValue = $root.google.firestore.v1.ArrayValue.toObject(message.arrayValue, options); - if (options.oneofs) - object.valueType = "arrayValue"; - } - if (message.timestampValue != null && message.hasOwnProperty("timestampValue")) { - object.timestampValue = $root.google.protobuf.Timestamp.toObject(message.timestampValue, options); - if (options.oneofs) - object.valueType = "timestampValue"; - } - if (message.nullValue != null && message.hasOwnProperty("nullValue")) { - object.nullValue = options.enums === String ? $root.google.protobuf.NullValue[message.nullValue] === undefined ? message.nullValue : $root.google.protobuf.NullValue[message.nullValue] : message.nullValue; - if (options.oneofs) - object.valueType = "nullValue"; - } - if (message.stringValue != null && message.hasOwnProperty("stringValue")) { - object.stringValue = message.stringValue; + if (message.readOnly != null && message.hasOwnProperty("readOnly")) { + object.readOnly = $root.google.firestore.v1.TransactionOptions.ReadOnly.toObject(message.readOnly, options); if (options.oneofs) - object.valueType = "stringValue"; + object.mode = "readOnly"; } - if (message.bytesValue != null && message.hasOwnProperty("bytesValue")) { - object.bytesValue = options.bytes === String ? $util.base64.encode(message.bytesValue, 0, message.bytesValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.bytesValue) : message.bytesValue; + if (message.readWrite != null && message.hasOwnProperty("readWrite")) { + object.readWrite = $root.google.firestore.v1.TransactionOptions.ReadWrite.toObject(message.readWrite, options); if (options.oneofs) - object.valueType = "bytesValue"; + object.mode = "readWrite"; } return object; }; - + /** - * Converts this Value to JSON. + * Converts this TransactionOptions to JSON. * @function toJSON - * @memberof google.firestore.v1.Value + * @memberof google.firestore.v1.TransactionOptions * @instance * @returns {Object.} JSON object */ - Value.prototype.toJSON = function toJSON() { + TransactionOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - + /** - * Gets the default type url for Value + * Gets the default type url for TransactionOptions * @function getTypeUrl - * @memberof google.firestore.v1.Value + * @memberof google.firestore.v1.TransactionOptions * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + TransactionOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.firestore.v1.Value"; + return typeUrlPrefix + "/google.firestore.v1.TransactionOptions"; }; - - return Value; - })(); - - v1.ArrayValue = (function() { - - /** - * Properties of an ArrayValue. - * @memberof google.firestore.v1 - * @interface IArrayValue - * @property {Array.|null} [values] ArrayValue values - */ - - /** - * Constructs a new ArrayValue. - * @memberof google.firestore.v1 - * @classdesc Represents an ArrayValue. - * @implements IArrayValue - * @constructor - * @param {google.firestore.v1.IArrayValue=} [properties] Properties to set - */ - function ArrayValue(properties) { - this.values = []; - 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]]; - } - - /** - * ArrayValue values. - * @member {Array.} values - * @memberof google.firestore.v1.ArrayValue - * @instance - */ - ArrayValue.prototype.values = $util.emptyArray; - - /** - * Creates an ArrayValue message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.firestore.v1.ArrayValue - * @static - * @param {Object.} object Plain object - * @returns {google.firestore.v1.ArrayValue} ArrayValue - */ - ArrayValue.fromObject = function fromObject(object) { - if (object instanceof $root.google.firestore.v1.ArrayValue) + + TransactionOptions.ReadWrite = (function() { + + /** + * Properties of a ReadWrite. + * @memberof google.firestore.v1.TransactionOptions + * @interface IReadWrite + * @property {Uint8Array|null} [retryTransaction] ReadWrite retryTransaction + */ + + /** + * Constructs a new ReadWrite. + * @memberof google.firestore.v1.TransactionOptions + * @classdesc Represents a ReadWrite. + * @implements IReadWrite + * @constructor + * @param {google.firestore.v1.TransactionOptions.IReadWrite=} [properties] Properties to set + */ + function ReadWrite(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]]; + } + + /** + * ReadWrite retryTransaction. + * @member {Uint8Array} retryTransaction + * @memberof google.firestore.v1.TransactionOptions.ReadWrite + * @instance + */ + ReadWrite.prototype.retryTransaction = $util.newBuffer([]); + + /** + * Creates a new ReadWrite instance using the specified properties. + * @function create + * @memberof google.firestore.v1.TransactionOptions.ReadWrite + * @static + * @param {google.firestore.v1.TransactionOptions.IReadWrite=} [properties] Properties to set + * @returns {google.firestore.v1.TransactionOptions.ReadWrite} ReadWrite instance + */ + ReadWrite.create = function create(properties) { + return new ReadWrite(properties); + }; + + /** + * Encodes the specified ReadWrite message. Does not implicitly {@link google.firestore.v1.TransactionOptions.ReadWrite.verify|verify} messages. + * @function encode + * @memberof google.firestore.v1.TransactionOptions.ReadWrite + * @static + * @param {google.firestore.v1.TransactionOptions.IReadWrite} message ReadWrite message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadWrite.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.retryTransaction != null && Object.hasOwnProperty.call(message, "retryTransaction")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.retryTransaction); + return writer; + }; + + /** + * Encodes the specified ReadWrite message, length delimited. Does not implicitly {@link google.firestore.v1.TransactionOptions.ReadWrite.verify|verify} messages. + * @function encodeDelimited + * @memberof google.firestore.v1.TransactionOptions.ReadWrite + * @static + * @param {google.firestore.v1.TransactionOptions.IReadWrite} message ReadWrite message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadWrite.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReadWrite message from the specified reader or buffer. + * @function decode + * @memberof google.firestore.v1.TransactionOptions.ReadWrite + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.firestore.v1.TransactionOptions.ReadWrite} ReadWrite + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadWrite.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.firestore.v1.TransactionOptions.ReadWrite(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.retryTransaction = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReadWrite message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.firestore.v1.TransactionOptions.ReadWrite + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.firestore.v1.TransactionOptions.ReadWrite} ReadWrite + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadWrite.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReadWrite message. + * @function verify + * @memberof google.firestore.v1.TransactionOptions.ReadWrite + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReadWrite.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.retryTransaction != null && message.hasOwnProperty("retryTransaction")) + if (!(message.retryTransaction && typeof message.retryTransaction.length === "number" || $util.isString(message.retryTransaction))) + return "retryTransaction: buffer expected"; + return null; + }; + + /** + * Creates a ReadWrite message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.firestore.v1.TransactionOptions.ReadWrite + * @static + * @param {Object.} object Plain object + * @returns {google.firestore.v1.TransactionOptions.ReadWrite} ReadWrite + */ + ReadWrite.fromObject = function fromObject(object) { + if (object instanceof $root.google.firestore.v1.TransactionOptions.ReadWrite) + return object; + var message = new $root.google.firestore.v1.TransactionOptions.ReadWrite(); + if (object.retryTransaction != null) + if (typeof object.retryTransaction === "string") + $util.base64.decode(object.retryTransaction, message.retryTransaction = $util.newBuffer($util.base64.length(object.retryTransaction)), 0); + else if (object.retryTransaction.length >= 0) + message.retryTransaction = object.retryTransaction; + return message; + }; + + /** + * Creates a plain object from a ReadWrite message. Also converts values to other types if specified. + * @function toObject + * @memberof google.firestore.v1.TransactionOptions.ReadWrite + * @static + * @param {google.firestore.v1.TransactionOptions.ReadWrite} message ReadWrite + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReadWrite.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if (options.bytes === String) + object.retryTransaction = ""; + else { + object.retryTransaction = []; + if (options.bytes !== Array) + object.retryTransaction = $util.newBuffer(object.retryTransaction); + } + if (message.retryTransaction != null && message.hasOwnProperty("retryTransaction")) + object.retryTransaction = options.bytes === String ? $util.base64.encode(message.retryTransaction, 0, message.retryTransaction.length) : options.bytes === Array ? Array.prototype.slice.call(message.retryTransaction) : message.retryTransaction; return object; - var message = new $root.google.firestore.v1.ArrayValue(); - if (object.values) { - if (!Array.isArray(object.values)) - throw TypeError(".google.firestore.v1.ArrayValue.values: array expected"); - message.values = []; - for (var i = 0; i < object.values.length; ++i) { - if (typeof object.values[i] !== "object") - throw TypeError(".google.firestore.v1.ArrayValue.values: object expected"); - message.values[i] = $root.google.firestore.v1.Value.fromObject(object.values[i]); + }; + + /** + * Converts this ReadWrite to JSON. + * @function toJSON + * @memberof google.firestore.v1.TransactionOptions.ReadWrite + * @instance + * @returns {Object.} JSON object + */ + ReadWrite.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReadWrite + * @function getTypeUrl + * @memberof google.firestore.v1.TransactionOptions.ReadWrite + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReadWrite.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; } + return typeUrlPrefix + "/google.firestore.v1.TransactionOptions.ReadWrite"; + }; + + return ReadWrite; + })(); + + TransactionOptions.ReadOnly = (function() { + + /** + * Properties of a ReadOnly. + * @memberof google.firestore.v1.TransactionOptions + * @interface IReadOnly + * @property {google.protobuf.ITimestamp|null} [readTime] ReadOnly readTime + */ + + /** + * Constructs a new ReadOnly. + * @memberof google.firestore.v1.TransactionOptions + * @classdesc Represents a ReadOnly. + * @implements IReadOnly + * @constructor + * @param {google.firestore.v1.TransactionOptions.IReadOnly=} [properties] Properties to set + */ + function ReadOnly(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]]; } - return message; - }; - - /** - * Creates a plain object from an ArrayValue message. Also converts values to other types if specified. - * @function toObject - * @memberof google.firestore.v1.ArrayValue - * @static - * @param {google.firestore.v1.ArrayValue} message ArrayValue - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ArrayValue.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.values = []; - if (message.values && message.values.length) { - object.values = []; - for (var j = 0; j < message.values.length; ++j) - object.values[j] = $root.google.firestore.v1.Value.toObject(message.values[j], options); - } - return object; - }; - - /** - * Converts this ArrayValue to JSON. - * @function toJSON - * @memberof google.firestore.v1.ArrayValue - * @instance - * @returns {Object.} JSON object - */ - ArrayValue.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ArrayValue - * @function getTypeUrl - * @memberof google.firestore.v1.ArrayValue - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ArrayValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.firestore.v1.ArrayValue"; - }; - - return ArrayValue; - })(); - - v1.MapValue = (function() { - - /** - * Properties of a MapValue. - * @memberof google.firestore.v1 - * @interface IMapValue - * @property {Object.|null} [fields] MapValue fields - */ - - /** - * Constructs a new MapValue. - * @memberof google.firestore.v1 - * @classdesc Represents a MapValue. - * @implements IMapValue - * @constructor - * @param {google.firestore.v1.IMapValue=} [properties] Properties to set - */ - function MapValue(properties) { - this.fields = {}; - 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]]; - } - - /** - * MapValue fields. - * @member {Object.} fields - * @memberof google.firestore.v1.MapValue - * @instance - */ - MapValue.prototype.fields = $util.emptyObject; - - /** - * Creates a MapValue message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.firestore.v1.MapValue - * @static - * @param {Object.} object Plain object - * @returns {google.firestore.v1.MapValue} MapValue - */ - MapValue.fromObject = function fromObject(object) { - if (object instanceof $root.google.firestore.v1.MapValue) + + /** + * ReadOnly readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.firestore.v1.TransactionOptions.ReadOnly + * @instance + */ + ReadOnly.prototype.readTime = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ReadOnly consistencySelector. + * @member {"readTime"|undefined} consistencySelector + * @memberof google.firestore.v1.TransactionOptions.ReadOnly + * @instance + */ + Object.defineProperty(ReadOnly.prototype, "consistencySelector", { + get: $util.oneOfGetter($oneOfFields = ["readTime"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ReadOnly instance using the specified properties. + * @function create + * @memberof google.firestore.v1.TransactionOptions.ReadOnly + * @static + * @param {google.firestore.v1.TransactionOptions.IReadOnly=} [properties] Properties to set + * @returns {google.firestore.v1.TransactionOptions.ReadOnly} ReadOnly instance + */ + ReadOnly.create = function create(properties) { + return new ReadOnly(properties); + }; + + /** + * Encodes the specified ReadOnly message. Does not implicitly {@link google.firestore.v1.TransactionOptions.ReadOnly.verify|verify} messages. + * @function encode + * @memberof google.firestore.v1.TransactionOptions.ReadOnly + * @static + * @param {google.firestore.v1.TransactionOptions.IReadOnly} message ReadOnly message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadOnly.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ReadOnly message, length delimited. Does not implicitly {@link google.firestore.v1.TransactionOptions.ReadOnly.verify|verify} messages. + * @function encodeDelimited + * @memberof google.firestore.v1.TransactionOptions.ReadOnly + * @static + * @param {google.firestore.v1.TransactionOptions.IReadOnly} message ReadOnly message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadOnly.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReadOnly message from the specified reader or buffer. + * @function decode + * @memberof google.firestore.v1.TransactionOptions.ReadOnly + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.firestore.v1.TransactionOptions.ReadOnly} ReadOnly + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadOnly.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.firestore.v1.TransactionOptions.ReadOnly(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReadOnly message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.firestore.v1.TransactionOptions.ReadOnly + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.firestore.v1.TransactionOptions.ReadOnly} ReadOnly + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadOnly.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReadOnly message. + * @function verify + * @memberof google.firestore.v1.TransactionOptions.ReadOnly + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReadOnly.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.readTime != null && message.hasOwnProperty("readTime")) { + properties.consistencySelector = 1; + { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; + } + } + return null; + }; + + /** + * Creates a ReadOnly message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.firestore.v1.TransactionOptions.ReadOnly + * @static + * @param {Object.} object Plain object + * @returns {google.firestore.v1.TransactionOptions.ReadOnly} ReadOnly + */ + ReadOnly.fromObject = function fromObject(object) { + if (object instanceof $root.google.firestore.v1.TransactionOptions.ReadOnly) + return object; + var message = new $root.google.firestore.v1.TransactionOptions.ReadOnly(); + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.firestore.v1.TransactionOptions.ReadOnly.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); + } + return message; + }; + + /** + * Creates a plain object from a ReadOnly message. Also converts values to other types if specified. + * @function toObject + * @memberof google.firestore.v1.TransactionOptions.ReadOnly + * @static + * @param {google.firestore.v1.TransactionOptions.ReadOnly} message ReadOnly + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReadOnly.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.readTime != null && message.hasOwnProperty("readTime")) { + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + if (options.oneofs) + object.consistencySelector = "readTime"; + } return object; - var message = new $root.google.firestore.v1.MapValue(); - if (object.fields) { - if (typeof object.fields !== "object") - throw TypeError(".google.firestore.v1.MapValue.fields: object expected"); - message.fields = {}; - for (var keys = Object.keys(object.fields), i = 0; i < keys.length; ++i) { - if (typeof object.fields[keys[i]] !== "object") - throw TypeError(".google.firestore.v1.MapValue.fields: object expected"); - message.fields[keys[i]] = $root.google.firestore.v1.Value.fromObject(object.fields[keys[i]]); + }; + + /** + * Converts this ReadOnly to JSON. + * @function toJSON + * @memberof google.firestore.v1.TransactionOptions.ReadOnly + * @instance + * @returns {Object.} JSON object + */ + ReadOnly.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReadOnly + * @function getTypeUrl + * @memberof google.firestore.v1.TransactionOptions.ReadOnly + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReadOnly.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; } - } - return message; - }; - - /** - * Creates a plain object from a MapValue message. Also converts values to other types if specified. - * @function toObject - * @memberof google.firestore.v1.MapValue - * @static - * @param {google.firestore.v1.MapValue} message MapValue - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MapValue.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.fields = {}; - var keys2; - if (message.fields && (keys2 = Object.keys(message.fields)).length) { - object.fields = {}; - for (var j = 0; j < keys2.length; ++j) - object.fields[keys2[j]] = $root.google.firestore.v1.Value.toObject(message.fields[keys2[j]], options); - } - return object; - }; - - /** - * Converts this MapValue to JSON. - * @function toJSON - * @memberof google.firestore.v1.MapValue - * @instance - * @returns {Object.} JSON object - */ - MapValue.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MapValue - * @function getTypeUrl - * @memberof google.firestore.v1.MapValue - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MapValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.firestore.v1.MapValue"; - }; - - return MapValue; + return typeUrlPrefix + "/google.firestore.v1.TransactionOptions.ReadOnly"; + }; + + return ReadOnly; + })(); + + return TransactionOptions; })(); - + v1.Firestore = (function() { - + /** * Constructs a new Firestore service. * @memberof google.firestore.v1 @@ -9063,18 +18847,32 @@ function Firestore(rpcImpl, requestDelimited, responseDelimited) { $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); } - + (Firestore.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Firestore; - + + /** + * Creates new Firestore service using the specified rpc implementation. + * @function create + * @memberof google.firestore.v1.Firestore + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Firestore} RPC service. Useful where requests and/or responses are streamed. + */ + Firestore.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + /** - * Callback as used by {@link google.firestore.v1.Firestore#getDocument}. + * Callback as used by {@link google.firestore.v1.Firestore|getDocument}. * @memberof google.firestore.v1.Firestore * @typedef GetDocumentCallback * @type {function} * @param {Error|null} error Error, if any * @param {google.firestore.v1.Document} [response] Document */ - + /** * Calls GetDocument. * @function getDocument @@ -9088,7 +18886,7 @@ Object.defineProperty(Firestore.prototype.getDocument = function getDocument(request, callback) { return this.rpcCall(getDocument, $root.google.firestore.v1.GetDocumentRequest, $root.google.firestore.v1.Document, request, callback); }, "name", { value: "GetDocument" }); - + /** * Calls GetDocument. * @function getDocument @@ -9098,16 +18896,16 @@ * @returns {Promise} Promise * @variation 2 */ - + /** - * Callback as used by {@link google.firestore.v1.Firestore#listDocuments}. + * Callback as used by {@link google.firestore.v1.Firestore|listDocuments}. * @memberof google.firestore.v1.Firestore * @typedef ListDocumentsCallback * @type {function} * @param {Error|null} error Error, if any * @param {google.firestore.v1.ListDocumentsResponse} [response] ListDocumentsResponse */ - + /** * Calls ListDocuments. * @function listDocuments @@ -9121,7 +18919,7 @@ Object.defineProperty(Firestore.prototype.listDocuments = function listDocuments(request, callback) { return this.rpcCall(listDocuments, $root.google.firestore.v1.ListDocumentsRequest, $root.google.firestore.v1.ListDocumentsResponse, request, callback); }, "name", { value: "ListDocuments" }); - + /** * Calls ListDocuments. * @function listDocuments @@ -9131,16 +18929,16 @@ * @returns {Promise} Promise * @variation 2 */ - + /** - * Callback as used by {@link google.firestore.v1.Firestore#updateDocument}. + * Callback as used by {@link google.firestore.v1.Firestore|updateDocument}. * @memberof google.firestore.v1.Firestore * @typedef UpdateDocumentCallback * @type {function} * @param {Error|null} error Error, if any * @param {google.firestore.v1.Document} [response] Document */ - + /** * Calls UpdateDocument. * @function updateDocument @@ -9154,7 +18952,7 @@ Object.defineProperty(Firestore.prototype.updateDocument = function updateDocument(request, callback) { return this.rpcCall(updateDocument, $root.google.firestore.v1.UpdateDocumentRequest, $root.google.firestore.v1.Document, request, callback); }, "name", { value: "UpdateDocument" }); - + /** * Calls UpdateDocument. * @function updateDocument @@ -9164,16 +18962,16 @@ * @returns {Promise} Promise * @variation 2 */ - + /** - * Callback as used by {@link google.firestore.v1.Firestore#deleteDocument}. + * Callback as used by {@link google.firestore.v1.Firestore|deleteDocument}. * @memberof google.firestore.v1.Firestore * @typedef DeleteDocumentCallback * @type {function} * @param {Error|null} error Error, if any * @param {google.protobuf.Empty} [response] Empty */ - + /** * Calls DeleteDocument. * @function deleteDocument @@ -9187,7 +18985,7 @@ Object.defineProperty(Firestore.prototype.deleteDocument = function deleteDocument(request, callback) { return this.rpcCall(deleteDocument, $root.google.firestore.v1.DeleteDocumentRequest, $root.google.protobuf.Empty, request, callback); }, "name", { value: "DeleteDocument" }); - + /** * Calls DeleteDocument. * @function deleteDocument @@ -9197,16 +18995,16 @@ * @returns {Promise} Promise * @variation 2 */ - + /** - * Callback as used by {@link google.firestore.v1.Firestore#batchGetDocuments}. + * Callback as used by {@link google.firestore.v1.Firestore|batchGetDocuments}. * @memberof google.firestore.v1.Firestore * @typedef BatchGetDocumentsCallback * @type {function} * @param {Error|null} error Error, if any * @param {google.firestore.v1.BatchGetDocumentsResponse} [response] BatchGetDocumentsResponse */ - + /** * Calls BatchGetDocuments. * @function batchGetDocuments @@ -9220,7 +19018,7 @@ Object.defineProperty(Firestore.prototype.batchGetDocuments = function batchGetDocuments(request, callback) { return this.rpcCall(batchGetDocuments, $root.google.firestore.v1.BatchGetDocumentsRequest, $root.google.firestore.v1.BatchGetDocumentsResponse, request, callback); }, "name", { value: "BatchGetDocuments" }); - + /** * Calls BatchGetDocuments. * @function batchGetDocuments @@ -9230,16 +19028,16 @@ * @returns {Promise} Promise * @variation 2 */ - + /** - * Callback as used by {@link google.firestore.v1.Firestore#beginTransaction}. + * Callback as used by {@link google.firestore.v1.Firestore|beginTransaction}. * @memberof google.firestore.v1.Firestore * @typedef BeginTransactionCallback * @type {function} * @param {Error|null} error Error, if any * @param {google.firestore.v1.BeginTransactionResponse} [response] BeginTransactionResponse */ - + /** * Calls BeginTransaction. * @function beginTransaction @@ -9253,7 +19051,7 @@ Object.defineProperty(Firestore.prototype.beginTransaction = function beginTransaction(request, callback) { return this.rpcCall(beginTransaction, $root.google.firestore.v1.BeginTransactionRequest, $root.google.firestore.v1.BeginTransactionResponse, request, callback); }, "name", { value: "BeginTransaction" }); - + /** * Calls BeginTransaction. * @function beginTransaction @@ -9263,16 +19061,16 @@ * @returns {Promise} Promise * @variation 2 */ - + /** - * Callback as used by {@link google.firestore.v1.Firestore#commit}. + * Callback as used by {@link google.firestore.v1.Firestore|commit}. * @memberof google.firestore.v1.Firestore * @typedef CommitCallback * @type {function} * @param {Error|null} error Error, if any * @param {google.firestore.v1.CommitResponse} [response] CommitResponse */ - + /** * Calls Commit. * @function commit @@ -9286,7 +19084,7 @@ Object.defineProperty(Firestore.prototype.commit = function commit(request, callback) { return this.rpcCall(commit, $root.google.firestore.v1.CommitRequest, $root.google.firestore.v1.CommitResponse, request, callback); }, "name", { value: "Commit" }); - + /** * Calls Commit. * @function commit @@ -9296,16 +19094,16 @@ * @returns {Promise} Promise * @variation 2 */ - + /** - * Callback as used by {@link google.firestore.v1.Firestore#rollback}. + * Callback as used by {@link google.firestore.v1.Firestore|rollback}. * @memberof google.firestore.v1.Firestore * @typedef RollbackCallback * @type {function} * @param {Error|null} error Error, if any * @param {google.protobuf.Empty} [response] Empty */ - + /** * Calls Rollback. * @function rollback @@ -9319,7 +19117,7 @@ Object.defineProperty(Firestore.prototype.rollback = function rollback(request, callback) { return this.rpcCall(rollback, $root.google.firestore.v1.RollbackRequest, $root.google.protobuf.Empty, request, callback); }, "name", { value: "Rollback" }); - + /** * Calls Rollback. * @function rollback @@ -9329,16 +19127,16 @@ * @returns {Promise} Promise * @variation 2 */ - + /** - * Callback as used by {@link google.firestore.v1.Firestore#runQuery}. + * Callback as used by {@link google.firestore.v1.Firestore|runQuery}. * @memberof google.firestore.v1.Firestore * @typedef RunQueryCallback * @type {function} * @param {Error|null} error Error, if any * @param {google.firestore.v1.RunQueryResponse} [response] RunQueryResponse */ - + /** * Calls RunQuery. * @function runQuery @@ -9352,7 +19150,7 @@ Object.defineProperty(Firestore.prototype.runQuery = function runQuery(request, callback) { return this.rpcCall(runQuery, $root.google.firestore.v1.RunQueryRequest, $root.google.firestore.v1.RunQueryResponse, request, callback); }, "name", { value: "RunQuery" }); - + /** * Calls RunQuery. * @function runQuery @@ -9362,16 +19160,16 @@ * @returns {Promise} Promise * @variation 2 */ - + /** - * Callback as used by {@link google.firestore.v1.Firestore#runAggregationQuery}. + * Callback as used by {@link google.firestore.v1.Firestore|runAggregationQuery}. * @memberof google.firestore.v1.Firestore * @typedef RunAggregationQueryCallback * @type {function} * @param {Error|null} error Error, if any * @param {google.firestore.v1.RunAggregationQueryResponse} [response] RunAggregationQueryResponse */ - + /** * Calls RunAggregationQuery. * @function runAggregationQuery @@ -9385,7 +19183,7 @@ Object.defineProperty(Firestore.prototype.runAggregationQuery = function runAggregationQuery(request, callback) { return this.rpcCall(runAggregationQuery, $root.google.firestore.v1.RunAggregationQueryRequest, $root.google.firestore.v1.RunAggregationQueryResponse, request, callback); }, "name", { value: "RunAggregationQuery" }); - + /** * Calls RunAggregationQuery. * @function runAggregationQuery @@ -9395,16 +19193,16 @@ * @returns {Promise} Promise * @variation 2 */ - + /** - * Callback as used by {@link google.firestore.v1.Firestore#partitionQuery}. + * Callback as used by {@link google.firestore.v1.Firestore|partitionQuery}. * @memberof google.firestore.v1.Firestore * @typedef PartitionQueryCallback * @type {function} * @param {Error|null} error Error, if any * @param {google.firestore.v1.PartitionQueryResponse} [response] PartitionQueryResponse */ - + /** * Calls PartitionQuery. * @function partitionQuery @@ -9418,7 +19216,7 @@ Object.defineProperty(Firestore.prototype.partitionQuery = function partitionQuery(request, callback) { return this.rpcCall(partitionQuery, $root.google.firestore.v1.PartitionQueryRequest, $root.google.firestore.v1.PartitionQueryResponse, request, callback); }, "name", { value: "PartitionQuery" }); - + /** * Calls PartitionQuery. * @function partitionQuery @@ -9428,16 +19226,16 @@ * @returns {Promise} Promise * @variation 2 */ - + /** - * Callback as used by {@link google.firestore.v1.Firestore#write}. + * Callback as used by {@link google.firestore.v1.Firestore|write}. * @memberof google.firestore.v1.Firestore * @typedef WriteCallback * @type {function} * @param {Error|null} error Error, if any * @param {google.firestore.v1.WriteResponse} [response] WriteResponse */ - + /** * Calls Write. * @function write @@ -9451,7 +19249,7 @@ Object.defineProperty(Firestore.prototype.write = function write(request, callback) { return this.rpcCall(write, $root.google.firestore.v1.WriteRequest, $root.google.firestore.v1.WriteResponse, request, callback); }, "name", { value: "Write" }); - + /** * Calls Write. * @function write @@ -9461,16 +19259,16 @@ * @returns {Promise} Promise * @variation 2 */ - + /** - * Callback as used by {@link google.firestore.v1.Firestore#listen}. + * Callback as used by {@link google.firestore.v1.Firestore|listen}. * @memberof google.firestore.v1.Firestore * @typedef ListenCallback * @type {function} * @param {Error|null} error Error, if any * @param {google.firestore.v1.ListenResponse} [response] ListenResponse */ - + /** * Calls Listen. * @function listen @@ -9484,7 +19282,7 @@ Object.defineProperty(Firestore.prototype.listen = function listen(request, callback) { return this.rpcCall(listen, $root.google.firestore.v1.ListenRequest, $root.google.firestore.v1.ListenResponse, request, callback); }, "name", { value: "Listen" }); - + /** * Calls Listen. * @function listen @@ -9494,16 +19292,16 @@ * @returns {Promise} Promise * @variation 2 */ - + /** - * Callback as used by {@link google.firestore.v1.Firestore#listCollectionIds}. + * Callback as used by {@link google.firestore.v1.Firestore|listCollectionIds}. * @memberof google.firestore.v1.Firestore * @typedef ListCollectionIdsCallback * @type {function} * @param {Error|null} error Error, if any * @param {google.firestore.v1.ListCollectionIdsResponse} [response] ListCollectionIdsResponse */ - + /** * Calls ListCollectionIds. * @function listCollectionIds @@ -9517,7 +19315,7 @@ Object.defineProperty(Firestore.prototype.listCollectionIds = function listCollectionIds(request, callback) { return this.rpcCall(listCollectionIds, $root.google.firestore.v1.ListCollectionIdsRequest, $root.google.firestore.v1.ListCollectionIdsResponse, request, callback); }, "name", { value: "ListCollectionIds" }); - + /** * Calls ListCollectionIds. * @function listCollectionIds @@ -9527,16 +19325,16 @@ * @returns {Promise} Promise * @variation 2 */ - + /** - * Callback as used by {@link google.firestore.v1.Firestore#batchWrite}. + * Callback as used by {@link google.firestore.v1.Firestore|batchWrite}. * @memberof google.firestore.v1.Firestore * @typedef BatchWriteCallback * @type {function} * @param {Error|null} error Error, if any * @param {google.firestore.v1.BatchWriteResponse} [response] BatchWriteResponse */ - + /** * Calls BatchWrite. * @function batchWrite @@ -9550,7 +19348,7 @@ Object.defineProperty(Firestore.prototype.batchWrite = function batchWrite(request, callback) { return this.rpcCall(batchWrite, $root.google.firestore.v1.BatchWriteRequest, $root.google.firestore.v1.BatchWriteResponse, request, callback); }, "name", { value: "BatchWrite" }); - + /** * Calls BatchWrite. * @function batchWrite @@ -9560,16 +19358,16 @@ * @returns {Promise} Promise * @variation 2 */ - + /** - * Callback as used by {@link google.firestore.v1.Firestore#createDocument}. + * Callback as used by {@link google.firestore.v1.Firestore|createDocument}. * @memberof google.firestore.v1.Firestore * @typedef CreateDocumentCallback * @type {function} * @param {Error|null} error Error, if any * @param {google.firestore.v1.Document} [response] Document */ - + /** * Calls CreateDocument. * @function createDocument @@ -9583,7 +19381,7 @@ Object.defineProperty(Firestore.prototype.createDocument = function createDocument(request, callback) { return this.rpcCall(createDocument, $root.google.firestore.v1.CreateDocumentRequest, $root.google.firestore.v1.Document, request, callback); }, "name", { value: "CreateDocument" }); - + /** * Calls CreateDocument. * @function createDocument @@ -9593,12 +19391,12 @@ * @returns {Promise} Promise * @variation 2 */ - + return Firestore; })(); - + v1.GetDocumentRequest = (function() { - + /** * Properties of a GetDocumentRequest. * @memberof google.firestore.v1 @@ -9608,7 +19406,7 @@ * @property {Uint8Array|null} [transaction] GetDocumentRequest transaction * @property {google.protobuf.ITimestamp|null} [readTime] GetDocumentRequest readTime */ - + /** * Constructs a new GetDocumentRequest. * @memberof google.firestore.v1 @@ -9623,7 +19421,7 @@ if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } - + /** * GetDocumentRequest name. * @member {string} name @@ -9631,7 +19429,7 @@ * @instance */ GetDocumentRequest.prototype.name = ""; - + /** * GetDocumentRequest mask. * @member {google.firestore.v1.IDocumentMask|null|undefined} mask @@ -9639,7 +19437,7 @@ * @instance */ GetDocumentRequest.prototype.mask = null; - + /** * GetDocumentRequest transaction. * @member {Uint8Array|null|undefined} transaction @@ -9647,7 +19445,7 @@ * @instance */ GetDocumentRequest.prototype.transaction = null; - + /** * GetDocumentRequest readTime. * @member {google.protobuf.ITimestamp|null|undefined} readTime @@ -9655,10 +19453,10 @@ * @instance */ GetDocumentRequest.prototype.readTime = null; - + // OneOf field names bound to virtual getters and setters var $oneOfFields; - + /** * GetDocumentRequest consistencySelector. * @member {"transaction"|"readTime"|undefined} consistencySelector @@ -9669,7 +19467,151 @@ get: $util.oneOfGetter($oneOfFields = ["transaction", "readTime"]), set: $util.oneOfSetter($oneOfFields) }); - + + /** + * Creates a new GetDocumentRequest instance using the specified properties. + * @function create + * @memberof google.firestore.v1.GetDocumentRequest + * @static + * @param {google.firestore.v1.IGetDocumentRequest=} [properties] Properties to set + * @returns {google.firestore.v1.GetDocumentRequest} GetDocumentRequest instance + */ + GetDocumentRequest.create = function create(properties) { + return new GetDocumentRequest(properties); + }; + + /** + * Encodes the specified GetDocumentRequest message. Does not implicitly {@link google.firestore.v1.GetDocumentRequest.verify|verify} messages. + * @function encode + * @memberof google.firestore.v1.GetDocumentRequest + * @static + * @param {google.firestore.v1.IGetDocumentRequest} message GetDocumentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDocumentRequest.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.mask != null && Object.hasOwnProperty.call(message, "mask")) + $root.google.firestore.v1.DocumentMask.encode(message.mask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.transaction != null && Object.hasOwnProperty.call(message, "transaction")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.transaction); + if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetDocumentRequest message, length delimited. Does not implicitly {@link google.firestore.v1.GetDocumentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.firestore.v1.GetDocumentRequest + * @static + * @param {google.firestore.v1.IGetDocumentRequest} message GetDocumentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDocumentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetDocumentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.firestore.v1.GetDocumentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.firestore.v1.GetDocumentRequest} GetDocumentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDocumentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.firestore.v1.GetDocumentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.mask = $root.google.firestore.v1.DocumentMask.decode(reader, reader.uint32()); + break; + } + case 3: { + message.transaction = reader.bytes(); + break; + } + case 5: { + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetDocumentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.firestore.v1.GetDocumentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.firestore.v1.GetDocumentRequest} GetDocumentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDocumentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetDocumentRequest message. + * @function verify + * @memberof google.firestore.v1.GetDocumentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetDocumentRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.mask != null && message.hasOwnProperty("mask")) { + var error = $root.google.firestore.v1.DocumentMask.verify(message.mask); + if (error) + return "mask." + error; + } + if (message.transaction != null && message.hasOwnProperty("transaction")) { + properties.consistencySelector = 1; + if (!(message.transaction && typeof message.transaction.length === "number" || $util.isString(message.transaction))) + return "transaction: buffer expected"; + } + if (message.readTime != null && message.hasOwnProperty("readTime")) { + if (properties.consistencySelector === 1) + return "consistencySelector: multiple values"; + properties.consistencySelector = 1; + { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; + } + } + return null; + }; + /** * Creates a GetDocumentRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject @@ -9701,7 +19643,7 @@ } return message; }; - + /** * Creates a plain object from a GetDocumentRequest message. Also converts values to other types if specified. * @function toObject @@ -9735,7 +19677,7 @@ } return object; }; - + /** * Converts this GetDocumentRequest to JSON. * @function toJSON @@ -9746,7 +19688,7 @@ GetDocumentRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - + /** * Gets the default type url for GetDocumentRequest * @function getTypeUrl @@ -9761,12 +19703,12 @@ } return typeUrlPrefix + "/google.firestore.v1.GetDocumentRequest"; }; - + return GetDocumentRequest; })(); - + v1.ListDocumentsRequest = (function() { - + /** * Properties of a ListDocumentsRequest. * @memberof google.firestore.v1 @@ -9781,7 +19723,7 @@ * @property {google.protobuf.ITimestamp|null} [readTime] ListDocumentsRequest readTime * @property {boolean|null} [showMissing] ListDocumentsRequest showMissing */ - + /** * Constructs a new ListDocumentsRequest. * @memberof google.firestore.v1 @@ -9796,7 +19738,7 @@ if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } - + /** * ListDocumentsRequest parent. * @member {string} parent @@ -9804,7 +19746,7 @@ * @instance */ ListDocumentsRequest.prototype.parent = ""; - + /** * ListDocumentsRequest collectionId. * @member {string} collectionId @@ -9812,7 +19754,7 @@ * @instance */ ListDocumentsRequest.prototype.collectionId = ""; - + /** * ListDocumentsRequest pageSize. * @member {number} pageSize @@ -9820,7 +19762,7 @@ * @instance */ ListDocumentsRequest.prototype.pageSize = 0; - + /** * ListDocumentsRequest pageToken. * @member {string} pageToken @@ -9828,7 +19770,7 @@ * @instance */ ListDocumentsRequest.prototype.pageToken = ""; - + /** * ListDocumentsRequest orderBy. * @member {string} orderBy @@ -9836,7 +19778,7 @@ * @instance */ ListDocumentsRequest.prototype.orderBy = ""; - + /** * ListDocumentsRequest mask. * @member {google.firestore.v1.IDocumentMask|null|undefined} mask @@ -9844,7 +19786,7 @@ * @instance */ ListDocumentsRequest.prototype.mask = null; - + /** * ListDocumentsRequest transaction. * @member {Uint8Array|null|undefined} transaction @@ -9852,37 +19794,226 @@ * @instance */ ListDocumentsRequest.prototype.transaction = null; - + /** * ListDocumentsRequest readTime. * @member {google.protobuf.ITimestamp|null|undefined} readTime * @memberof google.firestore.v1.ListDocumentsRequest - * @instance + * @instance + */ + ListDocumentsRequest.prototype.readTime = null; + + /** + * ListDocumentsRequest showMissing. + * @member {boolean} showMissing + * @memberof google.firestore.v1.ListDocumentsRequest + * @instance + */ + ListDocumentsRequest.prototype.showMissing = false; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ListDocumentsRequest consistencySelector. + * @member {"transaction"|"readTime"|undefined} consistencySelector + * @memberof google.firestore.v1.ListDocumentsRequest + * @instance + */ + Object.defineProperty(ListDocumentsRequest.prototype, "consistencySelector", { + get: $util.oneOfGetter($oneOfFields = ["transaction", "readTime"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ListDocumentsRequest instance using the specified properties. + * @function create + * @memberof google.firestore.v1.ListDocumentsRequest + * @static + * @param {google.firestore.v1.IListDocumentsRequest=} [properties] Properties to set + * @returns {google.firestore.v1.ListDocumentsRequest} ListDocumentsRequest instance + */ + ListDocumentsRequest.create = function create(properties) { + return new ListDocumentsRequest(properties); + }; + + /** + * Encodes the specified ListDocumentsRequest message. Does not implicitly {@link google.firestore.v1.ListDocumentsRequest.verify|verify} messages. + * @function encode + * @memberof google.firestore.v1.ListDocumentsRequest + * @static + * @param {google.firestore.v1.IListDocumentsRequest} message ListDocumentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDocumentsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.collectionId != null && Object.hasOwnProperty.call(message, "collectionId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.collectionId); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.orderBy); + if (message.mask != null && Object.hasOwnProperty.call(message, "mask")) + $root.google.firestore.v1.DocumentMask.encode(message.mask, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.transaction != null && Object.hasOwnProperty.call(message, "transaction")) + writer.uint32(/* id 8, wireType 2 =*/66).bytes(message.transaction); + if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.showMissing != null && Object.hasOwnProperty.call(message, "showMissing")) + writer.uint32(/* id 12, wireType 0 =*/96).bool(message.showMissing); + return writer; + }; + + /** + * Encodes the specified ListDocumentsRequest message, length delimited. Does not implicitly {@link google.firestore.v1.ListDocumentsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.firestore.v1.ListDocumentsRequest + * @static + * @param {google.firestore.v1.IListDocumentsRequest} message ListDocumentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - ListDocumentsRequest.prototype.readTime = null; - + ListDocumentsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + /** - * ListDocumentsRequest showMissing. - * @member {boolean} showMissing + * Decodes a ListDocumentsRequest message from the specified reader or buffer. + * @function decode * @memberof google.firestore.v1.ListDocumentsRequest - * @instance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.firestore.v1.ListDocumentsRequest} ListDocumentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDocumentsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.firestore.v1.ListDocumentsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.collectionId = reader.string(); + break; + } + case 3: { + message.pageSize = reader.int32(); + break; + } + case 4: { + message.pageToken = reader.string(); + break; + } + case 6: { + message.orderBy = reader.string(); + break; + } + case 7: { + message.mask = $root.google.firestore.v1.DocumentMask.decode(reader, reader.uint32()); + break; + } + case 8: { + message.transaction = reader.bytes(); + break; + } + case 10: { + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 12: { + message.showMissing = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListDocumentsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.firestore.v1.ListDocumentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.firestore.v1.ListDocumentsRequest} ListDocumentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListDocumentsRequest.prototype.showMissing = false; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - + ListDocumentsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + /** - * ListDocumentsRequest consistencySelector. - * @member {"transaction"|"readTime"|undefined} consistencySelector + * Verifies a ListDocumentsRequest message. + * @function verify * @memberof google.firestore.v1.ListDocumentsRequest - * @instance + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Object.defineProperty(ListDocumentsRequest.prototype, "consistencySelector", { - get: $util.oneOfGetter($oneOfFields = ["transaction", "readTime"]), - set: $util.oneOfSetter($oneOfFields) - }); - + ListDocumentsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.collectionId != null && message.hasOwnProperty("collectionId")) + if (!$util.isString(message.collectionId)) + return "collectionId: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + if (message.mask != null && message.hasOwnProperty("mask")) { + var error = $root.google.firestore.v1.DocumentMask.verify(message.mask); + if (error) + return "mask." + error; + } + if (message.transaction != null && message.hasOwnProperty("transaction")) { + properties.consistencySelector = 1; + if (!(message.transaction && typeof message.transaction.length === "number" || $util.isString(message.transaction))) + return "transaction: buffer expected"; + } + if (message.readTime != null && message.hasOwnProperty("readTime")) { + if (properties.consistencySelector === 1) + return "consistencySelector: multiple values"; + properties.consistencySelector = 1; + { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; + } + } + if (message.showMissing != null && message.hasOwnProperty("showMissing")) + if (typeof message.showMissing !== "boolean") + return "showMissing: boolean expected"; + return null; + }; + /** * Creates a ListDocumentsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject @@ -9924,7 +20055,7 @@ message.showMissing = Boolean(object.showMissing); return message; }; - + /** * Creates a plain object from a ListDocumentsRequest message. Also converts values to other types if specified. * @function toObject @@ -9973,7 +20104,7 @@ object.showMissing = message.showMissing; return object; }; - + /** * Converts this ListDocumentsRequest to JSON. * @function toJSON @@ -9984,7 +20115,7 @@ ListDocumentsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - + /** * Gets the default type url for ListDocumentsRequest * @function getTypeUrl @@ -9999,12 +20130,12 @@ } return typeUrlPrefix + "/google.firestore.v1.ListDocumentsRequest"; }; - + return ListDocumentsRequest; })(); - + v1.ListDocumentsResponse = (function() { - + /** * Properties of a ListDocumentsResponse. * @memberof google.firestore.v1 @@ -10012,7 +20143,7 @@ * @property {Array.|null} [documents] ListDocumentsResponse documents * @property {string|null} [nextPageToken] ListDocumentsResponse nextPageToken */ - + /** * Constructs a new ListDocumentsResponse. * @memberof google.firestore.v1 @@ -10028,7 +20159,7 @@ if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } - + /** * ListDocumentsResponse documents. * @member {Array.} documents @@ -10036,7 +20167,7 @@ * @instance */ ListDocumentsResponse.prototype.documents = $util.emptyArray; - + /** * ListDocumentsResponse nextPageToken. * @member {string} nextPageToken @@ -10044,7 +20175,130 @@ * @instance */ ListDocumentsResponse.prototype.nextPageToken = ""; - + + /** + * Creates a new ListDocumentsResponse instance using the specified properties. + * @function create + * @memberof google.firestore.v1.ListDocumentsResponse + * @static + * @param {google.firestore.v1.IListDocumentsResponse=} [properties] Properties to set + * @returns {google.firestore.v1.ListDocumentsResponse} ListDocumentsResponse instance + */ + ListDocumentsResponse.create = function create(properties) { + return new ListDocumentsResponse(properties); + }; + + /** + * Encodes the specified ListDocumentsResponse message. Does not implicitly {@link google.firestore.v1.ListDocumentsResponse.verify|verify} messages. + * @function encode + * @memberof google.firestore.v1.ListDocumentsResponse + * @static + * @param {google.firestore.v1.IListDocumentsResponse} message ListDocumentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDocumentsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.documents != null && message.documents.length) + for (var i = 0; i < message.documents.length; ++i) + $root.google.firestore.v1.Document.encode(message.documents[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListDocumentsResponse message, length delimited. Does not implicitly {@link google.firestore.v1.ListDocumentsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.firestore.v1.ListDocumentsResponse + * @static + * @param {google.firestore.v1.IListDocumentsResponse} message ListDocumentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDocumentsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListDocumentsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.firestore.v1.ListDocumentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.firestore.v1.ListDocumentsResponse} ListDocumentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDocumentsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.firestore.v1.ListDocumentsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.documents && message.documents.length)) + message.documents = []; + message.documents.push($root.google.firestore.v1.Document.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListDocumentsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.firestore.v1.ListDocumentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.firestore.v1.ListDocumentsResponse} ListDocumentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDocumentsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListDocumentsResponse message. + * @function verify + * @memberof google.firestore.v1.ListDocumentsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListDocumentsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.documents != null && message.hasOwnProperty("documents")) { + if (!Array.isArray(message.documents)) + return "documents: array expected"; + for (var i = 0; i < message.documents.length; ++i) { + var error = $root.google.firestore.v1.Document.verify(message.documents[i]); + if (error) + return "documents." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + /** * Creates a ListDocumentsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject @@ -10071,7 +20325,7 @@ message.nextPageToken = String(object.nextPageToken); return message; }; - + /** * Creates a plain object from a ListDocumentsResponse message. Also converts values to other types if specified. * @function toObject @@ -10098,7 +20352,7 @@ object.nextPageToken = message.nextPageToken; return object; }; - + /** * Converts this ListDocumentsResponse to JSON. * @function toJSON @@ -10109,7 +20363,7 @@ ListDocumentsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - + /** * Gets the default type url for ListDocumentsResponse * @function getTypeUrl @@ -10124,12 +20378,12 @@ } return typeUrlPrefix + "/google.firestore.v1.ListDocumentsResponse"; }; - + return ListDocumentsResponse; })(); - + v1.CreateDocumentRequest = (function() { - + /** * Properties of a CreateDocumentRequest. * @memberof google.firestore.v1 @@ -10140,7 +20394,7 @@ * @property {google.firestore.v1.IDocument|null} [document] CreateDocumentRequest document * @property {google.firestore.v1.IDocumentMask|null} [mask] CreateDocumentRequest mask */ - + /** * Constructs a new CreateDocumentRequest. * @memberof google.firestore.v1 @@ -10155,7 +20409,7 @@ if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } - + /** * CreateDocumentRequest parent. * @member {string} parent @@ -10163,7 +20417,7 @@ * @instance */ CreateDocumentRequest.prototype.parent = ""; - + /** * CreateDocumentRequest collectionId. * @member {string} collectionId @@ -10171,7 +20425,7 @@ * @instance */ CreateDocumentRequest.prototype.collectionId = ""; - + /** * CreateDocumentRequest documentId. * @member {string} documentId @@ -10179,7 +20433,7 @@ * @instance */ CreateDocumentRequest.prototype.documentId = ""; - + /** * CreateDocumentRequest document. * @member {google.firestore.v1.IDocument|null|undefined} document @@ -10187,7 +20441,7 @@ * @instance */ CreateDocumentRequest.prototype.document = null; - + /** * CreateDocumentRequest mask. * @member {google.firestore.v1.IDocumentMask|null|undefined} mask @@ -10195,7 +20449,152 @@ * @instance */ CreateDocumentRequest.prototype.mask = null; - + + /** + * Creates a new CreateDocumentRequest instance using the specified properties. + * @function create + * @memberof google.firestore.v1.CreateDocumentRequest + * @static + * @param {google.firestore.v1.ICreateDocumentRequest=} [properties] Properties to set + * @returns {google.firestore.v1.CreateDocumentRequest} CreateDocumentRequest instance + */ + CreateDocumentRequest.create = function create(properties) { + return new CreateDocumentRequest(properties); + }; + + /** + * Encodes the specified CreateDocumentRequest message. Does not implicitly {@link google.firestore.v1.CreateDocumentRequest.verify|verify} messages. + * @function encode + * @memberof google.firestore.v1.CreateDocumentRequest + * @static + * @param {google.firestore.v1.ICreateDocumentRequest} message CreateDocumentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateDocumentRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.collectionId != null && Object.hasOwnProperty.call(message, "collectionId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.collectionId); + if (message.documentId != null && Object.hasOwnProperty.call(message, "documentId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.documentId); + if (message.document != null && Object.hasOwnProperty.call(message, "document")) + $root.google.firestore.v1.Document.encode(message.document, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.mask != null && Object.hasOwnProperty.call(message, "mask")) + $root.google.firestore.v1.DocumentMask.encode(message.mask, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateDocumentRequest message, length delimited. Does not implicitly {@link google.firestore.v1.CreateDocumentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.firestore.v1.CreateDocumentRequest + * @static + * @param {google.firestore.v1.ICreateDocumentRequest} message CreateDocumentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateDocumentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateDocumentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.firestore.v1.CreateDocumentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.firestore.v1.CreateDocumentRequest} CreateDocumentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateDocumentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.firestore.v1.CreateDocumentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.collectionId = reader.string(); + break; + } + case 3: { + message.documentId = reader.string(); + break; + } + case 4: { + message.document = $root.google.firestore.v1.Document.decode(reader, reader.uint32()); + break; + } + case 5: { + message.mask = $root.google.firestore.v1.DocumentMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateDocumentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.firestore.v1.CreateDocumentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.firestore.v1.CreateDocumentRequest} CreateDocumentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateDocumentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateDocumentRequest message. + * @function verify + * @memberof google.firestore.v1.CreateDocumentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateDocumentRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.collectionId != null && message.hasOwnProperty("collectionId")) + if (!$util.isString(message.collectionId)) + return "collectionId: string expected"; + if (message.documentId != null && message.hasOwnProperty("documentId")) + if (!$util.isString(message.documentId)) + return "documentId: string expected"; + if (message.document != null && message.hasOwnProperty("document")) { + var error = $root.google.firestore.v1.Document.verify(message.document); + if (error) + return "document." + error; + } + if (message.mask != null && message.hasOwnProperty("mask")) { + var error = $root.google.firestore.v1.DocumentMask.verify(message.mask); + if (error) + return "mask." + error; + } + return null; + }; + /** * Creates a CreateDocumentRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject @@ -10226,7 +20625,7 @@ } return message; }; - + /** * Creates a plain object from a CreateDocumentRequest message. Also converts values to other types if specified. * @function toObject @@ -10259,7 +20658,7 @@ object.mask = $root.google.firestore.v1.DocumentMask.toObject(message.mask, options); return object; }; - + /** * Converts this CreateDocumentRequest to JSON. * @function toJSON @@ -10270,7 +20669,7 @@ CreateDocumentRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - + /** * Gets the default type url for CreateDocumentRequest * @function getTypeUrl @@ -10285,12 +20684,12 @@ } return typeUrlPrefix + "/google.firestore.v1.CreateDocumentRequest"; }; - + return CreateDocumentRequest; })(); - + v1.UpdateDocumentRequest = (function() { - + /** * Properties of an UpdateDocumentRequest. * @memberof google.firestore.v1 @@ -10300,7 +20699,7 @@ * @property {google.firestore.v1.IDocumentMask|null} [mask] UpdateDocumentRequest mask * @property {google.firestore.v1.IPrecondition|null} [currentDocument] UpdateDocumentRequest currentDocument */ - + /** * Constructs a new UpdateDocumentRequest. * @memberof google.firestore.v1 @@ -10315,7 +20714,7 @@ if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } - + /** * UpdateDocumentRequest document. * @member {google.firestore.v1.IDocument|null|undefined} document @@ -10323,7 +20722,7 @@ * @instance */ UpdateDocumentRequest.prototype.document = null; - + /** * UpdateDocumentRequest updateMask. * @member {google.firestore.v1.IDocumentMask|null|undefined} updateMask @@ -10331,7 +20730,7 @@ * @instance */ UpdateDocumentRequest.prototype.updateMask = null; - + /** * UpdateDocumentRequest mask. * @member {google.firestore.v1.IDocumentMask|null|undefined} mask @@ -10339,7 +20738,7 @@ * @instance */ UpdateDocumentRequest.prototype.mask = null; - + /** * UpdateDocumentRequest currentDocument. * @member {google.firestore.v1.IPrecondition|null|undefined} currentDocument @@ -10347,7 +20746,147 @@ * @instance */ UpdateDocumentRequest.prototype.currentDocument = null; - + + /** + * Creates a new UpdateDocumentRequest instance using the specified properties. + * @function create + * @memberof google.firestore.v1.UpdateDocumentRequest + * @static + * @param {google.firestore.v1.IUpdateDocumentRequest=} [properties] Properties to set + * @returns {google.firestore.v1.UpdateDocumentRequest} UpdateDocumentRequest instance + */ + UpdateDocumentRequest.create = function create(properties) { + return new UpdateDocumentRequest(properties); + }; + + /** + * Encodes the specified UpdateDocumentRequest message. Does not implicitly {@link google.firestore.v1.UpdateDocumentRequest.verify|verify} messages. + * @function encode + * @memberof google.firestore.v1.UpdateDocumentRequest + * @static + * @param {google.firestore.v1.IUpdateDocumentRequest} message UpdateDocumentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateDocumentRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.document != null && Object.hasOwnProperty.call(message, "document")) + $root.google.firestore.v1.Document.encode(message.document, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.firestore.v1.DocumentMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.mask != null && Object.hasOwnProperty.call(message, "mask")) + $root.google.firestore.v1.DocumentMask.encode(message.mask, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.currentDocument != null && Object.hasOwnProperty.call(message, "currentDocument")) + $root.google.firestore.v1.Precondition.encode(message.currentDocument, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateDocumentRequest message, length delimited. Does not implicitly {@link google.firestore.v1.UpdateDocumentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.firestore.v1.UpdateDocumentRequest + * @static + * @param {google.firestore.v1.IUpdateDocumentRequest} message UpdateDocumentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateDocumentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateDocumentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.firestore.v1.UpdateDocumentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.firestore.v1.UpdateDocumentRequest} UpdateDocumentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateDocumentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.firestore.v1.UpdateDocumentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.document = $root.google.firestore.v1.Document.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.firestore.v1.DocumentMask.decode(reader, reader.uint32()); + break; + } + case 3: { + message.mask = $root.google.firestore.v1.DocumentMask.decode(reader, reader.uint32()); + break; + } + case 4: { + message.currentDocument = $root.google.firestore.v1.Precondition.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateDocumentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.firestore.v1.UpdateDocumentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.firestore.v1.UpdateDocumentRequest} UpdateDocumentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateDocumentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateDocumentRequest message. + * @function verify + * @memberof google.firestore.v1.UpdateDocumentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateDocumentRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.document != null && message.hasOwnProperty("document")) { + var error = $root.google.firestore.v1.Document.verify(message.document); + if (error) + return "document." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.firestore.v1.DocumentMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.mask != null && message.hasOwnProperty("mask")) { + var error = $root.google.firestore.v1.DocumentMask.verify(message.mask); + if (error) + return "mask." + error; + } + if (message.currentDocument != null && message.hasOwnProperty("currentDocument")) { + var error = $root.google.firestore.v1.Precondition.verify(message.currentDocument); + if (error) + return "currentDocument." + error; + } + return null; + }; + /** * Creates an UpdateDocumentRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject @@ -10382,7 +20921,7 @@ } return message; }; - + /** * Creates a plain object from an UpdateDocumentRequest message. Also converts values to other types if specified. * @function toObject @@ -10412,7 +20951,7 @@ object.currentDocument = $root.google.firestore.v1.Precondition.toObject(message.currentDocument, options); return object; }; - + /** * Converts this UpdateDocumentRequest to JSON. * @function toJSON @@ -10423,7 +20962,7 @@ UpdateDocumentRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - + /** * Gets the default type url for UpdateDocumentRequest * @function getTypeUrl @@ -10438,12 +20977,12 @@ } return typeUrlPrefix + "/google.firestore.v1.UpdateDocumentRequest"; }; - + return UpdateDocumentRequest; })(); - + v1.DeleteDocumentRequest = (function() { - + /** * Properties of a DeleteDocumentRequest. * @memberof google.firestore.v1 @@ -10451,7 +20990,7 @@ * @property {string|null} [name] DeleteDocumentRequest name * @property {google.firestore.v1.IPrecondition|null} [currentDocument] DeleteDocumentRequest currentDocument */ - + /** * Constructs a new DeleteDocumentRequest. * @memberof google.firestore.v1 @@ -10466,7 +21005,7 @@ if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } - + /** * DeleteDocumentRequest name. * @member {string} name @@ -10474,7 +21013,7 @@ * @instance */ DeleteDocumentRequest.prototype.name = ""; - + /** * DeleteDocumentRequest currentDocument. * @member {google.firestore.v1.IPrecondition|null|undefined} currentDocument @@ -10482,7 +21021,123 @@ * @instance */ DeleteDocumentRequest.prototype.currentDocument = null; - + + /** + * Creates a new DeleteDocumentRequest instance using the specified properties. + * @function create + * @memberof google.firestore.v1.DeleteDocumentRequest + * @static + * @param {google.firestore.v1.IDeleteDocumentRequest=} [properties] Properties to set + * @returns {google.firestore.v1.DeleteDocumentRequest} DeleteDocumentRequest instance + */ + DeleteDocumentRequest.create = function create(properties) { + return new DeleteDocumentRequest(properties); + }; + + /** + * Encodes the specified DeleteDocumentRequest message. Does not implicitly {@link google.firestore.v1.DeleteDocumentRequest.verify|verify} messages. + * @function encode + * @memberof google.firestore.v1.DeleteDocumentRequest + * @static + * @param {google.firestore.v1.IDeleteDocumentRequest} message DeleteDocumentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteDocumentRequest.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.currentDocument != null && Object.hasOwnProperty.call(message, "currentDocument")) + $root.google.firestore.v1.Precondition.encode(message.currentDocument, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DeleteDocumentRequest message, length delimited. Does not implicitly {@link google.firestore.v1.DeleteDocumentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.firestore.v1.DeleteDocumentRequest + * @static + * @param {google.firestore.v1.IDeleteDocumentRequest} message DeleteDocumentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteDocumentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteDocumentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.firestore.v1.DeleteDocumentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.firestore.v1.DeleteDocumentRequest} DeleteDocumentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteDocumentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.firestore.v1.DeleteDocumentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.currentDocument = $root.google.firestore.v1.Precondition.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteDocumentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.firestore.v1.DeleteDocumentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.firestore.v1.DeleteDocumentRequest} DeleteDocumentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteDocumentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteDocumentRequest message. + * @function verify + * @memberof google.firestore.v1.DeleteDocumentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteDocumentRequest.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.currentDocument != null && message.hasOwnProperty("currentDocument")) { + var error = $root.google.firestore.v1.Precondition.verify(message.currentDocument); + if (error) + return "currentDocument." + error; + } + return null; + }; + /** * Creates a DeleteDocumentRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject @@ -10504,7 +21159,7 @@ } return message; }; - + /** * Creates a plain object from a DeleteDocumentRequest message. Also converts values to other types if specified. * @function toObject @@ -10528,7 +21183,7 @@ object.currentDocument = $root.google.firestore.v1.Precondition.toObject(message.currentDocument, options); return object; }; - + /** * Converts this DeleteDocumentRequest to JSON. * @function toJSON @@ -10539,7 +21194,7 @@ DeleteDocumentRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - + /** * Gets the default type url for DeleteDocumentRequest * @function getTypeUrl @@ -10554,12 +21209,12 @@ } return typeUrlPrefix + "/google.firestore.v1.DeleteDocumentRequest"; }; - + return DeleteDocumentRequest; })(); - + v1.BatchGetDocumentsRequest = (function() { - + /** * Properties of a BatchGetDocumentsRequest. * @memberof google.firestore.v1 @@ -10571,7 +21226,7 @@ * @property {google.firestore.v1.ITransactionOptions|null} [newTransaction] BatchGetDocumentsRequest newTransaction * @property {google.protobuf.ITimestamp|null} [readTime] BatchGetDocumentsRequest readTime */ - + /** * Constructs a new BatchGetDocumentsRequest. * @memberof google.firestore.v1 @@ -10587,7 +21242,7 @@ if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } - + /** * BatchGetDocumentsRequest database. * @member {string} database @@ -10595,7 +21250,7 @@ * @instance */ BatchGetDocumentsRequest.prototype.database = ""; - + /** * BatchGetDocumentsRequest documents. * @member {Array.} documents @@ -10603,7 +21258,7 @@ * @instance */ BatchGetDocumentsRequest.prototype.documents = $util.emptyArray; - + /** * BatchGetDocumentsRequest mask. * @member {google.firestore.v1.IDocumentMask|null|undefined} mask @@ -10611,7 +21266,7 @@ * @instance */ BatchGetDocumentsRequest.prototype.mask = null; - + /** * BatchGetDocumentsRequest transaction. * @member {Uint8Array|null|undefined} transaction @@ -10619,7 +21274,7 @@ * @instance */ BatchGetDocumentsRequest.prototype.transaction = null; - + /** * BatchGetDocumentsRequest newTransaction. * @member {google.firestore.v1.ITransactionOptions|null|undefined} newTransaction @@ -10627,7 +21282,7 @@ * @instance */ BatchGetDocumentsRequest.prototype.newTransaction = null; - + /** * BatchGetDocumentsRequest readTime. * @member {google.protobuf.ITimestamp|null|undefined} readTime @@ -10635,10 +21290,10 @@ * @instance */ BatchGetDocumentsRequest.prototype.readTime = null; - + // OneOf field names bound to virtual getters and setters var $oneOfFields; - + /** * BatchGetDocumentsRequest consistencySelector. * @member {"transaction"|"newTransaction"|"readTime"|undefined} consistencySelector @@ -10649,7 +21304,183 @@ get: $util.oneOfGetter($oneOfFields = ["transaction", "newTransaction", "readTime"]), set: $util.oneOfSetter($oneOfFields) }); - + + /** + * Creates a new BatchGetDocumentsRequest instance using the specified properties. + * @function create + * @memberof google.firestore.v1.BatchGetDocumentsRequest + * @static + * @param {google.firestore.v1.IBatchGetDocumentsRequest=} [properties] Properties to set + * @returns {google.firestore.v1.BatchGetDocumentsRequest} BatchGetDocumentsRequest instance + */ + BatchGetDocumentsRequest.create = function create(properties) { + return new BatchGetDocumentsRequest(properties); + }; + + /** + * Encodes the specified BatchGetDocumentsRequest message. Does not implicitly {@link google.firestore.v1.BatchGetDocumentsRequest.verify|verify} messages. + * @function encode + * @memberof google.firestore.v1.BatchGetDocumentsRequest + * @static + * @param {google.firestore.v1.IBatchGetDocumentsRequest} message BatchGetDocumentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchGetDocumentsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.database != null && Object.hasOwnProperty.call(message, "database")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.database); + if (message.documents != null && message.documents.length) + for (var i = 0; i < message.documents.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.documents[i]); + if (message.mask != null && Object.hasOwnProperty.call(message, "mask")) + $root.google.firestore.v1.DocumentMask.encode(message.mask, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.transaction != null && Object.hasOwnProperty.call(message, "transaction")) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.transaction); + if (message.newTransaction != null && Object.hasOwnProperty.call(message, "newTransaction")) + $root.google.firestore.v1.TransactionOptions.encode(message.newTransaction, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchGetDocumentsRequest message, length delimited. Does not implicitly {@link google.firestore.v1.BatchGetDocumentsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.firestore.v1.BatchGetDocumentsRequest + * @static + * @param {google.firestore.v1.IBatchGetDocumentsRequest} message BatchGetDocumentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchGetDocumentsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchGetDocumentsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.firestore.v1.BatchGetDocumentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.firestore.v1.BatchGetDocumentsRequest} BatchGetDocumentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchGetDocumentsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.firestore.v1.BatchGetDocumentsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.database = reader.string(); + break; + } + case 2: { + if (!(message.documents && message.documents.length)) + message.documents = []; + message.documents.push(reader.string()); + break; + } + case 3: { + message.mask = $root.google.firestore.v1.DocumentMask.decode(reader, reader.uint32()); + break; + } + case 4: { + message.transaction = reader.bytes(); + break; + } + case 5: { + message.newTransaction = $root.google.firestore.v1.TransactionOptions.decode(reader, reader.uint32()); + break; + } + case 7: { + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchGetDocumentsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.firestore.v1.BatchGetDocumentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.firestore.v1.BatchGetDocumentsRequest} BatchGetDocumentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchGetDocumentsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchGetDocumentsRequest message. + * @function verify + * @memberof google.firestore.v1.BatchGetDocumentsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchGetDocumentsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.database != null && message.hasOwnProperty("database")) + if (!$util.isString(message.database)) + return "database: string expected"; + if (message.documents != null && message.hasOwnProperty("documents")) { + if (!Array.isArray(message.documents)) + return "documents: array expected"; + for (var i = 0; i < message.documents.length; ++i) + if (!$util.isString(message.documents[i])) + return "documents: string[] expected"; + } + if (message.mask != null && message.hasOwnProperty("mask")) { + var error = $root.google.firestore.v1.DocumentMask.verify(message.mask); + if (error) + return "mask." + error; + } + if (message.transaction != null && message.hasOwnProperty("transaction")) { + properties.consistencySelector = 1; + if (!(message.transaction && typeof message.transaction.length === "number" || $util.isString(message.transaction))) + return "transaction: buffer expected"; + } + if (message.newTransaction != null && message.hasOwnProperty("newTransaction")) { + if (properties.consistencySelector === 1) + return "consistencySelector: multiple values"; + properties.consistencySelector = 1; + { + var error = $root.google.firestore.v1.TransactionOptions.verify(message.newTransaction); + if (error) + return "newTransaction." + error; + } + } + if (message.readTime != null && message.hasOwnProperty("readTime")) { + if (properties.consistencySelector === 1) + return "consistencySelector: multiple values"; + properties.consistencySelector = 1; + { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; + } + } + return null; + }; + /** * Creates a BatchGetDocumentsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject @@ -10693,7 +21524,7 @@ } return message; }; - + /** * Creates a plain object from a BatchGetDocumentsRequest message. Also converts values to other types if specified. * @function toObject @@ -10739,7 +21570,7 @@ } return object; }; - + /** * Converts this BatchGetDocumentsRequest to JSON. * @function toJSON @@ -10750,7 +21581,7 @@ BatchGetDocumentsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - + /** * Gets the default type url for BatchGetDocumentsRequest * @function getTypeUrl @@ -10765,12 +21596,12 @@ } return typeUrlPrefix + "/google.firestore.v1.BatchGetDocumentsRequest"; }; - + return BatchGetDocumentsRequest; })(); - + v1.BatchGetDocumentsResponse = (function() { - + /** * Properties of a BatchGetDocumentsResponse. * @memberof google.firestore.v1 @@ -10780,7 +21611,7 @@ * @property {Uint8Array|null} [transaction] BatchGetDocumentsResponse transaction * @property {google.protobuf.ITimestamp|null} [readTime] BatchGetDocumentsResponse readTime */ - + /** * Constructs a new BatchGetDocumentsResponse. * @memberof google.firestore.v1 @@ -10795,7 +21626,7 @@ if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } - + /** * BatchGetDocumentsResponse found. * @member {google.firestore.v1.IDocument|null|undefined} found @@ -10803,7 +21634,7 @@ * @instance */ BatchGetDocumentsResponse.prototype.found = null; - + /** * BatchGetDocumentsResponse missing. * @member {string|null|undefined} missing @@ -10811,7 +21642,7 @@ * @instance */ BatchGetDocumentsResponse.prototype.missing = null; - + /** * BatchGetDocumentsResponse transaction. * @member {Uint8Array} transaction @@ -10819,7 +21650,7 @@ * @instance */ BatchGetDocumentsResponse.prototype.transaction = $util.newBuffer([]); - + /** * BatchGetDocumentsResponse readTime. * @member {google.protobuf.ITimestamp|null|undefined} readTime @@ -10827,10 +21658,10 @@ * @instance */ BatchGetDocumentsResponse.prototype.readTime = null; - + // OneOf field names bound to virtual getters and setters var $oneOfFields; - + /** * BatchGetDocumentsResponse result. * @member {"found"|"missing"|undefined} result @@ -10841,7 +21672,151 @@ get: $util.oneOfGetter($oneOfFields = ["found", "missing"]), set: $util.oneOfSetter($oneOfFields) }); - + + /** + * Creates a new BatchGetDocumentsResponse instance using the specified properties. + * @function create + * @memberof google.firestore.v1.BatchGetDocumentsResponse + * @static + * @param {google.firestore.v1.IBatchGetDocumentsResponse=} [properties] Properties to set + * @returns {google.firestore.v1.BatchGetDocumentsResponse} BatchGetDocumentsResponse instance + */ + BatchGetDocumentsResponse.create = function create(properties) { + return new BatchGetDocumentsResponse(properties); + }; + + /** + * Encodes the specified BatchGetDocumentsResponse message. Does not implicitly {@link google.firestore.v1.BatchGetDocumentsResponse.verify|verify} messages. + * @function encode + * @memberof google.firestore.v1.BatchGetDocumentsResponse + * @static + * @param {google.firestore.v1.IBatchGetDocumentsResponse} message BatchGetDocumentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchGetDocumentsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.found != null && Object.hasOwnProperty.call(message, "found")) + $root.google.firestore.v1.Document.encode(message.found, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.missing != null && Object.hasOwnProperty.call(message, "missing")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.missing); + if (message.transaction != null && Object.hasOwnProperty.call(message, "transaction")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.transaction); + if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchGetDocumentsResponse message, length delimited. Does not implicitly {@link google.firestore.v1.BatchGetDocumentsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.firestore.v1.BatchGetDocumentsResponse + * @static + * @param {google.firestore.v1.IBatchGetDocumentsResponse} message BatchGetDocumentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchGetDocumentsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchGetDocumentsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.firestore.v1.BatchGetDocumentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.firestore.v1.BatchGetDocumentsResponse} BatchGetDocumentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchGetDocumentsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.firestore.v1.BatchGetDocumentsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.found = $root.google.firestore.v1.Document.decode(reader, reader.uint32()); + break; + } + case 2: { + message.missing = reader.string(); + break; + } + case 3: { + message.transaction = reader.bytes(); + break; + } + case 4: { + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchGetDocumentsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.firestore.v1.BatchGetDocumentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.firestore.v1.BatchGetDocumentsResponse} BatchGetDocumentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchGetDocumentsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchGetDocumentsResponse message. + * @function verify + * @memberof google.firestore.v1.BatchGetDocumentsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchGetDocumentsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.found != null && message.hasOwnProperty("found")) { + properties.result = 1; + { + var error = $root.google.firestore.v1.Document.verify(message.found); + if (error) + return "found." + error; + } + } + if (message.missing != null && message.hasOwnProperty("missing")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + if (!$util.isString(message.missing)) + return "missing: string expected"; + } + if (message.transaction != null && message.hasOwnProperty("transaction")) + if (!(message.transaction && typeof message.transaction.length === "number" || $util.isString(message.transaction))) + return "transaction: buffer expected"; + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; + } + return null; + }; + /** * Creates a BatchGetDocumentsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject @@ -10873,7 +21848,7 @@ } return message; }; - + /** * Creates a plain object from a BatchGetDocumentsResponse message. Also converts values to other types if specified. * @function toObject @@ -10913,7 +21888,7 @@ object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); return object; }; - + /** * Converts this BatchGetDocumentsResponse to JSON. * @function toJSON @@ -10924,7 +21899,7 @@ BatchGetDocumentsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - + /** * Gets the default type url for BatchGetDocumentsResponse * @function getTypeUrl @@ -10939,12 +21914,12 @@ } return typeUrlPrefix + "/google.firestore.v1.BatchGetDocumentsResponse"; }; - + return BatchGetDocumentsResponse; })(); - + v1.BeginTransactionRequest = (function() { - + /** * Properties of a BeginTransactionRequest. * @memberof google.firestore.v1 @@ -10952,7 +21927,7 @@ * @property {string|null} [database] BeginTransactionRequest database * @property {google.firestore.v1.ITransactionOptions|null} [options] BeginTransactionRequest options */ - + /** * Constructs a new BeginTransactionRequest. * @memberof google.firestore.v1 @@ -10967,23 +21942,139 @@ if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } - + + /** + * BeginTransactionRequest database. + * @member {string} database + * @memberof google.firestore.v1.BeginTransactionRequest + * @instance + */ + BeginTransactionRequest.prototype.database = ""; + + /** + * BeginTransactionRequest options. + * @member {google.firestore.v1.ITransactionOptions|null|undefined} options + * @memberof google.firestore.v1.BeginTransactionRequest + * @instance + */ + BeginTransactionRequest.prototype.options = null; + + /** + * Creates a new BeginTransactionRequest instance using the specified properties. + * @function create + * @memberof google.firestore.v1.BeginTransactionRequest + * @static + * @param {google.firestore.v1.IBeginTransactionRequest=} [properties] Properties to set + * @returns {google.firestore.v1.BeginTransactionRequest} BeginTransactionRequest instance + */ + BeginTransactionRequest.create = function create(properties) { + return new BeginTransactionRequest(properties); + }; + + /** + * Encodes the specified BeginTransactionRequest message. Does not implicitly {@link google.firestore.v1.BeginTransactionRequest.verify|verify} messages. + * @function encode + * @memberof google.firestore.v1.BeginTransactionRequest + * @static + * @param {google.firestore.v1.IBeginTransactionRequest} message BeginTransactionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BeginTransactionRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.database != null && Object.hasOwnProperty.call(message, "database")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.database); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.firestore.v1.TransactionOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BeginTransactionRequest message, length delimited. Does not implicitly {@link google.firestore.v1.BeginTransactionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.firestore.v1.BeginTransactionRequest + * @static + * @param {google.firestore.v1.IBeginTransactionRequest} message BeginTransactionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BeginTransactionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BeginTransactionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.firestore.v1.BeginTransactionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.firestore.v1.BeginTransactionRequest} BeginTransactionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BeginTransactionRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.firestore.v1.BeginTransactionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.database = reader.string(); + break; + } + case 2: { + message.options = $root.google.firestore.v1.TransactionOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + /** - * BeginTransactionRequest database. - * @member {string} database + * Decodes a BeginTransactionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited * @memberof google.firestore.v1.BeginTransactionRequest - * @instance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.firestore.v1.BeginTransactionRequest} BeginTransactionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BeginTransactionRequest.prototype.database = ""; - + BeginTransactionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + /** - * BeginTransactionRequest options. - * @member {google.firestore.v1.ITransactionOptions|null|undefined} options + * Verifies a BeginTransactionRequest message. + * @function verify * @memberof google.firestore.v1.BeginTransactionRequest - * @instance + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - BeginTransactionRequest.prototype.options = null; - + BeginTransactionRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.database != null && message.hasOwnProperty("database")) + if (!$util.isString(message.database)) + return "database: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.firestore.v1.TransactionOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + /** * Creates a BeginTransactionRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject @@ -11005,7 +22096,7 @@ } return message; }; - + /** * Creates a plain object from a BeginTransactionRequest message. Also converts values to other types if specified. * @function toObject @@ -11029,7 +22120,7 @@ object.options = $root.google.firestore.v1.TransactionOptions.toObject(message.options, options); return object; }; - + /** * Converts this BeginTransactionRequest to JSON. * @function toJSON @@ -11040,7 +22131,7 @@ BeginTransactionRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - + /** * Gets the default type url for BeginTransactionRequest * @function getTypeUrl @@ -11055,19 +22146,19 @@ } return typeUrlPrefix + "/google.firestore.v1.BeginTransactionRequest"; }; - + return BeginTransactionRequest; })(); - + v1.BeginTransactionResponse = (function() { - + /** * Properties of a BeginTransactionResponse. * @memberof google.firestore.v1 * @interface IBeginTransactionResponse * @property {Uint8Array|null} [transaction] BeginTransactionResponse transaction */ - + /** * Constructs a new BeginTransactionResponse. * @memberof google.firestore.v1 @@ -11082,7 +22173,7 @@ if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } - + /** * BeginTransactionResponse transaction. * @member {Uint8Array} transaction @@ -11090,7 +22181,112 @@ * @instance */ BeginTransactionResponse.prototype.transaction = $util.newBuffer([]); - + + /** + * Creates a new BeginTransactionResponse instance using the specified properties. + * @function create + * @memberof google.firestore.v1.BeginTransactionResponse + * @static + * @param {google.firestore.v1.IBeginTransactionResponse=} [properties] Properties to set + * @returns {google.firestore.v1.BeginTransactionResponse} BeginTransactionResponse instance + */ + BeginTransactionResponse.create = function create(properties) { + return new BeginTransactionResponse(properties); + }; + + /** + * Encodes the specified BeginTransactionResponse message. Does not implicitly {@link google.firestore.v1.BeginTransactionResponse.verify|verify} messages. + * @function encode + * @memberof google.firestore.v1.BeginTransactionResponse + * @static + * @param {google.firestore.v1.IBeginTransactionResponse} message BeginTransactionResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BeginTransactionResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.transaction != null && Object.hasOwnProperty.call(message, "transaction")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.transaction); + return writer; + }; + + /** + * Encodes the specified BeginTransactionResponse message, length delimited. Does not implicitly {@link google.firestore.v1.BeginTransactionResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.firestore.v1.BeginTransactionResponse + * @static + * @param {google.firestore.v1.IBeginTransactionResponse} message BeginTransactionResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BeginTransactionResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BeginTransactionResponse message from the specified reader or buffer. + * @function decode + * @memberof google.firestore.v1.BeginTransactionResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.firestore.v1.BeginTransactionResponse} BeginTransactionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BeginTransactionResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.firestore.v1.BeginTransactionResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.transaction = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BeginTransactionResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.firestore.v1.BeginTransactionResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.firestore.v1.BeginTransactionResponse} BeginTransactionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BeginTransactionResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BeginTransactionResponse message. + * @function verify + * @memberof google.firestore.v1.BeginTransactionResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BeginTransactionResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.transaction != null && message.hasOwnProperty("transaction")) + if (!(message.transaction && typeof message.transaction.length === "number" || $util.isString(message.transaction))) + return "transaction: buffer expected"; + return null; + }; + /** * Creates a BeginTransactionResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject @@ -11110,7 +22306,7 @@ message.transaction = object.transaction; return message; }; - + /** * Creates a plain object from a BeginTransactionResponse message. Also converts values to other types if specified. * @function toObject @@ -11136,7 +22332,7 @@ object.transaction = options.bytes === String ? $util.base64.encode(message.transaction, 0, message.transaction.length) : options.bytes === Array ? Array.prototype.slice.call(message.transaction) : message.transaction; return object; }; - + /** * Converts this BeginTransactionResponse to JSON. * @function toJSON @@ -11147,7 +22343,7 @@ BeginTransactionResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - + /** * Gets the default type url for BeginTransactionResponse * @function getTypeUrl @@ -11162,12 +22358,12 @@ } return typeUrlPrefix + "/google.firestore.v1.BeginTransactionResponse"; }; - + return BeginTransactionResponse; })(); - + v1.CommitRequest = (function() { - + /** * Properties of a CommitRequest. * @memberof google.firestore.v1 @@ -11176,7 +22372,7 @@ * @property {Array.|null} [writes] CommitRequest writes * @property {Uint8Array|null} [transaction] CommitRequest transaction */ - + /** * Constructs a new CommitRequest. * @memberof google.firestore.v1 @@ -11192,7 +22388,7 @@ if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } - + /** * CommitRequest database. * @member {string} database @@ -11200,7 +22396,7 @@ * @instance */ CommitRequest.prototype.database = ""; - + /** * CommitRequest writes. * @member {Array.} writes @@ -11208,7 +22404,7 @@ * @instance */ CommitRequest.prototype.writes = $util.emptyArray; - + /** * CommitRequest transaction. * @member {Uint8Array} transaction @@ -11216,7 +22412,139 @@ * @instance */ CommitRequest.prototype.transaction = $util.newBuffer([]); - + + /** + * Creates a new CommitRequest instance using the specified properties. + * @function create + * @memberof google.firestore.v1.CommitRequest + * @static + * @param {google.firestore.v1.ICommitRequest=} [properties] Properties to set + * @returns {google.firestore.v1.CommitRequest} CommitRequest instance + */ + CommitRequest.create = function create(properties) { + return new CommitRequest(properties); + }; + + /** + * Encodes the specified CommitRequest message. Does not implicitly {@link google.firestore.v1.CommitRequest.verify|verify} messages. + * @function encode + * @memberof google.firestore.v1.CommitRequest + * @static + * @param {google.firestore.v1.ICommitRequest} message CommitRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommitRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.database != null && Object.hasOwnProperty.call(message, "database")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.database); + if (message.writes != null && message.writes.length) + for (var i = 0; i < message.writes.length; ++i) + $root.google.firestore.v1.Write.encode(message.writes[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.transaction != null && Object.hasOwnProperty.call(message, "transaction")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.transaction); + return writer; + }; + + /** + * Encodes the specified CommitRequest message, length delimited. Does not implicitly {@link google.firestore.v1.CommitRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.firestore.v1.CommitRequest + * @static + * @param {google.firestore.v1.ICommitRequest} message CommitRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommitRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CommitRequest message from the specified reader or buffer. + * @function decode + * @memberof google.firestore.v1.CommitRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.firestore.v1.CommitRequest} CommitRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommitRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.firestore.v1.CommitRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.database = reader.string(); + break; + } + case 2: { + if (!(message.writes && message.writes.length)) + message.writes = []; + message.writes.push($root.google.firestore.v1.Write.decode(reader, reader.uint32())); + break; + } + case 3: { + message.transaction = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CommitRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.firestore.v1.CommitRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.firestore.v1.CommitRequest} CommitRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommitRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CommitRequest message. + * @function verify + * @memberof google.firestore.v1.CommitRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CommitRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.database != null && message.hasOwnProperty("database")) + if (!$util.isString(message.database)) + return "database: string expected"; + if (message.writes != null && message.hasOwnProperty("writes")) { + if (!Array.isArray(message.writes)) + return "writes: array expected"; + for (var i = 0; i < message.writes.length; ++i) { + var error = $root.google.firestore.v1.Write.verify(message.writes[i]); + if (error) + return "writes." + error; + } + } + if (message.transaction != null && message.hasOwnProperty("transaction")) + if (!(message.transaction && typeof message.transaction.length === "number" || $util.isString(message.transaction))) + return "transaction: buffer expected"; + return null; + }; + /** * Creates a CommitRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject @@ -11248,7 +22576,7 @@ message.transaction = object.transaction; return message; }; - + /** * Creates a plain object from a CommitRequest message. Also converts values to other types if specified. * @function toObject @@ -11285,7 +22613,7 @@ object.transaction = options.bytes === String ? $util.base64.encode(message.transaction, 0, message.transaction.length) : options.bytes === Array ? Array.prototype.slice.call(message.transaction) : message.transaction; return object; }; - + /** * Converts this CommitRequest to JSON. * @function toJSON @@ -11296,7 +22624,7 @@ CommitRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - + /** * Gets the default type url for CommitRequest * @function getTypeUrl @@ -11311,12 +22639,12 @@ } return typeUrlPrefix + "/google.firestore.v1.CommitRequest"; }; - + return CommitRequest; })(); - + v1.CommitResponse = (function() { - + /** * Properties of a CommitResponse. * @memberof google.firestore.v1 @@ -11324,7 +22652,7 @@ * @property {Array.|null} [writeResults] CommitResponse writeResults * @property {google.protobuf.ITimestamp|null} [commitTime] CommitResponse commitTime */ - + /** * Constructs a new CommitResponse. * @memberof google.firestore.v1 @@ -11340,7 +22668,7 @@ if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } - + /** * CommitResponse writeResults. * @member {Array.} writeResults @@ -11348,7 +22676,7 @@ * @instance */ CommitResponse.prototype.writeResults = $util.emptyArray; - + /** * CommitResponse commitTime. * @member {google.protobuf.ITimestamp|null|undefined} commitTime @@ -11356,7 +22684,132 @@ * @instance */ CommitResponse.prototype.commitTime = null; - + + /** + * Creates a new CommitResponse instance using the specified properties. + * @function create + * @memberof google.firestore.v1.CommitResponse + * @static + * @param {google.firestore.v1.ICommitResponse=} [properties] Properties to set + * @returns {google.firestore.v1.CommitResponse} CommitResponse instance + */ + CommitResponse.create = function create(properties) { + return new CommitResponse(properties); + }; + + /** + * Encodes the specified CommitResponse message. Does not implicitly {@link google.firestore.v1.CommitResponse.verify|verify} messages. + * @function encode + * @memberof google.firestore.v1.CommitResponse + * @static + * @param {google.firestore.v1.ICommitResponse} message CommitResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommitResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.writeResults != null && message.writeResults.length) + for (var i = 0; i < message.writeResults.length; ++i) + $root.google.firestore.v1.WriteResult.encode(message.writeResults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.commitTime != null && Object.hasOwnProperty.call(message, "commitTime")) + $root.google.protobuf.Timestamp.encode(message.commitTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CommitResponse message, length delimited. Does not implicitly {@link google.firestore.v1.CommitResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.firestore.v1.CommitResponse + * @static + * @param {google.firestore.v1.ICommitResponse} message CommitResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommitResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CommitResponse message from the specified reader or buffer. + * @function decode + * @memberof google.firestore.v1.CommitResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.firestore.v1.CommitResponse} CommitResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommitResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.firestore.v1.CommitResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.writeResults && message.writeResults.length)) + message.writeResults = []; + message.writeResults.push($root.google.firestore.v1.WriteResult.decode(reader, reader.uint32())); + break; + } + case 2: { + message.commitTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CommitResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.firestore.v1.CommitResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.firestore.v1.CommitResponse} CommitResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommitResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CommitResponse message. + * @function verify + * @memberof google.firestore.v1.CommitResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CommitResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.writeResults != null && message.hasOwnProperty("writeResults")) { + if (!Array.isArray(message.writeResults)) + return "writeResults: array expected"; + for (var i = 0; i < message.writeResults.length; ++i) { + var error = $root.google.firestore.v1.WriteResult.verify(message.writeResults[i]); + if (error) + return "writeResults." + error; + } + } + if (message.commitTime != null && message.hasOwnProperty("commitTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.commitTime); + if (error) + return "commitTime." + error; + } + return null; + }; + /** * Creates a CommitResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject @@ -11386,7 +22839,7 @@ } return message; }; - + /** * Creates a plain object from a CommitResponse message. Also converts values to other types if specified. * @function toObject @@ -11413,7 +22866,7 @@ object.commitTime = $root.google.protobuf.Timestamp.toObject(message.commitTime, options); return object; }; - + /** * Converts this CommitResponse to JSON. * @function toJSON @@ -11424,7 +22877,7 @@ CommitResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - + /** * Gets the default type url for CommitResponse * @function getTypeUrl @@ -11439,12 +22892,12 @@ } return typeUrlPrefix + "/google.firestore.v1.CommitResponse"; }; - + return CommitResponse; })(); - + v1.RollbackRequest = (function() { - + /** * Properties of a RollbackRequest. * @memberof google.firestore.v1 @@ -11452,7 +22905,7 @@ * @property {string|null} [database] RollbackRequest database * @property {Uint8Array|null} [transaction] RollbackRequest transaction */ - + /** * Constructs a new RollbackRequest. * @memberof google.firestore.v1 @@ -11467,7 +22920,7 @@ if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } - + /** * RollbackRequest database. * @member {string} database @@ -11475,7 +22928,7 @@ * @instance */ RollbackRequest.prototype.database = ""; - + /** * RollbackRequest transaction. * @member {Uint8Array} transaction @@ -11483,7 +22936,121 @@ * @instance */ RollbackRequest.prototype.transaction = $util.newBuffer([]); - + + /** + * Creates a new RollbackRequest instance using the specified properties. + * @function create + * @memberof google.firestore.v1.RollbackRequest + * @static + * @param {google.firestore.v1.IRollbackRequest=} [properties] Properties to set + * @returns {google.firestore.v1.RollbackRequest} RollbackRequest instance + */ + RollbackRequest.create = function create(properties) { + return new RollbackRequest(properties); + }; + + /** + * Encodes the specified RollbackRequest message. Does not implicitly {@link google.firestore.v1.RollbackRequest.verify|verify} messages. + * @function encode + * @memberof google.firestore.v1.RollbackRequest + * @static + * @param {google.firestore.v1.IRollbackRequest} message RollbackRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RollbackRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.database != null && Object.hasOwnProperty.call(message, "database")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.database); + if (message.transaction != null && Object.hasOwnProperty.call(message, "transaction")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.transaction); + return writer; + }; + + /** + * Encodes the specified RollbackRequest message, length delimited. Does not implicitly {@link google.firestore.v1.RollbackRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.firestore.v1.RollbackRequest + * @static + * @param {google.firestore.v1.IRollbackRequest} message RollbackRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RollbackRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RollbackRequest message from the specified reader or buffer. + * @function decode + * @memberof google.firestore.v1.RollbackRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.firestore.v1.RollbackRequest} RollbackRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RollbackRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.firestore.v1.RollbackRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.database = reader.string(); + break; + } + case 2: { + message.transaction = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RollbackRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.firestore.v1.RollbackRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.firestore.v1.RollbackRequest} RollbackRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RollbackRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RollbackRequest message. + * @function verify + * @memberof google.firestore.v1.RollbackRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RollbackRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.database != null && message.hasOwnProperty("database")) + if (!$util.isString(message.database)) + return "database: string expected"; + if (message.transaction != null && message.hasOwnProperty("transaction")) + if (!(message.transaction && typeof message.transaction.length === "number" || $util.isString(message.transaction))) + return "transaction: buffer expected"; + return null; + }; + /** * Creates a RollbackRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject @@ -11505,7 +23072,7 @@ message.transaction = object.transaction; return message; }; - + /** * Creates a plain object from a RollbackRequest message. Also converts values to other types if specified. * @function toObject @@ -11535,7 +23102,7 @@ object.transaction = options.bytes === String ? $util.base64.encode(message.transaction, 0, message.transaction.length) : options.bytes === Array ? Array.prototype.slice.call(message.transaction) : message.transaction; return object; }; - + /** * Converts this RollbackRequest to JSON. * @function toJSON @@ -11546,7 +23113,7 @@ RollbackRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - + /** * Gets the default type url for RollbackRequest * @function getTypeUrl @@ -11561,12 +23128,12 @@ } return typeUrlPrefix + "/google.firestore.v1.RollbackRequest"; }; - + return RollbackRequest; })(); - + v1.RunQueryRequest = (function() { - + /** * Properties of a RunQueryRequest. * @memberof google.firestore.v1 @@ -11576,9 +23143,9 @@ * @property {Uint8Array|null} [transaction] RunQueryRequest transaction * @property {google.firestore.v1.ITransactionOptions|null} [newTransaction] RunQueryRequest newTransaction * @property {google.protobuf.ITimestamp|null} [readTime] RunQueryRequest readTime - * @property {google.firestore.v1.QueryMode|null} [mode] RunQueryRequest mode + * @property {google.firestore.v1.IExplainOptions|null} [explainOptions] RunQueryRequest explainOptions */ - + /** * Constructs a new RunQueryRequest. * @memberof google.firestore.v1 @@ -11593,7 +23160,7 @@ if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } - + /** * RunQueryRequest parent. * @member {string} parent @@ -11601,7 +23168,7 @@ * @instance */ RunQueryRequest.prototype.parent = ""; - + /** * RunQueryRequest structuredQuery. * @member {google.firestore.v1.IStructuredQuery|null|undefined} structuredQuery @@ -11609,7 +23176,7 @@ * @instance */ RunQueryRequest.prototype.structuredQuery = null; - + /** * RunQueryRequest transaction. * @member {Uint8Array|null|undefined} transaction @@ -11617,7 +23184,7 @@ * @instance */ RunQueryRequest.prototype.transaction = null; - + /** * RunQueryRequest newTransaction. * @member {google.firestore.v1.ITransactionOptions|null|undefined} newTransaction @@ -11625,7 +23192,7 @@ * @instance */ RunQueryRequest.prototype.newTransaction = null; - + /** * RunQueryRequest readTime. * @member {google.protobuf.ITimestamp|null|undefined} readTime @@ -11633,18 +23200,18 @@ * @instance */ RunQueryRequest.prototype.readTime = null; - + /** - * RunQueryRequest mode. - * @member {google.firestore.v1.QueryMode} mode + * RunQueryRequest explainOptions. + * @member {google.firestore.v1.IExplainOptions|null|undefined} explainOptions * @memberof google.firestore.v1.RunQueryRequest * @instance */ - RunQueryRequest.prototype.mode = 0; - + RunQueryRequest.prototype.explainOptions = null; + // OneOf field names bound to virtual getters and setters var $oneOfFields; - + /** * RunQueryRequest queryType. * @member {"structuredQuery"|undefined} queryType @@ -11655,7 +23222,7 @@ get: $util.oneOfGetter($oneOfFields = ["structuredQuery"]), set: $util.oneOfSetter($oneOfFields) }); - + /** * RunQueryRequest consistencySelector. * @member {"transaction"|"newTransaction"|"readTime"|undefined} consistencySelector @@ -11666,7 +23233,181 @@ get: $util.oneOfGetter($oneOfFields = ["transaction", "newTransaction", "readTime"]), set: $util.oneOfSetter($oneOfFields) }); - + + /** + * Creates a new RunQueryRequest instance using the specified properties. + * @function create + * @memberof google.firestore.v1.RunQueryRequest + * @static + * @param {google.firestore.v1.IRunQueryRequest=} [properties] Properties to set + * @returns {google.firestore.v1.RunQueryRequest} RunQueryRequest instance + */ + RunQueryRequest.create = function create(properties) { + return new RunQueryRequest(properties); + }; + + /** + * Encodes the specified RunQueryRequest message. Does not implicitly {@link google.firestore.v1.RunQueryRequest.verify|verify} messages. + * @function encode + * @memberof google.firestore.v1.RunQueryRequest + * @static + * @param {google.firestore.v1.IRunQueryRequest} message RunQueryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunQueryRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.structuredQuery != null && Object.hasOwnProperty.call(message, "structuredQuery")) + $root.google.firestore.v1.StructuredQuery.encode(message.structuredQuery, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.transaction != null && Object.hasOwnProperty.call(message, "transaction")) + writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.transaction); + if (message.newTransaction != null && Object.hasOwnProperty.call(message, "newTransaction")) + $root.google.firestore.v1.TransactionOptions.encode(message.newTransaction, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.explainOptions != null && Object.hasOwnProperty.call(message, "explainOptions")) + $root.google.firestore.v1.ExplainOptions.encode(message.explainOptions, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RunQueryRequest message, length delimited. Does not implicitly {@link google.firestore.v1.RunQueryRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.firestore.v1.RunQueryRequest + * @static + * @param {google.firestore.v1.IRunQueryRequest} message RunQueryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunQueryRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RunQueryRequest message from the specified reader or buffer. + * @function decode + * @memberof google.firestore.v1.RunQueryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.firestore.v1.RunQueryRequest} RunQueryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunQueryRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.firestore.v1.RunQueryRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.structuredQuery = $root.google.firestore.v1.StructuredQuery.decode(reader, reader.uint32()); + break; + } + case 5: { + message.transaction = reader.bytes(); + break; + } + case 6: { + message.newTransaction = $root.google.firestore.v1.TransactionOptions.decode(reader, reader.uint32()); + break; + } + case 7: { + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 10: { + message.explainOptions = $root.google.firestore.v1.ExplainOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RunQueryRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.firestore.v1.RunQueryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.firestore.v1.RunQueryRequest} RunQueryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunQueryRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RunQueryRequest message. + * @function verify + * @memberof google.firestore.v1.RunQueryRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RunQueryRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.structuredQuery != null && message.hasOwnProperty("structuredQuery")) { + properties.queryType = 1; + { + var error = $root.google.firestore.v1.StructuredQuery.verify(message.structuredQuery); + if (error) + return "structuredQuery." + error; + } + } + if (message.transaction != null && message.hasOwnProperty("transaction")) { + properties.consistencySelector = 1; + if (!(message.transaction && typeof message.transaction.length === "number" || $util.isString(message.transaction))) + return "transaction: buffer expected"; + } + if (message.newTransaction != null && message.hasOwnProperty("newTransaction")) { + if (properties.consistencySelector === 1) + return "consistencySelector: multiple values"; + properties.consistencySelector = 1; + { + var error = $root.google.firestore.v1.TransactionOptions.verify(message.newTransaction); + if (error) + return "newTransaction." + error; + } + } + if (message.readTime != null && message.hasOwnProperty("readTime")) { + if (properties.consistencySelector === 1) + return "consistencySelector: multiple values"; + properties.consistencySelector = 1; + { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; + } + } + if (message.explainOptions != null && message.hasOwnProperty("explainOptions")) { + var error = $root.google.firestore.v1.ExplainOptions.verify(message.explainOptions); + if (error) + return "explainOptions." + error; + } + return null; + }; + /** * Creates a RunQueryRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject @@ -11701,29 +23442,14 @@ throw TypeError(".google.firestore.v1.RunQueryRequest.readTime: object expected"); message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); } - switch (object.mode) { - default: - if (typeof object.mode === "number") { - message.mode = object.mode; - break; - } - break; - case "NORMAL": - case 0: - message.mode = 0; - break; - case "PLAN": - case 1: - message.mode = 1; - break; - case "PROFILE": - case 2: - message.mode = 2; - break; + if (object.explainOptions != null) { + if (typeof object.explainOptions !== "object") + throw TypeError(".google.firestore.v1.RunQueryRequest.explainOptions: object expected"); + message.explainOptions = $root.google.firestore.v1.ExplainOptions.fromObject(object.explainOptions); } return message; }; - + /** * Creates a plain object from a RunQueryRequest message. Also converts values to other types if specified. * @function toObject @@ -11739,7 +23465,7 @@ var object = {}; if (options.defaults) { object.parent = ""; - object.mode = options.enums === String ? "NORMAL" : 0; + object.explainOptions = null; } if (message.parent != null && message.hasOwnProperty("parent")) object.parent = message.parent; @@ -11763,11 +23489,11 @@ if (options.oneofs) object.consistencySelector = "readTime"; } - if (message.mode != null && message.hasOwnProperty("mode")) - object.mode = options.enums === String ? $root.google.firestore.v1.QueryMode[message.mode] === undefined ? message.mode : $root.google.firestore.v1.QueryMode[message.mode] : message.mode; + if (message.explainOptions != null && message.hasOwnProperty("explainOptions")) + object.explainOptions = $root.google.firestore.v1.ExplainOptions.toObject(message.explainOptions, options); return object; }; - + /** * Converts this RunQueryRequest to JSON. * @function toJSON @@ -11778,7 +23504,7 @@ RunQueryRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - + /** * Gets the default type url for RunQueryRequest * @function getTypeUrl @@ -11793,12 +23519,12 @@ } return typeUrlPrefix + "/google.firestore.v1.RunQueryRequest"; }; - + return RunQueryRequest; })(); - + v1.RunQueryResponse = (function() { - + /** * Properties of a RunQueryResponse. * @memberof google.firestore.v1 @@ -11808,9 +23534,9 @@ * @property {google.protobuf.ITimestamp|null} [readTime] RunQueryResponse readTime * @property {number|null} [skippedResults] RunQueryResponse skippedResults * @property {boolean|null} [done] RunQueryResponse done - * @property {google.firestore.v1.IResultSetStats|null} [stats] RunQueryResponse stats + * @property {google.firestore.v1.IExplainMetrics|null} [explainMetrics] RunQueryResponse explainMetrics */ - + /** * Constructs a new RunQueryResponse. * @memberof google.firestore.v1 @@ -11825,7 +23551,7 @@ if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } - + /** * RunQueryResponse transaction. * @member {Uint8Array} transaction @@ -11833,7 +23559,7 @@ * @instance */ RunQueryResponse.prototype.transaction = $util.newBuffer([]); - + /** * RunQueryResponse document. * @member {google.firestore.v1.IDocument|null|undefined} document @@ -11841,7 +23567,7 @@ * @instance */ RunQueryResponse.prototype.document = null; - + /** * RunQueryResponse readTime. * @member {google.protobuf.ITimestamp|null|undefined} readTime @@ -11849,7 +23575,7 @@ * @instance */ RunQueryResponse.prototype.readTime = null; - + /** * RunQueryResponse skippedResults. * @member {number} skippedResults @@ -11857,7 +23583,7 @@ * @instance */ RunQueryResponse.prototype.skippedResults = 0; - + /** * RunQueryResponse done. * @member {boolean|null|undefined} done @@ -11865,18 +23591,18 @@ * @instance */ RunQueryResponse.prototype.done = null; - + /** - * RunQueryResponse stats. - * @member {google.firestore.v1.IResultSetStats|null|undefined} stats + * RunQueryResponse explainMetrics. + * @member {google.firestore.v1.IExplainMetrics|null|undefined} explainMetrics * @memberof google.firestore.v1.RunQueryResponse * @instance */ - RunQueryResponse.prototype.stats = null; - + RunQueryResponse.prototype.explainMetrics = null; + // OneOf field names bound to virtual getters and setters var $oneOfFields; - + /** * RunQueryResponse continuationSelector. * @member {"done"|undefined} continuationSelector @@ -11887,7 +23613,166 @@ get: $util.oneOfGetter($oneOfFields = ["done"]), set: $util.oneOfSetter($oneOfFields) }); - + + /** + * Creates a new RunQueryResponse instance using the specified properties. + * @function create + * @memberof google.firestore.v1.RunQueryResponse + * @static + * @param {google.firestore.v1.IRunQueryResponse=} [properties] Properties to set + * @returns {google.firestore.v1.RunQueryResponse} RunQueryResponse instance + */ + RunQueryResponse.create = function create(properties) { + return new RunQueryResponse(properties); + }; + + /** + * Encodes the specified RunQueryResponse message. Does not implicitly {@link google.firestore.v1.RunQueryResponse.verify|verify} messages. + * @function encode + * @memberof google.firestore.v1.RunQueryResponse + * @static + * @param {google.firestore.v1.IRunQueryResponse} message RunQueryResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunQueryResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.document != null && Object.hasOwnProperty.call(message, "document")) + $root.google.firestore.v1.Document.encode(message.document, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.transaction != null && Object.hasOwnProperty.call(message, "transaction")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.transaction); + if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.skippedResults != null && Object.hasOwnProperty.call(message, "skippedResults")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.skippedResults); + if (message.done != null && Object.hasOwnProperty.call(message, "done")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.done); + if (message.explainMetrics != null && Object.hasOwnProperty.call(message, "explainMetrics")) + $root.google.firestore.v1.ExplainMetrics.encode(message.explainMetrics, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RunQueryResponse message, length delimited. Does not implicitly {@link google.firestore.v1.RunQueryResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.firestore.v1.RunQueryResponse + * @static + * @param {google.firestore.v1.IRunQueryResponse} message RunQueryResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunQueryResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RunQueryResponse message from the specified reader or buffer. + * @function decode + * @memberof google.firestore.v1.RunQueryResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.firestore.v1.RunQueryResponse} RunQueryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunQueryResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.firestore.v1.RunQueryResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.transaction = reader.bytes(); + break; + } + case 1: { + message.document = $root.google.firestore.v1.Document.decode(reader, reader.uint32()); + break; + } + case 3: { + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.skippedResults = reader.int32(); + break; + } + case 6: { + message.done = reader.bool(); + break; + } + case 11: { + message.explainMetrics = $root.google.firestore.v1.ExplainMetrics.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RunQueryResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.firestore.v1.RunQueryResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.firestore.v1.RunQueryResponse} RunQueryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunQueryResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RunQueryResponse message. + * @function verify + * @memberof google.firestore.v1.RunQueryResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RunQueryResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.transaction != null && message.hasOwnProperty("transaction")) + if (!(message.transaction && typeof message.transaction.length === "number" || $util.isString(message.transaction))) + return "transaction: buffer expected"; + if (message.document != null && message.hasOwnProperty("document")) { + var error = $root.google.firestore.v1.Document.verify(message.document); + if (error) + return "document." + error; + } + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; + } + if (message.skippedResults != null && message.hasOwnProperty("skippedResults")) + if (!$util.isInteger(message.skippedResults)) + return "skippedResults: integer expected"; + if (message.done != null && message.hasOwnProperty("done")) { + properties.continuationSelector = 1; + if (typeof message.done !== "boolean") + return "done: boolean expected"; + } + if (message.explainMetrics != null && message.hasOwnProperty("explainMetrics")) { + var error = $root.google.firestore.v1.ExplainMetrics.verify(message.explainMetrics); + if (error) + return "explainMetrics." + error; + } + return null; + }; + /** * Creates a RunQueryResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject @@ -11919,14 +23804,14 @@ message.skippedResults = object.skippedResults | 0; if (object.done != null) message.done = Boolean(object.done); - if (object.stats != null) { - if (typeof object.stats !== "object") - throw TypeError(".google.firestore.v1.RunQueryResponse.stats: object expected"); - message.stats = $root.google.firestore.v1.ResultSetStats.fromObject(object.stats); + if (object.explainMetrics != null) { + if (typeof object.explainMetrics !== "object") + throw TypeError(".google.firestore.v1.RunQueryResponse.explainMetrics: object expected"); + message.explainMetrics = $root.google.firestore.v1.ExplainMetrics.fromObject(object.explainMetrics); } return message; }; - + /** * Creates a plain object from a RunQueryResponse message. Also converts values to other types if specified. * @function toObject @@ -11951,7 +23836,7 @@ } object.readTime = null; object.skippedResults = 0; - object.stats = null; + object.explainMetrics = null; } if (message.document != null && message.hasOwnProperty("document")) object.document = $root.google.firestore.v1.Document.toObject(message.document, options); @@ -11966,11 +23851,11 @@ if (options.oneofs) object.continuationSelector = "done"; } - if (message.stats != null && message.hasOwnProperty("stats")) - object.stats = $root.google.firestore.v1.ResultSetStats.toObject(message.stats, options); + if (message.explainMetrics != null && message.hasOwnProperty("explainMetrics")) + object.explainMetrics = $root.google.firestore.v1.ExplainMetrics.toObject(message.explainMetrics, options); return object; }; - + /** * Converts this RunQueryResponse to JSON. * @function toJSON @@ -11981,7 +23866,7 @@ RunQueryResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - + /** * Gets the default type url for RunQueryResponse * @function getTypeUrl @@ -11996,12 +23881,12 @@ } return typeUrlPrefix + "/google.firestore.v1.RunQueryResponse"; }; - + return RunQueryResponse; })(); - + v1.RunAggregationQueryRequest = (function() { - + /** * Properties of a RunAggregationQueryRequest. * @memberof google.firestore.v1 @@ -12011,9 +23896,9 @@ * @property {Uint8Array|null} [transaction] RunAggregationQueryRequest transaction * @property {google.firestore.v1.ITransactionOptions|null} [newTransaction] RunAggregationQueryRequest newTransaction * @property {google.protobuf.ITimestamp|null} [readTime] RunAggregationQueryRequest readTime - * @property {google.firestore.v1.QueryMode|null} [mode] RunAggregationQueryRequest mode + * @property {google.firestore.v1.IExplainOptions|null} [explainOptions] RunAggregationQueryRequest explainOptions */ - + /** * Constructs a new RunAggregationQueryRequest. * @memberof google.firestore.v1 @@ -12028,7 +23913,7 @@ if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } - + /** * RunAggregationQueryRequest parent. * @member {string} parent @@ -12036,7 +23921,7 @@ * @instance */ RunAggregationQueryRequest.prototype.parent = ""; - + /** * RunAggregationQueryRequest structuredAggregationQuery. * @member {google.firestore.v1.IStructuredAggregationQuery|null|undefined} structuredAggregationQuery @@ -12044,7 +23929,7 @@ * @instance */ RunAggregationQueryRequest.prototype.structuredAggregationQuery = null; - + /** * RunAggregationQueryRequest transaction. * @member {Uint8Array|null|undefined} transaction @@ -12052,7 +23937,7 @@ * @instance */ RunAggregationQueryRequest.prototype.transaction = null; - + /** * RunAggregationQueryRequest newTransaction. * @member {google.firestore.v1.ITransactionOptions|null|undefined} newTransaction @@ -12060,7 +23945,7 @@ * @instance */ RunAggregationQueryRequest.prototype.newTransaction = null; - + /** * RunAggregationQueryRequest readTime. * @member {google.protobuf.ITimestamp|null|undefined} readTime @@ -12068,18 +23953,18 @@ * @instance */ RunAggregationQueryRequest.prototype.readTime = null; - + /** - * RunAggregationQueryRequest mode. - * @member {google.firestore.v1.QueryMode} mode + * RunAggregationQueryRequest explainOptions. + * @member {google.firestore.v1.IExplainOptions|null|undefined} explainOptions * @memberof google.firestore.v1.RunAggregationQueryRequest * @instance */ - RunAggregationQueryRequest.prototype.mode = 0; - + RunAggregationQueryRequest.prototype.explainOptions = null; + // OneOf field names bound to virtual getters and setters var $oneOfFields; - + /** * RunAggregationQueryRequest queryType. * @member {"structuredAggregationQuery"|undefined} queryType @@ -12090,7 +23975,7 @@ get: $util.oneOfGetter($oneOfFields = ["structuredAggregationQuery"]), set: $util.oneOfSetter($oneOfFields) }); - + /** * RunAggregationQueryRequest consistencySelector. * @member {"transaction"|"newTransaction"|"readTime"|undefined} consistencySelector @@ -12101,7 +23986,181 @@ get: $util.oneOfGetter($oneOfFields = ["transaction", "newTransaction", "readTime"]), set: $util.oneOfSetter($oneOfFields) }); - + + /** + * Creates a new RunAggregationQueryRequest instance using the specified properties. + * @function create + * @memberof google.firestore.v1.RunAggregationQueryRequest + * @static + * @param {google.firestore.v1.IRunAggregationQueryRequest=} [properties] Properties to set + * @returns {google.firestore.v1.RunAggregationQueryRequest} RunAggregationQueryRequest instance + */ + RunAggregationQueryRequest.create = function create(properties) { + return new RunAggregationQueryRequest(properties); + }; + + /** + * Encodes the specified RunAggregationQueryRequest message. Does not implicitly {@link google.firestore.v1.RunAggregationQueryRequest.verify|verify} messages. + * @function encode + * @memberof google.firestore.v1.RunAggregationQueryRequest + * @static + * @param {google.firestore.v1.IRunAggregationQueryRequest} message RunAggregationQueryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunAggregationQueryRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.structuredAggregationQuery != null && Object.hasOwnProperty.call(message, "structuredAggregationQuery")) + $root.google.firestore.v1.StructuredAggregationQuery.encode(message.structuredAggregationQuery, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.transaction != null && Object.hasOwnProperty.call(message, "transaction")) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.transaction); + if (message.newTransaction != null && Object.hasOwnProperty.call(message, "newTransaction")) + $root.google.firestore.v1.TransactionOptions.encode(message.newTransaction, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.explainOptions != null && Object.hasOwnProperty.call(message, "explainOptions")) + $root.google.firestore.v1.ExplainOptions.encode(message.explainOptions, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RunAggregationQueryRequest message, length delimited. Does not implicitly {@link google.firestore.v1.RunAggregationQueryRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.firestore.v1.RunAggregationQueryRequest + * @static + * @param {google.firestore.v1.IRunAggregationQueryRequest} message RunAggregationQueryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunAggregationQueryRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RunAggregationQueryRequest message from the specified reader or buffer. + * @function decode + * @memberof google.firestore.v1.RunAggregationQueryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.firestore.v1.RunAggregationQueryRequest} RunAggregationQueryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunAggregationQueryRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.firestore.v1.RunAggregationQueryRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.structuredAggregationQuery = $root.google.firestore.v1.StructuredAggregationQuery.decode(reader, reader.uint32()); + break; + } + case 4: { + message.transaction = reader.bytes(); + break; + } + case 5: { + message.newTransaction = $root.google.firestore.v1.TransactionOptions.decode(reader, reader.uint32()); + break; + } + case 6: { + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 8: { + message.explainOptions = $root.google.firestore.v1.ExplainOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RunAggregationQueryRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.firestore.v1.RunAggregationQueryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.firestore.v1.RunAggregationQueryRequest} RunAggregationQueryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunAggregationQueryRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RunAggregationQueryRequest message. + * @function verify + * @memberof google.firestore.v1.RunAggregationQueryRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RunAggregationQueryRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.structuredAggregationQuery != null && message.hasOwnProperty("structuredAggregationQuery")) { + properties.queryType = 1; + { + var error = $root.google.firestore.v1.StructuredAggregationQuery.verify(message.structuredAggregationQuery); + if (error) + return "structuredAggregationQuery." + error; + } + } + if (message.transaction != null && message.hasOwnProperty("transaction")) { + properties.consistencySelector = 1; + if (!(message.transaction && typeof message.transaction.length === "number" || $util.isString(message.transaction))) + return "transaction: buffer expected"; + } + if (message.newTransaction != null && message.hasOwnProperty("newTransaction")) { + if (properties.consistencySelector === 1) + return "consistencySelector: multiple values"; + properties.consistencySelector = 1; + { + var error = $root.google.firestore.v1.TransactionOptions.verify(message.newTransaction); + if (error) + return "newTransaction." + error; + } + } + if (message.readTime != null && message.hasOwnProperty("readTime")) { + if (properties.consistencySelector === 1) + return "consistencySelector: multiple values"; + properties.consistencySelector = 1; + { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; + } + } + if (message.explainOptions != null && message.hasOwnProperty("explainOptions")) { + var error = $root.google.firestore.v1.ExplainOptions.verify(message.explainOptions); + if (error) + return "explainOptions." + error; + } + return null; + }; + /** * Creates a RunAggregationQueryRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject @@ -12136,29 +24195,14 @@ throw TypeError(".google.firestore.v1.RunAggregationQueryRequest.readTime: object expected"); message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); } - switch (object.mode) { - default: - if (typeof object.mode === "number") { - message.mode = object.mode; - break; - } - break; - case "NORMAL": - case 0: - message.mode = 0; - break; - case "PLAN": - case 1: - message.mode = 1; - break; - case "PROFILE": - case 2: - message.mode = 2; - break; - } + if (object.explainOptions != null) { + if (typeof object.explainOptions !== "object") + throw TypeError(".google.firestore.v1.RunAggregationQueryRequest.explainOptions: object expected"); + message.explainOptions = $root.google.firestore.v1.ExplainOptions.fromObject(object.explainOptions); + } return message; }; - + /** * Creates a plain object from a RunAggregationQueryRequest message. Also converts values to other types if specified. * @function toObject @@ -12174,7 +24218,7 @@ var object = {}; if (options.defaults) { object.parent = ""; - object.mode = options.enums === String ? "NORMAL" : 0; + object.explainOptions = null; } if (message.parent != null && message.hasOwnProperty("parent")) object.parent = message.parent; @@ -12198,11 +24242,11 @@ if (options.oneofs) object.consistencySelector = "readTime"; } - if (message.mode != null && message.hasOwnProperty("mode")) - object.mode = options.enums === String ? $root.google.firestore.v1.QueryMode[message.mode] === undefined ? message.mode : $root.google.firestore.v1.QueryMode[message.mode] : message.mode; + if (message.explainOptions != null && message.hasOwnProperty("explainOptions")) + object.explainOptions = $root.google.firestore.v1.ExplainOptions.toObject(message.explainOptions, options); return object; }; - + /** * Converts this RunAggregationQueryRequest to JSON. * @function toJSON @@ -12213,7 +24257,7 @@ RunAggregationQueryRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - + /** * Gets the default type url for RunAggregationQueryRequest * @function getTypeUrl @@ -12228,12 +24272,12 @@ } return typeUrlPrefix + "/google.firestore.v1.RunAggregationQueryRequest"; }; - + return RunAggregationQueryRequest; })(); - + v1.RunAggregationQueryResponse = (function() { - + /** * Properties of a RunAggregationQueryResponse. * @memberof google.firestore.v1 @@ -12241,9 +24285,9 @@ * @property {google.firestore.v1.IAggregationResult|null} [result] RunAggregationQueryResponse result * @property {Uint8Array|null} [transaction] RunAggregationQueryResponse transaction * @property {google.protobuf.ITimestamp|null} [readTime] RunAggregationQueryResponse readTime - * @property {google.firestore.v1.IResultSetStats|null} [stats] RunAggregationQueryResponse stats + * @property {google.firestore.v1.IExplainMetrics|null} [explainMetrics] RunAggregationQueryResponse explainMetrics */ - + /** * Constructs a new RunAggregationQueryResponse. * @memberof google.firestore.v1 @@ -12258,7 +24302,7 @@ if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } - + /** * RunAggregationQueryResponse result. * @member {google.firestore.v1.IAggregationResult|null|undefined} result @@ -12266,7 +24310,7 @@ * @instance */ RunAggregationQueryResponse.prototype.result = null; - + /** * RunAggregationQueryResponse transaction. * @member {Uint8Array} transaction @@ -12274,7 +24318,7 @@ * @instance */ RunAggregationQueryResponse.prototype.transaction = $util.newBuffer([]); - + /** * RunAggregationQueryResponse readTime. * @member {google.protobuf.ITimestamp|null|undefined} readTime @@ -12282,15 +24326,153 @@ * @instance */ RunAggregationQueryResponse.prototype.readTime = null; - + /** - * RunAggregationQueryResponse stats. - * @member {google.firestore.v1.IResultSetStats|null|undefined} stats + * RunAggregationQueryResponse explainMetrics. + * @member {google.firestore.v1.IExplainMetrics|null|undefined} explainMetrics * @memberof google.firestore.v1.RunAggregationQueryResponse * @instance */ - RunAggregationQueryResponse.prototype.stats = null; - + RunAggregationQueryResponse.prototype.explainMetrics = null; + + /** + * Creates a new RunAggregationQueryResponse instance using the specified properties. + * @function create + * @memberof google.firestore.v1.RunAggregationQueryResponse + * @static + * @param {google.firestore.v1.IRunAggregationQueryResponse=} [properties] Properties to set + * @returns {google.firestore.v1.RunAggregationQueryResponse} RunAggregationQueryResponse instance + */ + RunAggregationQueryResponse.create = function create(properties) { + return new RunAggregationQueryResponse(properties); + }; + + /** + * Encodes the specified RunAggregationQueryResponse message. Does not implicitly {@link google.firestore.v1.RunAggregationQueryResponse.verify|verify} messages. + * @function encode + * @memberof google.firestore.v1.RunAggregationQueryResponse + * @static + * @param {google.firestore.v1.IRunAggregationQueryResponse} message RunAggregationQueryResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunAggregationQueryResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.result != null && Object.hasOwnProperty.call(message, "result")) + $root.google.firestore.v1.AggregationResult.encode(message.result, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.transaction != null && Object.hasOwnProperty.call(message, "transaction")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.transaction); + if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.explainMetrics != null && Object.hasOwnProperty.call(message, "explainMetrics")) + $root.google.firestore.v1.ExplainMetrics.encode(message.explainMetrics, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RunAggregationQueryResponse message, length delimited. Does not implicitly {@link google.firestore.v1.RunAggregationQueryResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.firestore.v1.RunAggregationQueryResponse + * @static + * @param {google.firestore.v1.IRunAggregationQueryResponse} message RunAggregationQueryResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunAggregationQueryResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RunAggregationQueryResponse message from the specified reader or buffer. + * @function decode + * @memberof google.firestore.v1.RunAggregationQueryResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.firestore.v1.RunAggregationQueryResponse} RunAggregationQueryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunAggregationQueryResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.firestore.v1.RunAggregationQueryResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.result = $root.google.firestore.v1.AggregationResult.decode(reader, reader.uint32()); + break; + } + case 2: { + message.transaction = reader.bytes(); + break; + } + case 3: { + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 10: { + message.explainMetrics = $root.google.firestore.v1.ExplainMetrics.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RunAggregationQueryResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.firestore.v1.RunAggregationQueryResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.firestore.v1.RunAggregationQueryResponse} RunAggregationQueryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunAggregationQueryResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RunAggregationQueryResponse message. + * @function verify + * @memberof google.firestore.v1.RunAggregationQueryResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RunAggregationQueryResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.result != null && message.hasOwnProperty("result")) { + var error = $root.google.firestore.v1.AggregationResult.verify(message.result); + if (error) + return "result." + error; + } + if (message.transaction != null && message.hasOwnProperty("transaction")) + if (!(message.transaction && typeof message.transaction.length === "number" || $util.isString(message.transaction))) + return "transaction: buffer expected"; + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; + } + if (message.explainMetrics != null && message.hasOwnProperty("explainMetrics")) { + var error = $root.google.firestore.v1.ExplainMetrics.verify(message.explainMetrics); + if (error) + return "explainMetrics." + error; + } + return null; + }; + /** * Creates a RunAggregationQueryResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject @@ -12318,14 +24500,14 @@ throw TypeError(".google.firestore.v1.RunAggregationQueryResponse.readTime: object expected"); message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); } - if (object.stats != null) { - if (typeof object.stats !== "object") - throw TypeError(".google.firestore.v1.RunAggregationQueryResponse.stats: object expected"); - message.stats = $root.google.firestore.v1.ResultSetStats.fromObject(object.stats); + if (object.explainMetrics != null) { + if (typeof object.explainMetrics !== "object") + throw TypeError(".google.firestore.v1.RunAggregationQueryResponse.explainMetrics: object expected"); + message.explainMetrics = $root.google.firestore.v1.ExplainMetrics.fromObject(object.explainMetrics); } return message; }; - + /** * Creates a plain object from a RunAggregationQueryResponse message. Also converts values to other types if specified. * @function toObject @@ -12349,7 +24531,7 @@ object.transaction = $util.newBuffer(object.transaction); } object.readTime = null; - object.stats = null; + object.explainMetrics = null; } if (message.result != null && message.hasOwnProperty("result")) object.result = $root.google.firestore.v1.AggregationResult.toObject(message.result, options); @@ -12357,11 +24539,11 @@ object.transaction = options.bytes === String ? $util.base64.encode(message.transaction, 0, message.transaction.length) : options.bytes === Array ? Array.prototype.slice.call(message.transaction) : message.transaction; if (message.readTime != null && message.hasOwnProperty("readTime")) object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); - if (message.stats != null && message.hasOwnProperty("stats")) - object.stats = $root.google.firestore.v1.ResultSetStats.toObject(message.stats, options); + if (message.explainMetrics != null && message.hasOwnProperty("explainMetrics")) + object.explainMetrics = $root.google.firestore.v1.ExplainMetrics.toObject(message.explainMetrics, options); return object; }; - + /** * Converts this RunAggregationQueryResponse to JSON. * @function toJSON @@ -12372,7 +24554,7 @@ RunAggregationQueryResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - + /** * Gets the default type url for RunAggregationQueryResponse * @function getTypeUrl @@ -12387,24 +24569,24 @@ } return typeUrlPrefix + "/google.firestore.v1.RunAggregationQueryResponse"; }; - + return RunAggregationQueryResponse; })(); - + v1.PartitionQueryRequest = (function() { - + /** * Properties of a PartitionQueryRequest. * @memberof google.firestore.v1 * @interface IPartitionQueryRequest * @property {string|null} [parent] PartitionQueryRequest parent * @property {google.firestore.v1.IStructuredQuery|null} [structuredQuery] PartitionQueryRequest structuredQuery - * @property {number|string|null} [partitionCount] PartitionQueryRequest partitionCount + * @property {number|Long|null} [partitionCount] PartitionQueryRequest partitionCount * @property {string|null} [pageToken] PartitionQueryRequest pageToken * @property {number|null} [pageSize] PartitionQueryRequest pageSize * @property {google.protobuf.ITimestamp|null} [readTime] PartitionQueryRequest readTime */ - + /** * Constructs a new PartitionQueryRequest. * @memberof google.firestore.v1 @@ -12419,7 +24601,7 @@ if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } - + /** * PartitionQueryRequest parent. * @member {string} parent @@ -12427,7 +24609,7 @@ * @instance */ PartitionQueryRequest.prototype.parent = ""; - + /** * PartitionQueryRequest structuredQuery. * @member {google.firestore.v1.IStructuredQuery|null|undefined} structuredQuery @@ -12435,15 +24617,15 @@ * @instance */ PartitionQueryRequest.prototype.structuredQuery = null; - + /** * PartitionQueryRequest partitionCount. - * @member {number|string} partitionCount + * @member {number|Long} partitionCount * @memberof google.firestore.v1.PartitionQueryRequest * @instance */ PartitionQueryRequest.prototype.partitionCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - + /** * PartitionQueryRequest pageToken. * @member {string} pageToken @@ -12451,7 +24633,7 @@ * @instance */ PartitionQueryRequest.prototype.pageToken = ""; - + /** * PartitionQueryRequest pageSize. * @member {number} pageSize @@ -12459,7 +24641,7 @@ * @instance */ PartitionQueryRequest.prototype.pageSize = 0; - + /** * PartitionQueryRequest readTime. * @member {google.protobuf.ITimestamp|null|undefined} readTime @@ -12467,10 +24649,10 @@ * @instance */ PartitionQueryRequest.prototype.readTime = null; - + // OneOf field names bound to virtual getters and setters var $oneOfFields; - + /** * PartitionQueryRequest queryType. * @member {"structuredQuery"|undefined} queryType @@ -12481,7 +24663,7 @@ get: $util.oneOfGetter($oneOfFields = ["structuredQuery"]), set: $util.oneOfSetter($oneOfFields) }); - + /** * PartitionQueryRequest consistencySelector. * @member {"readTime"|undefined} consistencySelector @@ -12492,7 +24674,168 @@ get: $util.oneOfGetter($oneOfFields = ["readTime"]), set: $util.oneOfSetter($oneOfFields) }); - + + /** + * Creates a new PartitionQueryRequest instance using the specified properties. + * @function create + * @memberof google.firestore.v1.PartitionQueryRequest + * @static + * @param {google.firestore.v1.IPartitionQueryRequest=} [properties] Properties to set + * @returns {google.firestore.v1.PartitionQueryRequest} PartitionQueryRequest instance + */ + PartitionQueryRequest.create = function create(properties) { + return new PartitionQueryRequest(properties); + }; + + /** + * Encodes the specified PartitionQueryRequest message. Does not implicitly {@link google.firestore.v1.PartitionQueryRequest.verify|verify} messages. + * @function encode + * @memberof google.firestore.v1.PartitionQueryRequest + * @static + * @param {google.firestore.v1.IPartitionQueryRequest} message PartitionQueryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PartitionQueryRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.structuredQuery != null && Object.hasOwnProperty.call(message, "structuredQuery")) + $root.google.firestore.v1.StructuredQuery.encode(message.structuredQuery, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.partitionCount != null && Object.hasOwnProperty.call(message, "partitionCount")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.partitionCount); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.pageSize); + if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PartitionQueryRequest message, length delimited. Does not implicitly {@link google.firestore.v1.PartitionQueryRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.firestore.v1.PartitionQueryRequest + * @static + * @param {google.firestore.v1.IPartitionQueryRequest} message PartitionQueryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PartitionQueryRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PartitionQueryRequest message from the specified reader or buffer. + * @function decode + * @memberof google.firestore.v1.PartitionQueryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.firestore.v1.PartitionQueryRequest} PartitionQueryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PartitionQueryRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.firestore.v1.PartitionQueryRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.structuredQuery = $root.google.firestore.v1.StructuredQuery.decode(reader, reader.uint32()); + break; + } + case 3: { + message.partitionCount = reader.int64(); + break; + } + case 4: { + message.pageToken = reader.string(); + break; + } + case 5: { + message.pageSize = reader.int32(); + break; + } + case 6: { + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PartitionQueryRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.firestore.v1.PartitionQueryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.firestore.v1.PartitionQueryRequest} PartitionQueryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PartitionQueryRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PartitionQueryRequest message. + * @function verify + * @memberof google.firestore.v1.PartitionQueryRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PartitionQueryRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.structuredQuery != null && message.hasOwnProperty("structuredQuery")) { + properties.queryType = 1; + { + var error = $root.google.firestore.v1.StructuredQuery.verify(message.structuredQuery); + if (error) + return "structuredQuery." + error; + } + } + if (message.partitionCount != null && message.hasOwnProperty("partitionCount")) + if (!$util.isInteger(message.partitionCount) && !(message.partitionCount && $util.isInteger(message.partitionCount.low) && $util.isInteger(message.partitionCount.high))) + return "partitionCount: integer|Long expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.readTime != null && message.hasOwnProperty("readTime")) { + properties.consistencySelector = 1; + { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; + } + } + return null; + }; + /** * Creates a PartitionQueryRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject @@ -12532,7 +24875,7 @@ } return message; }; - + /** * Creates a plain object from a PartitionQueryRequest message. Also converts values to other types if specified. * @function toObject @@ -12579,7 +24922,7 @@ } return object; }; - + /** * Converts this PartitionQueryRequest to JSON. * @function toJSON @@ -12590,7 +24933,7 @@ PartitionQueryRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - + /** * Gets the default type url for PartitionQueryRequest * @function getTypeUrl @@ -12605,12 +24948,12 @@ } return typeUrlPrefix + "/google.firestore.v1.PartitionQueryRequest"; }; - + return PartitionQueryRequest; })(); - + v1.PartitionQueryResponse = (function() { - + /** * Properties of a PartitionQueryResponse. * @memberof google.firestore.v1 @@ -12618,7 +24961,7 @@ * @property {Array.|null} [partitions] PartitionQueryResponse partitions * @property {string|null} [nextPageToken] PartitionQueryResponse nextPageToken */ - + /** * Constructs a new PartitionQueryResponse. * @memberof google.firestore.v1 @@ -12634,7 +24977,7 @@ if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } - + /** * PartitionQueryResponse partitions. * @member {Array.} partitions @@ -12642,7 +24985,7 @@ * @instance */ PartitionQueryResponse.prototype.partitions = $util.emptyArray; - + /** * PartitionQueryResponse nextPageToken. * @member {string} nextPageToken @@ -12650,7 +24993,130 @@ * @instance */ PartitionQueryResponse.prototype.nextPageToken = ""; - + + /** + * Creates a new PartitionQueryResponse instance using the specified properties. + * @function create + * @memberof google.firestore.v1.PartitionQueryResponse + * @static + * @param {google.firestore.v1.IPartitionQueryResponse=} [properties] Properties to set + * @returns {google.firestore.v1.PartitionQueryResponse} PartitionQueryResponse instance + */ + PartitionQueryResponse.create = function create(properties) { + return new PartitionQueryResponse(properties); + }; + + /** + * Encodes the specified PartitionQueryResponse message. Does not implicitly {@link google.firestore.v1.PartitionQueryResponse.verify|verify} messages. + * @function encode + * @memberof google.firestore.v1.PartitionQueryResponse + * @static + * @param {google.firestore.v1.IPartitionQueryResponse} message PartitionQueryResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PartitionQueryResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.partitions != null && message.partitions.length) + for (var i = 0; i < message.partitions.length; ++i) + $root.google.firestore.v1.Cursor.encode(message.partitions[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified PartitionQueryResponse message, length delimited. Does not implicitly {@link google.firestore.v1.PartitionQueryResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.firestore.v1.PartitionQueryResponse + * @static + * @param {google.firestore.v1.IPartitionQueryResponse} message PartitionQueryResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PartitionQueryResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PartitionQueryResponse message from the specified reader or buffer. + * @function decode + * @memberof google.firestore.v1.PartitionQueryResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.firestore.v1.PartitionQueryResponse} PartitionQueryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PartitionQueryResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.firestore.v1.PartitionQueryResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.partitions && message.partitions.length)) + message.partitions = []; + message.partitions.push($root.google.firestore.v1.Cursor.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PartitionQueryResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.firestore.v1.PartitionQueryResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.firestore.v1.PartitionQueryResponse} PartitionQueryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PartitionQueryResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PartitionQueryResponse message. + * @function verify + * @memberof google.firestore.v1.PartitionQueryResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PartitionQueryResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.partitions != null && message.hasOwnProperty("partitions")) { + if (!Array.isArray(message.partitions)) + return "partitions: array expected"; + for (var i = 0; i < message.partitions.length; ++i) { + var error = $root.google.firestore.v1.Cursor.verify(message.partitions[i]); + if (error) + return "partitions." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + /** * Creates a PartitionQueryResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject @@ -12677,7 +25143,7 @@ message.nextPageToken = String(object.nextPageToken); return message; }; - + /** * Creates a plain object from a PartitionQueryResponse message. Also converts values to other types if specified. * @function toObject @@ -12704,7 +25170,7 @@ object.nextPageToken = message.nextPageToken; return object; }; - + /** * Converts this PartitionQueryResponse to JSON. * @function toJSON @@ -12715,7 +25181,7 @@ PartitionQueryResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - + /** * Gets the default type url for PartitionQueryResponse * @function getTypeUrl @@ -12730,12 +25196,12 @@ } return typeUrlPrefix + "/google.firestore.v1.PartitionQueryResponse"; }; - + return PartitionQueryResponse; })(); - + v1.WriteRequest = (function() { - + /** * Properties of a WriteRequest. * @memberof google.firestore.v1 @@ -12746,7 +25212,7 @@ * @property {Uint8Array|null} [streamToken] WriteRequest streamToken * @property {Object.|null} [labels] WriteRequest labels */ - + /** * Constructs a new WriteRequest. * @memberof google.firestore.v1 @@ -12763,7 +25229,7 @@ if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } - + /** * WriteRequest database. * @member {string} database @@ -12771,39 +25237,214 @@ * @instance */ WriteRequest.prototype.database = ""; - + + /** + * WriteRequest streamId. + * @member {string} streamId + * @memberof google.firestore.v1.WriteRequest + * @instance + */ + WriteRequest.prototype.streamId = ""; + + /** + * WriteRequest writes. + * @member {Array.} writes + * @memberof google.firestore.v1.WriteRequest + * @instance + */ + WriteRequest.prototype.writes = $util.emptyArray; + + /** + * WriteRequest streamToken. + * @member {Uint8Array} streamToken + * @memberof google.firestore.v1.WriteRequest + * @instance + */ + WriteRequest.prototype.streamToken = $util.newBuffer([]); + + /** + * WriteRequest labels. + * @member {Object.} labels + * @memberof google.firestore.v1.WriteRequest + * @instance + */ + WriteRequest.prototype.labels = $util.emptyObject; + + /** + * Creates a new WriteRequest instance using the specified properties. + * @function create + * @memberof google.firestore.v1.WriteRequest + * @static + * @param {google.firestore.v1.IWriteRequest=} [properties] Properties to set + * @returns {google.firestore.v1.WriteRequest} WriteRequest instance + */ + WriteRequest.create = function create(properties) { + return new WriteRequest(properties); + }; + + /** + * Encodes the specified WriteRequest message. Does not implicitly {@link google.firestore.v1.WriteRequest.verify|verify} messages. + * @function encode + * @memberof google.firestore.v1.WriteRequest + * @static + * @param {google.firestore.v1.IWriteRequest} message WriteRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WriteRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.database != null && Object.hasOwnProperty.call(message, "database")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.database); + if (message.streamId != null && Object.hasOwnProperty.call(message, "streamId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.streamId); + if (message.writes != null && message.writes.length) + for (var i = 0; i < message.writes.length; ++i) + $root.google.firestore.v1.Write.encode(message.writes[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.streamToken != null && Object.hasOwnProperty.call(message, "streamToken")) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.streamToken); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + return writer; + }; + /** - * WriteRequest streamId. - * @member {string} streamId + * Encodes the specified WriteRequest message, length delimited. Does not implicitly {@link google.firestore.v1.WriteRequest.verify|verify} messages. + * @function encodeDelimited * @memberof google.firestore.v1.WriteRequest - * @instance + * @static + * @param {google.firestore.v1.IWriteRequest} message WriteRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - WriteRequest.prototype.streamId = ""; - + WriteRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + /** - * WriteRequest writes. - * @member {Array.} writes + * Decodes a WriteRequest message from the specified reader or buffer. + * @function decode * @memberof google.firestore.v1.WriteRequest - * @instance - */ - WriteRequest.prototype.writes = $util.emptyArray; - + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.firestore.v1.WriteRequest} WriteRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WriteRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.firestore.v1.WriteRequest(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.database = reader.string(); + break; + } + case 2: { + message.streamId = reader.string(); + break; + } + case 3: { + if (!(message.writes && message.writes.length)) + message.writes = []; + message.writes.push($root.google.firestore.v1.Write.decode(reader, reader.uint32())); + break; + } + case 4: { + message.streamToken = reader.bytes(); + break; + } + case 5: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + /** - * WriteRequest streamToken. - * @member {Uint8Array} streamToken + * Decodes a WriteRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited * @memberof google.firestore.v1.WriteRequest - * @instance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.firestore.v1.WriteRequest} WriteRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - WriteRequest.prototype.streamToken = $util.newBuffer([]); - + WriteRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + /** - * WriteRequest labels. - * @member {Object.} labels + * Verifies a WriteRequest message. + * @function verify * @memberof google.firestore.v1.WriteRequest - * @instance + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - WriteRequest.prototype.labels = $util.emptyObject; - + WriteRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.database != null && message.hasOwnProperty("database")) + if (!$util.isString(message.database)) + return "database: string expected"; + if (message.streamId != null && message.hasOwnProperty("streamId")) + if (!$util.isString(message.streamId)) + return "streamId: string expected"; + if (message.writes != null && message.hasOwnProperty("writes")) { + if (!Array.isArray(message.writes)) + return "writes: array expected"; + for (var i = 0; i < message.writes.length; ++i) { + var error = $root.google.firestore.v1.Write.verify(message.writes[i]); + if (error) + return "writes." + error; + } + } + if (message.streamToken != null && message.hasOwnProperty("streamToken")) + if (!(message.streamToken && typeof message.streamToken.length === "number" || $util.isString(message.streamToken))) + return "streamToken: buffer expected"; + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + return null; + }; + /** * Creates a WriteRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject @@ -12844,7 +25485,7 @@ } return message; }; - + /** * Creates a plain object from a WriteRequest message. Also converts values to other types if specified. * @function toObject @@ -12892,7 +25533,7 @@ } return object; }; - + /** * Converts this WriteRequest to JSON. * @function toJSON @@ -12903,7 +25544,7 @@ WriteRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - + /** * Gets the default type url for WriteRequest * @function getTypeUrl @@ -12918,12 +25559,12 @@ } return typeUrlPrefix + "/google.firestore.v1.WriteRequest"; }; - + return WriteRequest; })(); - + v1.WriteResponse = (function() { - + /** * Properties of a WriteResponse. * @memberof google.firestore.v1 @@ -12933,7 +25574,7 @@ * @property {Array.|null} [writeResults] WriteResponse writeResults * @property {google.protobuf.ITimestamp|null} [commitTime] WriteResponse commitTime */ - + /** * Constructs a new WriteResponse. * @memberof google.firestore.v1 @@ -12949,7 +25590,7 @@ if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } - + /** * WriteResponse streamId. * @member {string} streamId @@ -12957,7 +25598,7 @@ * @instance */ WriteResponse.prototype.streamId = ""; - + /** * WriteResponse streamToken. * @member {Uint8Array} streamToken @@ -12965,7 +25606,7 @@ * @instance */ WriteResponse.prototype.streamToken = $util.newBuffer([]); - + /** * WriteResponse writeResults. * @member {Array.} writeResults @@ -12973,7 +25614,7 @@ * @instance */ WriteResponse.prototype.writeResults = $util.emptyArray; - + /** * WriteResponse commitTime. * @member {google.protobuf.ITimestamp|null|undefined} commitTime @@ -12981,7 +25622,150 @@ * @instance */ WriteResponse.prototype.commitTime = null; - + + /** + * Creates a new WriteResponse instance using the specified properties. + * @function create + * @memberof google.firestore.v1.WriteResponse + * @static + * @param {google.firestore.v1.IWriteResponse=} [properties] Properties to set + * @returns {google.firestore.v1.WriteResponse} WriteResponse instance + */ + WriteResponse.create = function create(properties) { + return new WriteResponse(properties); + }; + + /** + * Encodes the specified WriteResponse message. Does not implicitly {@link google.firestore.v1.WriteResponse.verify|verify} messages. + * @function encode + * @memberof google.firestore.v1.WriteResponse + * @static + * @param {google.firestore.v1.IWriteResponse} message WriteResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WriteResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.streamId != null && Object.hasOwnProperty.call(message, "streamId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.streamId); + if (message.streamToken != null && Object.hasOwnProperty.call(message, "streamToken")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.streamToken); + if (message.writeResults != null && message.writeResults.length) + for (var i = 0; i < message.writeResults.length; ++i) + $root.google.firestore.v1.WriteResult.encode(message.writeResults[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.commitTime != null && Object.hasOwnProperty.call(message, "commitTime")) + $root.google.protobuf.Timestamp.encode(message.commitTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified WriteResponse message, length delimited. Does not implicitly {@link google.firestore.v1.WriteResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.firestore.v1.WriteResponse + * @static + * @param {google.firestore.v1.IWriteResponse} message WriteResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WriteResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WriteResponse message from the specified reader or buffer. + * @function decode + * @memberof google.firestore.v1.WriteResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.firestore.v1.WriteResponse} WriteResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WriteResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.firestore.v1.WriteResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.streamId = reader.string(); + break; + } + case 2: { + message.streamToken = reader.bytes(); + break; + } + case 3: { + if (!(message.writeResults && message.writeResults.length)) + message.writeResults = []; + message.writeResults.push($root.google.firestore.v1.WriteResult.decode(reader, reader.uint32())); + break; + } + case 4: { + message.commitTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WriteResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.firestore.v1.WriteResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.firestore.v1.WriteResponse} WriteResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WriteResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WriteResponse message. + * @function verify + * @memberof google.firestore.v1.WriteResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WriteResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.streamId != null && message.hasOwnProperty("streamId")) + if (!$util.isString(message.streamId)) + return "streamId: string expected"; + if (message.streamToken != null && message.hasOwnProperty("streamToken")) + if (!(message.streamToken && typeof message.streamToken.length === "number" || $util.isString(message.streamToken))) + return "streamToken: buffer expected"; + if (message.writeResults != null && message.hasOwnProperty("writeResults")) { + if (!Array.isArray(message.writeResults)) + return "writeResults: array expected"; + for (var i = 0; i < message.writeResults.length; ++i) { + var error = $root.google.firestore.v1.WriteResult.verify(message.writeResults[i]); + if (error) + return "writeResults." + error; + } + } + if (message.commitTime != null && message.hasOwnProperty("commitTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.commitTime); + if (error) + return "commitTime." + error; + } + return null; + }; + /** * Creates a WriteResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject @@ -13018,7 +25802,7 @@ } return message; }; - + /** * Creates a plain object from a WriteResponse message. Also converts values to other types if specified. * @function toObject @@ -13058,7 +25842,7 @@ object.commitTime = $root.google.protobuf.Timestamp.toObject(message.commitTime, options); return object; }; - + /** * Converts this WriteResponse to JSON. * @function toJSON @@ -13069,7 +25853,7 @@ WriteResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - + /** * Gets the default type url for WriteResponse * @function getTypeUrl @@ -13084,12 +25868,12 @@ } return typeUrlPrefix + "/google.firestore.v1.WriteResponse"; }; - + return WriteResponse; })(); - + v1.ListenRequest = (function() { - + /** * Properties of a ListenRequest. * @memberof google.firestore.v1 @@ -13099,7 +25883,7 @@ * @property {number|null} [removeTarget] ListenRequest removeTarget * @property {Object.|null} [labels] ListenRequest labels */ - + /** * Constructs a new ListenRequest. * @memberof google.firestore.v1 @@ -13115,7 +25899,7 @@ if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } - + /** * ListenRequest database. * @member {string} database @@ -13123,7 +25907,7 @@ * @instance */ ListenRequest.prototype.database = ""; - + /** * ListenRequest addTarget. * @member {google.firestore.v1.ITarget|null|undefined} addTarget @@ -13131,7 +25915,7 @@ * @instance */ ListenRequest.prototype.addTarget = null; - + /** * ListenRequest removeTarget. * @member {number|null|undefined} removeTarget @@ -13139,7 +25923,7 @@ * @instance */ ListenRequest.prototype.removeTarget = null; - + /** * ListenRequest labels. * @member {Object.} labels @@ -13147,10 +25931,10 @@ * @instance */ ListenRequest.prototype.labels = $util.emptyObject; - + // OneOf field names bound to virtual getters and setters var $oneOfFields; - + /** * ListenRequest targetChange. * @member {"addTarget"|"removeTarget"|undefined} targetChange @@ -13161,7 +25945,174 @@ get: $util.oneOfGetter($oneOfFields = ["addTarget", "removeTarget"]), set: $util.oneOfSetter($oneOfFields) }); - + + /** + * Creates a new ListenRequest instance using the specified properties. + * @function create + * @memberof google.firestore.v1.ListenRequest + * @static + * @param {google.firestore.v1.IListenRequest=} [properties] Properties to set + * @returns {google.firestore.v1.ListenRequest} ListenRequest instance + */ + ListenRequest.create = function create(properties) { + return new ListenRequest(properties); + }; + + /** + * Encodes the specified ListenRequest message. Does not implicitly {@link google.firestore.v1.ListenRequest.verify|verify} messages. + * @function encode + * @memberof google.firestore.v1.ListenRequest + * @static + * @param {google.firestore.v1.IListenRequest} message ListenRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListenRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.database != null && Object.hasOwnProperty.call(message, "database")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.database); + if (message.addTarget != null && Object.hasOwnProperty.call(message, "addTarget")) + $root.google.firestore.v1.Target.encode(message.addTarget, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.removeTarget != null && Object.hasOwnProperty.call(message, "removeTarget")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.removeTarget); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified ListenRequest message, length delimited. Does not implicitly {@link google.firestore.v1.ListenRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.firestore.v1.ListenRequest + * @static + * @param {google.firestore.v1.IListenRequest} message ListenRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListenRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListenRequest message from the specified reader or buffer. + * @function decode + * @memberof google.firestore.v1.ListenRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.firestore.v1.ListenRequest} ListenRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListenRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.firestore.v1.ListenRequest(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.database = reader.string(); + break; + } + case 2: { + message.addTarget = $root.google.firestore.v1.Target.decode(reader, reader.uint32()); + break; + } + case 3: { + message.removeTarget = reader.int32(); + break; + } + case 4: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListenRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.firestore.v1.ListenRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.firestore.v1.ListenRequest} ListenRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListenRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListenRequest message. + * @function verify + * @memberof google.firestore.v1.ListenRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListenRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.database != null && message.hasOwnProperty("database")) + if (!$util.isString(message.database)) + return "database: string expected"; + if (message.addTarget != null && message.hasOwnProperty("addTarget")) { + properties.targetChange = 1; + { + var error = $root.google.firestore.v1.Target.verify(message.addTarget); + if (error) + return "addTarget." + error; + } + } + if (message.removeTarget != null && message.hasOwnProperty("removeTarget")) { + if (properties.targetChange === 1) + return "targetChange: multiple values"; + properties.targetChange = 1; + if (!$util.isInteger(message.removeTarget)) + return "removeTarget: integer expected"; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + return null; + }; + /** * Creates a ListenRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject @@ -13192,7 +26143,7 @@ } return message; }; - + /** * Creates a plain object from a ListenRequest message. Also converts values to other types if specified. * @function toObject @@ -13230,7 +26181,7 @@ } return object; }; - + /** * Converts this ListenRequest to JSON. * @function toJSON @@ -13241,7 +26192,7 @@ ListenRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - + /** * Gets the default type url for ListenRequest * @function getTypeUrl @@ -13256,12 +26207,12 @@ } return typeUrlPrefix + "/google.firestore.v1.ListenRequest"; }; - + return ListenRequest; })(); - + v1.ListenResponse = (function() { - + /** * Properties of a ListenResponse. * @memberof google.firestore.v1 @@ -13272,7 +26223,7 @@ * @property {google.firestore.v1.IDocumentRemove|null} [documentRemove] ListenResponse documentRemove * @property {google.firestore.v1.IExistenceFilter|null} [filter] ListenResponse filter */ - + /** * Constructs a new ListenResponse. * @memberof google.firestore.v1 @@ -13287,7 +26238,7 @@ if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } - + /** * ListenResponse targetChange. * @member {google.firestore.v1.ITargetChange|null|undefined} targetChange @@ -13295,7 +26246,7 @@ * @instance */ ListenResponse.prototype.targetChange = null; - + /** * ListenResponse documentChange. * @member {google.firestore.v1.IDocumentChange|null|undefined} documentChange @@ -13303,7 +26254,7 @@ * @instance */ ListenResponse.prototype.documentChange = null; - + /** * ListenResponse documentDelete. * @member {google.firestore.v1.IDocumentDelete|null|undefined} documentDelete @@ -13311,7 +26262,7 @@ * @instance */ ListenResponse.prototype.documentDelete = null; - + /** * ListenResponse documentRemove. * @member {google.firestore.v1.IDocumentRemove|null|undefined} documentRemove @@ -13319,7 +26270,7 @@ * @instance */ ListenResponse.prototype.documentRemove = null; - + /** * ListenResponse filter. * @member {google.firestore.v1.IExistenceFilter|null|undefined} filter @@ -13327,10 +26278,10 @@ * @instance */ ListenResponse.prototype.filter = null; - + // OneOf field names bound to virtual getters and setters var $oneOfFields; - + /** * ListenResponse responseType. * @member {"targetChange"|"documentChange"|"documentDelete"|"documentRemove"|"filter"|undefined} responseType @@ -13341,7 +26292,182 @@ get: $util.oneOfGetter($oneOfFields = ["targetChange", "documentChange", "documentDelete", "documentRemove", "filter"]), set: $util.oneOfSetter($oneOfFields) }); - + + /** + * Creates a new ListenResponse instance using the specified properties. + * @function create + * @memberof google.firestore.v1.ListenResponse + * @static + * @param {google.firestore.v1.IListenResponse=} [properties] Properties to set + * @returns {google.firestore.v1.ListenResponse} ListenResponse instance + */ + ListenResponse.create = function create(properties) { + return new ListenResponse(properties); + }; + + /** + * Encodes the specified ListenResponse message. Does not implicitly {@link google.firestore.v1.ListenResponse.verify|verify} messages. + * @function encode + * @memberof google.firestore.v1.ListenResponse + * @static + * @param {google.firestore.v1.IListenResponse} message ListenResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListenResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.targetChange != null && Object.hasOwnProperty.call(message, "targetChange")) + $root.google.firestore.v1.TargetChange.encode(message.targetChange, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.documentChange != null && Object.hasOwnProperty.call(message, "documentChange")) + $root.google.firestore.v1.DocumentChange.encode(message.documentChange, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.documentDelete != null && Object.hasOwnProperty.call(message, "documentDelete")) + $root.google.firestore.v1.DocumentDelete.encode(message.documentDelete, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + $root.google.firestore.v1.ExistenceFilter.encode(message.filter, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.documentRemove != null && Object.hasOwnProperty.call(message, "documentRemove")) + $root.google.firestore.v1.DocumentRemove.encode(message.documentRemove, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ListenResponse message, length delimited. Does not implicitly {@link google.firestore.v1.ListenResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.firestore.v1.ListenResponse + * @static + * @param {google.firestore.v1.IListenResponse} message ListenResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListenResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListenResponse message from the specified reader or buffer. + * @function decode + * @memberof google.firestore.v1.ListenResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.firestore.v1.ListenResponse} ListenResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListenResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.firestore.v1.ListenResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.targetChange = $root.google.firestore.v1.TargetChange.decode(reader, reader.uint32()); + break; + } + case 3: { + message.documentChange = $root.google.firestore.v1.DocumentChange.decode(reader, reader.uint32()); + break; + } + case 4: { + message.documentDelete = $root.google.firestore.v1.DocumentDelete.decode(reader, reader.uint32()); + break; + } + case 6: { + message.documentRemove = $root.google.firestore.v1.DocumentRemove.decode(reader, reader.uint32()); + break; + } + case 5: { + message.filter = $root.google.firestore.v1.ExistenceFilter.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListenResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.firestore.v1.ListenResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.firestore.v1.ListenResponse} ListenResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListenResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListenResponse message. + * @function verify + * @memberof google.firestore.v1.ListenResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListenResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.targetChange != null && message.hasOwnProperty("targetChange")) { + properties.responseType = 1; + { + var error = $root.google.firestore.v1.TargetChange.verify(message.targetChange); + if (error) + return "targetChange." + error; + } + } + if (message.documentChange != null && message.hasOwnProperty("documentChange")) { + if (properties.responseType === 1) + return "responseType: multiple values"; + properties.responseType = 1; + { + var error = $root.google.firestore.v1.DocumentChange.verify(message.documentChange); + if (error) + return "documentChange." + error; + } + } + if (message.documentDelete != null && message.hasOwnProperty("documentDelete")) { + if (properties.responseType === 1) + return "responseType: multiple values"; + properties.responseType = 1; + { + var error = $root.google.firestore.v1.DocumentDelete.verify(message.documentDelete); + if (error) + return "documentDelete." + error; + } + } + if (message.documentRemove != null && message.hasOwnProperty("documentRemove")) { + if (properties.responseType === 1) + return "responseType: multiple values"; + properties.responseType = 1; + { + var error = $root.google.firestore.v1.DocumentRemove.verify(message.documentRemove); + if (error) + return "documentRemove." + error; + } + } + if (message.filter != null && message.hasOwnProperty("filter")) { + if (properties.responseType === 1) + return "responseType: multiple values"; + properties.responseType = 1; + { + var error = $root.google.firestore.v1.ExistenceFilter.verify(message.filter); + if (error) + return "filter." + error; + } + } + return null; + }; + /** * Creates a ListenResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject @@ -13381,7 +26507,7 @@ } return message; }; - + /** * Creates a plain object from a ListenResponse message. Also converts values to other types if specified. * @function toObject @@ -13422,7 +26548,7 @@ } return object; }; - + /** * Converts this ListenResponse to JSON. * @function toJSON @@ -13433,7 +26559,7 @@ ListenResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - + /** * Gets the default type url for ListenResponse * @function getTypeUrl @@ -13448,12 +26574,12 @@ } return typeUrlPrefix + "/google.firestore.v1.ListenResponse"; }; - + return ListenResponse; })(); - + v1.Target = (function() { - + /** * Properties of a Target. * @memberof google.firestore.v1 @@ -13466,7 +26592,7 @@ * @property {boolean|null} [once] Target once * @property {google.protobuf.IInt32Value|null} [expectedCount] Target expectedCount */ - + /** * Constructs a new Target. * @memberof google.firestore.v1 @@ -13481,7 +26607,7 @@ if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } - + /** * Target query. * @member {google.firestore.v1.Target.IQueryTarget|null|undefined} query @@ -13489,7 +26615,7 @@ * @instance */ Target.prototype.query = null; - + /** * Target documents. * @member {google.firestore.v1.Target.IDocumentsTarget|null|undefined} documents @@ -13497,7 +26623,7 @@ * @instance */ Target.prototype.documents = null; - + /** * Target resumeToken. * @member {Uint8Array|null|undefined} resumeToken @@ -13505,7 +26631,7 @@ * @instance */ Target.prototype.resumeToken = null; - + /** * Target readTime. * @member {google.protobuf.ITimestamp|null|undefined} readTime @@ -13513,7 +26639,7 @@ * @instance */ Target.prototype.readTime = null; - + /** * Target targetId. * @member {number} targetId @@ -13521,7 +26647,7 @@ * @instance */ Target.prototype.targetId = 0; - + /** * Target once. * @member {boolean} once @@ -13529,7 +26655,7 @@ * @instance */ Target.prototype.once = false; - + /** * Target expectedCount. * @member {google.protobuf.IInt32Value|null|undefined} expectedCount @@ -13537,10 +26663,10 @@ * @instance */ Target.prototype.expectedCount = null; - + // OneOf field names bound to virtual getters and setters var $oneOfFields; - + /** * Target targetType. * @member {"query"|"documents"|undefined} targetType @@ -13551,7 +26677,7 @@ get: $util.oneOfGetter($oneOfFields = ["query", "documents"]), set: $util.oneOfSetter($oneOfFields) }); - + /** * Target resumeType. * @member {"resumeToken"|"readTime"|undefined} resumeType @@ -13562,7 +26688,190 @@ get: $util.oneOfGetter($oneOfFields = ["resumeToken", "readTime"]), set: $util.oneOfSetter($oneOfFields) }); - + + /** + * Creates a new Target instance using the specified properties. + * @function create + * @memberof google.firestore.v1.Target + * @static + * @param {google.firestore.v1.ITarget=} [properties] Properties to set + * @returns {google.firestore.v1.Target} Target instance + */ + Target.create = function create(properties) { + return new Target(properties); + }; + + /** + * Encodes the specified Target message. Does not implicitly {@link google.firestore.v1.Target.verify|verify} messages. + * @function encode + * @memberof google.firestore.v1.Target + * @static + * @param {google.firestore.v1.ITarget} message Target message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Target.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.query != null && Object.hasOwnProperty.call(message, "query")) + $root.google.firestore.v1.Target.QueryTarget.encode(message.query, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.documents != null && Object.hasOwnProperty.call(message, "documents")) + $root.google.firestore.v1.Target.DocumentsTarget.encode(message.documents, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.resumeToken != null && Object.hasOwnProperty.call(message, "resumeToken")) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.resumeToken); + if (message.targetId != null && Object.hasOwnProperty.call(message, "targetId")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.targetId); + if (message.once != null && Object.hasOwnProperty.call(message, "once")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.once); + if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.expectedCount != null && Object.hasOwnProperty.call(message, "expectedCount")) + $root.google.protobuf.Int32Value.encode(message.expectedCount, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Target message, length delimited. Does not implicitly {@link google.firestore.v1.Target.verify|verify} messages. + * @function encodeDelimited + * @memberof google.firestore.v1.Target + * @static + * @param {google.firestore.v1.ITarget} message Target message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Target.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Target message from the specified reader or buffer. + * @function decode + * @memberof google.firestore.v1.Target + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.firestore.v1.Target} Target + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Target.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.firestore.v1.Target(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.query = $root.google.firestore.v1.Target.QueryTarget.decode(reader, reader.uint32()); + break; + } + case 3: { + message.documents = $root.google.firestore.v1.Target.DocumentsTarget.decode(reader, reader.uint32()); + break; + } + case 4: { + message.resumeToken = reader.bytes(); + break; + } + case 11: { + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.targetId = reader.int32(); + break; + } + case 6: { + message.once = reader.bool(); + break; + } + case 12: { + message.expectedCount = $root.google.protobuf.Int32Value.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Target message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.firestore.v1.Target + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.firestore.v1.Target} Target + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Target.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Target message. + * @function verify + * @memberof google.firestore.v1.Target + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Target.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.query != null && message.hasOwnProperty("query")) { + properties.targetType = 1; + { + var error = $root.google.firestore.v1.Target.QueryTarget.verify(message.query); + if (error) + return "query." + error; + } + } + if (message.documents != null && message.hasOwnProperty("documents")) { + if (properties.targetType === 1) + return "targetType: multiple values"; + properties.targetType = 1; + { + var error = $root.google.firestore.v1.Target.DocumentsTarget.verify(message.documents); + if (error) + return "documents." + error; + } + } + if (message.resumeToken != null && message.hasOwnProperty("resumeToken")) { + properties.resumeType = 1; + if (!(message.resumeToken && typeof message.resumeToken.length === "number" || $util.isString(message.resumeToken))) + return "resumeToken: buffer expected"; + } + if (message.readTime != null && message.hasOwnProperty("readTime")) { + if (properties.resumeType === 1) + return "resumeType: multiple values"; + properties.resumeType = 1; + { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; + } + } + if (message.targetId != null && message.hasOwnProperty("targetId")) + if (!$util.isInteger(message.targetId)) + return "targetId: integer expected"; + if (message.once != null && message.hasOwnProperty("once")) + if (typeof message.once !== "boolean") + return "once: boolean expected"; + if (message.expectedCount != null && message.hasOwnProperty("expectedCount")) { + var error = $root.google.protobuf.Int32Value.verify(message.expectedCount); + if (error) + return "expectedCount." + error; + } + return null; + }; + /** * Creates a Target message from a plain object. Also converts values to their respective internal types. * @function fromObject @@ -13606,7 +26915,7 @@ } return message; }; - + /** * Creates a plain object from a Target message. Also converts values to other types if specified. * @function toObject @@ -13653,7 +26962,7 @@ object.expectedCount = $root.google.protobuf.Int32Value.toObject(message.expectedCount, options); return object; }; - + /** * Converts this Target to JSON. * @function toJSON @@ -13664,7 +26973,7 @@ Target.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - + /** * Gets the default type url for Target * @function getTypeUrl @@ -13679,16 +26988,16 @@ } return typeUrlPrefix + "/google.firestore.v1.Target"; }; - + Target.DocumentsTarget = (function() { - + /** * Properties of a DocumentsTarget. * @memberof google.firestore.v1.Target * @interface IDocumentsTarget * @property {Array.|null} [documents] DocumentsTarget documents */ - + /** * Constructs a new DocumentsTarget. * @memberof google.firestore.v1.Target @@ -13704,7 +27013,7 @@ if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } - + /** * DocumentsTarget documents. * @member {Array.} documents @@ -13712,7 +27021,119 @@ * @instance */ DocumentsTarget.prototype.documents = $util.emptyArray; - + + /** + * Creates a new DocumentsTarget instance using the specified properties. + * @function create + * @memberof google.firestore.v1.Target.DocumentsTarget + * @static + * @param {google.firestore.v1.Target.IDocumentsTarget=} [properties] Properties to set + * @returns {google.firestore.v1.Target.DocumentsTarget} DocumentsTarget instance + */ + DocumentsTarget.create = function create(properties) { + return new DocumentsTarget(properties); + }; + + /** + * Encodes the specified DocumentsTarget message. Does not implicitly {@link google.firestore.v1.Target.DocumentsTarget.verify|verify} messages. + * @function encode + * @memberof google.firestore.v1.Target.DocumentsTarget + * @static + * @param {google.firestore.v1.Target.IDocumentsTarget} message DocumentsTarget message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DocumentsTarget.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.documents != null && message.documents.length) + for (var i = 0; i < message.documents.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.documents[i]); + return writer; + }; + + /** + * Encodes the specified DocumentsTarget message, length delimited. Does not implicitly {@link google.firestore.v1.Target.DocumentsTarget.verify|verify} messages. + * @function encodeDelimited + * @memberof google.firestore.v1.Target.DocumentsTarget + * @static + * @param {google.firestore.v1.Target.IDocumentsTarget} message DocumentsTarget message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DocumentsTarget.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DocumentsTarget message from the specified reader or buffer. + * @function decode + * @memberof google.firestore.v1.Target.DocumentsTarget + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.firestore.v1.Target.DocumentsTarget} DocumentsTarget + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DocumentsTarget.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.firestore.v1.Target.DocumentsTarget(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + if (!(message.documents && message.documents.length)) + message.documents = []; + message.documents.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DocumentsTarget message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.firestore.v1.Target.DocumentsTarget + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.firestore.v1.Target.DocumentsTarget} DocumentsTarget + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DocumentsTarget.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DocumentsTarget message. + * @function verify + * @memberof google.firestore.v1.Target.DocumentsTarget + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DocumentsTarget.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.documents != null && message.hasOwnProperty("documents")) { + if (!Array.isArray(message.documents)) + return "documents: array expected"; + for (var i = 0; i < message.documents.length; ++i) + if (!$util.isString(message.documents[i])) + return "documents: string[] expected"; + } + return null; + }; + /** * Creates a DocumentsTarget message from a plain object. Also converts values to their respective internal types. * @function fromObject @@ -13734,7 +27155,7 @@ } return message; }; - + /** * Creates a plain object from a DocumentsTarget message. Also converts values to other types if specified. * @function toObject @@ -13757,7 +27178,7 @@ } return object; }; - + /** * Converts this DocumentsTarget to JSON. * @function toJSON @@ -13768,7 +27189,7 @@ DocumentsTarget.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - + /** * Gets the default type url for DocumentsTarget * @function getTypeUrl @@ -13783,12 +27204,12 @@ } return typeUrlPrefix + "/google.firestore.v1.Target.DocumentsTarget"; }; - + return DocumentsTarget; })(); - + Target.QueryTarget = (function() { - + /** * Properties of a QueryTarget. * @memberof google.firestore.v1.Target @@ -13796,7 +27217,7 @@ * @property {string|null} [parent] QueryTarget parent * @property {google.firestore.v1.IStructuredQuery|null} [structuredQuery] QueryTarget structuredQuery */ - + /** * Constructs a new QueryTarget. * @memberof google.firestore.v1.Target @@ -13811,7 +27232,7 @@ if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } - + /** * QueryTarget parent. * @member {string} parent @@ -13819,7 +27240,7 @@ * @instance */ QueryTarget.prototype.parent = ""; - + /** * QueryTarget structuredQuery. * @member {google.firestore.v1.IStructuredQuery|null|undefined} structuredQuery @@ -13827,10 +27248,10 @@ * @instance */ QueryTarget.prototype.structuredQuery = null; - + // OneOf field names bound to virtual getters and setters var $oneOfFields; - + /** * QueryTarget queryType. * @member {"structuredQuery"|undefined} queryType @@ -13841,7 +27262,127 @@ get: $util.oneOfGetter($oneOfFields = ["structuredQuery"]), set: $util.oneOfSetter($oneOfFields) }); - + + /** + * Creates a new QueryTarget instance using the specified properties. + * @function create + * @memberof google.firestore.v1.Target.QueryTarget + * @static + * @param {google.firestore.v1.Target.IQueryTarget=} [properties] Properties to set + * @returns {google.firestore.v1.Target.QueryTarget} QueryTarget instance + */ + QueryTarget.create = function create(properties) { + return new QueryTarget(properties); + }; + + /** + * Encodes the specified QueryTarget message. Does not implicitly {@link google.firestore.v1.Target.QueryTarget.verify|verify} messages. + * @function encode + * @memberof google.firestore.v1.Target.QueryTarget + * @static + * @param {google.firestore.v1.Target.IQueryTarget} message QueryTarget message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryTarget.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.structuredQuery != null && Object.hasOwnProperty.call(message, "structuredQuery")) + $root.google.firestore.v1.StructuredQuery.encode(message.structuredQuery, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryTarget message, length delimited. Does not implicitly {@link google.firestore.v1.Target.QueryTarget.verify|verify} messages. + * @function encodeDelimited + * @memberof google.firestore.v1.Target.QueryTarget + * @static + * @param {google.firestore.v1.Target.IQueryTarget} message QueryTarget message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryTarget.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryTarget message from the specified reader or buffer. + * @function decode + * @memberof google.firestore.v1.Target.QueryTarget + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.firestore.v1.Target.QueryTarget} QueryTarget + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryTarget.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.firestore.v1.Target.QueryTarget(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.structuredQuery = $root.google.firestore.v1.StructuredQuery.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryTarget message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.firestore.v1.Target.QueryTarget + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.firestore.v1.Target.QueryTarget} QueryTarget + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryTarget.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryTarget message. + * @function verify + * @memberof google.firestore.v1.Target.QueryTarget + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryTarget.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.structuredQuery != null && message.hasOwnProperty("structuredQuery")) { + properties.queryType = 1; + { + var error = $root.google.firestore.v1.StructuredQuery.verify(message.structuredQuery); + if (error) + return "structuredQuery." + error; + } + } + return null; + }; + /** * Creates a QueryTarget message from a plain object. Also converts values to their respective internal types. * @function fromObject @@ -13863,7 +27404,7 @@ } return message; }; - + /** * Creates a plain object from a QueryTarget message. Also converts values to other types if specified. * @function toObject @@ -13888,7 +27429,7 @@ } return object; }; - + /** * Converts this QueryTarget to JSON. * @function toJSON @@ -13899,7 +27440,7 @@ QueryTarget.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - + /** * Gets the default type url for QueryTarget * @function getTypeUrl @@ -13914,15 +27455,15 @@ } return typeUrlPrefix + "/google.firestore.v1.Target.QueryTarget"; }; - + return QueryTarget; })(); - + return Target; })(); - + v1.TargetChange = (function() { - + /** * Properties of a TargetChange. * @memberof google.firestore.v1 @@ -13933,7 +27474,7 @@ * @property {Uint8Array|null} [resumeToken] TargetChange resumeToken * @property {google.protobuf.ITimestamp|null} [readTime] TargetChange readTime */ - + /** * Constructs a new TargetChange. * @memberof google.firestore.v1 @@ -13949,7 +27490,7 @@ if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } - + /** * TargetChange targetChangeType. * @member {google.firestore.v1.TargetChange.TargetChangeType} targetChangeType @@ -13957,7 +27498,7 @@ * @instance */ TargetChange.prototype.targetChangeType = 0; - + /** * TargetChange targetIds. * @member {Array.} targetIds @@ -13965,31 +27506,199 @@ * @instance */ TargetChange.prototype.targetIds = $util.emptyArray; - + /** * TargetChange cause. * @member {google.rpc.IStatus|null|undefined} cause * @memberof google.firestore.v1.TargetChange - * @instance - */ - TargetChange.prototype.cause = null; - + * @instance + */ + TargetChange.prototype.cause = null; + + /** + * TargetChange resumeToken. + * @member {Uint8Array} resumeToken + * @memberof google.firestore.v1.TargetChange + * @instance + */ + TargetChange.prototype.resumeToken = $util.newBuffer([]); + + /** + * TargetChange readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.firestore.v1.TargetChange + * @instance + */ + TargetChange.prototype.readTime = null; + + /** + * Creates a new TargetChange instance using the specified properties. + * @function create + * @memberof google.firestore.v1.TargetChange + * @static + * @param {google.firestore.v1.ITargetChange=} [properties] Properties to set + * @returns {google.firestore.v1.TargetChange} TargetChange instance + */ + TargetChange.create = function create(properties) { + return new TargetChange(properties); + }; + + /** + * Encodes the specified TargetChange message. Does not implicitly {@link google.firestore.v1.TargetChange.verify|verify} messages. + * @function encode + * @memberof google.firestore.v1.TargetChange + * @static + * @param {google.firestore.v1.ITargetChange} message TargetChange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetChange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.targetChangeType != null && Object.hasOwnProperty.call(message, "targetChangeType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.targetChangeType); + if (message.targetIds != null && message.targetIds.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.targetIds.length; ++i) + writer.int32(message.targetIds[i]); + writer.ldelim(); + } + if (message.cause != null && Object.hasOwnProperty.call(message, "cause")) + $root.google.rpc.Status.encode(message.cause, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.resumeToken != null && Object.hasOwnProperty.call(message, "resumeToken")) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.resumeToken); + if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TargetChange message, length delimited. Does not implicitly {@link google.firestore.v1.TargetChange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.firestore.v1.TargetChange + * @static + * @param {google.firestore.v1.ITargetChange} message TargetChange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetChange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TargetChange message from the specified reader or buffer. + * @function decode + * @memberof google.firestore.v1.TargetChange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.firestore.v1.TargetChange} TargetChange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetChange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.firestore.v1.TargetChange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.targetChangeType = reader.int32(); + break; + } + case 2: { + if (!(message.targetIds && message.targetIds.length)) + message.targetIds = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.targetIds.push(reader.int32()); + } else + message.targetIds.push(reader.int32()); + break; + } + case 3: { + message.cause = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 4: { + message.resumeToken = reader.bytes(); + break; + } + case 6: { + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + /** - * TargetChange resumeToken. - * @member {Uint8Array} resumeToken + * Decodes a TargetChange message from the specified reader or buffer, length delimited. + * @function decodeDelimited * @memberof google.firestore.v1.TargetChange - * @instance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.firestore.v1.TargetChange} TargetChange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TargetChange.prototype.resumeToken = $util.newBuffer([]); - + TargetChange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + /** - * TargetChange readTime. - * @member {google.protobuf.ITimestamp|null|undefined} readTime + * Verifies a TargetChange message. + * @function verify * @memberof google.firestore.v1.TargetChange - * @instance + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - TargetChange.prototype.readTime = null; - + TargetChange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.targetChangeType != null && message.hasOwnProperty("targetChangeType")) + switch (message.targetChangeType) { + default: + return "targetChangeType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.targetIds != null && message.hasOwnProperty("targetIds")) { + if (!Array.isArray(message.targetIds)) + return "targetIds: array expected"; + for (var i = 0; i < message.targetIds.length; ++i) + if (!$util.isInteger(message.targetIds[i])) + return "targetIds: integer[] expected"; + } + if (message.cause != null && message.hasOwnProperty("cause")) { + var error = $root.google.rpc.Status.verify(message.cause); + if (error) + return "cause." + error; + } + if (message.resumeToken != null && message.hasOwnProperty("resumeToken")) + if (!(message.resumeToken && typeof message.resumeToken.length === "number" || $util.isString(message.resumeToken))) + return "resumeToken: buffer expected"; + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; + } + return null; + }; + /** * Creates a TargetChange message from a plain object. Also converts values to their respective internal types. * @function fromObject @@ -14003,32 +27712,32 @@ return object; var message = new $root.google.firestore.v1.TargetChange(); switch (object.targetChangeType) { - default: - if (typeof object.targetChangeType === "number") { - message.targetChangeType = object.targetChangeType; + default: + if (typeof object.targetChangeType === "number") { + message.targetChangeType = object.targetChangeType; + break; + } + break; + case "NO_CHANGE": + case 0: + message.targetChangeType = 0; + break; + case "ADD": + case 1: + message.targetChangeType = 1; + break; + case "REMOVE": + case 2: + message.targetChangeType = 2; + break; + case "CURRENT": + case 3: + message.targetChangeType = 3; + break; + case "RESET": + case 4: + message.targetChangeType = 4; break; - } - break; - case "NO_CHANGE": - case 0: - message.targetChangeType = 0; - break; - case "ADD": - case 1: - message.targetChangeType = 1; - break; - case "REMOVE": - case 2: - message.targetChangeType = 2; - break; - case "CURRENT": - case 3: - message.targetChangeType = 3; - break; - case "RESET": - case 4: - message.targetChangeType = 4; - break; } if (object.targetIds) { if (!Array.isArray(object.targetIds)) @@ -14054,7 +27763,7 @@ } return message; }; - + /** * Creates a plain object from a TargetChange message. Also converts values to other types if specified. * @function toObject @@ -14097,7 +27806,7 @@ object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); return object; }; - + /** * Converts this TargetChange to JSON. * @function toJSON @@ -14108,7 +27817,7 @@ TargetChange.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - + /** * Gets the default type url for TargetChange * @function getTypeUrl @@ -14123,32 +27832,32 @@ } return typeUrlPrefix + "/google.firestore.v1.TargetChange"; }; - + /** * TargetChangeType enum. * @name google.firestore.v1.TargetChange.TargetChangeType - * @enum {string} - * @property {string} NO_CHANGE=NO_CHANGE NO_CHANGE value - * @property {string} ADD=ADD ADD value - * @property {string} REMOVE=REMOVE REMOVE value - * @property {string} CURRENT=CURRENT CURRENT value - * @property {string} RESET=RESET RESET value + * @enum {number} + * @property {number} NO_CHANGE=0 NO_CHANGE value + * @property {number} ADD=1 ADD value + * @property {number} REMOVE=2 REMOVE value + * @property {number} CURRENT=3 CURRENT value + * @property {number} RESET=4 RESET value */ TargetChange.TargetChangeType = (function() { var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "NO_CHANGE"] = "NO_CHANGE"; - values[valuesById[1] = "ADD"] = "ADD"; - values[valuesById[2] = "REMOVE"] = "REMOVE"; - values[valuesById[3] = "CURRENT"] = "CURRENT"; - values[valuesById[4] = "RESET"] = "RESET"; + values[valuesById[0] = "NO_CHANGE"] = 0; + values[valuesById[1] = "ADD"] = 1; + values[valuesById[2] = "REMOVE"] = 2; + values[valuesById[3] = "CURRENT"] = 3; + values[valuesById[4] = "RESET"] = 4; return values; })(); - + return TargetChange; })(); - + v1.ListCollectionIdsRequest = (function() { - + /** * Properties of a ListCollectionIdsRequest. * @memberof google.firestore.v1 @@ -14158,7 +27867,7 @@ * @property {string|null} [pageToken] ListCollectionIdsRequest pageToken * @property {google.protobuf.ITimestamp|null} [readTime] ListCollectionIdsRequest readTime */ - + /** * Constructs a new ListCollectionIdsRequest. * @memberof google.firestore.v1 @@ -14173,7 +27882,7 @@ if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } - + /** * ListCollectionIdsRequest parent. * @member {string} parent @@ -14181,7 +27890,7 @@ * @instance */ ListCollectionIdsRequest.prototype.parent = ""; - + /** * ListCollectionIdsRequest pageSize. * @member {number} pageSize @@ -14189,7 +27898,7 @@ * @instance */ ListCollectionIdsRequest.prototype.pageSize = 0; - + /** * ListCollectionIdsRequest pageToken. * @member {string} pageToken @@ -14197,7 +27906,7 @@ * @instance */ ListCollectionIdsRequest.prototype.pageToken = ""; - + /** * ListCollectionIdsRequest readTime. * @member {google.protobuf.ITimestamp|null|undefined} readTime @@ -14205,10 +27914,10 @@ * @instance */ ListCollectionIdsRequest.prototype.readTime = null; - + // OneOf field names bound to virtual getters and setters var $oneOfFields; - + /** * ListCollectionIdsRequest consistencySelector. * @member {"readTime"|undefined} consistencySelector @@ -14219,7 +27928,145 @@ get: $util.oneOfGetter($oneOfFields = ["readTime"]), set: $util.oneOfSetter($oneOfFields) }); - + + /** + * Creates a new ListCollectionIdsRequest instance using the specified properties. + * @function create + * @memberof google.firestore.v1.ListCollectionIdsRequest + * @static + * @param {google.firestore.v1.IListCollectionIdsRequest=} [properties] Properties to set + * @returns {google.firestore.v1.ListCollectionIdsRequest} ListCollectionIdsRequest instance + */ + ListCollectionIdsRequest.create = function create(properties) { + return new ListCollectionIdsRequest(properties); + }; + + /** + * Encodes the specified ListCollectionIdsRequest message. Does not implicitly {@link google.firestore.v1.ListCollectionIdsRequest.verify|verify} messages. + * @function encode + * @memberof google.firestore.v1.ListCollectionIdsRequest + * @static + * @param {google.firestore.v1.IListCollectionIdsRequest} message ListCollectionIdsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCollectionIdsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ListCollectionIdsRequest message, length delimited. Does not implicitly {@link google.firestore.v1.ListCollectionIdsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.firestore.v1.ListCollectionIdsRequest + * @static + * @param {google.firestore.v1.IListCollectionIdsRequest} message ListCollectionIdsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCollectionIdsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListCollectionIdsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.firestore.v1.ListCollectionIdsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.firestore.v1.ListCollectionIdsRequest} ListCollectionIdsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCollectionIdsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.firestore.v1.ListCollectionIdsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListCollectionIdsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.firestore.v1.ListCollectionIdsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.firestore.v1.ListCollectionIdsRequest} ListCollectionIdsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCollectionIdsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListCollectionIdsRequest message. + * @function verify + * @memberof google.firestore.v1.ListCollectionIdsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListCollectionIdsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.readTime != null && message.hasOwnProperty("readTime")) { + properties.consistencySelector = 1; + { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; + } + } + return null; + }; + /** * Creates a ListCollectionIdsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject @@ -14245,7 +28092,7 @@ } return message; }; - + /** * Creates a plain object from a ListCollectionIdsRequest message. Also converts values to other types if specified. * @function toObject @@ -14277,7 +28124,7 @@ } return object; }; - + /** * Converts this ListCollectionIdsRequest to JSON. * @function toJSON @@ -14288,7 +28135,7 @@ ListCollectionIdsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - + /** * Gets the default type url for ListCollectionIdsRequest * @function getTypeUrl @@ -14303,12 +28150,12 @@ } return typeUrlPrefix + "/google.firestore.v1.ListCollectionIdsRequest"; }; - + return ListCollectionIdsRequest; })(); - + v1.ListCollectionIdsResponse = (function() { - + /** * Properties of a ListCollectionIdsResponse. * @memberof google.firestore.v1 @@ -14316,7 +28163,7 @@ * @property {Array.|null} [collectionIds] ListCollectionIdsResponse collectionIds * @property {string|null} [nextPageToken] ListCollectionIdsResponse nextPageToken */ - + /** * Constructs a new ListCollectionIdsResponse. * @memberof google.firestore.v1 @@ -14332,7 +28179,7 @@ if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } - + /** * ListCollectionIdsResponse collectionIds. * @member {Array.} collectionIds @@ -14340,7 +28187,7 @@ * @instance */ ListCollectionIdsResponse.prototype.collectionIds = $util.emptyArray; - + /** * ListCollectionIdsResponse nextPageToken. * @member {string} nextPageToken @@ -14348,7 +28195,128 @@ * @instance */ ListCollectionIdsResponse.prototype.nextPageToken = ""; - + + /** + * Creates a new ListCollectionIdsResponse instance using the specified properties. + * @function create + * @memberof google.firestore.v1.ListCollectionIdsResponse + * @static + * @param {google.firestore.v1.IListCollectionIdsResponse=} [properties] Properties to set + * @returns {google.firestore.v1.ListCollectionIdsResponse} ListCollectionIdsResponse instance + */ + ListCollectionIdsResponse.create = function create(properties) { + return new ListCollectionIdsResponse(properties); + }; + + /** + * Encodes the specified ListCollectionIdsResponse message. Does not implicitly {@link google.firestore.v1.ListCollectionIdsResponse.verify|verify} messages. + * @function encode + * @memberof google.firestore.v1.ListCollectionIdsResponse + * @static + * @param {google.firestore.v1.IListCollectionIdsResponse} message ListCollectionIdsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCollectionIdsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.collectionIds != null && message.collectionIds.length) + for (var i = 0; i < message.collectionIds.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.collectionIds[i]); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListCollectionIdsResponse message, length delimited. Does not implicitly {@link google.firestore.v1.ListCollectionIdsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.firestore.v1.ListCollectionIdsResponse + * @static + * @param {google.firestore.v1.IListCollectionIdsResponse} message ListCollectionIdsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCollectionIdsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListCollectionIdsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.firestore.v1.ListCollectionIdsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.firestore.v1.ListCollectionIdsResponse} ListCollectionIdsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCollectionIdsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.firestore.v1.ListCollectionIdsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.collectionIds && message.collectionIds.length)) + message.collectionIds = []; + message.collectionIds.push(reader.string()); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListCollectionIdsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.firestore.v1.ListCollectionIdsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.firestore.v1.ListCollectionIdsResponse} ListCollectionIdsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCollectionIdsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListCollectionIdsResponse message. + * @function verify + * @memberof google.firestore.v1.ListCollectionIdsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListCollectionIdsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.collectionIds != null && message.hasOwnProperty("collectionIds")) { + if (!Array.isArray(message.collectionIds)) + return "collectionIds: array expected"; + for (var i = 0; i < message.collectionIds.length; ++i) + if (!$util.isString(message.collectionIds[i])) + return "collectionIds: string[] expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + /** * Creates a ListCollectionIdsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject @@ -14372,7 +28340,7 @@ message.nextPageToken = String(object.nextPageToken); return message; }; - + /** * Creates a plain object from a ListCollectionIdsResponse message. Also converts values to other types if specified. * @function toObject @@ -14399,7 +28367,7 @@ object.nextPageToken = message.nextPageToken; return object; }; - + /** * Converts this ListCollectionIdsResponse to JSON. * @function toJSON @@ -14410,7 +28378,7 @@ ListCollectionIdsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - + /** * Gets the default type url for ListCollectionIdsResponse * @function getTypeUrl @@ -14425,12 +28393,12 @@ } return typeUrlPrefix + "/google.firestore.v1.ListCollectionIdsResponse"; }; - + return ListCollectionIdsResponse; })(); - + v1.BatchWriteRequest = (function() { - + /** * Properties of a BatchWriteRequest. * @memberof google.firestore.v1 @@ -14439,7 +28407,7 @@ * @property {Array.|null} [writes] BatchWriteRequest writes * @property {Object.|null} [labels] BatchWriteRequest labels */ - + /** * Constructs a new BatchWriteRequest. * @memberof google.firestore.v1 @@ -14456,7 +28424,7 @@ if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } - + /** * BatchWriteRequest database. * @member {string} database @@ -14464,7 +28432,7 @@ * @instance */ BatchWriteRequest.prototype.database = ""; - + /** * BatchWriteRequest writes. * @member {Array.} writes @@ -14472,7 +28440,7 @@ * @instance */ BatchWriteRequest.prototype.writes = $util.emptyArray; - + /** * BatchWriteRequest labels. * @member {Object.} labels @@ -14480,7 +28448,164 @@ * @instance */ BatchWriteRequest.prototype.labels = $util.emptyObject; - + + /** + * Creates a new BatchWriteRequest instance using the specified properties. + * @function create + * @memberof google.firestore.v1.BatchWriteRequest + * @static + * @param {google.firestore.v1.IBatchWriteRequest=} [properties] Properties to set + * @returns {google.firestore.v1.BatchWriteRequest} BatchWriteRequest instance + */ + BatchWriteRequest.create = function create(properties) { + return new BatchWriteRequest(properties); + }; + + /** + * Encodes the specified BatchWriteRequest message. Does not implicitly {@link google.firestore.v1.BatchWriteRequest.verify|verify} messages. + * @function encode + * @memberof google.firestore.v1.BatchWriteRequest + * @static + * @param {google.firestore.v1.IBatchWriteRequest} message BatchWriteRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchWriteRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.database != null && Object.hasOwnProperty.call(message, "database")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.database); + if (message.writes != null && message.writes.length) + for (var i = 0; i < message.writes.length; ++i) + $root.google.firestore.v1.Write.encode(message.writes[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchWriteRequest message, length delimited. Does not implicitly {@link google.firestore.v1.BatchWriteRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.firestore.v1.BatchWriteRequest + * @static + * @param {google.firestore.v1.IBatchWriteRequest} message BatchWriteRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchWriteRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchWriteRequest message from the specified reader or buffer. + * @function decode + * @memberof google.firestore.v1.BatchWriteRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.firestore.v1.BatchWriteRequest} BatchWriteRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchWriteRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.firestore.v1.BatchWriteRequest(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.database = reader.string(); + break; + } + case 2: { + if (!(message.writes && message.writes.length)) + message.writes = []; + message.writes.push($root.google.firestore.v1.Write.decode(reader, reader.uint32())); + break; + } + case 3: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchWriteRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.firestore.v1.BatchWriteRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.firestore.v1.BatchWriteRequest} BatchWriteRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchWriteRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchWriteRequest message. + * @function verify + * @memberof google.firestore.v1.BatchWriteRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchWriteRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.database != null && message.hasOwnProperty("database")) + if (!$util.isString(message.database)) + return "database: string expected"; + if (message.writes != null && message.hasOwnProperty("writes")) { + if (!Array.isArray(message.writes)) + return "writes: array expected"; + for (var i = 0; i < message.writes.length; ++i) { + var error = $root.google.firestore.v1.Write.verify(message.writes[i]); + if (error) + return "writes." + error; + } + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + return null; + }; + /** * Creates a BatchWriteRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject @@ -14514,7 +28639,7 @@ } return message; }; - + /** * Creates a plain object from a BatchWriteRequest message. Also converts values to other types if specified. * @function toObject @@ -14549,7 +28674,7 @@ } return object; }; - + /** * Converts this BatchWriteRequest to JSON. * @function toJSON @@ -14560,7 +28685,7 @@ BatchWriteRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - + /** * Gets the default type url for BatchWriteRequest * @function getTypeUrl @@ -14575,12 +28700,12 @@ } return typeUrlPrefix + "/google.firestore.v1.BatchWriteRequest"; }; - + return BatchWriteRequest; })(); - + v1.BatchWriteResponse = (function() { - + /** * Properties of a BatchWriteResponse. * @memberof google.firestore.v1 @@ -14588,7 +28713,7 @@ * @property {Array.|null} [writeResults] BatchWriteResponse writeResults * @property {Array.|null} [status] BatchWriteResponse status */ - + /** * Constructs a new BatchWriteResponse. * @memberof google.firestore.v1 @@ -14605,7 +28730,7 @@ if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } - + /** * BatchWriteResponse writeResults. * @member {Array.} writeResults @@ -14613,7 +28738,7 @@ * @instance */ BatchWriteResponse.prototype.writeResults = $util.emptyArray; - + /** * BatchWriteResponse status. * @member {Array.} status @@ -14621,7 +28746,139 @@ * @instance */ BatchWriteResponse.prototype.status = $util.emptyArray; - + + /** + * Creates a new BatchWriteResponse instance using the specified properties. + * @function create + * @memberof google.firestore.v1.BatchWriteResponse + * @static + * @param {google.firestore.v1.IBatchWriteResponse=} [properties] Properties to set + * @returns {google.firestore.v1.BatchWriteResponse} BatchWriteResponse instance + */ + BatchWriteResponse.create = function create(properties) { + return new BatchWriteResponse(properties); + }; + + /** + * Encodes the specified BatchWriteResponse message. Does not implicitly {@link google.firestore.v1.BatchWriteResponse.verify|verify} messages. + * @function encode + * @memberof google.firestore.v1.BatchWriteResponse + * @static + * @param {google.firestore.v1.IBatchWriteResponse} message BatchWriteResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchWriteResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.writeResults != null && message.writeResults.length) + for (var i = 0; i < message.writeResults.length; ++i) + $root.google.firestore.v1.WriteResult.encode(message.writeResults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.status != null && message.status.length) + for (var i = 0; i < message.status.length; ++i) + $root.google.rpc.Status.encode(message.status[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchWriteResponse message, length delimited. Does not implicitly {@link google.firestore.v1.BatchWriteResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.firestore.v1.BatchWriteResponse + * @static + * @param {google.firestore.v1.IBatchWriteResponse} message BatchWriteResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchWriteResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchWriteResponse message from the specified reader or buffer. + * @function decode + * @memberof google.firestore.v1.BatchWriteResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.firestore.v1.BatchWriteResponse} BatchWriteResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchWriteResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.firestore.v1.BatchWriteResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.writeResults && message.writeResults.length)) + message.writeResults = []; + message.writeResults.push($root.google.firestore.v1.WriteResult.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.status && message.status.length)) + message.status = []; + message.status.push($root.google.rpc.Status.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchWriteResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.firestore.v1.BatchWriteResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.firestore.v1.BatchWriteResponse} BatchWriteResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchWriteResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchWriteResponse message. + * @function verify + * @memberof google.firestore.v1.BatchWriteResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchWriteResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.writeResults != null && message.hasOwnProperty("writeResults")) { + if (!Array.isArray(message.writeResults)) + return "writeResults: array expected"; + for (var i = 0; i < message.writeResults.length; ++i) { + var error = $root.google.firestore.v1.WriteResult.verify(message.writeResults[i]); + if (error) + return "writeResults." + error; + } + } + if (message.status != null && message.hasOwnProperty("status")) { + if (!Array.isArray(message.status)) + return "status: array expected"; + for (var i = 0; i < message.status.length; ++i) { + var error = $root.google.rpc.Status.verify(message.status[i]); + if (error) + return "status." + error; + } + } + return null; + }; + /** * Creates a BatchWriteResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject @@ -14656,7 +28913,7 @@ } return message; }; - + /** * Creates a plain object from a BatchWriteResponse message. Also converts values to other types if specified. * @function toObject @@ -14686,7 +28943,7 @@ } return object; }; - + /** * Converts this BatchWriteResponse to JSON. * @function toJSON @@ -14697,7 +28954,7 @@ BatchWriteResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - + /** * Gets the default type url for BatchWriteResponse * @function getTypeUrl @@ -14712,248 +28969,12 @@ } return typeUrlPrefix + "/google.firestore.v1.BatchWriteResponse"; }; - + return BatchWriteResponse; })(); - - /** - * QueryMode enum. - * @name google.firestore.v1.QueryMode - * @enum {string} - * @property {string} NORMAL=NORMAL NORMAL value - * @property {string} PLAN=PLAN PLAN value - * @property {string} PROFILE=PROFILE PROFILE value - */ - v1.QueryMode = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "NORMAL"] = "NORMAL"; - values[valuesById[1] = "PLAN"] = "PLAN"; - values[valuesById[2] = "PROFILE"] = "PROFILE"; - return values; - })(); - - v1.QueryPlan = (function() { - - /** - * Properties of a QueryPlan. - * @memberof google.firestore.v1 - * @interface IQueryPlan - * @property {google.protobuf.IStruct|null} [planInfo] QueryPlan planInfo - */ - - /** - * Constructs a new QueryPlan. - * @memberof google.firestore.v1 - * @classdesc Represents a QueryPlan. - * @implements IQueryPlan - * @constructor - * @param {google.firestore.v1.IQueryPlan=} [properties] Properties to set - */ - function QueryPlan(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]]; - } - - /** - * QueryPlan planInfo. - * @member {google.protobuf.IStruct|null|undefined} planInfo - * @memberof google.firestore.v1.QueryPlan - * @instance - */ - QueryPlan.prototype.planInfo = null; - - /** - * Creates a QueryPlan message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.firestore.v1.QueryPlan - * @static - * @param {Object.} object Plain object - * @returns {google.firestore.v1.QueryPlan} QueryPlan - */ - QueryPlan.fromObject = function fromObject(object) { - if (object instanceof $root.google.firestore.v1.QueryPlan) - return object; - var message = new $root.google.firestore.v1.QueryPlan(); - if (object.planInfo != null) { - if (typeof object.planInfo !== "object") - throw TypeError(".google.firestore.v1.QueryPlan.planInfo: object expected"); - message.planInfo = $root.google.protobuf.Struct.fromObject(object.planInfo); - } - return message; - }; - - /** - * Creates a plain object from a QueryPlan message. Also converts values to other types if specified. - * @function toObject - * @memberof google.firestore.v1.QueryPlan - * @static - * @param {google.firestore.v1.QueryPlan} message QueryPlan - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryPlan.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.planInfo = null; - if (message.planInfo != null && message.hasOwnProperty("planInfo")) - object.planInfo = $root.google.protobuf.Struct.toObject(message.planInfo, options); - return object; - }; - - /** - * Converts this QueryPlan to JSON. - * @function toJSON - * @memberof google.firestore.v1.QueryPlan - * @instance - * @returns {Object.} JSON object - */ - QueryPlan.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for QueryPlan - * @function getTypeUrl - * @memberof google.firestore.v1.QueryPlan - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - QueryPlan.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.firestore.v1.QueryPlan"; - }; - - return QueryPlan; - })(); - - v1.ResultSetStats = (function() { - - /** - * Properties of a ResultSetStats. - * @memberof google.firestore.v1 - * @interface IResultSetStats - * @property {google.firestore.v1.IQueryPlan|null} [queryPlan] ResultSetStats queryPlan - * @property {google.protobuf.IStruct|null} [queryStats] ResultSetStats queryStats - */ - - /** - * Constructs a new ResultSetStats. - * @memberof google.firestore.v1 - * @classdesc Represents a ResultSetStats. - * @implements IResultSetStats - * @constructor - * @param {google.firestore.v1.IResultSetStats=} [properties] Properties to set - */ - function ResultSetStats(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]]; - } - - /** - * ResultSetStats queryPlan. - * @member {google.firestore.v1.IQueryPlan|null|undefined} queryPlan - * @memberof google.firestore.v1.ResultSetStats - * @instance - */ - ResultSetStats.prototype.queryPlan = null; - - /** - * ResultSetStats queryStats. - * @member {google.protobuf.IStruct|null|undefined} queryStats - * @memberof google.firestore.v1.ResultSetStats - * @instance - */ - ResultSetStats.prototype.queryStats = null; - - /** - * Creates a ResultSetStats message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.firestore.v1.ResultSetStats - * @static - * @param {Object.} object Plain object - * @returns {google.firestore.v1.ResultSetStats} ResultSetStats - */ - ResultSetStats.fromObject = function fromObject(object) { - if (object instanceof $root.google.firestore.v1.ResultSetStats) - return object; - var message = new $root.google.firestore.v1.ResultSetStats(); - if (object.queryPlan != null) { - if (typeof object.queryPlan !== "object") - throw TypeError(".google.firestore.v1.ResultSetStats.queryPlan: object expected"); - message.queryPlan = $root.google.firestore.v1.QueryPlan.fromObject(object.queryPlan); - } - if (object.queryStats != null) { - if (typeof object.queryStats !== "object") - throw TypeError(".google.firestore.v1.ResultSetStats.queryStats: object expected"); - message.queryStats = $root.google.protobuf.Struct.fromObject(object.queryStats); - } - return message; - }; - - /** - * Creates a plain object from a ResultSetStats message. Also converts values to other types if specified. - * @function toObject - * @memberof google.firestore.v1.ResultSetStats - * @static - * @param {google.firestore.v1.ResultSetStats} message ResultSetStats - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ResultSetStats.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.queryPlan = null; - object.queryStats = null; - } - if (message.queryPlan != null && message.hasOwnProperty("queryPlan")) - object.queryPlan = $root.google.firestore.v1.QueryPlan.toObject(message.queryPlan, options); - if (message.queryStats != null && message.hasOwnProperty("queryStats")) - object.queryStats = $root.google.protobuf.Struct.toObject(message.queryStats, options); - return object; - }; - - /** - * Converts this ResultSetStats to JSON. - * @function toJSON - * @memberof google.firestore.v1.ResultSetStats - * @instance - * @returns {Object.} JSON object - */ - ResultSetStats.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ResultSetStats - * @function getTypeUrl - * @memberof google.firestore.v1.ResultSetStats - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ResultSetStats.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.firestore.v1.ResultSetStats"; - }; - - return ResultSetStats; - })(); - + v1.StructuredQuery = (function() { - + /** * Properties of a StructuredQuery. * @memberof google.firestore.v1 @@ -14966,8 +28987,9 @@ * @property {google.firestore.v1.ICursor|null} [endAt] StructuredQuery endAt * @property {number|null} [offset] StructuredQuery offset * @property {google.protobuf.IInt32Value|null} [limit] StructuredQuery limit + * @property {google.firestore.v1.StructuredQuery.IFindNearest|null} [findNearest] StructuredQuery findNearest */ - + /** * Constructs a new StructuredQuery. * @memberof google.firestore.v1 @@ -14984,7 +29006,7 @@ if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } - + /** * StructuredQuery select. * @member {google.firestore.v1.StructuredQuery.IProjection|null|undefined} select @@ -14992,7 +29014,7 @@ * @instance */ StructuredQuery.prototype.select = null; - + /** * StructuredQuery from. * @member {Array.} from @@ -15000,7 +29022,7 @@ * @instance */ StructuredQuery.prototype.from = $util.emptyArray; - + /** * StructuredQuery where. * @member {google.firestore.v1.StructuredQuery.IFilter|null|undefined} where @@ -15008,7 +29030,7 @@ * @instance */ StructuredQuery.prototype.where = null; - + /** * StructuredQuery orderBy. * @member {Array.} orderBy @@ -15016,7 +29038,7 @@ * @instance */ StructuredQuery.prototype.orderBy = $util.emptyArray; - + /** * StructuredQuery startAt. * @member {google.firestore.v1.ICursor|null|undefined} startAt @@ -15024,7 +29046,7 @@ * @instance */ StructuredQuery.prototype.startAt = null; - + /** * StructuredQuery endAt. * @member {google.firestore.v1.ICursor|null|undefined} endAt @@ -15032,7 +29054,7 @@ * @instance */ StructuredQuery.prototype.endAt = null; - + /** * StructuredQuery offset. * @member {number} offset @@ -15040,15 +29062,230 @@ * @instance */ StructuredQuery.prototype.offset = 0; - + + /** + * StructuredQuery limit. + * @member {google.protobuf.IInt32Value|null|undefined} limit + * @memberof google.firestore.v1.StructuredQuery + * @instance + */ + StructuredQuery.prototype.limit = null; + + /** + * StructuredQuery findNearest. + * @member {google.firestore.v1.StructuredQuery.IFindNearest|null|undefined} findNearest + * @memberof google.firestore.v1.StructuredQuery + * @instance + */ + StructuredQuery.prototype.findNearest = null; + + /** + * Creates a new StructuredQuery instance using the specified properties. + * @function create + * @memberof google.firestore.v1.StructuredQuery + * @static + * @param {google.firestore.v1.IStructuredQuery=} [properties] Properties to set + * @returns {google.firestore.v1.StructuredQuery} StructuredQuery instance + */ + StructuredQuery.create = function create(properties) { + return new StructuredQuery(properties); + }; + + /** + * Encodes the specified StructuredQuery message. Does not implicitly {@link google.firestore.v1.StructuredQuery.verify|verify} messages. + * @function encode + * @memberof google.firestore.v1.StructuredQuery + * @static + * @param {google.firestore.v1.IStructuredQuery} message StructuredQuery message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StructuredQuery.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.select != null && Object.hasOwnProperty.call(message, "select")) + $root.google.firestore.v1.StructuredQuery.Projection.encode(message.select, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.from != null && message.from.length) + for (var i = 0; i < message.from.length; ++i) + $root.google.firestore.v1.StructuredQuery.CollectionSelector.encode(message.from[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.where != null && Object.hasOwnProperty.call(message, "where")) + $root.google.firestore.v1.StructuredQuery.Filter.encode(message.where, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.orderBy != null && message.orderBy.length) + for (var i = 0; i < message.orderBy.length; ++i) + $root.google.firestore.v1.StructuredQuery.Order.encode(message.orderBy[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.limit != null && Object.hasOwnProperty.call(message, "limit")) + $root.google.protobuf.Int32Value.encode(message.limit, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.offset != null && Object.hasOwnProperty.call(message, "offset")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.offset); + if (message.startAt != null && Object.hasOwnProperty.call(message, "startAt")) + $root.google.firestore.v1.Cursor.encode(message.startAt, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.endAt != null && Object.hasOwnProperty.call(message, "endAt")) + $root.google.firestore.v1.Cursor.encode(message.endAt, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.findNearest != null && Object.hasOwnProperty.call(message, "findNearest")) + $root.google.firestore.v1.StructuredQuery.FindNearest.encode(message.findNearest, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified StructuredQuery message, length delimited. Does not implicitly {@link google.firestore.v1.StructuredQuery.verify|verify} messages. + * @function encodeDelimited + * @memberof google.firestore.v1.StructuredQuery + * @static + * @param {google.firestore.v1.IStructuredQuery} message StructuredQuery message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StructuredQuery.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StructuredQuery message from the specified reader or buffer. + * @function decode + * @memberof google.firestore.v1.StructuredQuery + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.firestore.v1.StructuredQuery} StructuredQuery + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StructuredQuery.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.firestore.v1.StructuredQuery(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.select = $root.google.firestore.v1.StructuredQuery.Projection.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.from && message.from.length)) + message.from = []; + message.from.push($root.google.firestore.v1.StructuredQuery.CollectionSelector.decode(reader, reader.uint32())); + break; + } + case 3: { + message.where = $root.google.firestore.v1.StructuredQuery.Filter.decode(reader, reader.uint32()); + break; + } + case 4: { + if (!(message.orderBy && message.orderBy.length)) + message.orderBy = []; + message.orderBy.push($root.google.firestore.v1.StructuredQuery.Order.decode(reader, reader.uint32())); + break; + } + case 7: { + message.startAt = $root.google.firestore.v1.Cursor.decode(reader, reader.uint32()); + break; + } + case 8: { + message.endAt = $root.google.firestore.v1.Cursor.decode(reader, reader.uint32()); + break; + } + case 6: { + message.offset = reader.int32(); + break; + } + case 5: { + message.limit = $root.google.protobuf.Int32Value.decode(reader, reader.uint32()); + break; + } + case 9: { + message.findNearest = $root.google.firestore.v1.StructuredQuery.FindNearest.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StructuredQuery message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.firestore.v1.StructuredQuery + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.firestore.v1.StructuredQuery} StructuredQuery + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StructuredQuery.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + /** - * StructuredQuery limit. - * @member {google.protobuf.IInt32Value|null|undefined} limit + * Verifies a StructuredQuery message. + * @function verify * @memberof google.firestore.v1.StructuredQuery - * @instance - */ - StructuredQuery.prototype.limit = null; - + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StructuredQuery.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.select != null && message.hasOwnProperty("select")) { + var error = $root.google.firestore.v1.StructuredQuery.Projection.verify(message.select); + if (error) + return "select." + error; + } + if (message.from != null && message.hasOwnProperty("from")) { + if (!Array.isArray(message.from)) + return "from: array expected"; + for (var i = 0; i < message.from.length; ++i) { + var error = $root.google.firestore.v1.StructuredQuery.CollectionSelector.verify(message.from[i]); + if (error) + return "from." + error; + } + } + if (message.where != null && message.hasOwnProperty("where")) { + var error = $root.google.firestore.v1.StructuredQuery.Filter.verify(message.where); + if (error) + return "where." + error; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + if (!Array.isArray(message.orderBy)) + return "orderBy: array expected"; + for (var i = 0; i < message.orderBy.length; ++i) { + var error = $root.google.firestore.v1.StructuredQuery.Order.verify(message.orderBy[i]); + if (error) + return "orderBy." + error; + } + } + if (message.startAt != null && message.hasOwnProperty("startAt")) { + var error = $root.google.firestore.v1.Cursor.verify(message.startAt); + if (error) + return "startAt." + error; + } + if (message.endAt != null && message.hasOwnProperty("endAt")) { + var error = $root.google.firestore.v1.Cursor.verify(message.endAt); + if (error) + return "endAt." + error; + } + if (message.offset != null && message.hasOwnProperty("offset")) + if (!$util.isInteger(message.offset)) + return "offset: integer expected"; + if (message.limit != null && message.hasOwnProperty("limit")) { + var error = $root.google.protobuf.Int32Value.verify(message.limit); + if (error) + return "limit." + error; + } + if (message.findNearest != null && message.hasOwnProperty("findNearest")) { + var error = $root.google.firestore.v1.StructuredQuery.FindNearest.verify(message.findNearest); + if (error) + return "findNearest." + error; + } + return null; + }; + /** * Creates a StructuredQuery message from a plain object. Also converts values to their respective internal types. * @function fromObject @@ -15108,9 +29345,14 @@ throw TypeError(".google.firestore.v1.StructuredQuery.limit: object expected"); message.limit = $root.google.protobuf.Int32Value.fromObject(object.limit); } + if (object.findNearest != null) { + if (typeof object.findNearest !== "object") + throw TypeError(".google.firestore.v1.StructuredQuery.findNearest: object expected"); + message.findNearest = $root.google.firestore.v1.StructuredQuery.FindNearest.fromObject(object.findNearest); + } return message; }; - + /** * Creates a plain object from a StructuredQuery message. Also converts values to other types if specified. * @function toObject @@ -15135,6 +29377,7 @@ object.offset = 0; object.startAt = null; object.endAt = null; + object.findNearest = null; } if (message.select != null && message.hasOwnProperty("select")) object.select = $root.google.firestore.v1.StructuredQuery.Projection.toObject(message.select, options); @@ -15158,9 +29401,11 @@ object.startAt = $root.google.firestore.v1.Cursor.toObject(message.startAt, options); if (message.endAt != null && message.hasOwnProperty("endAt")) object.endAt = $root.google.firestore.v1.Cursor.toObject(message.endAt, options); + if (message.findNearest != null && message.hasOwnProperty("findNearest")) + object.findNearest = $root.google.firestore.v1.StructuredQuery.FindNearest.toObject(message.findNearest, options); return object; }; - + /** * Converts this StructuredQuery to JSON. * @function toJSON @@ -15171,7 +29416,7 @@ StructuredQuery.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - + /** * Gets the default type url for StructuredQuery * @function getTypeUrl @@ -15186,9 +29431,9 @@ } return typeUrlPrefix + "/google.firestore.v1.StructuredQuery"; }; - + StructuredQuery.CollectionSelector = (function() { - + /** * Properties of a CollectionSelector. * @memberof google.firestore.v1.StructuredQuery @@ -15196,7 +29441,7 @@ * @property {string|null} [collectionId] CollectionSelector collectionId * @property {boolean|null} [allDescendants] CollectionSelector allDescendants */ - + /** * Constructs a new CollectionSelector. * @memberof google.firestore.v1.StructuredQuery @@ -15211,7 +29456,7 @@ if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } - + /** * CollectionSelector collectionId. * @member {string} collectionId @@ -15219,7 +29464,7 @@ * @instance */ CollectionSelector.prototype.collectionId = ""; - + /** * CollectionSelector allDescendants. * @member {boolean} allDescendants @@ -15227,7 +29472,121 @@ * @instance */ CollectionSelector.prototype.allDescendants = false; - + + /** + * Creates a new CollectionSelector instance using the specified properties. + * @function create + * @memberof google.firestore.v1.StructuredQuery.CollectionSelector + * @static + * @param {google.firestore.v1.StructuredQuery.ICollectionSelector=} [properties] Properties to set + * @returns {google.firestore.v1.StructuredQuery.CollectionSelector} CollectionSelector instance + */ + CollectionSelector.create = function create(properties) { + return new CollectionSelector(properties); + }; + + /** + * Encodes the specified CollectionSelector message. Does not implicitly {@link google.firestore.v1.StructuredQuery.CollectionSelector.verify|verify} messages. + * @function encode + * @memberof google.firestore.v1.StructuredQuery.CollectionSelector + * @static + * @param {google.firestore.v1.StructuredQuery.ICollectionSelector} message CollectionSelector message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CollectionSelector.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.collectionId != null && Object.hasOwnProperty.call(message, "collectionId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.collectionId); + if (message.allDescendants != null && Object.hasOwnProperty.call(message, "allDescendants")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.allDescendants); + return writer; + }; + + /** + * Encodes the specified CollectionSelector message, length delimited. Does not implicitly {@link google.firestore.v1.StructuredQuery.CollectionSelector.verify|verify} messages. + * @function encodeDelimited + * @memberof google.firestore.v1.StructuredQuery.CollectionSelector + * @static + * @param {google.firestore.v1.StructuredQuery.ICollectionSelector} message CollectionSelector message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CollectionSelector.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CollectionSelector message from the specified reader or buffer. + * @function decode + * @memberof google.firestore.v1.StructuredQuery.CollectionSelector + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.firestore.v1.StructuredQuery.CollectionSelector} CollectionSelector + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CollectionSelector.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.firestore.v1.StructuredQuery.CollectionSelector(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.collectionId = reader.string(); + break; + } + case 3: { + message.allDescendants = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CollectionSelector message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.firestore.v1.StructuredQuery.CollectionSelector + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.firestore.v1.StructuredQuery.CollectionSelector} CollectionSelector + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CollectionSelector.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CollectionSelector message. + * @function verify + * @memberof google.firestore.v1.StructuredQuery.CollectionSelector + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CollectionSelector.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.collectionId != null && message.hasOwnProperty("collectionId")) + if (!$util.isString(message.collectionId)) + return "collectionId: string expected"; + if (message.allDescendants != null && message.hasOwnProperty("allDescendants")) + if (typeof message.allDescendants !== "boolean") + return "allDescendants: boolean expected"; + return null; + }; + /** * Creates a CollectionSelector message from a plain object. Also converts values to their respective internal types. * @function fromObject @@ -15246,7 +29605,7 @@ message.allDescendants = Boolean(object.allDescendants); return message; }; - + /** * Creates a plain object from a CollectionSelector message. Also converts values to other types if specified. * @function toObject @@ -15270,7 +29629,7 @@ object.allDescendants = message.allDescendants; return object; }; - + /** * Converts this CollectionSelector to JSON. * @function toJSON @@ -15281,7 +29640,7 @@ CollectionSelector.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - + /** * Gets the default type url for CollectionSelector * @function getTypeUrl @@ -15296,12 +29655,12 @@ } return typeUrlPrefix + "/google.firestore.v1.StructuredQuery.CollectionSelector"; }; - + return CollectionSelector; })(); - + StructuredQuery.Filter = (function() { - + /** * Properties of a Filter. * @memberof google.firestore.v1.StructuredQuery @@ -15310,7 +29669,7 @@ * @property {google.firestore.v1.StructuredQuery.IFieldFilter|null} [fieldFilter] Filter fieldFilter * @property {google.firestore.v1.StructuredQuery.IUnaryFilter|null} [unaryFilter] Filter unaryFilter */ - + /** * Constructs a new Filter. * @memberof google.firestore.v1.StructuredQuery @@ -15325,7 +29684,7 @@ if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } - + /** * Filter compositeFilter. * @member {google.firestore.v1.StructuredQuery.ICompositeFilter|null|undefined} compositeFilter @@ -15333,7 +29692,7 @@ * @instance */ Filter.prototype.compositeFilter = null; - + /** * Filter fieldFilter. * @member {google.firestore.v1.StructuredQuery.IFieldFilter|null|undefined} fieldFilter @@ -15341,7 +29700,7 @@ * @instance */ Filter.prototype.fieldFilter = null; - + /** * Filter unaryFilter. * @member {google.firestore.v1.StructuredQuery.IUnaryFilter|null|undefined} unaryFilter @@ -15349,10 +29708,10 @@ * @instance */ Filter.prototype.unaryFilter = null; - + // OneOf field names bound to virtual getters and setters var $oneOfFields; - + /** * Filter filterType. * @member {"compositeFilter"|"fieldFilter"|"unaryFilter"|undefined} filterType @@ -15363,7 +29722,150 @@ get: $util.oneOfGetter($oneOfFields = ["compositeFilter", "fieldFilter", "unaryFilter"]), set: $util.oneOfSetter($oneOfFields) }); - + + /** + * Creates a new Filter instance using the specified properties. + * @function create + * @memberof google.firestore.v1.StructuredQuery.Filter + * @static + * @param {google.firestore.v1.StructuredQuery.IFilter=} [properties] Properties to set + * @returns {google.firestore.v1.StructuredQuery.Filter} Filter instance + */ + Filter.create = function create(properties) { + return new Filter(properties); + }; + + /** + * Encodes the specified Filter message. Does not implicitly {@link google.firestore.v1.StructuredQuery.Filter.verify|verify} messages. + * @function encode + * @memberof google.firestore.v1.StructuredQuery.Filter + * @static + * @param {google.firestore.v1.StructuredQuery.IFilter} message Filter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Filter.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.compositeFilter != null && Object.hasOwnProperty.call(message, "compositeFilter")) + $root.google.firestore.v1.StructuredQuery.CompositeFilter.encode(message.compositeFilter, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.fieldFilter != null && Object.hasOwnProperty.call(message, "fieldFilter")) + $root.google.firestore.v1.StructuredQuery.FieldFilter.encode(message.fieldFilter, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.unaryFilter != null && Object.hasOwnProperty.call(message, "unaryFilter")) + $root.google.firestore.v1.StructuredQuery.UnaryFilter.encode(message.unaryFilter, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Filter message, length delimited. Does not implicitly {@link google.firestore.v1.StructuredQuery.Filter.verify|verify} messages. + * @function encodeDelimited + * @memberof google.firestore.v1.StructuredQuery.Filter + * @static + * @param {google.firestore.v1.StructuredQuery.IFilter} message Filter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Filter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Filter message from the specified reader or buffer. + * @function decode + * @memberof google.firestore.v1.StructuredQuery.Filter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.firestore.v1.StructuredQuery.Filter} Filter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Filter.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.firestore.v1.StructuredQuery.Filter(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.compositeFilter = $root.google.firestore.v1.StructuredQuery.CompositeFilter.decode(reader, reader.uint32()); + break; + } + case 2: { + message.fieldFilter = $root.google.firestore.v1.StructuredQuery.FieldFilter.decode(reader, reader.uint32()); + break; + } + case 3: { + message.unaryFilter = $root.google.firestore.v1.StructuredQuery.UnaryFilter.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Filter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.firestore.v1.StructuredQuery.Filter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.firestore.v1.StructuredQuery.Filter} Filter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Filter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Filter message. + * @function verify + * @memberof google.firestore.v1.StructuredQuery.Filter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Filter.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.compositeFilter != null && message.hasOwnProperty("compositeFilter")) { + properties.filterType = 1; + { + var error = $root.google.firestore.v1.StructuredQuery.CompositeFilter.verify(message.compositeFilter); + if (error) + return "compositeFilter." + error; + } + } + if (message.fieldFilter != null && message.hasOwnProperty("fieldFilter")) { + if (properties.filterType === 1) + return "filterType: multiple values"; + properties.filterType = 1; + { + var error = $root.google.firestore.v1.StructuredQuery.FieldFilter.verify(message.fieldFilter); + if (error) + return "fieldFilter." + error; + } + } + if (message.unaryFilter != null && message.hasOwnProperty("unaryFilter")) { + if (properties.filterType === 1) + return "filterType: multiple values"; + properties.filterType = 1; + { + var error = $root.google.firestore.v1.StructuredQuery.UnaryFilter.verify(message.unaryFilter); + if (error) + return "unaryFilter." + error; + } + } + return null; + }; + /** * Creates a Filter message from a plain object. Also converts values to their respective internal types. * @function fromObject @@ -15393,7 +29895,7 @@ } return message; }; - + /** * Creates a plain object from a Filter message. Also converts values to other types if specified. * @function toObject @@ -15424,7 +29926,7 @@ } return object; }; - + /** * Converts this Filter to JSON. * @function toJSON @@ -15435,7 +29937,7 @@ Filter.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - + /** * Gets the default type url for Filter * @function getTypeUrl @@ -15450,12 +29952,12 @@ } return typeUrlPrefix + "/google.firestore.v1.StructuredQuery.Filter"; }; - + return Filter; })(); - + StructuredQuery.CompositeFilter = (function() { - + /** * Properties of a CompositeFilter. * @memberof google.firestore.v1.StructuredQuery @@ -15463,7 +29965,7 @@ * @property {google.firestore.v1.StructuredQuery.CompositeFilter.Operator|null} [op] CompositeFilter op * @property {Array.|null} [filters] CompositeFilter filters */ - + /** * Constructs a new CompositeFilter. * @memberof google.firestore.v1.StructuredQuery @@ -15479,7 +29981,7 @@ if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } - + /** * CompositeFilter op. * @member {google.firestore.v1.StructuredQuery.CompositeFilter.Operator} op @@ -15487,7 +29989,7 @@ * @instance */ CompositeFilter.prototype.op = 0; - + /** * CompositeFilter filters. * @member {Array.} filters @@ -15495,7 +29997,136 @@ * @instance */ CompositeFilter.prototype.filters = $util.emptyArray; - + + /** + * Creates a new CompositeFilter instance using the specified properties. + * @function create + * @memberof google.firestore.v1.StructuredQuery.CompositeFilter + * @static + * @param {google.firestore.v1.StructuredQuery.ICompositeFilter=} [properties] Properties to set + * @returns {google.firestore.v1.StructuredQuery.CompositeFilter} CompositeFilter instance + */ + CompositeFilter.create = function create(properties) { + return new CompositeFilter(properties); + }; + + /** + * Encodes the specified CompositeFilter message. Does not implicitly {@link google.firestore.v1.StructuredQuery.CompositeFilter.verify|verify} messages. + * @function encode + * @memberof google.firestore.v1.StructuredQuery.CompositeFilter + * @static + * @param {google.firestore.v1.StructuredQuery.ICompositeFilter} message CompositeFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CompositeFilter.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.op != null && Object.hasOwnProperty.call(message, "op")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.op); + if (message.filters != null && message.filters.length) + for (var i = 0; i < message.filters.length; ++i) + $root.google.firestore.v1.StructuredQuery.Filter.encode(message.filters[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CompositeFilter message, length delimited. Does not implicitly {@link google.firestore.v1.StructuredQuery.CompositeFilter.verify|verify} messages. + * @function encodeDelimited + * @memberof google.firestore.v1.StructuredQuery.CompositeFilter + * @static + * @param {google.firestore.v1.StructuredQuery.ICompositeFilter} message CompositeFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CompositeFilter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CompositeFilter message from the specified reader or buffer. + * @function decode + * @memberof google.firestore.v1.StructuredQuery.CompositeFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.firestore.v1.StructuredQuery.CompositeFilter} CompositeFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CompositeFilter.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.firestore.v1.StructuredQuery.CompositeFilter(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.op = reader.int32(); + break; + } + case 2: { + if (!(message.filters && message.filters.length)) + message.filters = []; + message.filters.push($root.google.firestore.v1.StructuredQuery.Filter.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CompositeFilter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.firestore.v1.StructuredQuery.CompositeFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.firestore.v1.StructuredQuery.CompositeFilter} CompositeFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CompositeFilter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CompositeFilter message. + * @function verify + * @memberof google.firestore.v1.StructuredQuery.CompositeFilter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CompositeFilter.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.op != null && message.hasOwnProperty("op")) + switch (message.op) { + default: + return "op: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.filters != null && message.hasOwnProperty("filters")) { + if (!Array.isArray(message.filters)) + return "filters: array expected"; + for (var i = 0; i < message.filters.length; ++i) { + var error = $root.google.firestore.v1.StructuredQuery.Filter.verify(message.filters[i]); + if (error) + return "filters." + error; + } + } + return null; + }; + /** * Creates a CompositeFilter message from a plain object. Also converts values to their respective internal types. * @function fromObject @@ -15509,24 +30140,24 @@ return object; var message = new $root.google.firestore.v1.StructuredQuery.CompositeFilter(); switch (object.op) { - default: - if (typeof object.op === "number") { - message.op = object.op; + default: + if (typeof object.op === "number") { + message.op = object.op; + break; + } + break; + case "OPERATOR_UNSPECIFIED": + case 0: + message.op = 0; + break; + case "AND": + case 1: + message.op = 1; + break; + case "OR": + case 2: + message.op = 2; break; - } - break; - case "OPERATOR_UNSPECIFIED": - case 0: - message.op = 0; - break; - case "AND": - case 1: - message.op = 1; - break; - case "OR": - case 2: - message.op = 2; - break; } if (object.filters) { if (!Array.isArray(object.filters)) @@ -15540,7 +30171,7 @@ } return message; }; - + /** * Creates a plain object from a CompositeFilter message. Also converts values to other types if specified. * @function toObject @@ -15567,7 +30198,7 @@ } return object; }; - + /** * Converts this CompositeFilter to JSON. * @function toJSON @@ -15578,7 +30209,7 @@ CompositeFilter.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - + /** * Gets the default type url for CompositeFilter * @function getTypeUrl @@ -15593,28 +30224,28 @@ } return typeUrlPrefix + "/google.firestore.v1.StructuredQuery.CompositeFilter"; }; - + /** * Operator enum. * @name google.firestore.v1.StructuredQuery.CompositeFilter.Operator - * @enum {string} - * @property {string} OPERATOR_UNSPECIFIED=OPERATOR_UNSPECIFIED OPERATOR_UNSPECIFIED value - * @property {string} AND=AND AND value - * @property {string} OR=OR OR value + * @enum {number} + * @property {number} OPERATOR_UNSPECIFIED=0 OPERATOR_UNSPECIFIED value + * @property {number} AND=1 AND value + * @property {number} OR=2 OR value */ CompositeFilter.Operator = (function() { var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "OPERATOR_UNSPECIFIED"] = "OPERATOR_UNSPECIFIED"; - values[valuesById[1] = "AND"] = "AND"; - values[valuesById[2] = "OR"] = "OR"; + values[valuesById[0] = "OPERATOR_UNSPECIFIED"] = 0; + values[valuesById[1] = "AND"] = 1; + values[valuesById[2] = "OR"] = 2; return values; })(); - + return CompositeFilter; })(); - + StructuredQuery.FieldFilter = (function() { - + /** * Properties of a FieldFilter. * @memberof google.firestore.v1.StructuredQuery @@ -15623,7 +30254,7 @@ * @property {google.firestore.v1.StructuredQuery.FieldFilter.Operator|null} [op] FieldFilter op * @property {google.firestore.v1.IValue|null} [value] FieldFilter value */ - + /** * Constructs a new FieldFilter. * @memberof google.firestore.v1.StructuredQuery @@ -15638,7 +30269,7 @@ if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } - + /** * FieldFilter field. * @member {google.firestore.v1.StructuredQuery.IFieldReference|null|undefined} field @@ -15646,23 +30277,164 @@ * @instance */ FieldFilter.prototype.field = null; - + /** * FieldFilter op. * @member {google.firestore.v1.StructuredQuery.FieldFilter.Operator} op * @memberof google.firestore.v1.StructuredQuery.FieldFilter - * @instance + * @instance + */ + FieldFilter.prototype.op = 0; + + /** + * FieldFilter value. + * @member {google.firestore.v1.IValue|null|undefined} value + * @memberof google.firestore.v1.StructuredQuery.FieldFilter + * @instance + */ + FieldFilter.prototype.value = null; + + /** + * Creates a new FieldFilter instance using the specified properties. + * @function create + * @memberof google.firestore.v1.StructuredQuery.FieldFilter + * @static + * @param {google.firestore.v1.StructuredQuery.IFieldFilter=} [properties] Properties to set + * @returns {google.firestore.v1.StructuredQuery.FieldFilter} FieldFilter instance + */ + FieldFilter.create = function create(properties) { + return new FieldFilter(properties); + }; + + /** + * Encodes the specified FieldFilter message. Does not implicitly {@link google.firestore.v1.StructuredQuery.FieldFilter.verify|verify} messages. + * @function encode + * @memberof google.firestore.v1.StructuredQuery.FieldFilter + * @static + * @param {google.firestore.v1.StructuredQuery.IFieldFilter} message FieldFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldFilter.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.field != null && Object.hasOwnProperty.call(message, "field")) + $root.google.firestore.v1.StructuredQuery.FieldReference.encode(message.field, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.op != null && Object.hasOwnProperty.call(message, "op")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.op); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + $root.google.firestore.v1.Value.encode(message.value, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FieldFilter message, length delimited. Does not implicitly {@link google.firestore.v1.StructuredQuery.FieldFilter.verify|verify} messages. + * @function encodeDelimited + * @memberof google.firestore.v1.StructuredQuery.FieldFilter + * @static + * @param {google.firestore.v1.StructuredQuery.IFieldFilter} message FieldFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldFilter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldFilter message from the specified reader or buffer. + * @function decode + * @memberof google.firestore.v1.StructuredQuery.FieldFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.firestore.v1.StructuredQuery.FieldFilter} FieldFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldFilter.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.firestore.v1.StructuredQuery.FieldFilter(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.field = $root.google.firestore.v1.StructuredQuery.FieldReference.decode(reader, reader.uint32()); + break; + } + case 2: { + message.op = reader.int32(); + break; + } + case 3: { + message.value = $root.google.firestore.v1.Value.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldFilter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.firestore.v1.StructuredQuery.FieldFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.firestore.v1.StructuredQuery.FieldFilter} FieldFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - FieldFilter.prototype.op = 0; - + FieldFilter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + /** - * FieldFilter value. - * @member {google.firestore.v1.IValue|null|undefined} value + * Verifies a FieldFilter message. + * @function verify * @memberof google.firestore.v1.StructuredQuery.FieldFilter - * @instance + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - FieldFilter.prototype.value = null; - + FieldFilter.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.field != null && message.hasOwnProperty("field")) { + var error = $root.google.firestore.v1.StructuredQuery.FieldReference.verify(message.field); + if (error) + return "field." + error; + } + if (message.op != null && message.hasOwnProperty("op")) + switch (message.op) { + default: + return "op: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + break; + } + if (message.value != null && message.hasOwnProperty("value")) { + var error = $root.google.firestore.v1.Value.verify(message.value); + if (error) + return "value." + error; + } + return null; + }; + /** * Creates a FieldFilter message from a plain object. Also converts values to their respective internal types. * @function fromObject @@ -15681,56 +30453,56 @@ message.field = $root.google.firestore.v1.StructuredQuery.FieldReference.fromObject(object.field); } switch (object.op) { - default: - if (typeof object.op === "number") { - message.op = object.op; + default: + if (typeof object.op === "number") { + message.op = object.op; + break; + } + break; + case "OPERATOR_UNSPECIFIED": + case 0: + message.op = 0; + break; + case "LESS_THAN": + case 1: + message.op = 1; + break; + case "LESS_THAN_OR_EQUAL": + case 2: + message.op = 2; + break; + case "GREATER_THAN": + case 3: + message.op = 3; + break; + case "GREATER_THAN_OR_EQUAL": + case 4: + message.op = 4; + break; + case "EQUAL": + case 5: + message.op = 5; + break; + case "NOT_EQUAL": + case 6: + message.op = 6; + break; + case "ARRAY_CONTAINS": + case 7: + message.op = 7; + break; + case "IN": + case 8: + message.op = 8; + break; + case "ARRAY_CONTAINS_ANY": + case 9: + message.op = 9; + break; + case "NOT_IN": + case 10: + message.op = 10; break; - } - break; - case "OPERATOR_UNSPECIFIED": - case 0: - message.op = 0; - break; - case "LESS_THAN": - case 1: - message.op = 1; - break; - case "LESS_THAN_OR_EQUAL": - case 2: - message.op = 2; - break; - case "GREATER_THAN": - case 3: - message.op = 3; - break; - case "GREATER_THAN_OR_EQUAL": - case 4: - message.op = 4; - break; - case "EQUAL": - case 5: - message.op = 5; - break; - case "NOT_EQUAL": - case 6: - message.op = 6; - break; - case "ARRAY_CONTAINS": - case 7: - message.op = 7; - break; - case "IN": - case 8: - message.op = 8; - break; - case "ARRAY_CONTAINS_ANY": - case 9: - message.op = 9; - break; - case "NOT_IN": - case 10: - message.op = 10; - break; } if (object.value != null) { if (typeof object.value !== "object") @@ -15739,7 +30511,7 @@ } return message; }; - + /** * Creates a plain object from a FieldFilter message. Also converts values to other types if specified. * @function toObject @@ -15766,7 +30538,7 @@ object.value = $root.google.firestore.v1.Value.toObject(message.value, options); return object; }; - + /** * Converts this FieldFilter to JSON. * @function toJSON @@ -15777,7 +30549,7 @@ FieldFilter.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - + /** * Gets the default type url for FieldFilter * @function getTypeUrl @@ -15792,44 +30564,44 @@ } return typeUrlPrefix + "/google.firestore.v1.StructuredQuery.FieldFilter"; }; - + /** * Operator enum. * @name google.firestore.v1.StructuredQuery.FieldFilter.Operator - * @enum {string} - * @property {string} OPERATOR_UNSPECIFIED=OPERATOR_UNSPECIFIED OPERATOR_UNSPECIFIED value - * @property {string} LESS_THAN=LESS_THAN LESS_THAN value - * @property {string} LESS_THAN_OR_EQUAL=LESS_THAN_OR_EQUAL LESS_THAN_OR_EQUAL value - * @property {string} GREATER_THAN=GREATER_THAN GREATER_THAN value - * @property {string} GREATER_THAN_OR_EQUAL=GREATER_THAN_OR_EQUAL GREATER_THAN_OR_EQUAL value - * @property {string} EQUAL=EQUAL EQUAL value - * @property {string} NOT_EQUAL=NOT_EQUAL NOT_EQUAL value - * @property {string} ARRAY_CONTAINS=ARRAY_CONTAINS ARRAY_CONTAINS value - * @property {string} IN=IN IN value - * @property {string} ARRAY_CONTAINS_ANY=ARRAY_CONTAINS_ANY ARRAY_CONTAINS_ANY value - * @property {string} NOT_IN=NOT_IN NOT_IN value + * @enum {number} + * @property {number} OPERATOR_UNSPECIFIED=0 OPERATOR_UNSPECIFIED value + * @property {number} LESS_THAN=1 LESS_THAN value + * @property {number} LESS_THAN_OR_EQUAL=2 LESS_THAN_OR_EQUAL value + * @property {number} GREATER_THAN=3 GREATER_THAN value + * @property {number} GREATER_THAN_OR_EQUAL=4 GREATER_THAN_OR_EQUAL value + * @property {number} EQUAL=5 EQUAL value + * @property {number} NOT_EQUAL=6 NOT_EQUAL value + * @property {number} ARRAY_CONTAINS=7 ARRAY_CONTAINS value + * @property {number} IN=8 IN value + * @property {number} ARRAY_CONTAINS_ANY=9 ARRAY_CONTAINS_ANY value + * @property {number} NOT_IN=10 NOT_IN value */ FieldFilter.Operator = (function() { var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "OPERATOR_UNSPECIFIED"] = "OPERATOR_UNSPECIFIED"; - values[valuesById[1] = "LESS_THAN"] = "LESS_THAN"; - values[valuesById[2] = "LESS_THAN_OR_EQUAL"] = "LESS_THAN_OR_EQUAL"; - values[valuesById[3] = "GREATER_THAN"] = "GREATER_THAN"; - values[valuesById[4] = "GREATER_THAN_OR_EQUAL"] = "GREATER_THAN_OR_EQUAL"; - values[valuesById[5] = "EQUAL"] = "EQUAL"; - values[valuesById[6] = "NOT_EQUAL"] = "NOT_EQUAL"; - values[valuesById[7] = "ARRAY_CONTAINS"] = "ARRAY_CONTAINS"; - values[valuesById[8] = "IN"] = "IN"; - values[valuesById[9] = "ARRAY_CONTAINS_ANY"] = "ARRAY_CONTAINS_ANY"; - values[valuesById[10] = "NOT_IN"] = "NOT_IN"; + values[valuesById[0] = "OPERATOR_UNSPECIFIED"] = 0; + values[valuesById[1] = "LESS_THAN"] = 1; + values[valuesById[2] = "LESS_THAN_OR_EQUAL"] = 2; + values[valuesById[3] = "GREATER_THAN"] = 3; + values[valuesById[4] = "GREATER_THAN_OR_EQUAL"] = 4; + values[valuesById[5] = "EQUAL"] = 5; + values[valuesById[6] = "NOT_EQUAL"] = 6; + values[valuesById[7] = "ARRAY_CONTAINS"] = 7; + values[valuesById[8] = "IN"] = 8; + values[valuesById[9] = "ARRAY_CONTAINS_ANY"] = 9; + values[valuesById[10] = "NOT_IN"] = 10; return values; })(); - + return FieldFilter; })(); - + StructuredQuery.UnaryFilter = (function() { - + /** * Properties of an UnaryFilter. * @memberof google.firestore.v1.StructuredQuery @@ -15837,7 +30609,7 @@ * @property {google.firestore.v1.StructuredQuery.UnaryFilter.Operator|null} [op] UnaryFilter op * @property {google.firestore.v1.StructuredQuery.IFieldReference|null} [field] UnaryFilter field */ - + /** * Constructs a new UnaryFilter. * @memberof google.firestore.v1.StructuredQuery @@ -15852,7 +30624,7 @@ if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } - + /** * UnaryFilter op. * @member {google.firestore.v1.StructuredQuery.UnaryFilter.Operator} op @@ -15860,7 +30632,7 @@ * @instance */ UnaryFilter.prototype.op = 0; - + /** * UnaryFilter field. * @member {google.firestore.v1.StructuredQuery.IFieldReference|null|undefined} field @@ -15868,10 +30640,10 @@ * @instance */ UnaryFilter.prototype.field = null; - + // OneOf field names bound to virtual getters and setters var $oneOfFields; - + /** * UnaryFilter operandType. * @member {"field"|undefined} operandType @@ -15882,7 +30654,135 @@ get: $util.oneOfGetter($oneOfFields = ["field"]), set: $util.oneOfSetter($oneOfFields) }); - + + /** + * Creates a new UnaryFilter instance using the specified properties. + * @function create + * @memberof google.firestore.v1.StructuredQuery.UnaryFilter + * @static + * @param {google.firestore.v1.StructuredQuery.IUnaryFilter=} [properties] Properties to set + * @returns {google.firestore.v1.StructuredQuery.UnaryFilter} UnaryFilter instance + */ + UnaryFilter.create = function create(properties) { + return new UnaryFilter(properties); + }; + + /** + * Encodes the specified UnaryFilter message. Does not implicitly {@link google.firestore.v1.StructuredQuery.UnaryFilter.verify|verify} messages. + * @function encode + * @memberof google.firestore.v1.StructuredQuery.UnaryFilter + * @static + * @param {google.firestore.v1.StructuredQuery.IUnaryFilter} message UnaryFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UnaryFilter.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.op != null && Object.hasOwnProperty.call(message, "op")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.op); + if (message.field != null && Object.hasOwnProperty.call(message, "field")) + $root.google.firestore.v1.StructuredQuery.FieldReference.encode(message.field, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UnaryFilter message, length delimited. Does not implicitly {@link google.firestore.v1.StructuredQuery.UnaryFilter.verify|verify} messages. + * @function encodeDelimited + * @memberof google.firestore.v1.StructuredQuery.UnaryFilter + * @static + * @param {google.firestore.v1.StructuredQuery.IUnaryFilter} message UnaryFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UnaryFilter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UnaryFilter message from the specified reader or buffer. + * @function decode + * @memberof google.firestore.v1.StructuredQuery.UnaryFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.firestore.v1.StructuredQuery.UnaryFilter} UnaryFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UnaryFilter.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.firestore.v1.StructuredQuery.UnaryFilter(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.op = reader.int32(); + break; + } + case 2: { + message.field = $root.google.firestore.v1.StructuredQuery.FieldReference.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UnaryFilter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.firestore.v1.StructuredQuery.UnaryFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.firestore.v1.StructuredQuery.UnaryFilter} UnaryFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UnaryFilter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UnaryFilter message. + * @function verify + * @memberof google.firestore.v1.StructuredQuery.UnaryFilter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UnaryFilter.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.op != null && message.hasOwnProperty("op")) + switch (message.op) { + default: + return "op: enum value expected"; + case 0: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.field != null && message.hasOwnProperty("field")) { + properties.operandType = 1; + { + var error = $root.google.firestore.v1.StructuredQuery.FieldReference.verify(message.field); + if (error) + return "field." + error; + } + } + return null; + }; + /** * Creates an UnaryFilter message from a plain object. Also converts values to their respective internal types. * @function fromObject @@ -15896,32 +30796,32 @@ return object; var message = new $root.google.firestore.v1.StructuredQuery.UnaryFilter(); switch (object.op) { - default: - if (typeof object.op === "number") { - message.op = object.op; + default: + if (typeof object.op === "number") { + message.op = object.op; + break; + } + break; + case "OPERATOR_UNSPECIFIED": + case 0: + message.op = 0; + break; + case "IS_NAN": + case 2: + message.op = 2; + break; + case "IS_NULL": + case 3: + message.op = 3; + break; + case "IS_NOT_NAN": + case 4: + message.op = 4; + break; + case "IS_NOT_NULL": + case 5: + message.op = 5; break; - } - break; - case "OPERATOR_UNSPECIFIED": - case 0: - message.op = 0; - break; - case "IS_NAN": - case 2: - message.op = 2; - break; - case "IS_NULL": - case 3: - message.op = 3; - break; - case "IS_NOT_NAN": - case 4: - message.op = 4; - break; - case "IS_NOT_NULL": - case 5: - message.op = 5; - break; } if (object.field != null) { if (typeof object.field !== "object") @@ -15930,7 +30830,7 @@ } return message; }; - + /** * Creates a plain object from an UnaryFilter message. Also converts values to other types if specified. * @function toObject @@ -15955,7 +30855,7 @@ } return object; }; - + /** * Converts this UnaryFilter to JSON. * @function toJSON @@ -15966,7 +30866,7 @@ UnaryFilter.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - + /** * Gets the default type url for UnaryFilter * @function getTypeUrl @@ -15981,32 +30881,32 @@ } return typeUrlPrefix + "/google.firestore.v1.StructuredQuery.UnaryFilter"; }; - + /** * Operator enum. * @name google.firestore.v1.StructuredQuery.UnaryFilter.Operator - * @enum {string} - * @property {string} OPERATOR_UNSPECIFIED=OPERATOR_UNSPECIFIED OPERATOR_UNSPECIFIED value - * @property {string} IS_NAN=IS_NAN IS_NAN value - * @property {string} IS_NULL=IS_NULL IS_NULL value - * @property {string} IS_NOT_NAN=IS_NOT_NAN IS_NOT_NAN value - * @property {string} IS_NOT_NULL=IS_NOT_NULL IS_NOT_NULL value + * @enum {number} + * @property {number} OPERATOR_UNSPECIFIED=0 OPERATOR_UNSPECIFIED value + * @property {number} IS_NAN=2 IS_NAN value + * @property {number} IS_NULL=3 IS_NULL value + * @property {number} IS_NOT_NAN=4 IS_NOT_NAN value + * @property {number} IS_NOT_NULL=5 IS_NOT_NULL value */ UnaryFilter.Operator = (function() { var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "OPERATOR_UNSPECIFIED"] = "OPERATOR_UNSPECIFIED"; - values[valuesById[2] = "IS_NAN"] = "IS_NAN"; - values[valuesById[3] = "IS_NULL"] = "IS_NULL"; - values[valuesById[4] = "IS_NOT_NAN"] = "IS_NOT_NAN"; - values[valuesById[5] = "IS_NOT_NULL"] = "IS_NOT_NULL"; + values[valuesById[0] = "OPERATOR_UNSPECIFIED"] = 0; + values[valuesById[2] = "IS_NAN"] = 2; + values[valuesById[3] = "IS_NULL"] = 3; + values[valuesById[4] = "IS_NOT_NAN"] = 4; + values[valuesById[5] = "IS_NOT_NULL"] = 5; return values; })(); - + return UnaryFilter; })(); - + StructuredQuery.Order = (function() { - + /** * Properties of an Order. * @memberof google.firestore.v1.StructuredQuery @@ -16014,7 +30914,7 @@ * @property {google.firestore.v1.StructuredQuery.IFieldReference|null} [field] Order field * @property {google.firestore.v1.StructuredQuery.Direction|null} [direction] Order direction */ - + /** * Constructs a new Order. * @memberof google.firestore.v1.StructuredQuery @@ -16029,7 +30929,7 @@ if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } - + /** * Order field. * @member {google.firestore.v1.StructuredQuery.IFieldReference|null|undefined} field @@ -16037,7 +30937,7 @@ * @instance */ Order.prototype.field = null; - + /** * Order direction. * @member {google.firestore.v1.StructuredQuery.Direction} direction @@ -16045,7 +30945,129 @@ * @instance */ Order.prototype.direction = 0; - + + /** + * Creates a new Order instance using the specified properties. + * @function create + * @memberof google.firestore.v1.StructuredQuery.Order + * @static + * @param {google.firestore.v1.StructuredQuery.IOrder=} [properties] Properties to set + * @returns {google.firestore.v1.StructuredQuery.Order} Order instance + */ + Order.create = function create(properties) { + return new Order(properties); + }; + + /** + * Encodes the specified Order message. Does not implicitly {@link google.firestore.v1.StructuredQuery.Order.verify|verify} messages. + * @function encode + * @memberof google.firestore.v1.StructuredQuery.Order + * @static + * @param {google.firestore.v1.StructuredQuery.IOrder} message Order message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Order.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.field != null && Object.hasOwnProperty.call(message, "field")) + $root.google.firestore.v1.StructuredQuery.FieldReference.encode(message.field, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.direction != null && Object.hasOwnProperty.call(message, "direction")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.direction); + return writer; + }; + + /** + * Encodes the specified Order message, length delimited. Does not implicitly {@link google.firestore.v1.StructuredQuery.Order.verify|verify} messages. + * @function encodeDelimited + * @memberof google.firestore.v1.StructuredQuery.Order + * @static + * @param {google.firestore.v1.StructuredQuery.IOrder} message Order message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Order.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Order message from the specified reader or buffer. + * @function decode + * @memberof google.firestore.v1.StructuredQuery.Order + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.firestore.v1.StructuredQuery.Order} Order + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Order.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.firestore.v1.StructuredQuery.Order(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.field = $root.google.firestore.v1.StructuredQuery.FieldReference.decode(reader, reader.uint32()); + break; + } + case 2: { + message.direction = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Order message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.firestore.v1.StructuredQuery.Order + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.firestore.v1.StructuredQuery.Order} Order + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Order.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Order message. + * @function verify + * @memberof google.firestore.v1.StructuredQuery.Order + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Order.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.field != null && message.hasOwnProperty("field")) { + var error = $root.google.firestore.v1.StructuredQuery.FieldReference.verify(message.field); + if (error) + return "field." + error; + } + if (message.direction != null && message.hasOwnProperty("direction")) + switch (message.direction) { + default: + return "direction: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + /** * Creates an Order message from a plain object. Also converts values to their respective internal types. * @function fromObject @@ -16064,28 +31086,28 @@ message.field = $root.google.firestore.v1.StructuredQuery.FieldReference.fromObject(object.field); } switch (object.direction) { - default: - if (typeof object.direction === "number") { - message.direction = object.direction; + default: + if (typeof object.direction === "number") { + message.direction = object.direction; + break; + } + break; + case "DIRECTION_UNSPECIFIED": + case 0: + message.direction = 0; + break; + case "ASCENDING": + case 1: + message.direction = 1; + break; + case "DESCENDING": + case 2: + message.direction = 2; break; - } - break; - case "DIRECTION_UNSPECIFIED": - case 0: - message.direction = 0; - break; - case "ASCENDING": - case 1: - message.direction = 1; - break; - case "DESCENDING": - case 2: - message.direction = 2; - break; } return message; }; - + /** * Creates a plain object from an Order message. Also converts values to other types if specified. * @function toObject @@ -16109,7 +31131,7 @@ object.direction = options.enums === String ? $root.google.firestore.v1.StructuredQuery.Direction[message.direction] === undefined ? message.direction : $root.google.firestore.v1.StructuredQuery.Direction[message.direction] : message.direction; return object; }; - + /** * Converts this Order to JSON. * @function toJSON @@ -16120,7 +31142,7 @@ Order.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - + /** * Gets the default type url for Order * @function getTypeUrl @@ -16135,35 +31157,35 @@ } return typeUrlPrefix + "/google.firestore.v1.StructuredQuery.Order"; }; - + return Order; })(); - + /** * Direction enum. * @name google.firestore.v1.StructuredQuery.Direction - * @enum {string} - * @property {string} DIRECTION_UNSPECIFIED=DIRECTION_UNSPECIFIED DIRECTION_UNSPECIFIED value - * @property {string} ASCENDING=ASCENDING ASCENDING value - * @property {string} DESCENDING=DESCENDING DESCENDING value + * @enum {number} + * @property {number} DIRECTION_UNSPECIFIED=0 DIRECTION_UNSPECIFIED value + * @property {number} ASCENDING=1 ASCENDING value + * @property {number} DESCENDING=2 DESCENDING value */ StructuredQuery.Direction = (function() { var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "DIRECTION_UNSPECIFIED"] = "DIRECTION_UNSPECIFIED"; - values[valuesById[1] = "ASCENDING"] = "ASCENDING"; - values[valuesById[2] = "DESCENDING"] = "DESCENDING"; + values[valuesById[0] = "DIRECTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "ASCENDING"] = 1; + values[valuesById[2] = "DESCENDING"] = 2; return values; })(); - + StructuredQuery.FieldReference = (function() { - + /** * Properties of a FieldReference. * @memberof google.firestore.v1.StructuredQuery * @interface IFieldReference * @property {string|null} [fieldPath] FieldReference fieldPath */ - + /** * Constructs a new FieldReference. * @memberof google.firestore.v1.StructuredQuery @@ -16172,21 +31194,126 @@ * @constructor * @param {google.firestore.v1.StructuredQuery.IFieldReference=} [properties] Properties to set */ - function FieldReference(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]]; - } - + function FieldReference(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]]; + } + + /** + * FieldReference fieldPath. + * @member {string} fieldPath + * @memberof google.firestore.v1.StructuredQuery.FieldReference + * @instance + */ + FieldReference.prototype.fieldPath = ""; + + /** + * Creates a new FieldReference instance using the specified properties. + * @function create + * @memberof google.firestore.v1.StructuredQuery.FieldReference + * @static + * @param {google.firestore.v1.StructuredQuery.IFieldReference=} [properties] Properties to set + * @returns {google.firestore.v1.StructuredQuery.FieldReference} FieldReference instance + */ + FieldReference.create = function create(properties) { + return new FieldReference(properties); + }; + + /** + * Encodes the specified FieldReference message. Does not implicitly {@link google.firestore.v1.StructuredQuery.FieldReference.verify|verify} messages. + * @function encode + * @memberof google.firestore.v1.StructuredQuery.FieldReference + * @static + * @param {google.firestore.v1.StructuredQuery.IFieldReference} message FieldReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldReference.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fieldPath != null && Object.hasOwnProperty.call(message, "fieldPath")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.fieldPath); + return writer; + }; + + /** + * Encodes the specified FieldReference message, length delimited. Does not implicitly {@link google.firestore.v1.StructuredQuery.FieldReference.verify|verify} messages. + * @function encodeDelimited + * @memberof google.firestore.v1.StructuredQuery.FieldReference + * @static + * @param {google.firestore.v1.StructuredQuery.IFieldReference} message FieldReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldReference.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldReference message from the specified reader or buffer. + * @function decode + * @memberof google.firestore.v1.StructuredQuery.FieldReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.firestore.v1.StructuredQuery.FieldReference} FieldReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldReference.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.firestore.v1.StructuredQuery.FieldReference(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.fieldPath = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldReference message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.firestore.v1.StructuredQuery.FieldReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.firestore.v1.StructuredQuery.FieldReference} FieldReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldReference.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + /** - * FieldReference fieldPath. - * @member {string} fieldPath + * Verifies a FieldReference message. + * @function verify * @memberof google.firestore.v1.StructuredQuery.FieldReference - * @instance + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - FieldReference.prototype.fieldPath = ""; - + FieldReference.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fieldPath != null && message.hasOwnProperty("fieldPath")) + if (!$util.isString(message.fieldPath)) + return "fieldPath: string expected"; + return null; + }; + /** * Creates a FieldReference message from a plain object. Also converts values to their respective internal types. * @function fromObject @@ -16203,7 +31330,7 @@ message.fieldPath = String(object.fieldPath); return message; }; - + /** * Creates a plain object from a FieldReference message. Also converts values to other types if specified. * @function toObject @@ -16223,7 +31350,7 @@ object.fieldPath = message.fieldPath; return object; }; - + /** * Converts this FieldReference to JSON. * @function toJSON @@ -16234,7 +31361,7 @@ FieldReference.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - + /** * Gets the default type url for FieldReference * @function getTypeUrl @@ -16249,19 +31376,19 @@ } return typeUrlPrefix + "/google.firestore.v1.StructuredQuery.FieldReference"; }; - + return FieldReference; })(); - + StructuredQuery.Projection = (function() { - + /** * Properties of a Projection. * @memberof google.firestore.v1.StructuredQuery * @interface IProjection * @property {Array.|null} [fields] Projection fields */ - + /** * Constructs a new Projection. * @memberof google.firestore.v1.StructuredQuery @@ -16277,7 +31404,7 @@ if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } - + /** * Projection fields. * @member {Array.} fields @@ -16285,7 +31412,121 @@ * @instance */ Projection.prototype.fields = $util.emptyArray; - + + /** + * Creates a new Projection instance using the specified properties. + * @function create + * @memberof google.firestore.v1.StructuredQuery.Projection + * @static + * @param {google.firestore.v1.StructuredQuery.IProjection=} [properties] Properties to set + * @returns {google.firestore.v1.StructuredQuery.Projection} Projection instance + */ + Projection.create = function create(properties) { + return new Projection(properties); + }; + + /** + * Encodes the specified Projection message. Does not implicitly {@link google.firestore.v1.StructuredQuery.Projection.verify|verify} messages. + * @function encode + * @memberof google.firestore.v1.StructuredQuery.Projection + * @static + * @param {google.firestore.v1.StructuredQuery.IProjection} message Projection message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Projection.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fields != null && message.fields.length) + for (var i = 0; i < message.fields.length; ++i) + $root.google.firestore.v1.StructuredQuery.FieldReference.encode(message.fields[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Projection message, length delimited. Does not implicitly {@link google.firestore.v1.StructuredQuery.Projection.verify|verify} messages. + * @function encodeDelimited + * @memberof google.firestore.v1.StructuredQuery.Projection + * @static + * @param {google.firestore.v1.StructuredQuery.IProjection} message Projection message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Projection.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Projection message from the specified reader or buffer. + * @function decode + * @memberof google.firestore.v1.StructuredQuery.Projection + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.firestore.v1.StructuredQuery.Projection} Projection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Projection.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.firestore.v1.StructuredQuery.Projection(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + if (!(message.fields && message.fields.length)) + message.fields = []; + message.fields.push($root.google.firestore.v1.StructuredQuery.FieldReference.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Projection message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.firestore.v1.StructuredQuery.Projection + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.firestore.v1.StructuredQuery.Projection} Projection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Projection.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Projection message. + * @function verify + * @memberof google.firestore.v1.StructuredQuery.Projection + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Projection.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fields != null && message.hasOwnProperty("fields")) { + if (!Array.isArray(message.fields)) + return "fields: array expected"; + for (var i = 0; i < message.fields.length; ++i) { + var error = $root.google.firestore.v1.StructuredQuery.FieldReference.verify(message.fields[i]); + if (error) + return "fields." + error; + } + } + return null; + }; + /** * Creates a Projection message from a plain object. Also converts values to their respective internal types. * @function fromObject @@ -16310,7 +31551,7 @@ } return message; }; - + /** * Creates a plain object from a Projection message. Also converts values to other types if specified. * @function toObject @@ -16333,7 +31574,7 @@ } return object; }; - + /** * Converts this Projection to JSON. * @function toJSON @@ -16344,7 +31585,7 @@ Projection.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - + /** * Gets the default type url for Projection * @function getTypeUrl @@ -16359,15 +31600,350 @@ } return typeUrlPrefix + "/google.firestore.v1.StructuredQuery.Projection"; }; - + return Projection; })(); - + + StructuredQuery.FindNearest = (function() { + + /** + * Properties of a FindNearest. + * @memberof google.firestore.v1.StructuredQuery + * @interface IFindNearest + * @property {google.firestore.v1.StructuredQuery.IFieldReference|null} [vectorField] FindNearest vectorField + * @property {google.firestore.v1.IValue|null} [queryVector] FindNearest queryVector + * @property {google.firestore.v1.StructuredQuery.FindNearest.DistanceMeasure|null} [distanceMeasure] FindNearest distanceMeasure + * @property {google.protobuf.IInt32Value|null} [limit] FindNearest limit + */ + + /** + * Constructs a new FindNearest. + * @memberof google.firestore.v1.StructuredQuery + * @classdesc Represents a FindNearest. + * @implements IFindNearest + * @constructor + * @param {google.firestore.v1.StructuredQuery.IFindNearest=} [properties] Properties to set + */ + function FindNearest(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]]; + } + + /** + * FindNearest vectorField. + * @member {google.firestore.v1.StructuredQuery.IFieldReference|null|undefined} vectorField + * @memberof google.firestore.v1.StructuredQuery.FindNearest + * @instance + */ + FindNearest.prototype.vectorField = null; + + /** + * FindNearest queryVector. + * @member {google.firestore.v1.IValue|null|undefined} queryVector + * @memberof google.firestore.v1.StructuredQuery.FindNearest + * @instance + */ + FindNearest.prototype.queryVector = null; + + /** + * FindNearest distanceMeasure. + * @member {google.firestore.v1.StructuredQuery.FindNearest.DistanceMeasure} distanceMeasure + * @memberof google.firestore.v1.StructuredQuery.FindNearest + * @instance + */ + FindNearest.prototype.distanceMeasure = 0; + + /** + * FindNearest limit. + * @member {google.protobuf.IInt32Value|null|undefined} limit + * @memberof google.firestore.v1.StructuredQuery.FindNearest + * @instance + */ + FindNearest.prototype.limit = null; + + /** + * Creates a new FindNearest instance using the specified properties. + * @function create + * @memberof google.firestore.v1.StructuredQuery.FindNearest + * @static + * @param {google.firestore.v1.StructuredQuery.IFindNearest=} [properties] Properties to set + * @returns {google.firestore.v1.StructuredQuery.FindNearest} FindNearest instance + */ + FindNearest.create = function create(properties) { + return new FindNearest(properties); + }; + + /** + * Encodes the specified FindNearest message. Does not implicitly {@link google.firestore.v1.StructuredQuery.FindNearest.verify|verify} messages. + * @function encode + * @memberof google.firestore.v1.StructuredQuery.FindNearest + * @static + * @param {google.firestore.v1.StructuredQuery.IFindNearest} message FindNearest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FindNearest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.vectorField != null && Object.hasOwnProperty.call(message, "vectorField")) + $root.google.firestore.v1.StructuredQuery.FieldReference.encode(message.vectorField, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.queryVector != null && Object.hasOwnProperty.call(message, "queryVector")) + $root.google.firestore.v1.Value.encode(message.queryVector, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.distanceMeasure != null && Object.hasOwnProperty.call(message, "distanceMeasure")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.distanceMeasure); + if (message.limit != null && Object.hasOwnProperty.call(message, "limit")) + $root.google.protobuf.Int32Value.encode(message.limit, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FindNearest message, length delimited. Does not implicitly {@link google.firestore.v1.StructuredQuery.FindNearest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.firestore.v1.StructuredQuery.FindNearest + * @static + * @param {google.firestore.v1.StructuredQuery.IFindNearest} message FindNearest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FindNearest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FindNearest message from the specified reader or buffer. + * @function decode + * @memberof google.firestore.v1.StructuredQuery.FindNearest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.firestore.v1.StructuredQuery.FindNearest} FindNearest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FindNearest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.firestore.v1.StructuredQuery.FindNearest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.vectorField = $root.google.firestore.v1.StructuredQuery.FieldReference.decode(reader, reader.uint32()); + break; + } + case 2: { + message.queryVector = $root.google.firestore.v1.Value.decode(reader, reader.uint32()); + break; + } + case 3: { + message.distanceMeasure = reader.int32(); + break; + } + case 4: { + message.limit = $root.google.protobuf.Int32Value.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FindNearest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.firestore.v1.StructuredQuery.FindNearest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.firestore.v1.StructuredQuery.FindNearest} FindNearest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FindNearest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FindNearest message. + * @function verify + * @memberof google.firestore.v1.StructuredQuery.FindNearest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FindNearest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.vectorField != null && message.hasOwnProperty("vectorField")) { + var error = $root.google.firestore.v1.StructuredQuery.FieldReference.verify(message.vectorField); + if (error) + return "vectorField." + error; + } + if (message.queryVector != null && message.hasOwnProperty("queryVector")) { + var error = $root.google.firestore.v1.Value.verify(message.queryVector); + if (error) + return "queryVector." + error; + } + if (message.distanceMeasure != null && message.hasOwnProperty("distanceMeasure")) + switch (message.distanceMeasure) { + default: + return "distanceMeasure: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.limit != null && message.hasOwnProperty("limit")) { + var error = $root.google.protobuf.Int32Value.verify(message.limit); + if (error) + return "limit." + error; + } + return null; + }; + + /** + * Creates a FindNearest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.firestore.v1.StructuredQuery.FindNearest + * @static + * @param {Object.} object Plain object + * @returns {google.firestore.v1.StructuredQuery.FindNearest} FindNearest + */ + FindNearest.fromObject = function fromObject(object) { + if (object instanceof $root.google.firestore.v1.StructuredQuery.FindNearest) + return object; + var message = new $root.google.firestore.v1.StructuredQuery.FindNearest(); + if (object.vectorField != null) { + if (typeof object.vectorField !== "object") + throw TypeError(".google.firestore.v1.StructuredQuery.FindNearest.vectorField: object expected"); + message.vectorField = $root.google.firestore.v1.StructuredQuery.FieldReference.fromObject(object.vectorField); + } + if (object.queryVector != null) { + if (typeof object.queryVector !== "object") + throw TypeError(".google.firestore.v1.StructuredQuery.FindNearest.queryVector: object expected"); + message.queryVector = $root.google.firestore.v1.Value.fromObject(object.queryVector); + } + switch (object.distanceMeasure) { + default: + if (typeof object.distanceMeasure === "number") { + message.distanceMeasure = object.distanceMeasure; + break; + } + break; + case "DISTANCE_MEASURE_UNSPECIFIED": + case 0: + message.distanceMeasure = 0; + break; + case "EUCLIDEAN": + case 1: + message.distanceMeasure = 1; + break; + case "COSINE": + case 2: + message.distanceMeasure = 2; + break; + case "DOT_PRODUCT": + case 3: + message.distanceMeasure = 3; + break; + } + if (object.limit != null) { + if (typeof object.limit !== "object") + throw TypeError(".google.firestore.v1.StructuredQuery.FindNearest.limit: object expected"); + message.limit = $root.google.protobuf.Int32Value.fromObject(object.limit); + } + return message; + }; + + /** + * Creates a plain object from a FindNearest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.firestore.v1.StructuredQuery.FindNearest + * @static + * @param {google.firestore.v1.StructuredQuery.FindNearest} message FindNearest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FindNearest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.vectorField = null; + object.queryVector = null; + object.distanceMeasure = options.enums === String ? "DISTANCE_MEASURE_UNSPECIFIED" : 0; + object.limit = null; + } + if (message.vectorField != null && message.hasOwnProperty("vectorField")) + object.vectorField = $root.google.firestore.v1.StructuredQuery.FieldReference.toObject(message.vectorField, options); + if (message.queryVector != null && message.hasOwnProperty("queryVector")) + object.queryVector = $root.google.firestore.v1.Value.toObject(message.queryVector, options); + if (message.distanceMeasure != null && message.hasOwnProperty("distanceMeasure")) + object.distanceMeasure = options.enums === String ? $root.google.firestore.v1.StructuredQuery.FindNearest.DistanceMeasure[message.distanceMeasure] === undefined ? message.distanceMeasure : $root.google.firestore.v1.StructuredQuery.FindNearest.DistanceMeasure[message.distanceMeasure] : message.distanceMeasure; + if (message.limit != null && message.hasOwnProperty("limit")) + object.limit = $root.google.protobuf.Int32Value.toObject(message.limit, options); + return object; + }; + + /** + * Converts this FindNearest to JSON. + * @function toJSON + * @memberof google.firestore.v1.StructuredQuery.FindNearest + * @instance + * @returns {Object.} JSON object + */ + FindNearest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FindNearest + * @function getTypeUrl + * @memberof google.firestore.v1.StructuredQuery.FindNearest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FindNearest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.firestore.v1.StructuredQuery.FindNearest"; + }; + + /** + * DistanceMeasure enum. + * @name google.firestore.v1.StructuredQuery.FindNearest.DistanceMeasure + * @enum {number} + * @property {number} DISTANCE_MEASURE_UNSPECIFIED=0 DISTANCE_MEASURE_UNSPECIFIED value + * @property {number} EUCLIDEAN=1 EUCLIDEAN value + * @property {number} COSINE=2 COSINE value + * @property {number} DOT_PRODUCT=3 DOT_PRODUCT value + */ + FindNearest.DistanceMeasure = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DISTANCE_MEASURE_UNSPECIFIED"] = 0; + values[valuesById[1] = "EUCLIDEAN"] = 1; + values[valuesById[2] = "COSINE"] = 2; + values[valuesById[3] = "DOT_PRODUCT"] = 3; + return values; + })(); + + return FindNearest; + })(); + return StructuredQuery; })(); - + v1.StructuredAggregationQuery = (function() { - + /** * Properties of a StructuredAggregationQuery. * @memberof google.firestore.v1 @@ -16375,7 +31951,7 @@ * @property {google.firestore.v1.IStructuredQuery|null} [structuredQuery] StructuredAggregationQuery structuredQuery * @property {Array.|null} [aggregations] StructuredAggregationQuery aggregations */ - + /** * Constructs a new StructuredAggregationQuery. * @memberof google.firestore.v1 @@ -16391,7 +31967,7 @@ if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } - + /** * StructuredAggregationQuery structuredQuery. * @member {google.firestore.v1.IStructuredQuery|null|undefined} structuredQuery @@ -16399,29 +31975,158 @@ * @instance */ StructuredAggregationQuery.prototype.structuredQuery = null; - + + /** + * StructuredAggregationQuery aggregations. + * @member {Array.} aggregations + * @memberof google.firestore.v1.StructuredAggregationQuery + * @instance + */ + StructuredAggregationQuery.prototype.aggregations = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * StructuredAggregationQuery queryType. + * @member {"structuredQuery"|undefined} queryType + * @memberof google.firestore.v1.StructuredAggregationQuery + * @instance + */ + Object.defineProperty(StructuredAggregationQuery.prototype, "queryType", { + get: $util.oneOfGetter($oneOfFields = ["structuredQuery"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new StructuredAggregationQuery instance using the specified properties. + * @function create + * @memberof google.firestore.v1.StructuredAggregationQuery + * @static + * @param {google.firestore.v1.IStructuredAggregationQuery=} [properties] Properties to set + * @returns {google.firestore.v1.StructuredAggregationQuery} StructuredAggregationQuery instance + */ + StructuredAggregationQuery.create = function create(properties) { + return new StructuredAggregationQuery(properties); + }; + + /** + * Encodes the specified StructuredAggregationQuery message. Does not implicitly {@link google.firestore.v1.StructuredAggregationQuery.verify|verify} messages. + * @function encode + * @memberof google.firestore.v1.StructuredAggregationQuery + * @static + * @param {google.firestore.v1.IStructuredAggregationQuery} message StructuredAggregationQuery message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StructuredAggregationQuery.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.structuredQuery != null && Object.hasOwnProperty.call(message, "structuredQuery")) + $root.google.firestore.v1.StructuredQuery.encode(message.structuredQuery, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.aggregations != null && message.aggregations.length) + for (var i = 0; i < message.aggregations.length; ++i) + $root.google.firestore.v1.StructuredAggregationQuery.Aggregation.encode(message.aggregations[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified StructuredAggregationQuery message, length delimited. Does not implicitly {@link google.firestore.v1.StructuredAggregationQuery.verify|verify} messages. + * @function encodeDelimited + * @memberof google.firestore.v1.StructuredAggregationQuery + * @static + * @param {google.firestore.v1.IStructuredAggregationQuery} message StructuredAggregationQuery message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StructuredAggregationQuery.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StructuredAggregationQuery message from the specified reader or buffer. + * @function decode + * @memberof google.firestore.v1.StructuredAggregationQuery + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.firestore.v1.StructuredAggregationQuery} StructuredAggregationQuery + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StructuredAggregationQuery.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.firestore.v1.StructuredAggregationQuery(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.structuredQuery = $root.google.firestore.v1.StructuredQuery.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.aggregations && message.aggregations.length)) + message.aggregations = []; + message.aggregations.push($root.google.firestore.v1.StructuredAggregationQuery.Aggregation.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + /** - * StructuredAggregationQuery aggregations. - * @member {Array.} aggregations + * Decodes a StructuredAggregationQuery message from the specified reader or buffer, length delimited. + * @function decodeDelimited * @memberof google.firestore.v1.StructuredAggregationQuery - * @instance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.firestore.v1.StructuredAggregationQuery} StructuredAggregationQuery + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - StructuredAggregationQuery.prototype.aggregations = $util.emptyArray; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - + StructuredAggregationQuery.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + /** - * StructuredAggregationQuery queryType. - * @member {"structuredQuery"|undefined} queryType + * Verifies a StructuredAggregationQuery message. + * @function verify * @memberof google.firestore.v1.StructuredAggregationQuery - * @instance + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Object.defineProperty(StructuredAggregationQuery.prototype, "queryType", { - get: $util.oneOfGetter($oneOfFields = ["structuredQuery"]), - set: $util.oneOfSetter($oneOfFields) - }); - + StructuredAggregationQuery.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.structuredQuery != null && message.hasOwnProperty("structuredQuery")) { + properties.queryType = 1; + { + var error = $root.google.firestore.v1.StructuredQuery.verify(message.structuredQuery); + if (error) + return "structuredQuery." + error; + } + } + if (message.aggregations != null && message.hasOwnProperty("aggregations")) { + if (!Array.isArray(message.aggregations)) + return "aggregations: array expected"; + for (var i = 0; i < message.aggregations.length; ++i) { + var error = $root.google.firestore.v1.StructuredAggregationQuery.Aggregation.verify(message.aggregations[i]); + if (error) + return "aggregations." + error; + } + } + return null; + }; + /** * Creates a StructuredAggregationQuery message from a plain object. Also converts values to their respective internal types. * @function fromObject @@ -16451,7 +32156,7 @@ } return message; }; - + /** * Creates a plain object from a StructuredAggregationQuery message. Also converts values to other types if specified. * @function toObject @@ -16479,7 +32184,7 @@ } return object; }; - + /** * Converts this StructuredAggregationQuery to JSON. * @function toJSON @@ -16490,7 +32195,7 @@ StructuredAggregationQuery.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - + /** * Gets the default type url for StructuredAggregationQuery * @function getTypeUrl @@ -16505,9 +32210,9 @@ } return typeUrlPrefix + "/google.firestore.v1.StructuredAggregationQuery"; }; - + StructuredAggregationQuery.Aggregation = (function() { - + /** * Properties of an Aggregation. * @memberof google.firestore.v1.StructuredAggregationQuery @@ -16517,7 +32222,7 @@ * @property {google.firestore.v1.StructuredAggregationQuery.Aggregation.IAvg|null} [avg] Aggregation avg * @property {string|null} [alias] Aggregation alias */ - + /** * Constructs a new Aggregation. * @memberof google.firestore.v1.StructuredAggregationQuery @@ -16532,7 +32237,7 @@ if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } - + /** * Aggregation count. * @member {google.firestore.v1.StructuredAggregationQuery.Aggregation.ICount|null|undefined} count @@ -16540,7 +32245,7 @@ * @instance */ Aggregation.prototype.count = null; - + /** * Aggregation sum. * @member {google.firestore.v1.StructuredAggregationQuery.Aggregation.ISum|null|undefined} sum @@ -16548,7 +32253,7 @@ * @instance */ Aggregation.prototype.sum = null; - + /** * Aggregation avg. * @member {google.firestore.v1.StructuredAggregationQuery.Aggregation.IAvg|null|undefined} avg @@ -16556,7 +32261,7 @@ * @instance */ Aggregation.prototype.avg = null; - + /** * Aggregation alias. * @member {string} alias @@ -16564,10 +32269,10 @@ * @instance */ Aggregation.prototype.alias = ""; - + // OneOf field names bound to virtual getters and setters var $oneOfFields; - + /** * Aggregation operator. * @member {"count"|"sum"|"avg"|undefined} operator @@ -16578,7 +32283,159 @@ get: $util.oneOfGetter($oneOfFields = ["count", "sum", "avg"]), set: $util.oneOfSetter($oneOfFields) }); - + + /** + * Creates a new Aggregation instance using the specified properties. + * @function create + * @memberof google.firestore.v1.StructuredAggregationQuery.Aggregation + * @static + * @param {google.firestore.v1.StructuredAggregationQuery.IAggregation=} [properties] Properties to set + * @returns {google.firestore.v1.StructuredAggregationQuery.Aggregation} Aggregation instance + */ + Aggregation.create = function create(properties) { + return new Aggregation(properties); + }; + + /** + * Encodes the specified Aggregation message. Does not implicitly {@link google.firestore.v1.StructuredAggregationQuery.Aggregation.verify|verify} messages. + * @function encode + * @memberof google.firestore.v1.StructuredAggregationQuery.Aggregation + * @static + * @param {google.firestore.v1.StructuredAggregationQuery.IAggregation} message Aggregation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Aggregation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.count != null && Object.hasOwnProperty.call(message, "count")) + $root.google.firestore.v1.StructuredAggregationQuery.Aggregation.Count.encode(message.count, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.sum != null && Object.hasOwnProperty.call(message, "sum")) + $root.google.firestore.v1.StructuredAggregationQuery.Aggregation.Sum.encode(message.sum, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.avg != null && Object.hasOwnProperty.call(message, "avg")) + $root.google.firestore.v1.StructuredAggregationQuery.Aggregation.Avg.encode(message.avg, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.alias != null && Object.hasOwnProperty.call(message, "alias")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.alias); + return writer; + }; + + /** + * Encodes the specified Aggregation message, length delimited. Does not implicitly {@link google.firestore.v1.StructuredAggregationQuery.Aggregation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.firestore.v1.StructuredAggregationQuery.Aggregation + * @static + * @param {google.firestore.v1.StructuredAggregationQuery.IAggregation} message Aggregation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Aggregation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Aggregation message from the specified reader or buffer. + * @function decode + * @memberof google.firestore.v1.StructuredAggregationQuery.Aggregation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.firestore.v1.StructuredAggregationQuery.Aggregation} Aggregation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Aggregation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.firestore.v1.StructuredAggregationQuery.Aggregation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.count = $root.google.firestore.v1.StructuredAggregationQuery.Aggregation.Count.decode(reader, reader.uint32()); + break; + } + case 2: { + message.sum = $root.google.firestore.v1.StructuredAggregationQuery.Aggregation.Sum.decode(reader, reader.uint32()); + break; + } + case 3: { + message.avg = $root.google.firestore.v1.StructuredAggregationQuery.Aggregation.Avg.decode(reader, reader.uint32()); + break; + } + case 7: { + message.alias = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Aggregation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.firestore.v1.StructuredAggregationQuery.Aggregation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.firestore.v1.StructuredAggregationQuery.Aggregation} Aggregation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Aggregation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Aggregation message. + * @function verify + * @memberof google.firestore.v1.StructuredAggregationQuery.Aggregation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Aggregation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.count != null && message.hasOwnProperty("count")) { + properties.operator = 1; + { + var error = $root.google.firestore.v1.StructuredAggregationQuery.Aggregation.Count.verify(message.count); + if (error) + return "count." + error; + } + } + if (message.sum != null && message.hasOwnProperty("sum")) { + if (properties.operator === 1) + return "operator: multiple values"; + properties.operator = 1; + { + var error = $root.google.firestore.v1.StructuredAggregationQuery.Aggregation.Sum.verify(message.sum); + if (error) + return "sum." + error; + } + } + if (message.avg != null && message.hasOwnProperty("avg")) { + if (properties.operator === 1) + return "operator: multiple values"; + properties.operator = 1; + { + var error = $root.google.firestore.v1.StructuredAggregationQuery.Aggregation.Avg.verify(message.avg); + if (error) + return "avg." + error; + } + } + if (message.alias != null && message.hasOwnProperty("alias")) + if (!$util.isString(message.alias)) + return "alias: string expected"; + return null; + }; + /** * Creates an Aggregation message from a plain object. Also converts values to their respective internal types. * @function fromObject @@ -16590,524 +32447,1980 @@ Aggregation.fromObject = function fromObject(object) { if (object instanceof $root.google.firestore.v1.StructuredAggregationQuery.Aggregation) return object; - var message = new $root.google.firestore.v1.StructuredAggregationQuery.Aggregation(); - if (object.count != null) { - if (typeof object.count !== "object") - throw TypeError(".google.firestore.v1.StructuredAggregationQuery.Aggregation.count: object expected"); - message.count = $root.google.firestore.v1.StructuredAggregationQuery.Aggregation.Count.fromObject(object.count); - } - if (object.sum != null) { - if (typeof object.sum !== "object") - throw TypeError(".google.firestore.v1.StructuredAggregationQuery.Aggregation.sum: object expected"); - message.sum = $root.google.firestore.v1.StructuredAggregationQuery.Aggregation.Sum.fromObject(object.sum); - } - if (object.avg != null) { - if (typeof object.avg !== "object") - throw TypeError(".google.firestore.v1.StructuredAggregationQuery.Aggregation.avg: object expected"); - message.avg = $root.google.firestore.v1.StructuredAggregationQuery.Aggregation.Avg.fromObject(object.avg); - } - if (object.alias != null) - message.alias = String(object.alias); - return message; - }; - - /** - * Creates a plain object from an Aggregation message. Also converts values to other types if specified. - * @function toObject - * @memberof google.firestore.v1.StructuredAggregationQuery.Aggregation - * @static - * @param {google.firestore.v1.StructuredAggregationQuery.Aggregation} message Aggregation - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Aggregation.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.alias = ""; - if (message.count != null && message.hasOwnProperty("count")) { - object.count = $root.google.firestore.v1.StructuredAggregationQuery.Aggregation.Count.toObject(message.count, options); - if (options.oneofs) - object.operator = "count"; - } - if (message.sum != null && message.hasOwnProperty("sum")) { - object.sum = $root.google.firestore.v1.StructuredAggregationQuery.Aggregation.Sum.toObject(message.sum, options); - if (options.oneofs) - object.operator = "sum"; - } - if (message.avg != null && message.hasOwnProperty("avg")) { - object.avg = $root.google.firestore.v1.StructuredAggregationQuery.Aggregation.Avg.toObject(message.avg, options); - if (options.oneofs) - object.operator = "avg"; - } - if (message.alias != null && message.hasOwnProperty("alias")) - object.alias = message.alias; - return object; - }; - - /** - * Converts this Aggregation to JSON. - * @function toJSON - * @memberof google.firestore.v1.StructuredAggregationQuery.Aggregation - * @instance - * @returns {Object.} JSON object - */ - Aggregation.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Aggregation - * @function getTypeUrl - * @memberof google.firestore.v1.StructuredAggregationQuery.Aggregation - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Aggregation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; + var message = new $root.google.firestore.v1.StructuredAggregationQuery.Aggregation(); + if (object.count != null) { + if (typeof object.count !== "object") + throw TypeError(".google.firestore.v1.StructuredAggregationQuery.Aggregation.count: object expected"); + message.count = $root.google.firestore.v1.StructuredAggregationQuery.Aggregation.Count.fromObject(object.count); + } + if (object.sum != null) { + if (typeof object.sum !== "object") + throw TypeError(".google.firestore.v1.StructuredAggregationQuery.Aggregation.sum: object expected"); + message.sum = $root.google.firestore.v1.StructuredAggregationQuery.Aggregation.Sum.fromObject(object.sum); + } + if (object.avg != null) { + if (typeof object.avg !== "object") + throw TypeError(".google.firestore.v1.StructuredAggregationQuery.Aggregation.avg: object expected"); + message.avg = $root.google.firestore.v1.StructuredAggregationQuery.Aggregation.Avg.fromObject(object.avg); + } + if (object.alias != null) + message.alias = String(object.alias); + return message; + }; + + /** + * Creates a plain object from an Aggregation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.firestore.v1.StructuredAggregationQuery.Aggregation + * @static + * @param {google.firestore.v1.StructuredAggregationQuery.Aggregation} message Aggregation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Aggregation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.alias = ""; + if (message.count != null && message.hasOwnProperty("count")) { + object.count = $root.google.firestore.v1.StructuredAggregationQuery.Aggregation.Count.toObject(message.count, options); + if (options.oneofs) + object.operator = "count"; + } + if (message.sum != null && message.hasOwnProperty("sum")) { + object.sum = $root.google.firestore.v1.StructuredAggregationQuery.Aggregation.Sum.toObject(message.sum, options); + if (options.oneofs) + object.operator = "sum"; + } + if (message.avg != null && message.hasOwnProperty("avg")) { + object.avg = $root.google.firestore.v1.StructuredAggregationQuery.Aggregation.Avg.toObject(message.avg, options); + if (options.oneofs) + object.operator = "avg"; + } + if (message.alias != null && message.hasOwnProperty("alias")) + object.alias = message.alias; + return object; + }; + + /** + * Converts this Aggregation to JSON. + * @function toJSON + * @memberof google.firestore.v1.StructuredAggregationQuery.Aggregation + * @instance + * @returns {Object.} JSON object + */ + Aggregation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Aggregation + * @function getTypeUrl + * @memberof google.firestore.v1.StructuredAggregationQuery.Aggregation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Aggregation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.firestore.v1.StructuredAggregationQuery.Aggregation"; + }; + + Aggregation.Count = (function() { + + /** + * Properties of a Count. + * @memberof google.firestore.v1.StructuredAggregationQuery.Aggregation + * @interface ICount + * @property {google.protobuf.IInt64Value|null} [upTo] Count upTo + */ + + /** + * Constructs a new Count. + * @memberof google.firestore.v1.StructuredAggregationQuery.Aggregation + * @classdesc Represents a Count. + * @implements ICount + * @constructor + * @param {google.firestore.v1.StructuredAggregationQuery.Aggregation.ICount=} [properties] Properties to set + */ + function Count(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]]; + } + + /** + * Count upTo. + * @member {google.protobuf.IInt64Value|null|undefined} upTo + * @memberof google.firestore.v1.StructuredAggregationQuery.Aggregation.Count + * @instance + */ + Count.prototype.upTo = null; + + /** + * Creates a new Count instance using the specified properties. + * @function create + * @memberof google.firestore.v1.StructuredAggregationQuery.Aggregation.Count + * @static + * @param {google.firestore.v1.StructuredAggregationQuery.Aggregation.ICount=} [properties] Properties to set + * @returns {google.firestore.v1.StructuredAggregationQuery.Aggregation.Count} Count instance + */ + Count.create = function create(properties) { + return new Count(properties); + }; + + /** + * Encodes the specified Count message. Does not implicitly {@link google.firestore.v1.StructuredAggregationQuery.Aggregation.Count.verify|verify} messages. + * @function encode + * @memberof google.firestore.v1.StructuredAggregationQuery.Aggregation.Count + * @static + * @param {google.firestore.v1.StructuredAggregationQuery.Aggregation.ICount} message Count message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Count.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.upTo != null && Object.hasOwnProperty.call(message, "upTo")) + $root.google.protobuf.Int64Value.encode(message.upTo, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Count message, length delimited. Does not implicitly {@link google.firestore.v1.StructuredAggregationQuery.Aggregation.Count.verify|verify} messages. + * @function encodeDelimited + * @memberof google.firestore.v1.StructuredAggregationQuery.Aggregation.Count + * @static + * @param {google.firestore.v1.StructuredAggregationQuery.Aggregation.ICount} message Count message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Count.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Count message from the specified reader or buffer. + * @function decode + * @memberof google.firestore.v1.StructuredAggregationQuery.Aggregation.Count + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.firestore.v1.StructuredAggregationQuery.Aggregation.Count} Count + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Count.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.firestore.v1.StructuredAggregationQuery.Aggregation.Count(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.upTo = $root.google.protobuf.Int64Value.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Count message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.firestore.v1.StructuredAggregationQuery.Aggregation.Count + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.firestore.v1.StructuredAggregationQuery.Aggregation.Count} Count + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Count.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Count message. + * @function verify + * @memberof google.firestore.v1.StructuredAggregationQuery.Aggregation.Count + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Count.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.upTo != null && message.hasOwnProperty("upTo")) { + var error = $root.google.protobuf.Int64Value.verify(message.upTo); + if (error) + return "upTo." + error; + } + return null; + }; + + /** + * Creates a Count message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.firestore.v1.StructuredAggregationQuery.Aggregation.Count + * @static + * @param {Object.} object Plain object + * @returns {google.firestore.v1.StructuredAggregationQuery.Aggregation.Count} Count + */ + Count.fromObject = function fromObject(object) { + if (object instanceof $root.google.firestore.v1.StructuredAggregationQuery.Aggregation.Count) + return object; + var message = new $root.google.firestore.v1.StructuredAggregationQuery.Aggregation.Count(); + if (object.upTo != null) { + if (typeof object.upTo !== "object") + throw TypeError(".google.firestore.v1.StructuredAggregationQuery.Aggregation.Count.upTo: object expected"); + message.upTo = $root.google.protobuf.Int64Value.fromObject(object.upTo); + } + return message; + }; + + /** + * Creates a plain object from a Count message. Also converts values to other types if specified. + * @function toObject + * @memberof google.firestore.v1.StructuredAggregationQuery.Aggregation.Count + * @static + * @param {google.firestore.v1.StructuredAggregationQuery.Aggregation.Count} message Count + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Count.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.upTo = null; + if (message.upTo != null && message.hasOwnProperty("upTo")) + object.upTo = $root.google.protobuf.Int64Value.toObject(message.upTo, options); + return object; + }; + + /** + * Converts this Count to JSON. + * @function toJSON + * @memberof google.firestore.v1.StructuredAggregationQuery.Aggregation.Count + * @instance + * @returns {Object.} JSON object + */ + Count.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Count + * @function getTypeUrl + * @memberof google.firestore.v1.StructuredAggregationQuery.Aggregation.Count + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Count.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.firestore.v1.StructuredAggregationQuery.Aggregation.Count"; + }; + + return Count; + })(); + + Aggregation.Sum = (function() { + + /** + * Properties of a Sum. + * @memberof google.firestore.v1.StructuredAggregationQuery.Aggregation + * @interface ISum + * @property {google.firestore.v1.StructuredQuery.IFieldReference|null} [field] Sum field + */ + + /** + * Constructs a new Sum. + * @memberof google.firestore.v1.StructuredAggregationQuery.Aggregation + * @classdesc Represents a Sum. + * @implements ISum + * @constructor + * @param {google.firestore.v1.StructuredAggregationQuery.Aggregation.ISum=} [properties] Properties to set + */ + function Sum(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]]; } - return typeUrlPrefix + "/google.firestore.v1.StructuredAggregationQuery.Aggregation"; - }; - - Aggregation.Count = (function() { - + + /** + * Sum field. + * @member {google.firestore.v1.StructuredQuery.IFieldReference|null|undefined} field + * @memberof google.firestore.v1.StructuredAggregationQuery.Aggregation.Sum + * @instance + */ + Sum.prototype.field = null; + + /** + * Creates a new Sum instance using the specified properties. + * @function create + * @memberof google.firestore.v1.StructuredAggregationQuery.Aggregation.Sum + * @static + * @param {google.firestore.v1.StructuredAggregationQuery.Aggregation.ISum=} [properties] Properties to set + * @returns {google.firestore.v1.StructuredAggregationQuery.Aggregation.Sum} Sum instance + */ + Sum.create = function create(properties) { + return new Sum(properties); + }; + + /** + * Encodes the specified Sum message. Does not implicitly {@link google.firestore.v1.StructuredAggregationQuery.Aggregation.Sum.verify|verify} messages. + * @function encode + * @memberof google.firestore.v1.StructuredAggregationQuery.Aggregation.Sum + * @static + * @param {google.firestore.v1.StructuredAggregationQuery.Aggregation.ISum} message Sum message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Sum.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.field != null && Object.hasOwnProperty.call(message, "field")) + $root.google.firestore.v1.StructuredQuery.FieldReference.encode(message.field, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Sum message, length delimited. Does not implicitly {@link google.firestore.v1.StructuredAggregationQuery.Aggregation.Sum.verify|verify} messages. + * @function encodeDelimited + * @memberof google.firestore.v1.StructuredAggregationQuery.Aggregation.Sum + * @static + * @param {google.firestore.v1.StructuredAggregationQuery.Aggregation.ISum} message Sum message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Sum.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Sum message from the specified reader or buffer. + * @function decode + * @memberof google.firestore.v1.StructuredAggregationQuery.Aggregation.Sum + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.firestore.v1.StructuredAggregationQuery.Aggregation.Sum} Sum + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Sum.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.firestore.v1.StructuredAggregationQuery.Aggregation.Sum(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.field = $root.google.firestore.v1.StructuredQuery.FieldReference.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Sum message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.firestore.v1.StructuredAggregationQuery.Aggregation.Sum + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.firestore.v1.StructuredAggregationQuery.Aggregation.Sum} Sum + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Sum.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Sum message. + * @function verify + * @memberof google.firestore.v1.StructuredAggregationQuery.Aggregation.Sum + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Sum.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.field != null && message.hasOwnProperty("field")) { + var error = $root.google.firestore.v1.StructuredQuery.FieldReference.verify(message.field); + if (error) + return "field." + error; + } + return null; + }; + + /** + * Creates a Sum message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.firestore.v1.StructuredAggregationQuery.Aggregation.Sum + * @static + * @param {Object.} object Plain object + * @returns {google.firestore.v1.StructuredAggregationQuery.Aggregation.Sum} Sum + */ + Sum.fromObject = function fromObject(object) { + if (object instanceof $root.google.firestore.v1.StructuredAggregationQuery.Aggregation.Sum) + return object; + var message = new $root.google.firestore.v1.StructuredAggregationQuery.Aggregation.Sum(); + if (object.field != null) { + if (typeof object.field !== "object") + throw TypeError(".google.firestore.v1.StructuredAggregationQuery.Aggregation.Sum.field: object expected"); + message.field = $root.google.firestore.v1.StructuredQuery.FieldReference.fromObject(object.field); + } + return message; + }; + + /** + * Creates a plain object from a Sum message. Also converts values to other types if specified. + * @function toObject + * @memberof google.firestore.v1.StructuredAggregationQuery.Aggregation.Sum + * @static + * @param {google.firestore.v1.StructuredAggregationQuery.Aggregation.Sum} message Sum + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Sum.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.field = null; + if (message.field != null && message.hasOwnProperty("field")) + object.field = $root.google.firestore.v1.StructuredQuery.FieldReference.toObject(message.field, options); + return object; + }; + /** - * Properties of a Count. + * Converts this Sum to JSON. + * @function toJSON + * @memberof google.firestore.v1.StructuredAggregationQuery.Aggregation.Sum + * @instance + * @returns {Object.} JSON object + */ + Sum.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Sum + * @function getTypeUrl + * @memberof google.firestore.v1.StructuredAggregationQuery.Aggregation.Sum + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Sum.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.firestore.v1.StructuredAggregationQuery.Aggregation.Sum"; + }; + + return Sum; + })(); + + Aggregation.Avg = (function() { + + /** + * Properties of an Avg. * @memberof google.firestore.v1.StructuredAggregationQuery.Aggregation - * @interface ICount - * @property {google.protobuf.IInt64Value|null} [upTo] Count upTo + * @interface IAvg + * @property {google.firestore.v1.StructuredQuery.IFieldReference|null} [field] Avg field */ - + /** - * Constructs a new Count. + * Constructs a new Avg. * @memberof google.firestore.v1.StructuredAggregationQuery.Aggregation - * @classdesc Represents a Count. - * @implements ICount + * @classdesc Represents an Avg. + * @implements IAvg * @constructor - * @param {google.firestore.v1.StructuredAggregationQuery.Aggregation.ICount=} [properties] Properties to set + * @param {google.firestore.v1.StructuredAggregationQuery.Aggregation.IAvg=} [properties] Properties to set */ - function Count(properties) { + function Avg(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]]; } - + /** - * Count upTo. - * @member {google.protobuf.IInt64Value|null|undefined} upTo - * @memberof google.firestore.v1.StructuredAggregationQuery.Aggregation.Count + * Avg field. + * @member {google.firestore.v1.StructuredQuery.IFieldReference|null|undefined} field + * @memberof google.firestore.v1.StructuredAggregationQuery.Aggregation.Avg * @instance */ - Count.prototype.upTo = null; - + Avg.prototype.field = null; + /** - * Creates a Count message from a plain object. Also converts values to their respective internal types. + * Creates a new Avg instance using the specified properties. + * @function create + * @memberof google.firestore.v1.StructuredAggregationQuery.Aggregation.Avg + * @static + * @param {google.firestore.v1.StructuredAggregationQuery.Aggregation.IAvg=} [properties] Properties to set + * @returns {google.firestore.v1.StructuredAggregationQuery.Aggregation.Avg} Avg instance + */ + Avg.create = function create(properties) { + return new Avg(properties); + }; + + /** + * Encodes the specified Avg message. Does not implicitly {@link google.firestore.v1.StructuredAggregationQuery.Aggregation.Avg.verify|verify} messages. + * @function encode + * @memberof google.firestore.v1.StructuredAggregationQuery.Aggregation.Avg + * @static + * @param {google.firestore.v1.StructuredAggregationQuery.Aggregation.IAvg} message Avg message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Avg.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.field != null && Object.hasOwnProperty.call(message, "field")) + $root.google.firestore.v1.StructuredQuery.FieldReference.encode(message.field, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Avg message, length delimited. Does not implicitly {@link google.firestore.v1.StructuredAggregationQuery.Aggregation.Avg.verify|verify} messages. + * @function encodeDelimited + * @memberof google.firestore.v1.StructuredAggregationQuery.Aggregation.Avg + * @static + * @param {google.firestore.v1.StructuredAggregationQuery.Aggregation.IAvg} message Avg message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Avg.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Avg message from the specified reader or buffer. + * @function decode + * @memberof google.firestore.v1.StructuredAggregationQuery.Aggregation.Avg + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.firestore.v1.StructuredAggregationQuery.Aggregation.Avg} Avg + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Avg.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.firestore.v1.StructuredAggregationQuery.Aggregation.Avg(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.field = $root.google.firestore.v1.StructuredQuery.FieldReference.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Avg message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.firestore.v1.StructuredAggregationQuery.Aggregation.Avg + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.firestore.v1.StructuredAggregationQuery.Aggregation.Avg} Avg + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Avg.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Avg message. + * @function verify + * @memberof google.firestore.v1.StructuredAggregationQuery.Aggregation.Avg + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Avg.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.field != null && message.hasOwnProperty("field")) { + var error = $root.google.firestore.v1.StructuredQuery.FieldReference.verify(message.field); + if (error) + return "field." + error; + } + return null; + }; + + /** + * Creates an Avg message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.firestore.v1.StructuredAggregationQuery.Aggregation.Count + * @memberof google.firestore.v1.StructuredAggregationQuery.Aggregation.Avg * @static * @param {Object.} object Plain object - * @returns {google.firestore.v1.StructuredAggregationQuery.Aggregation.Count} Count + * @returns {google.firestore.v1.StructuredAggregationQuery.Aggregation.Avg} Avg */ - Count.fromObject = function fromObject(object) { - if (object instanceof $root.google.firestore.v1.StructuredAggregationQuery.Aggregation.Count) + Avg.fromObject = function fromObject(object) { + if (object instanceof $root.google.firestore.v1.StructuredAggregationQuery.Aggregation.Avg) return object; - var message = new $root.google.firestore.v1.StructuredAggregationQuery.Aggregation.Count(); - if (object.upTo != null) { - if (typeof object.upTo !== "object") - throw TypeError(".google.firestore.v1.StructuredAggregationQuery.Aggregation.Count.upTo: object expected"); - message.upTo = $root.google.protobuf.Int64Value.fromObject(object.upTo); + var message = new $root.google.firestore.v1.StructuredAggregationQuery.Aggregation.Avg(); + if (object.field != null) { + if (typeof object.field !== "object") + throw TypeError(".google.firestore.v1.StructuredAggregationQuery.Aggregation.Avg.field: object expected"); + message.field = $root.google.firestore.v1.StructuredQuery.FieldReference.fromObject(object.field); } return message; }; - + /** - * Creates a plain object from a Count message. Also converts values to other types if specified. + * Creates a plain object from an Avg message. Also converts values to other types if specified. * @function toObject - * @memberof google.firestore.v1.StructuredAggregationQuery.Aggregation.Count + * @memberof google.firestore.v1.StructuredAggregationQuery.Aggregation.Avg * @static - * @param {google.firestore.v1.StructuredAggregationQuery.Aggregation.Count} message Count + * @param {google.firestore.v1.StructuredAggregationQuery.Aggregation.Avg} message Avg * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Count.toObject = function toObject(message, options) { + Avg.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) - object.upTo = null; - if (message.upTo != null && message.hasOwnProperty("upTo")) - object.upTo = $root.google.protobuf.Int64Value.toObject(message.upTo, options); + object.field = null; + if (message.field != null && message.hasOwnProperty("field")) + object.field = $root.google.firestore.v1.StructuredQuery.FieldReference.toObject(message.field, options); return object; }; - + /** - * Converts this Count to JSON. + * Converts this Avg to JSON. * @function toJSON - * @memberof google.firestore.v1.StructuredAggregationQuery.Aggregation.Count + * @memberof google.firestore.v1.StructuredAggregationQuery.Aggregation.Avg * @instance * @returns {Object.} JSON object */ - Count.prototype.toJSON = function toJSON() { + Avg.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - + /** - * Gets the default type url for Count + * Gets the default type url for Avg * @function getTypeUrl - * @memberof google.firestore.v1.StructuredAggregationQuery.Aggregation.Count + * @memberof google.firestore.v1.StructuredAggregationQuery.Aggregation.Avg * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - Count.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Avg.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.firestore.v1.StructuredAggregationQuery.Aggregation.Count"; - }; - - return Count; - })(); - - Aggregation.Sum = (function() { - - /** - * Properties of a Sum. - * @memberof google.firestore.v1.StructuredAggregationQuery.Aggregation - * @interface ISum - * @property {google.firestore.v1.StructuredQuery.IFieldReference|null} [field] Sum field - */ - - /** - * Constructs a new Sum. - * @memberof google.firestore.v1.StructuredAggregationQuery.Aggregation - * @classdesc Represents a Sum. - * @implements ISum - * @constructor - * @param {google.firestore.v1.StructuredAggregationQuery.Aggregation.ISum=} [properties] Properties to set - */ - function Sum(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]]; + return typeUrlPrefix + "/google.firestore.v1.StructuredAggregationQuery.Aggregation.Avg"; + }; + + return Avg; + })(); + + return Aggregation; + })(); + + return StructuredAggregationQuery; + })(); + + v1.Cursor = (function() { + + /** + * Properties of a Cursor. + * @memberof google.firestore.v1 + * @interface ICursor + * @property {Array.|null} [values] Cursor values + * @property {boolean|null} [before] Cursor before + */ + + /** + * Constructs a new Cursor. + * @memberof google.firestore.v1 + * @classdesc Represents a Cursor. + * @implements ICursor + * @constructor + * @param {google.firestore.v1.ICursor=} [properties] Properties to set + */ + function Cursor(properties) { + this.values = []; + 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]]; + } + + /** + * Cursor values. + * @member {Array.} values + * @memberof google.firestore.v1.Cursor + * @instance + */ + Cursor.prototype.values = $util.emptyArray; + + /** + * Cursor before. + * @member {boolean} before + * @memberof google.firestore.v1.Cursor + * @instance + */ + Cursor.prototype.before = false; + + /** + * Creates a new Cursor instance using the specified properties. + * @function create + * @memberof google.firestore.v1.Cursor + * @static + * @param {google.firestore.v1.ICursor=} [properties] Properties to set + * @returns {google.firestore.v1.Cursor} Cursor instance + */ + Cursor.create = function create(properties) { + return new Cursor(properties); + }; + + /** + * Encodes the specified Cursor message. Does not implicitly {@link google.firestore.v1.Cursor.verify|verify} messages. + * @function encode + * @memberof google.firestore.v1.Cursor + * @static + * @param {google.firestore.v1.ICursor} message Cursor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Cursor.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.values != null && message.values.length) + for (var i = 0; i < message.values.length; ++i) + $root.google.firestore.v1.Value.encode(message.values[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.before != null && Object.hasOwnProperty.call(message, "before")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.before); + return writer; + }; + + /** + * Encodes the specified Cursor message, length delimited. Does not implicitly {@link google.firestore.v1.Cursor.verify|verify} messages. + * @function encodeDelimited + * @memberof google.firestore.v1.Cursor + * @static + * @param {google.firestore.v1.ICursor} message Cursor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Cursor.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Cursor message from the specified reader or buffer. + * @function decode + * @memberof google.firestore.v1.Cursor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.firestore.v1.Cursor} Cursor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Cursor.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.firestore.v1.Cursor(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.values && message.values.length)) + message.values = []; + message.values.push($root.google.firestore.v1.Value.decode(reader, reader.uint32())); + break; + } + case 2: { + message.before = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Cursor message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.firestore.v1.Cursor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.firestore.v1.Cursor} Cursor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Cursor.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Cursor message. + * @function verify + * @memberof google.firestore.v1.Cursor + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Cursor.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.values != null && message.hasOwnProperty("values")) { + if (!Array.isArray(message.values)) + return "values: array expected"; + for (var i = 0; i < message.values.length; ++i) { + var error = $root.google.firestore.v1.Value.verify(message.values[i]); + if (error) + return "values." + error; + } + } + if (message.before != null && message.hasOwnProperty("before")) + if (typeof message.before !== "boolean") + return "before: boolean expected"; + return null; + }; + + /** + * Creates a Cursor message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.firestore.v1.Cursor + * @static + * @param {Object.} object Plain object + * @returns {google.firestore.v1.Cursor} Cursor + */ + Cursor.fromObject = function fromObject(object) { + if (object instanceof $root.google.firestore.v1.Cursor) + return object; + var message = new $root.google.firestore.v1.Cursor(); + if (object.values) { + if (!Array.isArray(object.values)) + throw TypeError(".google.firestore.v1.Cursor.values: array expected"); + message.values = []; + for (var i = 0; i < object.values.length; ++i) { + if (typeof object.values[i] !== "object") + throw TypeError(".google.firestore.v1.Cursor.values: object expected"); + message.values[i] = $root.google.firestore.v1.Value.fromObject(object.values[i]); + } + } + if (object.before != null) + message.before = Boolean(object.before); + return message; + }; + + /** + * Creates a plain object from a Cursor message. Also converts values to other types if specified. + * @function toObject + * @memberof google.firestore.v1.Cursor + * @static + * @param {google.firestore.v1.Cursor} message Cursor + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Cursor.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.values = []; + if (options.defaults) + object.before = false; + if (message.values && message.values.length) { + object.values = []; + for (var j = 0; j < message.values.length; ++j) + object.values[j] = $root.google.firestore.v1.Value.toObject(message.values[j], options); + } + if (message.before != null && message.hasOwnProperty("before")) + object.before = message.before; + return object; + }; + + /** + * Converts this Cursor to JSON. + * @function toJSON + * @memberof google.firestore.v1.Cursor + * @instance + * @returns {Object.} JSON object + */ + Cursor.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Cursor + * @function getTypeUrl + * @memberof google.firestore.v1.Cursor + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Cursor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.firestore.v1.Cursor"; + }; + + return Cursor; + })(); + + v1.ExplainOptions = (function() { + + /** + * Properties of an ExplainOptions. + * @memberof google.firestore.v1 + * @interface IExplainOptions + * @property {boolean|null} [analyze] ExplainOptions analyze + */ + + /** + * Constructs a new ExplainOptions. + * @memberof google.firestore.v1 + * @classdesc Represents an ExplainOptions. + * @implements IExplainOptions + * @constructor + * @param {google.firestore.v1.IExplainOptions=} [properties] Properties to set + */ + function ExplainOptions(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]]; + } + + /** + * ExplainOptions analyze. + * @member {boolean} analyze + * @memberof google.firestore.v1.ExplainOptions + * @instance + */ + ExplainOptions.prototype.analyze = false; + + /** + * Creates a new ExplainOptions instance using the specified properties. + * @function create + * @memberof google.firestore.v1.ExplainOptions + * @static + * @param {google.firestore.v1.IExplainOptions=} [properties] Properties to set + * @returns {google.firestore.v1.ExplainOptions} ExplainOptions instance + */ + ExplainOptions.create = function create(properties) { + return new ExplainOptions(properties); + }; + + /** + * Encodes the specified ExplainOptions message. Does not implicitly {@link google.firestore.v1.ExplainOptions.verify|verify} messages. + * @function encode + * @memberof google.firestore.v1.ExplainOptions + * @static + * @param {google.firestore.v1.IExplainOptions} message ExplainOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExplainOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.analyze != null && Object.hasOwnProperty.call(message, "analyze")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.analyze); + return writer; + }; + + /** + * Encodes the specified ExplainOptions message, length delimited. Does not implicitly {@link google.firestore.v1.ExplainOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.firestore.v1.ExplainOptions + * @static + * @param {google.firestore.v1.IExplainOptions} message ExplainOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExplainOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExplainOptions message from the specified reader or buffer. + * @function decode + * @memberof google.firestore.v1.ExplainOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.firestore.v1.ExplainOptions} ExplainOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExplainOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.firestore.v1.ExplainOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.analyze = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; } - - /** - * Sum field. - * @member {google.firestore.v1.StructuredQuery.IFieldReference|null|undefined} field - * @memberof google.firestore.v1.StructuredAggregationQuery.Aggregation.Sum - * @instance - */ - Sum.prototype.field = null; - - /** - * Creates a Sum message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.firestore.v1.StructuredAggregationQuery.Aggregation.Sum - * @static - * @param {Object.} object Plain object - * @returns {google.firestore.v1.StructuredAggregationQuery.Aggregation.Sum} Sum - */ - Sum.fromObject = function fromObject(object) { - if (object instanceof $root.google.firestore.v1.StructuredAggregationQuery.Aggregation.Sum) - return object; - var message = new $root.google.firestore.v1.StructuredAggregationQuery.Aggregation.Sum(); - if (object.field != null) { - if (typeof object.field !== "object") - throw TypeError(".google.firestore.v1.StructuredAggregationQuery.Aggregation.Sum.field: object expected"); - message.field = $root.google.firestore.v1.StructuredQuery.FieldReference.fromObject(object.field); + } + return message; + }; + + /** + * Decodes an ExplainOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.firestore.v1.ExplainOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.firestore.v1.ExplainOptions} ExplainOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExplainOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExplainOptions message. + * @function verify + * @memberof google.firestore.v1.ExplainOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExplainOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.analyze != null && message.hasOwnProperty("analyze")) + if (typeof message.analyze !== "boolean") + return "analyze: boolean expected"; + return null; + }; + + /** + * Creates an ExplainOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.firestore.v1.ExplainOptions + * @static + * @param {Object.} object Plain object + * @returns {google.firestore.v1.ExplainOptions} ExplainOptions + */ + ExplainOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.firestore.v1.ExplainOptions) + return object; + var message = new $root.google.firestore.v1.ExplainOptions(); + if (object.analyze != null) + message.analyze = Boolean(object.analyze); + return message; + }; + + /** + * Creates a plain object from an ExplainOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.firestore.v1.ExplainOptions + * @static + * @param {google.firestore.v1.ExplainOptions} message ExplainOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExplainOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.analyze = false; + if (message.analyze != null && message.hasOwnProperty("analyze")) + object.analyze = message.analyze; + return object; + }; + + /** + * Converts this ExplainOptions to JSON. + * @function toJSON + * @memberof google.firestore.v1.ExplainOptions + * @instance + * @returns {Object.} JSON object + */ + ExplainOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExplainOptions + * @function getTypeUrl + * @memberof google.firestore.v1.ExplainOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExplainOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.firestore.v1.ExplainOptions"; + }; + + return ExplainOptions; + })(); + + v1.ExplainMetrics = (function() { + + /** + * Properties of an ExplainMetrics. + * @memberof google.firestore.v1 + * @interface IExplainMetrics + * @property {google.firestore.v1.IPlanSummary|null} [planSummary] ExplainMetrics planSummary + * @property {google.firestore.v1.IExecutionStats|null} [executionStats] ExplainMetrics executionStats + */ + + /** + * Constructs a new ExplainMetrics. + * @memberof google.firestore.v1 + * @classdesc Represents an ExplainMetrics. + * @implements IExplainMetrics + * @constructor + * @param {google.firestore.v1.IExplainMetrics=} [properties] Properties to set + */ + function ExplainMetrics(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]]; + } + + /** + * ExplainMetrics planSummary. + * @member {google.firestore.v1.IPlanSummary|null|undefined} planSummary + * @memberof google.firestore.v1.ExplainMetrics + * @instance + */ + ExplainMetrics.prototype.planSummary = null; + + /** + * ExplainMetrics executionStats. + * @member {google.firestore.v1.IExecutionStats|null|undefined} executionStats + * @memberof google.firestore.v1.ExplainMetrics + * @instance + */ + ExplainMetrics.prototype.executionStats = null; + + /** + * Creates a new ExplainMetrics instance using the specified properties. + * @function create + * @memberof google.firestore.v1.ExplainMetrics + * @static + * @param {google.firestore.v1.IExplainMetrics=} [properties] Properties to set + * @returns {google.firestore.v1.ExplainMetrics} ExplainMetrics instance + */ + ExplainMetrics.create = function create(properties) { + return new ExplainMetrics(properties); + }; + + /** + * Encodes the specified ExplainMetrics message. Does not implicitly {@link google.firestore.v1.ExplainMetrics.verify|verify} messages. + * @function encode + * @memberof google.firestore.v1.ExplainMetrics + * @static + * @param {google.firestore.v1.IExplainMetrics} message ExplainMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExplainMetrics.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.planSummary != null && Object.hasOwnProperty.call(message, "planSummary")) + $root.google.firestore.v1.PlanSummary.encode(message.planSummary, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.executionStats != null && Object.hasOwnProperty.call(message, "executionStats")) + $root.google.firestore.v1.ExecutionStats.encode(message.executionStats, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExplainMetrics message, length delimited. Does not implicitly {@link google.firestore.v1.ExplainMetrics.verify|verify} messages. + * @function encodeDelimited + * @memberof google.firestore.v1.ExplainMetrics + * @static + * @param {google.firestore.v1.IExplainMetrics} message ExplainMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExplainMetrics.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExplainMetrics message from the specified reader or buffer. + * @function decode + * @memberof google.firestore.v1.ExplainMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.firestore.v1.ExplainMetrics} ExplainMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExplainMetrics.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.firestore.v1.ExplainMetrics(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.planSummary = $root.google.firestore.v1.PlanSummary.decode(reader, reader.uint32()); + break; } - return message; - }; - - /** - * Creates a plain object from a Sum message. Also converts values to other types if specified. - * @function toObject - * @memberof google.firestore.v1.StructuredAggregationQuery.Aggregation.Sum - * @static - * @param {google.firestore.v1.StructuredAggregationQuery.Aggregation.Sum} message Sum - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Sum.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.field = null; - if (message.field != null && message.hasOwnProperty("field")) - object.field = $root.google.firestore.v1.StructuredQuery.FieldReference.toObject(message.field, options); - return object; - }; - - /** - * Converts this Sum to JSON. - * @function toJSON - * @memberof google.firestore.v1.StructuredAggregationQuery.Aggregation.Sum - * @instance - * @returns {Object.} JSON object - */ - Sum.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Sum - * @function getTypeUrl - * @memberof google.firestore.v1.StructuredAggregationQuery.Aggregation.Sum - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Sum.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; + case 2: { + message.executionStats = $root.google.firestore.v1.ExecutionStats.decode(reader, reader.uint32()); + break; } - return typeUrlPrefix + "/google.firestore.v1.StructuredAggregationQuery.Aggregation.Sum"; - }; - - return Sum; - })(); - - Aggregation.Avg = (function() { - - /** - * Properties of an Avg. - * @memberof google.firestore.v1.StructuredAggregationQuery.Aggregation - * @interface IAvg - * @property {google.firestore.v1.StructuredQuery.IFieldReference|null} [field] Avg field - */ - - /** - * Constructs a new Avg. - * @memberof google.firestore.v1.StructuredAggregationQuery.Aggregation - * @classdesc Represents an Avg. - * @implements IAvg - * @constructor - * @param {google.firestore.v1.StructuredAggregationQuery.Aggregation.IAvg=} [properties] Properties to set - */ - function Avg(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]]; + default: + reader.skipType(tag & 7); + break; } - - /** - * Avg field. - * @member {google.firestore.v1.StructuredQuery.IFieldReference|null|undefined} field - * @memberof google.firestore.v1.StructuredAggregationQuery.Aggregation.Avg - * @instance - */ - Avg.prototype.field = null; - - /** - * Creates an Avg message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.firestore.v1.StructuredAggregationQuery.Aggregation.Avg - * @static - * @param {Object.} object Plain object - * @returns {google.firestore.v1.StructuredAggregationQuery.Aggregation.Avg} Avg - */ - Avg.fromObject = function fromObject(object) { - if (object instanceof $root.google.firestore.v1.StructuredAggregationQuery.Aggregation.Avg) - return object; - var message = new $root.google.firestore.v1.StructuredAggregationQuery.Aggregation.Avg(); - if (object.field != null) { - if (typeof object.field !== "object") - throw TypeError(".google.firestore.v1.StructuredAggregationQuery.Aggregation.Avg.field: object expected"); - message.field = $root.google.firestore.v1.StructuredQuery.FieldReference.fromObject(object.field); - } - return message; - }; - - /** - * Creates a plain object from an Avg message. Also converts values to other types if specified. - * @function toObject - * @memberof google.firestore.v1.StructuredAggregationQuery.Aggregation.Avg - * @static - * @param {google.firestore.v1.StructuredAggregationQuery.Aggregation.Avg} message Avg - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Avg.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.field = null; - if (message.field != null && message.hasOwnProperty("field")) - object.field = $root.google.firestore.v1.StructuredQuery.FieldReference.toObject(message.field, options); - return object; - }; - - /** - * Converts this Avg to JSON. - * @function toJSON - * @memberof google.firestore.v1.StructuredAggregationQuery.Aggregation.Avg - * @instance - * @returns {Object.} JSON object - */ - Avg.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Avg - * @function getTypeUrl - * @memberof google.firestore.v1.StructuredAggregationQuery.Aggregation.Avg - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Avg.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; + } + return message; + }; + + /** + * Decodes an ExplainMetrics message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.firestore.v1.ExplainMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.firestore.v1.ExplainMetrics} ExplainMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExplainMetrics.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExplainMetrics message. + * @function verify + * @memberof google.firestore.v1.ExplainMetrics + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExplainMetrics.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.planSummary != null && message.hasOwnProperty("planSummary")) { + var error = $root.google.firestore.v1.PlanSummary.verify(message.planSummary); + if (error) + return "planSummary." + error; + } + if (message.executionStats != null && message.hasOwnProperty("executionStats")) { + var error = $root.google.firestore.v1.ExecutionStats.verify(message.executionStats); + if (error) + return "executionStats." + error; + } + return null; + }; + + /** + * Creates an ExplainMetrics message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.firestore.v1.ExplainMetrics + * @static + * @param {Object.} object Plain object + * @returns {google.firestore.v1.ExplainMetrics} ExplainMetrics + */ + ExplainMetrics.fromObject = function fromObject(object) { + if (object instanceof $root.google.firestore.v1.ExplainMetrics) + return object; + var message = new $root.google.firestore.v1.ExplainMetrics(); + if (object.planSummary != null) { + if (typeof object.planSummary !== "object") + throw TypeError(".google.firestore.v1.ExplainMetrics.planSummary: object expected"); + message.planSummary = $root.google.firestore.v1.PlanSummary.fromObject(object.planSummary); + } + if (object.executionStats != null) { + if (typeof object.executionStats !== "object") + throw TypeError(".google.firestore.v1.ExplainMetrics.executionStats: object expected"); + message.executionStats = $root.google.firestore.v1.ExecutionStats.fromObject(object.executionStats); + } + return message; + }; + + /** + * Creates a plain object from an ExplainMetrics message. Also converts values to other types if specified. + * @function toObject + * @memberof google.firestore.v1.ExplainMetrics + * @static + * @param {google.firestore.v1.ExplainMetrics} message ExplainMetrics + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExplainMetrics.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.planSummary = null; + object.executionStats = null; + } + if (message.planSummary != null && message.hasOwnProperty("planSummary")) + object.planSummary = $root.google.firestore.v1.PlanSummary.toObject(message.planSummary, options); + if (message.executionStats != null && message.hasOwnProperty("executionStats")) + object.executionStats = $root.google.firestore.v1.ExecutionStats.toObject(message.executionStats, options); + return object; + }; + + /** + * Converts this ExplainMetrics to JSON. + * @function toJSON + * @memberof google.firestore.v1.ExplainMetrics + * @instance + * @returns {Object.} JSON object + */ + ExplainMetrics.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExplainMetrics + * @function getTypeUrl + * @memberof google.firestore.v1.ExplainMetrics + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExplainMetrics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.firestore.v1.ExplainMetrics"; + }; + + return ExplainMetrics; + })(); + + v1.PlanSummary = (function() { + + /** + * Properties of a PlanSummary. + * @memberof google.firestore.v1 + * @interface IPlanSummary + * @property {Array.|null} [indexesUsed] PlanSummary indexesUsed + */ + + /** + * Constructs a new PlanSummary. + * @memberof google.firestore.v1 + * @classdesc Represents a PlanSummary. + * @implements IPlanSummary + * @constructor + * @param {google.firestore.v1.IPlanSummary=} [properties] Properties to set + */ + function PlanSummary(properties) { + this.indexesUsed = []; + 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]]; + } + + /** + * PlanSummary indexesUsed. + * @member {Array.} indexesUsed + * @memberof google.firestore.v1.PlanSummary + * @instance + */ + PlanSummary.prototype.indexesUsed = $util.emptyArray; + + /** + * Creates a new PlanSummary instance using the specified properties. + * @function create + * @memberof google.firestore.v1.PlanSummary + * @static + * @param {google.firestore.v1.IPlanSummary=} [properties] Properties to set + * @returns {google.firestore.v1.PlanSummary} PlanSummary instance + */ + PlanSummary.create = function create(properties) { + return new PlanSummary(properties); + }; + + /** + * Encodes the specified PlanSummary message. Does not implicitly {@link google.firestore.v1.PlanSummary.verify|verify} messages. + * @function encode + * @memberof google.firestore.v1.PlanSummary + * @static + * @param {google.firestore.v1.IPlanSummary} message PlanSummary message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PlanSummary.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.indexesUsed != null && message.indexesUsed.length) + for (var i = 0; i < message.indexesUsed.length; ++i) + $root.google.protobuf.Struct.encode(message.indexesUsed[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PlanSummary message, length delimited. Does not implicitly {@link google.firestore.v1.PlanSummary.verify|verify} messages. + * @function encodeDelimited + * @memberof google.firestore.v1.PlanSummary + * @static + * @param {google.firestore.v1.IPlanSummary} message PlanSummary message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PlanSummary.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PlanSummary message from the specified reader or buffer. + * @function decode + * @memberof google.firestore.v1.PlanSummary + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.firestore.v1.PlanSummary} PlanSummary + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PlanSummary.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.firestore.v1.PlanSummary(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.indexesUsed && message.indexesUsed.length)) + message.indexesUsed = []; + message.indexesUsed.push($root.google.protobuf.Struct.decode(reader, reader.uint32())); + break; } - return typeUrlPrefix + "/google.firestore.v1.StructuredAggregationQuery.Aggregation.Avg"; - }; - - return Avg; - })(); - - return Aggregation; - })(); - - return StructuredAggregationQuery; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PlanSummary message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.firestore.v1.PlanSummary + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.firestore.v1.PlanSummary} PlanSummary + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PlanSummary.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PlanSummary message. + * @function verify + * @memberof google.firestore.v1.PlanSummary + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PlanSummary.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.indexesUsed != null && message.hasOwnProperty("indexesUsed")) { + if (!Array.isArray(message.indexesUsed)) + return "indexesUsed: array expected"; + for (var i = 0; i < message.indexesUsed.length; ++i) { + var error = $root.google.protobuf.Struct.verify(message.indexesUsed[i]); + if (error) + return "indexesUsed." + error; + } + } + return null; + }; + + /** + * Creates a PlanSummary message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.firestore.v1.PlanSummary + * @static + * @param {Object.} object Plain object + * @returns {google.firestore.v1.PlanSummary} PlanSummary + */ + PlanSummary.fromObject = function fromObject(object) { + if (object instanceof $root.google.firestore.v1.PlanSummary) + return object; + var message = new $root.google.firestore.v1.PlanSummary(); + if (object.indexesUsed) { + if (!Array.isArray(object.indexesUsed)) + throw TypeError(".google.firestore.v1.PlanSummary.indexesUsed: array expected"); + message.indexesUsed = []; + for (var i = 0; i < object.indexesUsed.length; ++i) { + if (typeof object.indexesUsed[i] !== "object") + throw TypeError(".google.firestore.v1.PlanSummary.indexesUsed: object expected"); + message.indexesUsed[i] = $root.google.protobuf.Struct.fromObject(object.indexesUsed[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a PlanSummary message. Also converts values to other types if specified. + * @function toObject + * @memberof google.firestore.v1.PlanSummary + * @static + * @param {google.firestore.v1.PlanSummary} message PlanSummary + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PlanSummary.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.indexesUsed = []; + if (message.indexesUsed && message.indexesUsed.length) { + object.indexesUsed = []; + for (var j = 0; j < message.indexesUsed.length; ++j) + object.indexesUsed[j] = $root.google.protobuf.Struct.toObject(message.indexesUsed[j], options); + } + return object; + }; + + /** + * Converts this PlanSummary to JSON. + * @function toJSON + * @memberof google.firestore.v1.PlanSummary + * @instance + * @returns {Object.} JSON object + */ + PlanSummary.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PlanSummary + * @function getTypeUrl + * @memberof google.firestore.v1.PlanSummary + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PlanSummary.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.firestore.v1.PlanSummary"; + }; + + return PlanSummary; })(); - - v1.Cursor = (function() { - + + v1.ExecutionStats = (function() { + /** - * Properties of a Cursor. + * Properties of an ExecutionStats. * @memberof google.firestore.v1 - * @interface ICursor - * @property {Array.|null} [values] Cursor values - * @property {boolean|null} [before] Cursor before + * @interface IExecutionStats + * @property {number|Long|null} [resultsReturned] ExecutionStats resultsReturned + * @property {number|Long|null} [bytesReturned] ExecutionStats bytesReturned + * @property {google.protobuf.IDuration|null} [executionDuration] ExecutionStats executionDuration + * @property {number|Long|null} [readOperations] ExecutionStats readOperations + * @property {google.protobuf.IStruct|null} [debugStats] ExecutionStats debugStats */ - + /** - * Constructs a new Cursor. + * Constructs a new ExecutionStats. * @memberof google.firestore.v1 - * @classdesc Represents a Cursor. - * @implements ICursor + * @classdesc Represents an ExecutionStats. + * @implements IExecutionStats * @constructor - * @param {google.firestore.v1.ICursor=} [properties] Properties to set + * @param {google.firestore.v1.IExecutionStats=} [properties] Properties to set */ - function Cursor(properties) { - this.values = []; + function ExecutionStats(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]]; } - + /** - * Cursor values. - * @member {Array.} values - * @memberof google.firestore.v1.Cursor + * ExecutionStats resultsReturned. + * @member {number|Long} resultsReturned + * @memberof google.firestore.v1.ExecutionStats * @instance */ - Cursor.prototype.values = $util.emptyArray; - + ExecutionStats.prototype.resultsReturned = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + /** - * Cursor before. - * @member {boolean} before - * @memberof google.firestore.v1.Cursor + * ExecutionStats bytesReturned. + * @member {number|Long} bytesReturned + * @memberof google.firestore.v1.ExecutionStats * @instance */ - Cursor.prototype.before = false; - + ExecutionStats.prototype.bytesReturned = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + /** - * Creates a Cursor message from a plain object. Also converts values to their respective internal types. + * ExecutionStats executionDuration. + * @member {google.protobuf.IDuration|null|undefined} executionDuration + * @memberof google.firestore.v1.ExecutionStats + * @instance + */ + ExecutionStats.prototype.executionDuration = null; + + /** + * ExecutionStats readOperations. + * @member {number|Long} readOperations + * @memberof google.firestore.v1.ExecutionStats + * @instance + */ + ExecutionStats.prototype.readOperations = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ExecutionStats debugStats. + * @member {google.protobuf.IStruct|null|undefined} debugStats + * @memberof google.firestore.v1.ExecutionStats + * @instance + */ + ExecutionStats.prototype.debugStats = null; + + /** + * Creates a new ExecutionStats instance using the specified properties. + * @function create + * @memberof google.firestore.v1.ExecutionStats + * @static + * @param {google.firestore.v1.IExecutionStats=} [properties] Properties to set + * @returns {google.firestore.v1.ExecutionStats} ExecutionStats instance + */ + ExecutionStats.create = function create(properties) { + return new ExecutionStats(properties); + }; + + /** + * Encodes the specified ExecutionStats message. Does not implicitly {@link google.firestore.v1.ExecutionStats.verify|verify} messages. + * @function encode + * @memberof google.firestore.v1.ExecutionStats + * @static + * @param {google.firestore.v1.IExecutionStats} message ExecutionStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExecutionStats.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resultsReturned != null && Object.hasOwnProperty.call(message, "resultsReturned")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.resultsReturned); + if (message.bytesReturned != null && Object.hasOwnProperty.call(message, "bytesReturned")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.bytesReturned); + if (message.executionDuration != null && Object.hasOwnProperty.call(message, "executionDuration")) + $root.google.protobuf.Duration.encode(message.executionDuration, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.readOperations != null && Object.hasOwnProperty.call(message, "readOperations")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.readOperations); + if (message.debugStats != null && Object.hasOwnProperty.call(message, "debugStats")) + $root.google.protobuf.Struct.encode(message.debugStats, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExecutionStats message, length delimited. Does not implicitly {@link google.firestore.v1.ExecutionStats.verify|verify} messages. + * @function encodeDelimited + * @memberof google.firestore.v1.ExecutionStats + * @static + * @param {google.firestore.v1.IExecutionStats} message ExecutionStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExecutionStats.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExecutionStats message from the specified reader or buffer. + * @function decode + * @memberof google.firestore.v1.ExecutionStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.firestore.v1.ExecutionStats} ExecutionStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExecutionStats.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.firestore.v1.ExecutionStats(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.resultsReturned = reader.int64(); + break; + } + case 2: { + message.bytesReturned = reader.int64(); + break; + } + case 3: { + message.executionDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 4: { + message.readOperations = reader.int64(); + break; + } + case 5: { + message.debugStats = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExecutionStats message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.firestore.v1.ExecutionStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.firestore.v1.ExecutionStats} ExecutionStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExecutionStats.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExecutionStats message. + * @function verify + * @memberof google.firestore.v1.ExecutionStats + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExecutionStats.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resultsReturned != null && message.hasOwnProperty("resultsReturned")) + if (!$util.isInteger(message.resultsReturned) && !(message.resultsReturned && $util.isInteger(message.resultsReturned.low) && $util.isInteger(message.resultsReturned.high))) + return "resultsReturned: integer|Long expected"; + if (message.bytesReturned != null && message.hasOwnProperty("bytesReturned")) + if (!$util.isInteger(message.bytesReturned) && !(message.bytesReturned && $util.isInteger(message.bytesReturned.low) && $util.isInteger(message.bytesReturned.high))) + return "bytesReturned: integer|Long expected"; + if (message.executionDuration != null && message.hasOwnProperty("executionDuration")) { + var error = $root.google.protobuf.Duration.verify(message.executionDuration); + if (error) + return "executionDuration." + error; + } + if (message.readOperations != null && message.hasOwnProperty("readOperations")) + if (!$util.isInteger(message.readOperations) && !(message.readOperations && $util.isInteger(message.readOperations.low) && $util.isInteger(message.readOperations.high))) + return "readOperations: integer|Long expected"; + if (message.debugStats != null && message.hasOwnProperty("debugStats")) { + var error = $root.google.protobuf.Struct.verify(message.debugStats); + if (error) + return "debugStats." + error; + } + return null; + }; + + /** + * Creates an ExecutionStats message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.firestore.v1.Cursor + * @memberof google.firestore.v1.ExecutionStats * @static * @param {Object.} object Plain object - * @returns {google.firestore.v1.Cursor} Cursor + * @returns {google.firestore.v1.ExecutionStats} ExecutionStats */ - Cursor.fromObject = function fromObject(object) { - if (object instanceof $root.google.firestore.v1.Cursor) + ExecutionStats.fromObject = function fromObject(object) { + if (object instanceof $root.google.firestore.v1.ExecutionStats) return object; - var message = new $root.google.firestore.v1.Cursor(); - if (object.values) { - if (!Array.isArray(object.values)) - throw TypeError(".google.firestore.v1.Cursor.values: array expected"); - message.values = []; - for (var i = 0; i < object.values.length; ++i) { - if (typeof object.values[i] !== "object") - throw TypeError(".google.firestore.v1.Cursor.values: object expected"); - message.values[i] = $root.google.firestore.v1.Value.fromObject(object.values[i]); - } + var message = new $root.google.firestore.v1.ExecutionStats(); + if (object.resultsReturned != null) + if ($util.Long) + (message.resultsReturned = $util.Long.fromValue(object.resultsReturned)).unsigned = false; + else if (typeof object.resultsReturned === "string") + message.resultsReturned = parseInt(object.resultsReturned, 10); + else if (typeof object.resultsReturned === "number") + message.resultsReturned = object.resultsReturned; + else if (typeof object.resultsReturned === "object") + message.resultsReturned = new $util.LongBits(object.resultsReturned.low >>> 0, object.resultsReturned.high >>> 0).toNumber(); + if (object.bytesReturned != null) + if ($util.Long) + (message.bytesReturned = $util.Long.fromValue(object.bytesReturned)).unsigned = false; + else if (typeof object.bytesReturned === "string") + message.bytesReturned = parseInt(object.bytesReturned, 10); + else if (typeof object.bytesReturned === "number") + message.bytesReturned = object.bytesReturned; + else if (typeof object.bytesReturned === "object") + message.bytesReturned = new $util.LongBits(object.bytesReturned.low >>> 0, object.bytesReturned.high >>> 0).toNumber(); + if (object.executionDuration != null) { + if (typeof object.executionDuration !== "object") + throw TypeError(".google.firestore.v1.ExecutionStats.executionDuration: object expected"); + message.executionDuration = $root.google.protobuf.Duration.fromObject(object.executionDuration); + } + if (object.readOperations != null) + if ($util.Long) + (message.readOperations = $util.Long.fromValue(object.readOperations)).unsigned = false; + else if (typeof object.readOperations === "string") + message.readOperations = parseInt(object.readOperations, 10); + else if (typeof object.readOperations === "number") + message.readOperations = object.readOperations; + else if (typeof object.readOperations === "object") + message.readOperations = new $util.LongBits(object.readOperations.low >>> 0, object.readOperations.high >>> 0).toNumber(); + if (object.debugStats != null) { + if (typeof object.debugStats !== "object") + throw TypeError(".google.firestore.v1.ExecutionStats.debugStats: object expected"); + message.debugStats = $root.google.protobuf.Struct.fromObject(object.debugStats); } - if (object.before != null) - message.before = Boolean(object.before); return message; }; - + /** - * Creates a plain object from a Cursor message. Also converts values to other types if specified. + * Creates a plain object from an ExecutionStats message. Also converts values to other types if specified. * @function toObject - * @memberof google.firestore.v1.Cursor + * @memberof google.firestore.v1.ExecutionStats * @static - * @param {google.firestore.v1.Cursor} message Cursor + * @param {google.firestore.v1.ExecutionStats} message ExecutionStats * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Cursor.toObject = function toObject(message, options) { + ExecutionStats.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.values = []; - if (options.defaults) - object.before = false; - if (message.values && message.values.length) { - object.values = []; - for (var j = 0; j < message.values.length; ++j) - object.values[j] = $root.google.firestore.v1.Value.toObject(message.values[j], options); + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.resultsReturned = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.resultsReturned = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.bytesReturned = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.bytesReturned = options.longs === String ? "0" : 0; + object.executionDuration = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.readOperations = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.readOperations = options.longs === String ? "0" : 0; + object.debugStats = null; } - if (message.before != null && message.hasOwnProperty("before")) - object.before = message.before; + if (message.resultsReturned != null && message.hasOwnProperty("resultsReturned")) + if (typeof message.resultsReturned === "number") + object.resultsReturned = options.longs === String ? String(message.resultsReturned) : message.resultsReturned; + else + object.resultsReturned = options.longs === String ? $util.Long.prototype.toString.call(message.resultsReturned) : options.longs === Number ? new $util.LongBits(message.resultsReturned.low >>> 0, message.resultsReturned.high >>> 0).toNumber() : message.resultsReturned; + if (message.bytesReturned != null && message.hasOwnProperty("bytesReturned")) + if (typeof message.bytesReturned === "number") + object.bytesReturned = options.longs === String ? String(message.bytesReturned) : message.bytesReturned; + else + object.bytesReturned = options.longs === String ? $util.Long.prototype.toString.call(message.bytesReturned) : options.longs === Number ? new $util.LongBits(message.bytesReturned.low >>> 0, message.bytesReturned.high >>> 0).toNumber() : message.bytesReturned; + if (message.executionDuration != null && message.hasOwnProperty("executionDuration")) + object.executionDuration = $root.google.protobuf.Duration.toObject(message.executionDuration, options); + if (message.readOperations != null && message.hasOwnProperty("readOperations")) + if (typeof message.readOperations === "number") + object.readOperations = options.longs === String ? String(message.readOperations) : message.readOperations; + else + object.readOperations = options.longs === String ? $util.Long.prototype.toString.call(message.readOperations) : options.longs === Number ? new $util.LongBits(message.readOperations.low >>> 0, message.readOperations.high >>> 0).toNumber() : message.readOperations; + if (message.debugStats != null && message.hasOwnProperty("debugStats")) + object.debugStats = $root.google.protobuf.Struct.toObject(message.debugStats, options); return object; }; - + /** - * Converts this Cursor to JSON. + * Converts this ExecutionStats to JSON. * @function toJSON - * @memberof google.firestore.v1.Cursor + * @memberof google.firestore.v1.ExecutionStats * @instance * @returns {Object.} JSON object */ - Cursor.prototype.toJSON = function toJSON() { + ExecutionStats.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - + /** - * Gets the default type url for Cursor + * Gets the default type url for ExecutionStats * @function getTypeUrl - * @memberof google.firestore.v1.Cursor + * @memberof google.firestore.v1.ExecutionStats * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - Cursor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ExecutionStats.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.firestore.v1.Cursor"; + return typeUrlPrefix + "/google.firestore.v1.ExecutionStats"; }; - - return Cursor; + + return ExecutionStats; })(); - + v1.Write = (function() { - + /** * Properties of a Write. * @memberof google.firestore.v1 @@ -17119,7 +34432,7 @@ * @property {Array.|null} [updateTransforms] Write updateTransforms * @property {google.firestore.v1.IPrecondition|null} [currentDocument] Write currentDocument */ - + /** * Constructs a new Write. * @memberof google.firestore.v1 @@ -17135,7 +34448,7 @@ if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } - + /** * Write update. * @member {google.firestore.v1.IDocument|null|undefined} update @@ -17143,7 +34456,7 @@ * @instance */ Write.prototype.update = null; - + /** * Write delete. * @member {string|null|undefined} delete @@ -17151,7 +34464,7 @@ * @instance */ Write.prototype["delete"] = null; - + /** * Write transform. * @member {google.firestore.v1.IDocumentTransform|null|undefined} transform @@ -17159,7 +34472,7 @@ * @instance */ Write.prototype.transform = null; - + /** * Write updateMask. * @member {google.firestore.v1.IDocumentMask|null|undefined} updateMask @@ -17167,7 +34480,7 @@ * @instance */ Write.prototype.updateMask = null; - + /** * Write updateTransforms. * @member {Array.} updateTransforms @@ -17175,7 +34488,7 @@ * @instance */ Write.prototype.updateTransforms = $util.emptyArray; - + /** * Write currentDocument. * @member {google.firestore.v1.IPrecondition|null|undefined} currentDocument @@ -17183,10 +34496,10 @@ * @instance */ Write.prototype.currentDocument = null; - + // OneOf field names bound to virtual getters and setters var $oneOfFields; - + /** * Write operation. * @member {"update"|"delete"|"transform"|undefined} operation @@ -17197,7 +34510,187 @@ get: $util.oneOfGetter($oneOfFields = ["update", "delete", "transform"]), set: $util.oneOfSetter($oneOfFields) }); - + + /** + * Creates a new Write instance using the specified properties. + * @function create + * @memberof google.firestore.v1.Write + * @static + * @param {google.firestore.v1.IWrite=} [properties] Properties to set + * @returns {google.firestore.v1.Write} Write instance + */ + Write.create = function create(properties) { + return new Write(properties); + }; + + /** + * Encodes the specified Write message. Does not implicitly {@link google.firestore.v1.Write.verify|verify} messages. + * @function encode + * @memberof google.firestore.v1.Write + * @static + * @param {google.firestore.v1.IWrite} message Write message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Write.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.update != null && Object.hasOwnProperty.call(message, "update")) + $root.google.firestore.v1.Document.encode(message.update, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message["delete"]); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.firestore.v1.DocumentMask.encode(message.updateMask, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.currentDocument != null && Object.hasOwnProperty.call(message, "currentDocument")) + $root.google.firestore.v1.Precondition.encode(message.currentDocument, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.transform != null && Object.hasOwnProperty.call(message, "transform")) + $root.google.firestore.v1.DocumentTransform.encode(message.transform, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.updateTransforms != null && message.updateTransforms.length) + for (var i = 0; i < message.updateTransforms.length; ++i) + $root.google.firestore.v1.DocumentTransform.FieldTransform.encode(message.updateTransforms[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Write message, length delimited. Does not implicitly {@link google.firestore.v1.Write.verify|verify} messages. + * @function encodeDelimited + * @memberof google.firestore.v1.Write + * @static + * @param {google.firestore.v1.IWrite} message Write message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Write.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Write message from the specified reader or buffer. + * @function decode + * @memberof google.firestore.v1.Write + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.firestore.v1.Write} Write + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Write.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.firestore.v1.Write(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.update = $root.google.firestore.v1.Document.decode(reader, reader.uint32()); + break; + } + case 2: { + message["delete"] = reader.string(); + break; + } + case 6: { + message.transform = $root.google.firestore.v1.DocumentTransform.decode(reader, reader.uint32()); + break; + } + case 3: { + message.updateMask = $root.google.firestore.v1.DocumentMask.decode(reader, reader.uint32()); + break; + } + case 7: { + if (!(message.updateTransforms && message.updateTransforms.length)) + message.updateTransforms = []; + message.updateTransforms.push($root.google.firestore.v1.DocumentTransform.FieldTransform.decode(reader, reader.uint32())); + break; + } + case 4: { + message.currentDocument = $root.google.firestore.v1.Precondition.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Write message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.firestore.v1.Write + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.firestore.v1.Write} Write + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Write.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Write message. + * @function verify + * @memberof google.firestore.v1.Write + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Write.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.update != null && message.hasOwnProperty("update")) { + properties.operation = 1; + { + var error = $root.google.firestore.v1.Document.verify(message.update); + if (error) + return "update." + error; + } + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + if (properties.operation === 1) + return "operation: multiple values"; + properties.operation = 1; + if (!$util.isString(message["delete"])) + return "delete: string expected"; + } + if (message.transform != null && message.hasOwnProperty("transform")) { + if (properties.operation === 1) + return "operation: multiple values"; + properties.operation = 1; + { + var error = $root.google.firestore.v1.DocumentTransform.verify(message.transform); + if (error) + return "transform." + error; + } + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.firestore.v1.DocumentMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.updateTransforms != null && message.hasOwnProperty("updateTransforms")) { + if (!Array.isArray(message.updateTransforms)) + return "updateTransforms: array expected"; + for (var i = 0; i < message.updateTransforms.length; ++i) { + var error = $root.google.firestore.v1.DocumentTransform.FieldTransform.verify(message.updateTransforms[i]); + if (error) + return "updateTransforms." + error; + } + } + if (message.currentDocument != null && message.hasOwnProperty("currentDocument")) { + var error = $root.google.firestore.v1.Precondition.verify(message.currentDocument); + if (error) + return "currentDocument." + error; + } + return null; + }; + /** * Creates a Write message from a plain object. Also converts values to their respective internal types. * @function fromObject @@ -17244,7 +34737,7 @@ } return message; }; - + /** * Creates a plain object from a Write message. Also converts values to other types if specified. * @function toObject @@ -17290,7 +34783,7 @@ } return object; }; - + /** * Converts this Write to JSON. * @function toJSON @@ -17301,7 +34794,7 @@ Write.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - + /** * Gets the default type url for Write * @function getTypeUrl @@ -17316,12 +34809,12 @@ } return typeUrlPrefix + "/google.firestore.v1.Write"; }; - + return Write; })(); - + v1.DocumentTransform = (function() { - + /** * Properties of a DocumentTransform. * @memberof google.firestore.v1 @@ -17329,7 +34822,7 @@ * @property {string|null} [document] DocumentTransform document * @property {Array.|null} [fieldTransforms] DocumentTransform fieldTransforms */ - + /** * Constructs a new DocumentTransform. * @memberof google.firestore.v1 @@ -17345,7 +34838,7 @@ if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } - + /** * DocumentTransform document. * @member {string} document @@ -17353,7 +34846,7 @@ * @instance */ DocumentTransform.prototype.document = ""; - + /** * DocumentTransform fieldTransforms. * @member {Array.} fieldTransforms @@ -17361,7 +34854,130 @@ * @instance */ DocumentTransform.prototype.fieldTransforms = $util.emptyArray; - + + /** + * Creates a new DocumentTransform instance using the specified properties. + * @function create + * @memberof google.firestore.v1.DocumentTransform + * @static + * @param {google.firestore.v1.IDocumentTransform=} [properties] Properties to set + * @returns {google.firestore.v1.DocumentTransform} DocumentTransform instance + */ + DocumentTransform.create = function create(properties) { + return new DocumentTransform(properties); + }; + + /** + * Encodes the specified DocumentTransform message. Does not implicitly {@link google.firestore.v1.DocumentTransform.verify|verify} messages. + * @function encode + * @memberof google.firestore.v1.DocumentTransform + * @static + * @param {google.firestore.v1.IDocumentTransform} message DocumentTransform message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DocumentTransform.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.document != null && Object.hasOwnProperty.call(message, "document")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.document); + if (message.fieldTransforms != null && message.fieldTransforms.length) + for (var i = 0; i < message.fieldTransforms.length; ++i) + $root.google.firestore.v1.DocumentTransform.FieldTransform.encode(message.fieldTransforms[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DocumentTransform message, length delimited. Does not implicitly {@link google.firestore.v1.DocumentTransform.verify|verify} messages. + * @function encodeDelimited + * @memberof google.firestore.v1.DocumentTransform + * @static + * @param {google.firestore.v1.IDocumentTransform} message DocumentTransform message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DocumentTransform.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DocumentTransform message from the specified reader or buffer. + * @function decode + * @memberof google.firestore.v1.DocumentTransform + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.firestore.v1.DocumentTransform} DocumentTransform + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DocumentTransform.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.firestore.v1.DocumentTransform(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.document = reader.string(); + break; + } + case 2: { + if (!(message.fieldTransforms && message.fieldTransforms.length)) + message.fieldTransforms = []; + message.fieldTransforms.push($root.google.firestore.v1.DocumentTransform.FieldTransform.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DocumentTransform message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.firestore.v1.DocumentTransform + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.firestore.v1.DocumentTransform} DocumentTransform + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DocumentTransform.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DocumentTransform message. + * @function verify + * @memberof google.firestore.v1.DocumentTransform + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DocumentTransform.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.document != null && message.hasOwnProperty("document")) + if (!$util.isString(message.document)) + return "document: string expected"; + if (message.fieldTransforms != null && message.hasOwnProperty("fieldTransforms")) { + if (!Array.isArray(message.fieldTransforms)) + return "fieldTransforms: array expected"; + for (var i = 0; i < message.fieldTransforms.length; ++i) { + var error = $root.google.firestore.v1.DocumentTransform.FieldTransform.verify(message.fieldTransforms[i]); + if (error) + return "fieldTransforms." + error; + } + } + return null; + }; + /** * Creates a DocumentTransform message from a plain object. Also converts values to their respective internal types. * @function fromObject @@ -17388,7 +35004,7 @@ } return message; }; - + /** * Creates a plain object from a DocumentTransform message. Also converts values to other types if specified. * @function toObject @@ -17415,7 +35031,7 @@ } return object; }; - + /** * Converts this DocumentTransform to JSON. * @function toJSON @@ -17426,7 +35042,7 @@ DocumentTransform.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - + /** * Gets the default type url for DocumentTransform * @function getTypeUrl @@ -17441,9 +35057,9 @@ } return typeUrlPrefix + "/google.firestore.v1.DocumentTransform"; }; - + DocumentTransform.FieldTransform = (function() { - + /** * Properties of a FieldTransform. * @memberof google.firestore.v1.DocumentTransform @@ -17456,7 +35072,7 @@ * @property {google.firestore.v1.IArrayValue|null} [appendMissingElements] FieldTransform appendMissingElements * @property {google.firestore.v1.IArrayValue|null} [removeAllFromArray] FieldTransform removeAllFromArray */ - + /** * Constructs a new FieldTransform. * @memberof google.firestore.v1.DocumentTransform @@ -17471,7 +35087,7 @@ if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } - + /** * FieldTransform fieldPath. * @member {string} fieldPath @@ -17479,7 +35095,7 @@ * @instance */ FieldTransform.prototype.fieldPath = ""; - + /** * FieldTransform setToServerValue. * @member {google.firestore.v1.DocumentTransform.FieldTransform.ServerValue|null|undefined} setToServerValue @@ -17487,7 +35103,7 @@ * @instance */ FieldTransform.prototype.setToServerValue = null; - + /** * FieldTransform increment. * @member {google.firestore.v1.IValue|null|undefined} increment @@ -17495,7 +35111,7 @@ * @instance */ FieldTransform.prototype.increment = null; - + /** * FieldTransform maximum. * @member {google.firestore.v1.IValue|null|undefined} maximum @@ -17503,7 +35119,7 @@ * @instance */ FieldTransform.prototype.maximum = null; - + /** * FieldTransform minimum. * @member {google.firestore.v1.IValue|null|undefined} minimum @@ -17511,7 +35127,7 @@ * @instance */ FieldTransform.prototype.minimum = null; - + /** * FieldTransform appendMissingElements. * @member {google.firestore.v1.IArrayValue|null|undefined} appendMissingElements @@ -17519,7 +35135,7 @@ * @instance */ FieldTransform.prototype.appendMissingElements = null; - + /** * FieldTransform removeAllFromArray. * @member {google.firestore.v1.IArrayValue|null|undefined} removeAllFromArray @@ -17527,10 +35143,10 @@ * @instance */ FieldTransform.prototype.removeAllFromArray = null; - + // OneOf field names bound to virtual getters and setters var $oneOfFields; - + /** * FieldTransform transformType. * @member {"setToServerValue"|"increment"|"maximum"|"minimum"|"appendMissingElements"|"removeAllFromArray"|undefined} transformType @@ -17541,7 +35157,209 @@ get: $util.oneOfGetter($oneOfFields = ["setToServerValue", "increment", "maximum", "minimum", "appendMissingElements", "removeAllFromArray"]), set: $util.oneOfSetter($oneOfFields) }); - + + /** + * Creates a new FieldTransform instance using the specified properties. + * @function create + * @memberof google.firestore.v1.DocumentTransform.FieldTransform + * @static + * @param {google.firestore.v1.DocumentTransform.IFieldTransform=} [properties] Properties to set + * @returns {google.firestore.v1.DocumentTransform.FieldTransform} FieldTransform instance + */ + FieldTransform.create = function create(properties) { + return new FieldTransform(properties); + }; + + /** + * Encodes the specified FieldTransform message. Does not implicitly {@link google.firestore.v1.DocumentTransform.FieldTransform.verify|verify} messages. + * @function encode + * @memberof google.firestore.v1.DocumentTransform.FieldTransform + * @static + * @param {google.firestore.v1.DocumentTransform.IFieldTransform} message FieldTransform message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldTransform.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fieldPath != null && Object.hasOwnProperty.call(message, "fieldPath")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.fieldPath); + if (message.setToServerValue != null && Object.hasOwnProperty.call(message, "setToServerValue")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.setToServerValue); + if (message.increment != null && Object.hasOwnProperty.call(message, "increment")) + $root.google.firestore.v1.Value.encode(message.increment, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.maximum != null && Object.hasOwnProperty.call(message, "maximum")) + $root.google.firestore.v1.Value.encode(message.maximum, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.minimum != null && Object.hasOwnProperty.call(message, "minimum")) + $root.google.firestore.v1.Value.encode(message.minimum, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.appendMissingElements != null && Object.hasOwnProperty.call(message, "appendMissingElements")) + $root.google.firestore.v1.ArrayValue.encode(message.appendMissingElements, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.removeAllFromArray != null && Object.hasOwnProperty.call(message, "removeAllFromArray")) + $root.google.firestore.v1.ArrayValue.encode(message.removeAllFromArray, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FieldTransform message, length delimited. Does not implicitly {@link google.firestore.v1.DocumentTransform.FieldTransform.verify|verify} messages. + * @function encodeDelimited + * @memberof google.firestore.v1.DocumentTransform.FieldTransform + * @static + * @param {google.firestore.v1.DocumentTransform.IFieldTransform} message FieldTransform message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldTransform.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldTransform message from the specified reader or buffer. + * @function decode + * @memberof google.firestore.v1.DocumentTransform.FieldTransform + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.firestore.v1.DocumentTransform.FieldTransform} FieldTransform + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldTransform.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.firestore.v1.DocumentTransform.FieldTransform(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.fieldPath = reader.string(); + break; + } + case 2: { + message.setToServerValue = reader.int32(); + break; + } + case 3: { + message.increment = $root.google.firestore.v1.Value.decode(reader, reader.uint32()); + break; + } + case 4: { + message.maximum = $root.google.firestore.v1.Value.decode(reader, reader.uint32()); + break; + } + case 5: { + message.minimum = $root.google.firestore.v1.Value.decode(reader, reader.uint32()); + break; + } + case 6: { + message.appendMissingElements = $root.google.firestore.v1.ArrayValue.decode(reader, reader.uint32()); + break; + } + case 7: { + message.removeAllFromArray = $root.google.firestore.v1.ArrayValue.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldTransform message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.firestore.v1.DocumentTransform.FieldTransform + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.firestore.v1.DocumentTransform.FieldTransform} FieldTransform + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldTransform.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldTransform message. + * @function verify + * @memberof google.firestore.v1.DocumentTransform.FieldTransform + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldTransform.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.fieldPath != null && message.hasOwnProperty("fieldPath")) + if (!$util.isString(message.fieldPath)) + return "fieldPath: string expected"; + if (message.setToServerValue != null && message.hasOwnProperty("setToServerValue")) { + properties.transformType = 1; + switch (message.setToServerValue) { + default: + return "setToServerValue: enum value expected"; + case 0: + case 1: + break; + } + } + if (message.increment != null && message.hasOwnProperty("increment")) { + if (properties.transformType === 1) + return "transformType: multiple values"; + properties.transformType = 1; + { + var error = $root.google.firestore.v1.Value.verify(message.increment); + if (error) + return "increment." + error; + } + } + if (message.maximum != null && message.hasOwnProperty("maximum")) { + if (properties.transformType === 1) + return "transformType: multiple values"; + properties.transformType = 1; + { + var error = $root.google.firestore.v1.Value.verify(message.maximum); + if (error) + return "maximum." + error; + } + } + if (message.minimum != null && message.hasOwnProperty("minimum")) { + if (properties.transformType === 1) + return "transformType: multiple values"; + properties.transformType = 1; + { + var error = $root.google.firestore.v1.Value.verify(message.minimum); + if (error) + return "minimum." + error; + } + } + if (message.appendMissingElements != null && message.hasOwnProperty("appendMissingElements")) { + if (properties.transformType === 1) + return "transformType: multiple values"; + properties.transformType = 1; + { + var error = $root.google.firestore.v1.ArrayValue.verify(message.appendMissingElements); + if (error) + return "appendMissingElements." + error; + } + } + if (message.removeAllFromArray != null && message.hasOwnProperty("removeAllFromArray")) { + if (properties.transformType === 1) + return "transformType: multiple values"; + properties.transformType = 1; + { + var error = $root.google.firestore.v1.ArrayValue.verify(message.removeAllFromArray); + if (error) + return "removeAllFromArray." + error; + } + } + return null; + }; + /** * Creates a FieldTransform message from a plain object. Also converts values to their respective internal types. * @function fromObject @@ -17557,20 +35375,20 @@ if (object.fieldPath != null) message.fieldPath = String(object.fieldPath); switch (object.setToServerValue) { - default: - if (typeof object.setToServerValue === "number") { - message.setToServerValue = object.setToServerValue; + default: + if (typeof object.setToServerValue === "number") { + message.setToServerValue = object.setToServerValue; + break; + } + break; + case "SERVER_VALUE_UNSPECIFIED": + case 0: + message.setToServerValue = 0; + break; + case "REQUEST_TIME": + case 1: + message.setToServerValue = 1; break; - } - break; - case "SERVER_VALUE_UNSPECIFIED": - case 0: - message.setToServerValue = 0; - break; - case "REQUEST_TIME": - case 1: - message.setToServerValue = 1; - break; } if (object.increment != null) { if (typeof object.increment !== "object") @@ -17599,7 +35417,7 @@ } return message; }; - + /** * Creates a plain object from a FieldTransform message. Also converts values to other types if specified. * @function toObject @@ -17649,7 +35467,7 @@ } return object; }; - + /** * Converts this FieldTransform to JSON. * @function toJSON @@ -17660,7 +35478,7 @@ FieldTransform.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - + /** * Gets the default type url for FieldTransform * @function getTypeUrl @@ -17675,29 +35493,29 @@ } return typeUrlPrefix + "/google.firestore.v1.DocumentTransform.FieldTransform"; }; - + /** * ServerValue enum. * @name google.firestore.v1.DocumentTransform.FieldTransform.ServerValue - * @enum {string} - * @property {string} SERVER_VALUE_UNSPECIFIED=SERVER_VALUE_UNSPECIFIED SERVER_VALUE_UNSPECIFIED value - * @property {string} REQUEST_TIME=REQUEST_TIME REQUEST_TIME value + * @enum {number} + * @property {number} SERVER_VALUE_UNSPECIFIED=0 SERVER_VALUE_UNSPECIFIED value + * @property {number} REQUEST_TIME=1 REQUEST_TIME value */ FieldTransform.ServerValue = (function() { var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "SERVER_VALUE_UNSPECIFIED"] = "SERVER_VALUE_UNSPECIFIED"; - values[valuesById[1] = "REQUEST_TIME"] = "REQUEST_TIME"; + values[valuesById[0] = "SERVER_VALUE_UNSPECIFIED"] = 0; + values[valuesById[1] = "REQUEST_TIME"] = 1; return values; })(); - + return FieldTransform; })(); - + return DocumentTransform; })(); - + v1.WriteResult = (function() { - + /** * Properties of a WriteResult. * @memberof google.firestore.v1 @@ -17705,7 +35523,7 @@ * @property {google.protobuf.ITimestamp|null} [updateTime] WriteResult updateTime * @property {Array.|null} [transformResults] WriteResult transformResults */ - + /** * Constructs a new WriteResult. * @memberof google.firestore.v1 @@ -17721,7 +35539,7 @@ if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } - + /** * WriteResult updateTime. * @member {google.protobuf.ITimestamp|null|undefined} updateTime @@ -17729,7 +35547,7 @@ * @instance */ WriteResult.prototype.updateTime = null; - + /** * WriteResult transformResults. * @member {Array.} transformResults @@ -17737,7 +35555,132 @@ * @instance */ WriteResult.prototype.transformResults = $util.emptyArray; - + + /** + * Creates a new WriteResult instance using the specified properties. + * @function create + * @memberof google.firestore.v1.WriteResult + * @static + * @param {google.firestore.v1.IWriteResult=} [properties] Properties to set + * @returns {google.firestore.v1.WriteResult} WriteResult instance + */ + WriteResult.create = function create(properties) { + return new WriteResult(properties); + }; + + /** + * Encodes the specified WriteResult message. Does not implicitly {@link google.firestore.v1.WriteResult.verify|verify} messages. + * @function encode + * @memberof google.firestore.v1.WriteResult + * @static + * @param {google.firestore.v1.IWriteResult} message WriteResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WriteResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.transformResults != null && message.transformResults.length) + for (var i = 0; i < message.transformResults.length; ++i) + $root.google.firestore.v1.Value.encode(message.transformResults[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified WriteResult message, length delimited. Does not implicitly {@link google.firestore.v1.WriteResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.firestore.v1.WriteResult + * @static + * @param {google.firestore.v1.IWriteResult} message WriteResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WriteResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WriteResult message from the specified reader or buffer. + * @function decode + * @memberof google.firestore.v1.WriteResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.firestore.v1.WriteResult} WriteResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WriteResult.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.firestore.v1.WriteResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.transformResults && message.transformResults.length)) + message.transformResults = []; + message.transformResults.push($root.google.firestore.v1.Value.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WriteResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.firestore.v1.WriteResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.firestore.v1.WriteResult} WriteResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WriteResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WriteResult message. + * @function verify + * @memberof google.firestore.v1.WriteResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WriteResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.transformResults != null && message.hasOwnProperty("transformResults")) { + if (!Array.isArray(message.transformResults)) + return "transformResults: array expected"; + for (var i = 0; i < message.transformResults.length; ++i) { + var error = $root.google.firestore.v1.Value.verify(message.transformResults[i]); + if (error) + return "transformResults." + error; + } + } + return null; + }; + /** * Creates a WriteResult message from a plain object. Also converts values to their respective internal types. * @function fromObject @@ -17767,7 +35710,7 @@ } return message; }; - + /** * Creates a plain object from a WriteResult message. Also converts values to other types if specified. * @function toObject @@ -17794,7 +35737,7 @@ } return object; }; - + /** * Converts this WriteResult to JSON. * @function toJSON @@ -17805,7 +35748,7 @@ WriteResult.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - + /** * Gets the default type url for WriteResult * @function getTypeUrl @@ -17820,12 +35763,12 @@ } return typeUrlPrefix + "/google.firestore.v1.WriteResult"; }; - + return WriteResult; })(); - + v1.DocumentChange = (function() { - + /** * Properties of a DocumentChange. * @memberof google.firestore.v1 @@ -17834,7 +35777,7 @@ * @property {Array.|null} [targetIds] DocumentChange targetIds * @property {Array.|null} [removedTargetIds] DocumentChange removedTargetIds */ - + /** * Constructs a new DocumentChange. * @memberof google.firestore.v1 @@ -17851,7 +35794,7 @@ if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } - + /** * DocumentChange document. * @member {google.firestore.v1.IDocument|null|undefined} document @@ -17859,7 +35802,7 @@ * @instance */ DocumentChange.prototype.document = null; - + /** * DocumentChange targetIds. * @member {Array.} targetIds @@ -17867,7 +35810,7 @@ * @instance */ DocumentChange.prototype.targetIds = $util.emptyArray; - + /** * DocumentChange removedTargetIds. * @member {Array.} removedTargetIds @@ -17875,7 +35818,162 @@ * @instance */ DocumentChange.prototype.removedTargetIds = $util.emptyArray; - + + /** + * Creates a new DocumentChange instance using the specified properties. + * @function create + * @memberof google.firestore.v1.DocumentChange + * @static + * @param {google.firestore.v1.IDocumentChange=} [properties] Properties to set + * @returns {google.firestore.v1.DocumentChange} DocumentChange instance + */ + DocumentChange.create = function create(properties) { + return new DocumentChange(properties); + }; + + /** + * Encodes the specified DocumentChange message. Does not implicitly {@link google.firestore.v1.DocumentChange.verify|verify} messages. + * @function encode + * @memberof google.firestore.v1.DocumentChange + * @static + * @param {google.firestore.v1.IDocumentChange} message DocumentChange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DocumentChange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.document != null && Object.hasOwnProperty.call(message, "document")) + $root.google.firestore.v1.Document.encode(message.document, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.targetIds != null && message.targetIds.length) { + writer.uint32(/* id 5, wireType 2 =*/42).fork(); + for (var i = 0; i < message.targetIds.length; ++i) + writer.int32(message.targetIds[i]); + writer.ldelim(); + } + if (message.removedTargetIds != null && message.removedTargetIds.length) { + writer.uint32(/* id 6, wireType 2 =*/50).fork(); + for (var i = 0; i < message.removedTargetIds.length; ++i) + writer.int32(message.removedTargetIds[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified DocumentChange message, length delimited. Does not implicitly {@link google.firestore.v1.DocumentChange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.firestore.v1.DocumentChange + * @static + * @param {google.firestore.v1.IDocumentChange} message DocumentChange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DocumentChange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DocumentChange message from the specified reader or buffer. + * @function decode + * @memberof google.firestore.v1.DocumentChange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.firestore.v1.DocumentChange} DocumentChange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DocumentChange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.firestore.v1.DocumentChange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.document = $root.google.firestore.v1.Document.decode(reader, reader.uint32()); + break; + } + case 5: { + if (!(message.targetIds && message.targetIds.length)) + message.targetIds = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.targetIds.push(reader.int32()); + } else + message.targetIds.push(reader.int32()); + break; + } + case 6: { + if (!(message.removedTargetIds && message.removedTargetIds.length)) + message.removedTargetIds = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.removedTargetIds.push(reader.int32()); + } else + message.removedTargetIds.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DocumentChange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.firestore.v1.DocumentChange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.firestore.v1.DocumentChange} DocumentChange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DocumentChange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DocumentChange message. + * @function verify + * @memberof google.firestore.v1.DocumentChange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DocumentChange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.document != null && message.hasOwnProperty("document")) { + var error = $root.google.firestore.v1.Document.verify(message.document); + if (error) + return "document." + error; + } + if (message.targetIds != null && message.hasOwnProperty("targetIds")) { + if (!Array.isArray(message.targetIds)) + return "targetIds: array expected"; + for (var i = 0; i < message.targetIds.length; ++i) + if (!$util.isInteger(message.targetIds[i])) + return "targetIds: integer[] expected"; + } + if (message.removedTargetIds != null && message.hasOwnProperty("removedTargetIds")) { + if (!Array.isArray(message.removedTargetIds)) + return "removedTargetIds: array expected"; + for (var i = 0; i < message.removedTargetIds.length; ++i) + if (!$util.isInteger(message.removedTargetIds[i])) + return "removedTargetIds: integer[] expected"; + } + return null; + }; + /** * Creates a DocumentChange message from a plain object. Also converts values to their respective internal types. * @function fromObject @@ -17909,7 +36007,7 @@ } return message; }; - + /** * Creates a plain object from a DocumentChange message. Also converts values to other types if specified. * @function toObject @@ -17943,7 +36041,7 @@ } return object; }; - + /** * Converts this DocumentChange to JSON. * @function toJSON @@ -17954,7 +36052,7 @@ DocumentChange.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - + /** * Gets the default type url for DocumentChange * @function getTypeUrl @@ -17969,12 +36067,12 @@ } return typeUrlPrefix + "/google.firestore.v1.DocumentChange"; }; - + return DocumentChange; })(); - + v1.DocumentDelete = (function() { - + /** * Properties of a DocumentDelete. * @memberof google.firestore.v1 @@ -17983,7 +36081,7 @@ * @property {Array.|null} [removedTargetIds] DocumentDelete removedTargetIds * @property {google.protobuf.ITimestamp|null} [readTime] DocumentDelete readTime */ - + /** * Constructs a new DocumentDelete. * @memberof google.firestore.v1 @@ -17999,7 +36097,7 @@ if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } - + /** * DocumentDelete document. * @member {string} document @@ -18007,7 +36105,7 @@ * @instance */ DocumentDelete.prototype.document = ""; - + /** * DocumentDelete removedTargetIds. * @member {Array.} removedTargetIds @@ -18015,7 +36113,7 @@ * @instance */ DocumentDelete.prototype.removedTargetIds = $util.emptyArray; - + /** * DocumentDelete readTime. * @member {google.protobuf.ITimestamp|null|undefined} readTime @@ -18023,7 +36121,147 @@ * @instance */ DocumentDelete.prototype.readTime = null; - + + /** + * Creates a new DocumentDelete instance using the specified properties. + * @function create + * @memberof google.firestore.v1.DocumentDelete + * @static + * @param {google.firestore.v1.IDocumentDelete=} [properties] Properties to set + * @returns {google.firestore.v1.DocumentDelete} DocumentDelete instance + */ + DocumentDelete.create = function create(properties) { + return new DocumentDelete(properties); + }; + + /** + * Encodes the specified DocumentDelete message. Does not implicitly {@link google.firestore.v1.DocumentDelete.verify|verify} messages. + * @function encode + * @memberof google.firestore.v1.DocumentDelete + * @static + * @param {google.firestore.v1.IDocumentDelete} message DocumentDelete message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DocumentDelete.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.document != null && Object.hasOwnProperty.call(message, "document")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.document); + if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.removedTargetIds != null && message.removedTargetIds.length) { + writer.uint32(/* id 6, wireType 2 =*/50).fork(); + for (var i = 0; i < message.removedTargetIds.length; ++i) + writer.int32(message.removedTargetIds[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified DocumentDelete message, length delimited. Does not implicitly {@link google.firestore.v1.DocumentDelete.verify|verify} messages. + * @function encodeDelimited + * @memberof google.firestore.v1.DocumentDelete + * @static + * @param {google.firestore.v1.IDocumentDelete} message DocumentDelete message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DocumentDelete.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DocumentDelete message from the specified reader or buffer. + * @function decode + * @memberof google.firestore.v1.DocumentDelete + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.firestore.v1.DocumentDelete} DocumentDelete + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DocumentDelete.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.firestore.v1.DocumentDelete(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.document = reader.string(); + break; + } + case 6: { + if (!(message.removedTargetIds && message.removedTargetIds.length)) + message.removedTargetIds = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.removedTargetIds.push(reader.int32()); + } else + message.removedTargetIds.push(reader.int32()); + break; + } + case 4: { + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DocumentDelete message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.firestore.v1.DocumentDelete + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.firestore.v1.DocumentDelete} DocumentDelete + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DocumentDelete.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DocumentDelete message. + * @function verify + * @memberof google.firestore.v1.DocumentDelete + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DocumentDelete.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.document != null && message.hasOwnProperty("document")) + if (!$util.isString(message.document)) + return "document: string expected"; + if (message.removedTargetIds != null && message.hasOwnProperty("removedTargetIds")) { + if (!Array.isArray(message.removedTargetIds)) + return "removedTargetIds: array expected"; + for (var i = 0; i < message.removedTargetIds.length; ++i) + if (!$util.isInteger(message.removedTargetIds[i])) + return "removedTargetIds: integer[] expected"; + } + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; + } + return null; + }; + /** * Creates a DocumentDelete message from a plain object. Also converts values to their respective internal types. * @function fromObject @@ -18052,7 +36290,7 @@ } return message; }; - + /** * Creates a plain object from a DocumentDelete message. Also converts values to other types if specified. * @function toObject @@ -18083,7 +36321,7 @@ } return object; }; - + /** * Converts this DocumentDelete to JSON. * @function toJSON @@ -18094,7 +36332,7 @@ DocumentDelete.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - + /** * Gets the default type url for DocumentDelete * @function getTypeUrl @@ -18109,12 +36347,12 @@ } return typeUrlPrefix + "/google.firestore.v1.DocumentDelete"; }; - + return DocumentDelete; })(); - + v1.DocumentRemove = (function() { - + /** * Properties of a DocumentRemove. * @memberof google.firestore.v1 @@ -18123,7 +36361,7 @@ * @property {Array.|null} [removedTargetIds] DocumentRemove removedTargetIds * @property {google.protobuf.ITimestamp|null} [readTime] DocumentRemove readTime */ - + /** * Constructs a new DocumentRemove. * @memberof google.firestore.v1 @@ -18139,7 +36377,7 @@ if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } - + /** * DocumentRemove document. * @member {string} document @@ -18147,7 +36385,7 @@ * @instance */ DocumentRemove.prototype.document = ""; - + /** * DocumentRemove removedTargetIds. * @member {Array.} removedTargetIds @@ -18155,7 +36393,7 @@ * @instance */ DocumentRemove.prototype.removedTargetIds = $util.emptyArray; - + /** * DocumentRemove readTime. * @member {google.protobuf.ITimestamp|null|undefined} readTime @@ -18163,4637 +36401,5952 @@ * @instance */ DocumentRemove.prototype.readTime = null; - - /** - * Creates a DocumentRemove message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.firestore.v1.DocumentRemove - * @static - * @param {Object.} object Plain object - * @returns {google.firestore.v1.DocumentRemove} DocumentRemove - */ - DocumentRemove.fromObject = function fromObject(object) { - if (object instanceof $root.google.firestore.v1.DocumentRemove) - return object; - var message = new $root.google.firestore.v1.DocumentRemove(); - if (object.document != null) - message.document = String(object.document); - if (object.removedTargetIds) { - if (!Array.isArray(object.removedTargetIds)) - throw TypeError(".google.firestore.v1.DocumentRemove.removedTargetIds: array expected"); - message.removedTargetIds = []; - for (var i = 0; i < object.removedTargetIds.length; ++i) - message.removedTargetIds[i] = object.removedTargetIds[i] | 0; - } - if (object.readTime != null) { - if (typeof object.readTime !== "object") - throw TypeError(".google.firestore.v1.DocumentRemove.readTime: object expected"); - message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); - } - return message; - }; - - /** - * Creates a plain object from a DocumentRemove message. Also converts values to other types if specified. - * @function toObject - * @memberof google.firestore.v1.DocumentRemove - * @static - * @param {google.firestore.v1.DocumentRemove} message DocumentRemove - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DocumentRemove.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.removedTargetIds = []; - if (options.defaults) { - object.document = ""; - object.readTime = null; - } - if (message.document != null && message.hasOwnProperty("document")) - object.document = message.document; - if (message.removedTargetIds && message.removedTargetIds.length) { - object.removedTargetIds = []; - for (var j = 0; j < message.removedTargetIds.length; ++j) - object.removedTargetIds[j] = message.removedTargetIds[j]; - } - if (message.readTime != null && message.hasOwnProperty("readTime")) - object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); - return object; - }; - - /** - * Converts this DocumentRemove to JSON. - * @function toJSON - * @memberof google.firestore.v1.DocumentRemove - * @instance - * @returns {Object.} JSON object - */ - DocumentRemove.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DocumentRemove - * @function getTypeUrl - * @memberof google.firestore.v1.DocumentRemove - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DocumentRemove.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.firestore.v1.DocumentRemove"; - }; - - return DocumentRemove; - })(); - - v1.ExistenceFilter = (function() { - - /** - * Properties of an ExistenceFilter. - * @memberof google.firestore.v1 - * @interface IExistenceFilter - * @property {number|null} [targetId] ExistenceFilter targetId - * @property {number|null} [count] ExistenceFilter count - * @property {google.firestore.v1.IBloomFilter|null} [unchangedNames] ExistenceFilter unchangedNames - */ - - /** - * Constructs a new ExistenceFilter. - * @memberof google.firestore.v1 - * @classdesc Represents an ExistenceFilter. - * @implements IExistenceFilter - * @constructor - * @param {google.firestore.v1.IExistenceFilter=} [properties] Properties to set - */ - function ExistenceFilter(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]]; - } - - /** - * ExistenceFilter targetId. - * @member {number} targetId - * @memberof google.firestore.v1.ExistenceFilter - * @instance - */ - ExistenceFilter.prototype.targetId = 0; - - /** - * ExistenceFilter count. - * @member {number} count - * @memberof google.firestore.v1.ExistenceFilter - * @instance - */ - ExistenceFilter.prototype.count = 0; - - /** - * ExistenceFilter unchangedNames. - * @member {google.firestore.v1.IBloomFilter|null|undefined} unchangedNames - * @memberof google.firestore.v1.ExistenceFilter - * @instance - */ - ExistenceFilter.prototype.unchangedNames = null; - - /** - * Creates an ExistenceFilter message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.firestore.v1.ExistenceFilter - * @static - * @param {Object.} object Plain object - * @returns {google.firestore.v1.ExistenceFilter} ExistenceFilter - */ - ExistenceFilter.fromObject = function fromObject(object) { - if (object instanceof $root.google.firestore.v1.ExistenceFilter) - return object; - var message = new $root.google.firestore.v1.ExistenceFilter(); - if (object.targetId != null) - message.targetId = object.targetId | 0; - if (object.count != null) - message.count = object.count | 0; - if (object.unchangedNames != null) { - if (typeof object.unchangedNames !== "object") - throw TypeError(".google.firestore.v1.ExistenceFilter.unchangedNames: object expected"); - message.unchangedNames = $root.google.firestore.v1.BloomFilter.fromObject(object.unchangedNames); - } - return message; - }; - - /** - * Creates a plain object from an ExistenceFilter message. Also converts values to other types if specified. - * @function toObject - * @memberof google.firestore.v1.ExistenceFilter - * @static - * @param {google.firestore.v1.ExistenceFilter} message ExistenceFilter - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExistenceFilter.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.targetId = 0; - object.count = 0; - object.unchangedNames = null; - } - if (message.targetId != null && message.hasOwnProperty("targetId")) - object.targetId = message.targetId; - if (message.count != null && message.hasOwnProperty("count")) - object.count = message.count; - if (message.unchangedNames != null && message.hasOwnProperty("unchangedNames")) - object.unchangedNames = $root.google.firestore.v1.BloomFilter.toObject(message.unchangedNames, options); - return object; - }; - + /** - * Converts this ExistenceFilter to JSON. - * @function toJSON - * @memberof google.firestore.v1.ExistenceFilter - * @instance - * @returns {Object.} JSON object + * Creates a new DocumentRemove instance using the specified properties. + * @function create + * @memberof google.firestore.v1.DocumentRemove + * @static + * @param {google.firestore.v1.IDocumentRemove=} [properties] Properties to set + * @returns {google.firestore.v1.DocumentRemove} DocumentRemove instance */ - ExistenceFilter.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + DocumentRemove.create = function create(properties) { + return new DocumentRemove(properties); }; - + /** - * Gets the default type url for ExistenceFilter - * @function getTypeUrl - * @memberof google.firestore.v1.ExistenceFilter + * Encodes the specified DocumentRemove message. Does not implicitly {@link google.firestore.v1.DocumentRemove.verify|verify} messages. + * @function encode + * @memberof google.firestore.v1.DocumentRemove * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url + * @param {google.firestore.v1.IDocumentRemove} message DocumentRemove message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DocumentRemove.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.document != null && Object.hasOwnProperty.call(message, "document")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.document); + if (message.removedTargetIds != null && message.removedTargetIds.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.removedTargetIds.length; ++i) + writer.int32(message.removedTargetIds[i]); + writer.ldelim(); + } + if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DocumentRemove message, length delimited. Does not implicitly {@link google.firestore.v1.DocumentRemove.verify|verify} messages. + * @function encodeDelimited + * @memberof google.firestore.v1.DocumentRemove + * @static + * @param {google.firestore.v1.IDocumentRemove} message DocumentRemove message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - ExistenceFilter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.firestore.v1.ExistenceFilter"; + DocumentRemove.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); }; - - return ExistenceFilter; - })(); - - return v1; - })(); - - return firestore; - })(); - - google.api = (function() { - - /** - * Namespace api. - * @memberof google - * @namespace - */ - var api = {}; - - api.Http = (function() { - - /** - * Properties of a Http. - * @memberof google.api - * @interface IHttp - * @property {Array.|null} [rules] Http rules - */ - - /** - * Constructs a new Http. - * @memberof google.api - * @classdesc Represents a Http. - * @implements IHttp - * @constructor - * @param {google.api.IHttp=} [properties] Properties to set - */ - function Http(properties) { - this.rules = []; - 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]]; - } - - /** - * Http rules. - * @member {Array.} rules - * @memberof google.api.Http - * @instance - */ - Http.prototype.rules = $util.emptyArray; - - /** - * Creates a Http message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.Http - * @static - * @param {Object.} object Plain object - * @returns {google.api.Http} Http - */ - Http.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.Http) - return object; - var message = new $root.google.api.Http(); - if (object.rules) { - if (!Array.isArray(object.rules)) - throw TypeError(".google.api.Http.rules: array expected"); - message.rules = []; - for (var i = 0; i < object.rules.length; ++i) { - if (typeof object.rules[i] !== "object") - throw TypeError(".google.api.Http.rules: object expected"); - message.rules[i] = $root.google.api.HttpRule.fromObject(object.rules[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a Http message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.Http - * @static - * @param {google.api.Http} message Http - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Http.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.rules = []; - if (message.rules && message.rules.length) { - object.rules = []; - for (var j = 0; j < message.rules.length; ++j) - object.rules[j] = $root.google.api.HttpRule.toObject(message.rules[j], options); - } - return object; - }; - - /** - * Converts this Http to JSON. - * @function toJSON - * @memberof google.api.Http - * @instance - * @returns {Object.} JSON object - */ - Http.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Http - * @function getTypeUrl - * @memberof google.api.Http - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Http.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.Http"; - }; - - return Http; - })(); - - api.HttpRule = (function() { - - /** - * Properties of a HttpRule. - * @memberof google.api - * @interface IHttpRule - * @property {string|null} [get] HttpRule get - * @property {string|null} [put] HttpRule put - * @property {string|null} [post] HttpRule post - * @property {string|null} ["delete"] HttpRule delete - * @property {string|null} [patch] HttpRule patch - * @property {google.api.ICustomHttpPattern|null} [custom] HttpRule custom - * @property {string|null} [selector] HttpRule selector - * @property {string|null} [body] HttpRule body - * @property {Array.|null} [additionalBindings] HttpRule additionalBindings - */ - - /** - * Constructs a new HttpRule. - * @memberof google.api - * @classdesc Represents a HttpRule. - * @implements IHttpRule - * @constructor - * @param {google.api.IHttpRule=} [properties] Properties to set - */ - function HttpRule(properties) { - this.additionalBindings = []; - 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]]; - } - - /** - * HttpRule get. - * @member {string|null|undefined} get - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.get = null; - - /** - * HttpRule put. - * @member {string|null|undefined} put - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.put = null; - - /** - * HttpRule post. - * @member {string|null|undefined} post - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.post = null; - - /** - * HttpRule delete. - * @member {string|null|undefined} delete - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype["delete"] = null; - - /** - * HttpRule patch. - * @member {string|null|undefined} patch - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.patch = null; - - /** - * HttpRule custom. - * @member {google.api.ICustomHttpPattern|null|undefined} custom - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.custom = null; - - /** - * HttpRule selector. - * @member {string} selector - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.selector = ""; - - /** - * HttpRule body. - * @member {string} body - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.body = ""; - - /** - * HttpRule additionalBindings. - * @member {Array.} additionalBindings - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.additionalBindings = $util.emptyArray; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * HttpRule pattern. - * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern - * @memberof google.api.HttpRule - * @instance - */ - Object.defineProperty(HttpRule.prototype, "pattern", { - get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.HttpRule - * @static - * @param {Object.} object Plain object - * @returns {google.api.HttpRule} HttpRule - */ - HttpRule.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.HttpRule) + + /** + * Decodes a DocumentRemove message from the specified reader or buffer. + * @function decode + * @memberof google.firestore.v1.DocumentRemove + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.firestore.v1.DocumentRemove} DocumentRemove + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DocumentRemove.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.firestore.v1.DocumentRemove(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.document = reader.string(); + break; + } + case 2: { + if (!(message.removedTargetIds && message.removedTargetIds.length)) + message.removedTargetIds = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.removedTargetIds.push(reader.int32()); + } else + message.removedTargetIds.push(reader.int32()); + break; + } + case 4: { + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DocumentRemove message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.firestore.v1.DocumentRemove + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.firestore.v1.DocumentRemove} DocumentRemove + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DocumentRemove.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DocumentRemove message. + * @function verify + * @memberof google.firestore.v1.DocumentRemove + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DocumentRemove.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.document != null && message.hasOwnProperty("document")) + if (!$util.isString(message.document)) + return "document: string expected"; + if (message.removedTargetIds != null && message.hasOwnProperty("removedTargetIds")) { + if (!Array.isArray(message.removedTargetIds)) + return "removedTargetIds: array expected"; + for (var i = 0; i < message.removedTargetIds.length; ++i) + if (!$util.isInteger(message.removedTargetIds[i])) + return "removedTargetIds: integer[] expected"; + } + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; + } + return null; + }; + + /** + * Creates a DocumentRemove message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.firestore.v1.DocumentRemove + * @static + * @param {Object.} object Plain object + * @returns {google.firestore.v1.DocumentRemove} DocumentRemove + */ + DocumentRemove.fromObject = function fromObject(object) { + if (object instanceof $root.google.firestore.v1.DocumentRemove) + return object; + var message = new $root.google.firestore.v1.DocumentRemove(); + if (object.document != null) + message.document = String(object.document); + if (object.removedTargetIds) { + if (!Array.isArray(object.removedTargetIds)) + throw TypeError(".google.firestore.v1.DocumentRemove.removedTargetIds: array expected"); + message.removedTargetIds = []; + for (var i = 0; i < object.removedTargetIds.length; ++i) + message.removedTargetIds[i] = object.removedTargetIds[i] | 0; + } + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.firestore.v1.DocumentRemove.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); + } + return message; + }; + + /** + * Creates a plain object from a DocumentRemove message. Also converts values to other types if specified. + * @function toObject + * @memberof google.firestore.v1.DocumentRemove + * @static + * @param {google.firestore.v1.DocumentRemove} message DocumentRemove + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DocumentRemove.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.removedTargetIds = []; + if (options.defaults) { + object.document = ""; + object.readTime = null; + } + if (message.document != null && message.hasOwnProperty("document")) + object.document = message.document; + if (message.removedTargetIds && message.removedTargetIds.length) { + object.removedTargetIds = []; + for (var j = 0; j < message.removedTargetIds.length; ++j) + object.removedTargetIds[j] = message.removedTargetIds[j]; + } + if (message.readTime != null && message.hasOwnProperty("readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); return object; - var message = new $root.google.api.HttpRule(); - if (object.get != null) - message.get = String(object.get); - if (object.put != null) - message.put = String(object.put); - if (object.post != null) - message.post = String(object.post); - if (object["delete"] != null) - message["delete"] = String(object["delete"]); - if (object.patch != null) - message.patch = String(object.patch); - if (object.custom != null) { - if (typeof object.custom !== "object") - throw TypeError(".google.api.HttpRule.custom: object expected"); - message.custom = $root.google.api.CustomHttpPattern.fromObject(object.custom); + }; + + /** + * Converts this DocumentRemove to JSON. + * @function toJSON + * @memberof google.firestore.v1.DocumentRemove + * @instance + * @returns {Object.} JSON object + */ + DocumentRemove.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DocumentRemove + * @function getTypeUrl + * @memberof google.firestore.v1.DocumentRemove + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DocumentRemove.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.firestore.v1.DocumentRemove"; + }; + + return DocumentRemove; + })(); + + v1.ExistenceFilter = (function() { + + /** + * Properties of an ExistenceFilter. + * @memberof google.firestore.v1 + * @interface IExistenceFilter + * @property {number|null} [targetId] ExistenceFilter targetId + * @property {number|null} [count] ExistenceFilter count + * @property {google.firestore.v1.IBloomFilter|null} [unchangedNames] ExistenceFilter unchangedNames + */ + + /** + * Constructs a new ExistenceFilter. + * @memberof google.firestore.v1 + * @classdesc Represents an ExistenceFilter. + * @implements IExistenceFilter + * @constructor + * @param {google.firestore.v1.IExistenceFilter=} [properties] Properties to set + */ + function ExistenceFilter(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]]; } - if (object.selector != null) - message.selector = String(object.selector); - if (object.body != null) - message.body = String(object.body); - if (object.additionalBindings) { - if (!Array.isArray(object.additionalBindings)) - throw TypeError(".google.api.HttpRule.additionalBindings: array expected"); - message.additionalBindings = []; - for (var i = 0; i < object.additionalBindings.length; ++i) { - if (typeof object.additionalBindings[i] !== "object") - throw TypeError(".google.api.HttpRule.additionalBindings: object expected"); - message.additionalBindings[i] = $root.google.api.HttpRule.fromObject(object.additionalBindings[i]); + + /** + * ExistenceFilter targetId. + * @member {number} targetId + * @memberof google.firestore.v1.ExistenceFilter + * @instance + */ + ExistenceFilter.prototype.targetId = 0; + + /** + * ExistenceFilter count. + * @member {number} count + * @memberof google.firestore.v1.ExistenceFilter + * @instance + */ + ExistenceFilter.prototype.count = 0; + + /** + * ExistenceFilter unchangedNames. + * @member {google.firestore.v1.IBloomFilter|null|undefined} unchangedNames + * @memberof google.firestore.v1.ExistenceFilter + * @instance + */ + ExistenceFilter.prototype.unchangedNames = null; + + /** + * Creates a new ExistenceFilter instance using the specified properties. + * @function create + * @memberof google.firestore.v1.ExistenceFilter + * @static + * @param {google.firestore.v1.IExistenceFilter=} [properties] Properties to set + * @returns {google.firestore.v1.ExistenceFilter} ExistenceFilter instance + */ + ExistenceFilter.create = function create(properties) { + return new ExistenceFilter(properties); + }; + + /** + * Encodes the specified ExistenceFilter message. Does not implicitly {@link google.firestore.v1.ExistenceFilter.verify|verify} messages. + * @function encode + * @memberof google.firestore.v1.ExistenceFilter + * @static + * @param {google.firestore.v1.IExistenceFilter} message ExistenceFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExistenceFilter.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.targetId != null && Object.hasOwnProperty.call(message, "targetId")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.targetId); + if (message.count != null && Object.hasOwnProperty.call(message, "count")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.count); + if (message.unchangedNames != null && Object.hasOwnProperty.call(message, "unchangedNames")) + $root.google.firestore.v1.BloomFilter.encode(message.unchangedNames, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExistenceFilter message, length delimited. Does not implicitly {@link google.firestore.v1.ExistenceFilter.verify|verify} messages. + * @function encodeDelimited + * @memberof google.firestore.v1.ExistenceFilter + * @static + * @param {google.firestore.v1.IExistenceFilter} message ExistenceFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExistenceFilter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExistenceFilter message from the specified reader or buffer. + * @function decode + * @memberof google.firestore.v1.ExistenceFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.firestore.v1.ExistenceFilter} ExistenceFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExistenceFilter.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.firestore.v1.ExistenceFilter(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.targetId = reader.int32(); + break; + } + case 2: { + message.count = reader.int32(); + break; + } + case 3: { + message.unchangedNames = $root.google.firestore.v1.BloomFilter.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExistenceFilter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.firestore.v1.ExistenceFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.firestore.v1.ExistenceFilter} ExistenceFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExistenceFilter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExistenceFilter message. + * @function verify + * @memberof google.firestore.v1.ExistenceFilter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExistenceFilter.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.targetId != null && message.hasOwnProperty("targetId")) + if (!$util.isInteger(message.targetId)) + return "targetId: integer expected"; + if (message.count != null && message.hasOwnProperty("count")) + if (!$util.isInteger(message.count)) + return "count: integer expected"; + if (message.unchangedNames != null && message.hasOwnProperty("unchangedNames")) { + var error = $root.google.firestore.v1.BloomFilter.verify(message.unchangedNames); + if (error) + return "unchangedNames." + error; + } + return null; + }; + + /** + * Creates an ExistenceFilter message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.firestore.v1.ExistenceFilter + * @static + * @param {Object.} object Plain object + * @returns {google.firestore.v1.ExistenceFilter} ExistenceFilter + */ + ExistenceFilter.fromObject = function fromObject(object) { + if (object instanceof $root.google.firestore.v1.ExistenceFilter) + return object; + var message = new $root.google.firestore.v1.ExistenceFilter(); + if (object.targetId != null) + message.targetId = object.targetId | 0; + if (object.count != null) + message.count = object.count | 0; + if (object.unchangedNames != null) { + if (typeof object.unchangedNames !== "object") + throw TypeError(".google.firestore.v1.ExistenceFilter.unchangedNames: object expected"); + message.unchangedNames = $root.google.firestore.v1.BloomFilter.fromObject(object.unchangedNames); } - } - return message; - }; - - /** - * Creates a plain object from a HttpRule message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.HttpRule - * @static - * @param {google.api.HttpRule} message HttpRule - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - HttpRule.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.additionalBindings = []; - if (options.defaults) { - object.selector = ""; - object.body = ""; - } - if (message.selector != null && message.hasOwnProperty("selector")) - object.selector = message.selector; - if (message.get != null && message.hasOwnProperty("get")) { - object.get = message.get; - if (options.oneofs) - object.pattern = "get"; - } - if (message.put != null && message.hasOwnProperty("put")) { - object.put = message.put; - if (options.oneofs) - object.pattern = "put"; - } - if (message.post != null && message.hasOwnProperty("post")) { - object.post = message.post; - if (options.oneofs) - object.pattern = "post"; - } - if (message["delete"] != null && message.hasOwnProperty("delete")) { - object["delete"] = message["delete"]; - if (options.oneofs) - object.pattern = "delete"; - } - if (message.patch != null && message.hasOwnProperty("patch")) { - object.patch = message.patch; - if (options.oneofs) - object.pattern = "patch"; - } - if (message.body != null && message.hasOwnProperty("body")) - object.body = message.body; - if (message.custom != null && message.hasOwnProperty("custom")) { - object.custom = $root.google.api.CustomHttpPattern.toObject(message.custom, options); - if (options.oneofs) - object.pattern = "custom"; - } - if (message.additionalBindings && message.additionalBindings.length) { - object.additionalBindings = []; - for (var j = 0; j < message.additionalBindings.length; ++j) - object.additionalBindings[j] = $root.google.api.HttpRule.toObject(message.additionalBindings[j], options); - } - return object; - }; - - /** - * Converts this HttpRule to JSON. - * @function toJSON - * @memberof google.api.HttpRule - * @instance - * @returns {Object.} JSON object - */ - HttpRule.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for HttpRule - * @function getTypeUrl - * @memberof google.api.HttpRule - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - HttpRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.HttpRule"; - }; - - return HttpRule; - })(); - - api.CustomHttpPattern = (function() { - - /** - * Properties of a CustomHttpPattern. - * @memberof google.api - * @interface ICustomHttpPattern - * @property {string|null} [kind] CustomHttpPattern kind - * @property {string|null} [path] CustomHttpPattern path - */ - - /** - * Constructs a new CustomHttpPattern. - * @memberof google.api - * @classdesc Represents a CustomHttpPattern. - * @implements ICustomHttpPattern - * @constructor - * @param {google.api.ICustomHttpPattern=} [properties] Properties to set - */ - function CustomHttpPattern(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]]; - } - - /** - * CustomHttpPattern kind. - * @member {string} kind - * @memberof google.api.CustomHttpPattern - * @instance - */ - CustomHttpPattern.prototype.kind = ""; - - /** - * CustomHttpPattern path. - * @member {string} path - * @memberof google.api.CustomHttpPattern - * @instance - */ - CustomHttpPattern.prototype.path = ""; - - /** - * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.CustomHttpPattern - * @static - * @param {Object.} object Plain object - * @returns {google.api.CustomHttpPattern} CustomHttpPattern - */ - CustomHttpPattern.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.CustomHttpPattern) + return message; + }; + + /** + * Creates a plain object from an ExistenceFilter message. Also converts values to other types if specified. + * @function toObject + * @memberof google.firestore.v1.ExistenceFilter + * @static + * @param {google.firestore.v1.ExistenceFilter} message ExistenceFilter + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExistenceFilter.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.targetId = 0; + object.count = 0; + object.unchangedNames = null; + } + if (message.targetId != null && message.hasOwnProperty("targetId")) + object.targetId = message.targetId; + if (message.count != null && message.hasOwnProperty("count")) + object.count = message.count; + if (message.unchangedNames != null && message.hasOwnProperty("unchangedNames")) + object.unchangedNames = $root.google.firestore.v1.BloomFilter.toObject(message.unchangedNames, options); return object; - var message = new $root.google.api.CustomHttpPattern(); - if (object.kind != null) - message.kind = String(object.kind); - if (object.path != null) - message.path = String(object.path); - return message; - }; - - /** - * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.CustomHttpPattern - * @static - * @param {google.api.CustomHttpPattern} message CustomHttpPattern - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CustomHttpPattern.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.kind = ""; - object.path = ""; - } - if (message.kind != null && message.hasOwnProperty("kind")) - object.kind = message.kind; - if (message.path != null && message.hasOwnProperty("path")) - object.path = message.path; - return object; - }; - - /** - * Converts this CustomHttpPattern to JSON. - * @function toJSON - * @memberof google.api.CustomHttpPattern - * @instance - * @returns {Object.} JSON object - */ - CustomHttpPattern.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CustomHttpPattern - * @function getTypeUrl - * @memberof google.api.CustomHttpPattern - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CustomHttpPattern.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.CustomHttpPattern"; - }; - - return CustomHttpPattern; + }; + + /** + * Converts this ExistenceFilter to JSON. + * @function toJSON + * @memberof google.firestore.v1.ExistenceFilter + * @instance + * @returns {Object.} JSON object + */ + ExistenceFilter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExistenceFilter + * @function getTypeUrl + * @memberof google.firestore.v1.ExistenceFilter + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExistenceFilter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.firestore.v1.ExistenceFilter"; + }; + + return ExistenceFilter; + })(); + + return v1; })(); - - api.CommonLanguageSettings = (function() { - + + return firestore; + })(); + + google.type = (function() { + + /** + * Namespace type. + * @memberof google + * @namespace + */ + var type = {}; + + type.LatLng = (function() { + /** - * Properties of a CommonLanguageSettings. - * @memberof google.api - * @interface ICommonLanguageSettings - * @property {string|null} [referenceDocsUri] CommonLanguageSettings referenceDocsUri - * @property {Array.|null} [destinations] CommonLanguageSettings destinations + * Properties of a LatLng. + * @memberof google.type + * @interface ILatLng + * @property {number|null} [latitude] LatLng latitude + * @property {number|null} [longitude] LatLng longitude */ - + /** - * Constructs a new CommonLanguageSettings. - * @memberof google.api - * @classdesc Represents a CommonLanguageSettings. - * @implements ICommonLanguageSettings + * Constructs a new LatLng. + * @memberof google.type + * @classdesc Represents a LatLng. + * @implements ILatLng * @constructor - * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set + * @param {google.type.ILatLng=} [properties] Properties to set */ - function CommonLanguageSettings(properties) { - this.destinations = []; + function LatLng(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]]; } - + /** - * CommonLanguageSettings referenceDocsUri. - * @member {string} referenceDocsUri - * @memberof google.api.CommonLanguageSettings + * LatLng latitude. + * @member {number} latitude + * @memberof google.type.LatLng * @instance */ - CommonLanguageSettings.prototype.referenceDocsUri = ""; - + LatLng.prototype.latitude = 0; + /** - * CommonLanguageSettings destinations. - * @member {Array.} destinations - * @memberof google.api.CommonLanguageSettings + * LatLng longitude. + * @member {number} longitude + * @memberof google.type.LatLng * @instance */ - CommonLanguageSettings.prototype.destinations = $util.emptyArray; - + LatLng.prototype.longitude = 0; + /** - * Creates a CommonLanguageSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.CommonLanguageSettings + * Creates a new LatLng instance using the specified properties. + * @function create + * @memberof google.type.LatLng * @static - * @param {Object.} object Plain object - * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings + * @param {google.type.ILatLng=} [properties] Properties to set + * @returns {google.type.LatLng} LatLng instance */ - CommonLanguageSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.CommonLanguageSettings) - return object; - var message = new $root.google.api.CommonLanguageSettings(); - if (object.referenceDocsUri != null) - message.referenceDocsUri = String(object.referenceDocsUri); - if (object.destinations) { - if (!Array.isArray(object.destinations)) - throw TypeError(".google.api.CommonLanguageSettings.destinations: array expected"); - message.destinations = []; - for (var i = 0; i < object.destinations.length; ++i) - switch (object.destinations[i]) { - default: - if (typeof object.destinations[i] === "number") { - message.destinations[i] = object.destinations[i]; - break; - } - case "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED": - case 0: - message.destinations[i] = 0; - break; - case "GITHUB": - case 10: - message.destinations[i] = 10; + LatLng.create = function create(properties) { + return new LatLng(properties); + }; + + /** + * Encodes the specified LatLng message. Does not implicitly {@link google.type.LatLng.verify|verify} messages. + * @function encode + * @memberof google.type.LatLng + * @static + * @param {google.type.ILatLng} message LatLng message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LatLng.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.latitude != null && Object.hasOwnProperty.call(message, "latitude")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.latitude); + if (message.longitude != null && Object.hasOwnProperty.call(message, "longitude")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.longitude); + return writer; + }; + + /** + * Encodes the specified LatLng message, length delimited. Does not implicitly {@link google.type.LatLng.verify|verify} messages. + * @function encodeDelimited + * @memberof google.type.LatLng + * @static + * @param {google.type.ILatLng} message LatLng message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LatLng.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LatLng message from the specified reader or buffer. + * @function decode + * @memberof google.type.LatLng + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.type.LatLng} LatLng + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LatLng.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.type.LatLng(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.latitude = reader.double(); break; - case "PACKAGE_MANAGER": - case 20: - message.destinations[i] = 20; + } + case 2: { + message.longitude = reader.double(); break; } + default: + reader.skipType(tag & 7); + break; + } } return message; }; - + /** - * Creates a plain object from a CommonLanguageSettings message. Also converts values to other types if specified. + * Decodes a LatLng message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.type.LatLng + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.type.LatLng} LatLng + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LatLng.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LatLng message. + * @function verify + * @memberof google.type.LatLng + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LatLng.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.latitude != null && message.hasOwnProperty("latitude")) + if (typeof message.latitude !== "number") + return "latitude: number expected"; + if (message.longitude != null && message.hasOwnProperty("longitude")) + if (typeof message.longitude !== "number") + return "longitude: number expected"; + return null; + }; + + /** + * Creates a LatLng message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.type.LatLng + * @static + * @param {Object.} object Plain object + * @returns {google.type.LatLng} LatLng + */ + LatLng.fromObject = function fromObject(object) { + if (object instanceof $root.google.type.LatLng) + return object; + var message = new $root.google.type.LatLng(); + if (object.latitude != null) + message.latitude = Number(object.latitude); + if (object.longitude != null) + message.longitude = Number(object.longitude); + return message; + }; + + /** + * Creates a plain object from a LatLng message. Also converts values to other types if specified. * @function toObject - * @memberof google.api.CommonLanguageSettings + * @memberof google.type.LatLng * @static - * @param {google.api.CommonLanguageSettings} message CommonLanguageSettings + * @param {google.type.LatLng} message LatLng * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CommonLanguageSettings.toObject = function toObject(message, options) { + LatLng.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.destinations = []; - if (options.defaults) - object.referenceDocsUri = ""; - if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) - object.referenceDocsUri = message.referenceDocsUri; - if (message.destinations && message.destinations.length) { - object.destinations = []; - for (var j = 0; j < message.destinations.length; ++j) - object.destinations[j] = options.enums === String ? $root.google.api.ClientLibraryDestination[message.destinations[j]] === undefined ? message.destinations[j] : $root.google.api.ClientLibraryDestination[message.destinations[j]] : message.destinations[j]; + if (options.defaults) { + object.latitude = 0; + object.longitude = 0; } + if (message.latitude != null && message.hasOwnProperty("latitude")) + object.latitude = options.json && !isFinite(message.latitude) ? String(message.latitude) : message.latitude; + if (message.longitude != null && message.hasOwnProperty("longitude")) + object.longitude = options.json && !isFinite(message.longitude) ? String(message.longitude) : message.longitude; return object; }; - + /** - * Converts this CommonLanguageSettings to JSON. + * Converts this LatLng to JSON. * @function toJSON - * @memberof google.api.CommonLanguageSettings + * @memberof google.type.LatLng * @instance * @returns {Object.} JSON object */ - CommonLanguageSettings.prototype.toJSON = function toJSON() { + LatLng.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - + /** - * Gets the default type url for CommonLanguageSettings + * Gets the default type url for LatLng * @function getTypeUrl - * @memberof google.api.CommonLanguageSettings + * @memberof google.type.LatLng * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - CommonLanguageSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + LatLng.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.api.CommonLanguageSettings"; + return typeUrlPrefix + "/google.type.LatLng"; }; - - return CommonLanguageSettings; + + return LatLng; })(); - - api.ClientLibrarySettings = (function() { - - /** - * Properties of a ClientLibrarySettings. - * @memberof google.api - * @interface IClientLibrarySettings - * @property {string|null} [version] ClientLibrarySettings version - * @property {google.api.LaunchStage|null} [launchStage] ClientLibrarySettings launchStage - * @property {boolean|null} [restNumericEnums] ClientLibrarySettings restNumericEnums - * @property {google.api.IJavaSettings|null} [javaSettings] ClientLibrarySettings javaSettings - * @property {google.api.ICppSettings|null} [cppSettings] ClientLibrarySettings cppSettings - * @property {google.api.IPhpSettings|null} [phpSettings] ClientLibrarySettings phpSettings - * @property {google.api.IPythonSettings|null} [pythonSettings] ClientLibrarySettings pythonSettings - * @property {google.api.INodeSettings|null} [nodeSettings] ClientLibrarySettings nodeSettings - * @property {google.api.IDotnetSettings|null} [dotnetSettings] ClientLibrarySettings dotnetSettings - * @property {google.api.IRubySettings|null} [rubySettings] ClientLibrarySettings rubySettings - * @property {google.api.IGoSettings|null} [goSettings] ClientLibrarySettings goSettings - */ - - /** - * Constructs a new ClientLibrarySettings. - * @memberof google.api - * @classdesc Represents a ClientLibrarySettings. - * @implements IClientLibrarySettings - * @constructor - * @param {google.api.IClientLibrarySettings=} [properties] Properties to set - */ - function ClientLibrarySettings(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]]; - } - - /** - * ClientLibrarySettings version. - * @member {string} version - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.version = ""; - - /** - * ClientLibrarySettings launchStage. - * @member {google.api.LaunchStage} launchStage - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.launchStage = 0; - - /** - * ClientLibrarySettings restNumericEnums. - * @member {boolean} restNumericEnums - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.restNumericEnums = false; - - /** - * ClientLibrarySettings javaSettings. - * @member {google.api.IJavaSettings|null|undefined} javaSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.javaSettings = null; - + + return type; + })(); + + google.api = (function() { + + /** + * Namespace api. + * @memberof google + * @namespace + */ + var api = {}; + + api.Http = (function() { + /** - * ClientLibrarySettings cppSettings. - * @member {google.api.ICppSettings|null|undefined} cppSettings - * @memberof google.api.ClientLibrarySettings - * @instance + * Properties of a Http. + * @memberof google.api + * @interface IHttp + * @property {Array.|null} [rules] Http rules + * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion */ - ClientLibrarySettings.prototype.cppSettings = null; - + /** - * ClientLibrarySettings phpSettings. - * @member {google.api.IPhpSettings|null|undefined} phpSettings - * @memberof google.api.ClientLibrarySettings - * @instance + * Constructs a new Http. + * @memberof google.api + * @classdesc Represents a Http. + * @implements IHttp + * @constructor + * @param {google.api.IHttp=} [properties] Properties to set */ - ClientLibrarySettings.prototype.phpSettings = null; - + function Http(properties) { + this.rules = []; + 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]]; + } + /** - * ClientLibrarySettings pythonSettings. - * @member {google.api.IPythonSettings|null|undefined} pythonSettings - * @memberof google.api.ClientLibrarySettings + * Http rules. + * @member {Array.} rules + * @memberof google.api.Http * @instance */ - ClientLibrarySettings.prototype.pythonSettings = null; - + Http.prototype.rules = $util.emptyArray; + /** - * ClientLibrarySettings nodeSettings. - * @member {google.api.INodeSettings|null|undefined} nodeSettings - * @memberof google.api.ClientLibrarySettings + * Http fullyDecodeReservedExpansion. + * @member {boolean} fullyDecodeReservedExpansion + * @memberof google.api.Http * @instance */ - ClientLibrarySettings.prototype.nodeSettings = null; - + Http.prototype.fullyDecodeReservedExpansion = false; + /** - * ClientLibrarySettings dotnetSettings. - * @member {google.api.IDotnetSettings|null|undefined} dotnetSettings - * @memberof google.api.ClientLibrarySettings - * @instance + * Creates a new Http instance using the specified properties. + * @function create + * @memberof google.api.Http + * @static + * @param {google.api.IHttp=} [properties] Properties to set + * @returns {google.api.Http} Http instance */ - ClientLibrarySettings.prototype.dotnetSettings = null; - + Http.create = function create(properties) { + return new Http(properties); + }; + /** - * ClientLibrarySettings rubySettings. - * @member {google.api.IRubySettings|null|undefined} rubySettings - * @memberof google.api.ClientLibrarySettings - * @instance + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encode + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rules != null && message.rules.length) + for (var i = 0; i < message.rules.length; ++i) + $root.google.api.HttpRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.fullyDecodeReservedExpansion != null && Object.hasOwnProperty.call(message, "fullyDecodeReservedExpansion")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); + return writer; + }; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - ClientLibrarySettings.prototype.rubySettings = null; - + Http.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + /** - * ClientLibrarySettings goSettings. - * @member {google.api.IGoSettings|null|undefined} goSettings - * @memberof google.api.ClientLibrarySettings - * @instance + * Decodes a Http message from the specified reader or buffer. + * @function decode + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Http(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.rules && message.rules.length)) + message.rules = []; + message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + } + case 2: { + message.fullyDecodeReservedExpansion = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ClientLibrarySettings.prototype.goSettings = null; - + Http.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + /** - * Creates a ClientLibrarySettings message from a plain object. Also converts values to their respective internal types. + * Verifies a Http message. + * @function verify + * @memberof google.api.Http + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Http.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rules != null && message.hasOwnProperty("rules")) { + if (!Array.isArray(message.rules)) + return "rules: array expected"; + for (var i = 0; i < message.rules.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.rules[i]); + if (error) + return "rules." + error; + } + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + if (typeof message.fullyDecodeReservedExpansion !== "boolean") + return "fullyDecodeReservedExpansion: boolean expected"; + return null; + }; + + /** + * Creates a Http message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.api.ClientLibrarySettings + * @memberof google.api.Http * @static * @param {Object.} object Plain object - * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + * @returns {google.api.Http} Http */ - ClientLibrarySettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.ClientLibrarySettings) + Http.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Http) return object; - var message = new $root.google.api.ClientLibrarySettings(); - if (object.version != null) - message.version = String(object.version); - switch (object.launchStage) { - default: - if (typeof object.launchStage === "number") { - message.launchStage = object.launchStage; - break; + var message = new $root.google.api.Http(); + if (object.rules) { + if (!Array.isArray(object.rules)) + throw TypeError(".google.api.Http.rules: array expected"); + message.rules = []; + for (var i = 0; i < object.rules.length; ++i) { + if (typeof object.rules[i] !== "object") + throw TypeError(".google.api.Http.rules: object expected"); + message.rules[i] = $root.google.api.HttpRule.fromObject(object.rules[i]); } - break; - case "LAUNCH_STAGE_UNSPECIFIED": - case 0: - message.launchStage = 0; - break; - case "UNIMPLEMENTED": - case 6: - message.launchStage = 6; - break; - case "PRELAUNCH": - case 7: - message.launchStage = 7; - break; - case "EARLY_ACCESS": - case 1: - message.launchStage = 1; - break; - case "ALPHA": - case 2: - message.launchStage = 2; - break; - case "BETA": - case 3: - message.launchStage = 3; - break; - case "GA": - case 4: - message.launchStage = 4; - break; - case "DEPRECATED": - case 5: - message.launchStage = 5; - break; - } - if (object.restNumericEnums != null) - message.restNumericEnums = Boolean(object.restNumericEnums); - if (object.javaSettings != null) { - if (typeof object.javaSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.javaSettings: object expected"); - message.javaSettings = $root.google.api.JavaSettings.fromObject(object.javaSettings); - } - if (object.cppSettings != null) { - if (typeof object.cppSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.cppSettings: object expected"); - message.cppSettings = $root.google.api.CppSettings.fromObject(object.cppSettings); - } - if (object.phpSettings != null) { - if (typeof object.phpSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.phpSettings: object expected"); - message.phpSettings = $root.google.api.PhpSettings.fromObject(object.phpSettings); - } - if (object.pythonSettings != null) { - if (typeof object.pythonSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.pythonSettings: object expected"); - message.pythonSettings = $root.google.api.PythonSettings.fromObject(object.pythonSettings); - } - if (object.nodeSettings != null) { - if (typeof object.nodeSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.nodeSettings: object expected"); - message.nodeSettings = $root.google.api.NodeSettings.fromObject(object.nodeSettings); - } - if (object.dotnetSettings != null) { - if (typeof object.dotnetSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.dotnetSettings: object expected"); - message.dotnetSettings = $root.google.api.DotnetSettings.fromObject(object.dotnetSettings); - } - if (object.rubySettings != null) { - if (typeof object.rubySettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.rubySettings: object expected"); - message.rubySettings = $root.google.api.RubySettings.fromObject(object.rubySettings); - } - if (object.goSettings != null) { - if (typeof object.goSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.goSettings: object expected"); - message.goSettings = $root.google.api.GoSettings.fromObject(object.goSettings); } + if (object.fullyDecodeReservedExpansion != null) + message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion); return message; }; - + /** - * Creates a plain object from a ClientLibrarySettings message. Also converts values to other types if specified. + * Creates a plain object from a Http message. Also converts values to other types if specified. * @function toObject - * @memberof google.api.ClientLibrarySettings + * @memberof google.api.Http * @static - * @param {google.api.ClientLibrarySettings} message ClientLibrarySettings + * @param {google.api.Http} message Http * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ClientLibrarySettings.toObject = function toObject(message, options) { + Http.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.version = ""; - object.launchStage = options.enums === String ? "LAUNCH_STAGE_UNSPECIFIED" : 0; - object.restNumericEnums = false; - object.javaSettings = null; - object.cppSettings = null; - object.phpSettings = null; - object.pythonSettings = null; - object.nodeSettings = null; - object.dotnetSettings = null; - object.rubySettings = null; - object.goSettings = null; + if (options.arrays || options.defaults) + object.rules = []; + if (options.defaults) + object.fullyDecodeReservedExpansion = false; + if (message.rules && message.rules.length) { + object.rules = []; + for (var j = 0; j < message.rules.length; ++j) + object.rules[j] = $root.google.api.HttpRule.toObject(message.rules[j], options); } - if (message.version != null && message.hasOwnProperty("version")) - object.version = message.version; - if (message.launchStage != null && message.hasOwnProperty("launchStage")) - object.launchStage = options.enums === String ? $root.google.api.LaunchStage[message.launchStage] === undefined ? message.launchStage : $root.google.api.LaunchStage[message.launchStage] : message.launchStage; - if (message.restNumericEnums != null && message.hasOwnProperty("restNumericEnums")) - object.restNumericEnums = message.restNumericEnums; - if (message.javaSettings != null && message.hasOwnProperty("javaSettings")) - object.javaSettings = $root.google.api.JavaSettings.toObject(message.javaSettings, options); - if (message.cppSettings != null && message.hasOwnProperty("cppSettings")) - object.cppSettings = $root.google.api.CppSettings.toObject(message.cppSettings, options); - if (message.phpSettings != null && message.hasOwnProperty("phpSettings")) - object.phpSettings = $root.google.api.PhpSettings.toObject(message.phpSettings, options); - if (message.pythonSettings != null && message.hasOwnProperty("pythonSettings")) - object.pythonSettings = $root.google.api.PythonSettings.toObject(message.pythonSettings, options); - if (message.nodeSettings != null && message.hasOwnProperty("nodeSettings")) - object.nodeSettings = $root.google.api.NodeSettings.toObject(message.nodeSettings, options); - if (message.dotnetSettings != null && message.hasOwnProperty("dotnetSettings")) - object.dotnetSettings = $root.google.api.DotnetSettings.toObject(message.dotnetSettings, options); - if (message.rubySettings != null && message.hasOwnProperty("rubySettings")) - object.rubySettings = $root.google.api.RubySettings.toObject(message.rubySettings, options); - if (message.goSettings != null && message.hasOwnProperty("goSettings")) - object.goSettings = $root.google.api.GoSettings.toObject(message.goSettings, options); + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; return object; }; - + /** - * Converts this ClientLibrarySettings to JSON. + * Converts this Http to JSON. * @function toJSON - * @memberof google.api.ClientLibrarySettings + * @memberof google.api.Http * @instance * @returns {Object.} JSON object */ - ClientLibrarySettings.prototype.toJSON = function toJSON() { + Http.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - + /** - * Gets the default type url for ClientLibrarySettings + * Gets the default type url for Http * @function getTypeUrl - * @memberof google.api.ClientLibrarySettings + * @memberof google.api.Http * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ClientLibrarySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Http.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.api.ClientLibrarySettings"; + return typeUrlPrefix + "/google.api.Http"; }; - - return ClientLibrarySettings; + + return Http; })(); - - api.Publishing = (function() { - + + api.HttpRule = (function() { + /** - * Properties of a Publishing. + * Properties of a HttpRule. * @memberof google.api - * @interface IPublishing - * @property {Array.|null} [methodSettings] Publishing methodSettings - * @property {string|null} [newIssueUri] Publishing newIssueUri - * @property {string|null} [documentationUri] Publishing documentationUri - * @property {string|null} [apiShortName] Publishing apiShortName - * @property {string|null} [githubLabel] Publishing githubLabel - * @property {Array.|null} [codeownerGithubTeams] Publishing codeownerGithubTeams - * @property {string|null} [docTagPrefix] Publishing docTagPrefix - * @property {google.api.ClientLibraryOrganization|null} [organization] Publishing organization - * @property {Array.|null} [librarySettings] Publishing librarySettings - * @property {string|null} [protoReferenceDocumentationUri] Publishing protoReferenceDocumentationUri + * @interface IHttpRule + * @property {string|null} [selector] HttpRule selector + * @property {string|null} [get] HttpRule get + * @property {string|null} [put] HttpRule put + * @property {string|null} [post] HttpRule post + * @property {string|null} ["delete"] HttpRule delete + * @property {string|null} [patch] HttpRule patch + * @property {google.api.ICustomHttpPattern|null} [custom] HttpRule custom + * @property {string|null} [body] HttpRule body + * @property {string|null} [responseBody] HttpRule responseBody + * @property {Array.|null} [additionalBindings] HttpRule additionalBindings */ - + /** - * Constructs a new Publishing. + * Constructs a new HttpRule. * @memberof google.api - * @classdesc Represents a Publishing. - * @implements IPublishing + * @classdesc Represents a HttpRule. + * @implements IHttpRule * @constructor - * @param {google.api.IPublishing=} [properties] Properties to set + * @param {google.api.IHttpRule=} [properties] Properties to set */ - function Publishing(properties) { - this.methodSettings = []; - this.codeownerGithubTeams = []; - this.librarySettings = []; + function HttpRule(properties) { + this.additionalBindings = []; 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]]; } - + /** - * Publishing methodSettings. - * @member {Array.} methodSettings - * @memberof google.api.Publishing + * HttpRule selector. + * @member {string} selector + * @memberof google.api.HttpRule * @instance */ - Publishing.prototype.methodSettings = $util.emptyArray; - + HttpRule.prototype.selector = ""; + /** - * Publishing newIssueUri. - * @member {string} newIssueUri - * @memberof google.api.Publishing + * HttpRule get. + * @member {string|null|undefined} get + * @memberof google.api.HttpRule * @instance */ - Publishing.prototype.newIssueUri = ""; - + HttpRule.prototype.get = null; + /** - * Publishing documentationUri. - * @member {string} documentationUri - * @memberof google.api.Publishing + * HttpRule put. + * @member {string|null|undefined} put + * @memberof google.api.HttpRule * @instance */ - Publishing.prototype.documentationUri = ""; - + HttpRule.prototype.put = null; + /** - * Publishing apiShortName. - * @member {string} apiShortName - * @memberof google.api.Publishing + * HttpRule post. + * @member {string|null|undefined} post + * @memberof google.api.HttpRule * @instance */ - Publishing.prototype.apiShortName = ""; - + HttpRule.prototype.post = null; + /** - * Publishing githubLabel. - * @member {string} githubLabel - * @memberof google.api.Publishing + * HttpRule delete. + * @member {string|null|undefined} delete + * @memberof google.api.HttpRule * @instance */ - Publishing.prototype.githubLabel = ""; - + HttpRule.prototype["delete"] = null; + /** - * Publishing codeownerGithubTeams. - * @member {Array.} codeownerGithubTeams - * @memberof google.api.Publishing + * HttpRule patch. + * @member {string|null|undefined} patch + * @memberof google.api.HttpRule * @instance */ - Publishing.prototype.codeownerGithubTeams = $util.emptyArray; - + HttpRule.prototype.patch = null; + /** - * Publishing docTagPrefix. - * @member {string} docTagPrefix - * @memberof google.api.Publishing + * HttpRule custom. + * @member {google.api.ICustomHttpPattern|null|undefined} custom + * @memberof google.api.HttpRule * @instance */ - Publishing.prototype.docTagPrefix = ""; - + HttpRule.prototype.custom = null; + /** - * Publishing organization. - * @member {google.api.ClientLibraryOrganization} organization - * @memberof google.api.Publishing + * HttpRule body. + * @member {string} body + * @memberof google.api.HttpRule * @instance */ - Publishing.prototype.organization = 0; - + HttpRule.prototype.body = ""; + /** - * Publishing librarySettings. - * @member {Array.} librarySettings - * @memberof google.api.Publishing + * HttpRule responseBody. + * @member {string} responseBody + * @memberof google.api.HttpRule * @instance */ - Publishing.prototype.librarySettings = $util.emptyArray; - + HttpRule.prototype.responseBody = ""; + /** - * Publishing protoReferenceDocumentationUri. - * @member {string} protoReferenceDocumentationUri - * @memberof google.api.Publishing + * HttpRule additionalBindings. + * @member {Array.} additionalBindings + * @memberof google.api.HttpRule * @instance */ - Publishing.prototype.protoReferenceDocumentationUri = ""; - + HttpRule.prototype.additionalBindings = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + /** - * Creates a Publishing message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.Publishing + * HttpRule pattern. + * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern + * @memberof google.api.HttpRule + * @instance + */ + Object.defineProperty(HttpRule.prototype, "pattern", { + get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new HttpRule instance using the specified properties. + * @function create + * @memberof google.api.HttpRule * @static - * @param {Object.} object Plain object - * @returns {google.api.Publishing} Publishing + * @param {google.api.IHttpRule=} [properties] Properties to set + * @returns {google.api.HttpRule} HttpRule instance */ - Publishing.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.Publishing) - return object; - var message = new $root.google.api.Publishing(); - if (object.methodSettings) { - if (!Array.isArray(object.methodSettings)) - throw TypeError(".google.api.Publishing.methodSettings: array expected"); - message.methodSettings = []; - for (var i = 0; i < object.methodSettings.length; ++i) { - if (typeof object.methodSettings[i] !== "object") - throw TypeError(".google.api.Publishing.methodSettings: object expected"); - message.methodSettings[i] = $root.google.api.MethodSettings.fromObject(object.methodSettings[i]); - } - } - if (object.newIssueUri != null) - message.newIssueUri = String(object.newIssueUri); - if (object.documentationUri != null) - message.documentationUri = String(object.documentationUri); - if (object.apiShortName != null) - message.apiShortName = String(object.apiShortName); - if (object.githubLabel != null) - message.githubLabel = String(object.githubLabel); - if (object.codeownerGithubTeams) { - if (!Array.isArray(object.codeownerGithubTeams)) - throw TypeError(".google.api.Publishing.codeownerGithubTeams: array expected"); - message.codeownerGithubTeams = []; - for (var i = 0; i < object.codeownerGithubTeams.length; ++i) - message.codeownerGithubTeams[i] = String(object.codeownerGithubTeams[i]); - } - if (object.docTagPrefix != null) - message.docTagPrefix = String(object.docTagPrefix); - switch (object.organization) { - default: - if (typeof object.organization === "number") { - message.organization = object.organization; - break; - } - break; - case "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": - case 0: - message.organization = 0; - break; - case "CLOUD": - case 1: - message.organization = 1; - break; - case "ADS": - case 2: - message.organization = 2; - break; - case "PHOTOS": - case 3: - message.organization = 3; - break; - case "STREET_VIEW": - case 4: - message.organization = 4; - break; - case "SHOPPING": - case 5: - message.organization = 5; - break; - case "GEO": - case 6: - message.organization = 6; - break; - case "GENERATIVE_AI": - case 7: - message.organization = 7; - break; - } - if (object.librarySettings) { - if (!Array.isArray(object.librarySettings)) - throw TypeError(".google.api.Publishing.librarySettings: array expected"); - message.librarySettings = []; - for (var i = 0; i < object.librarySettings.length; ++i) { - if (typeof object.librarySettings[i] !== "object") - throw TypeError(".google.api.Publishing.librarySettings: object expected"); - message.librarySettings[i] = $root.google.api.ClientLibrarySettings.fromObject(object.librarySettings[i]); - } - } - if (object.protoReferenceDocumentationUri != null) - message.protoReferenceDocumentationUri = String(object.protoReferenceDocumentationUri); - return message; + HttpRule.create = function create(properties) { + return new HttpRule(properties); }; - + /** - * Creates a plain object from a Publishing message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.Publishing + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encode + * @memberof google.api.HttpRule * @static - * @param {google.api.Publishing} message Publishing - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); + if (message.get != null && Object.hasOwnProperty.call(message, "get")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); + if (message.put != null && Object.hasOwnProperty.call(message, "put")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); + if (message.post != null && Object.hasOwnProperty.call(message, "post")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); + if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); + if (message.patch != null && Object.hasOwnProperty.call(message, "patch")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); + if (message.custom != null && Object.hasOwnProperty.call(message, "custom")) + $root.google.api.CustomHttpPattern.encode(message.custom, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.additionalBindings != null && message.additionalBindings.length) + for (var i = 0; i < message.additionalBindings.length; ++i) + $root.google.api.HttpRule.encode(message.additionalBindings[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.responseBody != null && Object.hasOwnProperty.call(message, "responseBody")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); + return writer; + }; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Publishing.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.methodSettings = []; - object.codeownerGithubTeams = []; - object.librarySettings = []; - } - if (options.defaults) { - object.newIssueUri = ""; - object.documentationUri = ""; - object.apiShortName = ""; - object.githubLabel = ""; - object.docTagPrefix = ""; - object.organization = options.enums === String ? "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED" : 0; - object.protoReferenceDocumentationUri = ""; - } - if (message.methodSettings && message.methodSettings.length) { - object.methodSettings = []; - for (var j = 0; j < message.methodSettings.length; ++j) - object.methodSettings[j] = $root.google.api.MethodSettings.toObject(message.methodSettings[j], options); - } - if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) - object.newIssueUri = message.newIssueUri; - if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) - object.documentationUri = message.documentationUri; - if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) - object.apiShortName = message.apiShortName; - if (message.githubLabel != null && message.hasOwnProperty("githubLabel")) - object.githubLabel = message.githubLabel; - if (message.codeownerGithubTeams && message.codeownerGithubTeams.length) { - object.codeownerGithubTeams = []; - for (var j = 0; j < message.codeownerGithubTeams.length; ++j) - object.codeownerGithubTeams[j] = message.codeownerGithubTeams[j]; - } - if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix")) - object.docTagPrefix = message.docTagPrefix; - if (message.organization != null && message.hasOwnProperty("organization")) - object.organization = options.enums === String ? $root.google.api.ClientLibraryOrganization[message.organization] === undefined ? message.organization : $root.google.api.ClientLibraryOrganization[message.organization] : message.organization; - if (message.librarySettings && message.librarySettings.length) { - object.librarySettings = []; - for (var j = 0; j < message.librarySettings.length; ++j) - object.librarySettings[j] = $root.google.api.ClientLibrarySettings.toObject(message.librarySettings[j], options); + HttpRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @function decode + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.HttpRule(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.selector = reader.string(); + break; + } + case 2: { + message.get = reader.string(); + break; + } + case 3: { + message.put = reader.string(); + break; + } + case 4: { + message.post = reader.string(); + break; + } + case 5: { + message["delete"] = reader.string(); + break; + } + case 6: { + message.patch = reader.string(); + break; + } + case 8: { + message.custom = $root.google.api.CustomHttpPattern.decode(reader, reader.uint32()); + break; + } + case 7: { + message.body = reader.string(); + break; + } + case 12: { + message.responseBody = reader.string(); + break; + } + case 11: { + if (!(message.additionalBindings && message.additionalBindings.length)) + message.additionalBindings = []; + message.additionalBindings.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } } - if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) - object.protoReferenceDocumentationUri = message.protoReferenceDocumentationUri; - return object; + return message; }; - + /** - * Converts this Publishing to JSON. - * @function toJSON - * @memberof google.api.Publishing - * @instance - * @returns {Object.} JSON object + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Publishing.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + HttpRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); }; - + /** - * Gets the default type url for Publishing - * @function getTypeUrl - * @memberof google.api.Publishing + * Verifies a HttpRule message. + * @function verify + * @memberof google.api.HttpRule * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Publishing.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; + HttpRule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.selector != null && message.hasOwnProperty("selector")) + if (!$util.isString(message.selector)) + return "selector: string expected"; + if (message.get != null && message.hasOwnProperty("get")) { + properties.pattern = 1; + if (!$util.isString(message.get)) + return "get: string expected"; } - return typeUrlPrefix + "/google.api.Publishing"; + if (message.put != null && message.hasOwnProperty("put")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.put)) + return "put: string expected"; + } + if (message.post != null && message.hasOwnProperty("post")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.post)) + return "post: string expected"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message["delete"])) + return "delete: string expected"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.patch)) + return "patch: string expected"; + } + if (message.custom != null && message.hasOwnProperty("custom")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + { + var error = $root.google.api.CustomHttpPattern.verify(message.custom); + if (error) + return "custom." + error; + } + } + if (message.body != null && message.hasOwnProperty("body")) + if (!$util.isString(message.body)) + return "body: string expected"; + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + if (!$util.isString(message.responseBody)) + return "responseBody: string expected"; + if (message.additionalBindings != null && message.hasOwnProperty("additionalBindings")) { + if (!Array.isArray(message.additionalBindings)) + return "additionalBindings: array expected"; + for (var i = 0; i < message.additionalBindings.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.additionalBindings[i]); + if (error) + return "additionalBindings." + error; + } + } + return null; }; - - return Publishing; - })(); - - api.JavaSettings = (function() { - - /** - * Properties of a JavaSettings. - * @memberof google.api - * @interface IJavaSettings - * @property {string|null} [libraryPackage] JavaSettings libraryPackage - * @property {Object.|null} [serviceClassNames] JavaSettings serviceClassNames - * @property {google.api.ICommonLanguageSettings|null} [common] JavaSettings common - */ - - /** - * Constructs a new JavaSettings. - * @memberof google.api - * @classdesc Represents a JavaSettings. - * @implements IJavaSettings - * @constructor - * @param {google.api.IJavaSettings=} [properties] Properties to set - */ - function JavaSettings(properties) { - this.serviceClassNames = {}; - 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]]; - } - - /** - * JavaSettings libraryPackage. - * @member {string} libraryPackage - * @memberof google.api.JavaSettings - * @instance - */ - JavaSettings.prototype.libraryPackage = ""; - - /** - * JavaSettings serviceClassNames. - * @member {Object.} serviceClassNames - * @memberof google.api.JavaSettings - * @instance - */ - JavaSettings.prototype.serviceClassNames = $util.emptyObject; - - /** - * JavaSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.JavaSettings - * @instance - */ - JavaSettings.prototype.common = null; - + /** - * Creates a JavaSettings message from a plain object. Also converts values to their respective internal types. + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.api.JavaSettings + * @memberof google.api.HttpRule * @static * @param {Object.} object Plain object - * @returns {google.api.JavaSettings} JavaSettings + * @returns {google.api.HttpRule} HttpRule */ - JavaSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.JavaSettings) + HttpRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.HttpRule) return object; - var message = new $root.google.api.JavaSettings(); - if (object.libraryPackage != null) - message.libraryPackage = String(object.libraryPackage); - if (object.serviceClassNames) { - if (typeof object.serviceClassNames !== "object") - throw TypeError(".google.api.JavaSettings.serviceClassNames: object expected"); - message.serviceClassNames = {}; - for (var keys = Object.keys(object.serviceClassNames), i = 0; i < keys.length; ++i) - message.serviceClassNames[keys[i]] = String(object.serviceClassNames[keys[i]]); + var message = new $root.google.api.HttpRule(); + if (object.selector != null) + message.selector = String(object.selector); + if (object.get != null) + message.get = String(object.get); + if (object.put != null) + message.put = String(object.put); + if (object.post != null) + message.post = String(object.post); + if (object["delete"] != null) + message["delete"] = String(object["delete"]); + if (object.patch != null) + message.patch = String(object.patch); + if (object.custom != null) { + if (typeof object.custom !== "object") + throw TypeError(".google.api.HttpRule.custom: object expected"); + message.custom = $root.google.api.CustomHttpPattern.fromObject(object.custom); } - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.JavaSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + if (object.body != null) + message.body = String(object.body); + if (object.responseBody != null) + message.responseBody = String(object.responseBody); + if (object.additionalBindings) { + if (!Array.isArray(object.additionalBindings)) + throw TypeError(".google.api.HttpRule.additionalBindings: array expected"); + message.additionalBindings = []; + for (var i = 0; i < object.additionalBindings.length; ++i) { + if (typeof object.additionalBindings[i] !== "object") + throw TypeError(".google.api.HttpRule.additionalBindings: object expected"); + message.additionalBindings[i] = $root.google.api.HttpRule.fromObject(object.additionalBindings[i]); + } } return message; }; - + /** - * Creates a plain object from a JavaSettings message. Also converts values to other types if specified. + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. * @function toObject - * @memberof google.api.JavaSettings + * @memberof google.api.HttpRule * @static - * @param {google.api.JavaSettings} message JavaSettings + * @param {google.api.HttpRule} message HttpRule * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - JavaSettings.toObject = function toObject(message, options) { + HttpRule.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.objects || options.defaults) - object.serviceClassNames = {}; + if (options.arrays || options.defaults) + object.additionalBindings = []; if (options.defaults) { - object.libraryPackage = ""; - object.common = null; + object.selector = ""; + object.body = ""; + object.responseBody = ""; } - if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) - object.libraryPackage = message.libraryPackage; - var keys2; - if (message.serviceClassNames && (keys2 = Object.keys(message.serviceClassNames)).length) { - object.serviceClassNames = {}; - for (var j = 0; j < keys2.length; ++j) - object.serviceClassNames[keys2[j]] = message.serviceClassNames[keys2[j]]; + if (message.selector != null && message.hasOwnProperty("selector")) + object.selector = message.selector; + if (message.get != null && message.hasOwnProperty("get")) { + object.get = message.get; + if (options.oneofs) + object.pattern = "get"; } - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this JavaSettings to JSON. - * @function toJSON - * @memberof google.api.JavaSettings - * @instance - * @returns {Object.} JSON object - */ - JavaSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for JavaSettings - * @function getTypeUrl - * @memberof google.api.JavaSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - JavaSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; + if (message.put != null && message.hasOwnProperty("put")) { + object.put = message.put; + if (options.oneofs) + object.pattern = "put"; } - return typeUrlPrefix + "/google.api.JavaSettings"; - }; - - return JavaSettings; - })(); - - api.CppSettings = (function() { - - /** - * Properties of a CppSettings. - * @memberof google.api - * @interface ICppSettings - * @property {google.api.ICommonLanguageSettings|null} [common] CppSettings common - */ - - /** - * Constructs a new CppSettings. - * @memberof google.api - * @classdesc Represents a CppSettings. - * @implements ICppSettings - * @constructor - * @param {google.api.ICppSettings=} [properties] Properties to set - */ - function CppSettings(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]]; - } - - /** - * CppSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.CppSettings - * @instance - */ - CppSettings.prototype.common = null; - - /** - * Creates a CppSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.CppSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.CppSettings} CppSettings - */ - CppSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.CppSettings) - return object; - var message = new $root.google.api.CppSettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.CppSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + if (message.post != null && message.hasOwnProperty("post")) { + object.post = message.post; + if (options.oneofs) + object.pattern = "post"; } - return message; - }; - - /** - * Creates a plain object from a CppSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.CppSettings - * @static - * @param {google.api.CppSettings} message CppSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CppSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + if (message["delete"] != null && message.hasOwnProperty("delete")) { + object["delete"] = message["delete"]; + if (options.oneofs) + object.pattern = "delete"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + object.patch = message.patch; + if (options.oneofs) + object.pattern = "patch"; + } + if (message.body != null && message.hasOwnProperty("body")) + object.body = message.body; + if (message.custom != null && message.hasOwnProperty("custom")) { + object.custom = $root.google.api.CustomHttpPattern.toObject(message.custom, options); + if (options.oneofs) + object.pattern = "custom"; + } + if (message.additionalBindings && message.additionalBindings.length) { + object.additionalBindings = []; + for (var j = 0; j < message.additionalBindings.length; ++j) + object.additionalBindings[j] = $root.google.api.HttpRule.toObject(message.additionalBindings[j], options); + } + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + object.responseBody = message.responseBody; return object; }; - + /** - * Converts this CppSettings to JSON. + * Converts this HttpRule to JSON. * @function toJSON - * @memberof google.api.CppSettings + * @memberof google.api.HttpRule * @instance * @returns {Object.} JSON object */ - CppSettings.prototype.toJSON = function toJSON() { + HttpRule.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - + /** - * Gets the default type url for CppSettings + * Gets the default type url for HttpRule * @function getTypeUrl - * @memberof google.api.CppSettings + * @memberof google.api.HttpRule * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - CppSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + HttpRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.api.CppSettings"; + return typeUrlPrefix + "/google.api.HttpRule"; }; - - return CppSettings; + + return HttpRule; })(); - - api.PhpSettings = (function() { - + + api.CustomHttpPattern = (function() { + /** - * Properties of a PhpSettings. + * Properties of a CustomHttpPattern. * @memberof google.api - * @interface IPhpSettings - * @property {google.api.ICommonLanguageSettings|null} [common] PhpSettings common + * @interface ICustomHttpPattern + * @property {string|null} [kind] CustomHttpPattern kind + * @property {string|null} [path] CustomHttpPattern path */ - + /** - * Constructs a new PhpSettings. + * Constructs a new CustomHttpPattern. * @memberof google.api - * @classdesc Represents a PhpSettings. - * @implements IPhpSettings + * @classdesc Represents a CustomHttpPattern. + * @implements ICustomHttpPattern * @constructor - * @param {google.api.IPhpSettings=} [properties] Properties to set + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set */ - function PhpSettings(properties) { + function CustomHttpPattern(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]]; } - + /** - * PhpSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.PhpSettings + * CustomHttpPattern kind. + * @member {string} kind + * @memberof google.api.CustomHttpPattern * @instance */ - PhpSettings.prototype.common = null; - + CustomHttpPattern.prototype.kind = ""; + /** - * Creates a PhpSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.PhpSettings + * CustomHttpPattern path. + * @member {string} path + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.path = ""; + + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @function create + * @memberof google.api.CustomHttpPattern * @static - * @param {Object.} object Plain object - * @returns {google.api.PhpSettings} PhpSettings + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance */ - PhpSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.PhpSettings) - return object; - var message = new $root.google.api.PhpSettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.PhpSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; + CustomHttpPattern.create = function create(properties) { + return new CustomHttpPattern(properties); }; - + /** - * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.PhpSettings + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encode + * @memberof google.api.CustomHttpPattern * @static - * @param {google.api.PhpSettings} message PhpSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PhpSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); + if (message.path != null && Object.hasOwnProperty.call(message, "path")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); + return writer; }; - + /** - * Converts this PhpSettings to JSON. - * @function toJSON - * @memberof google.api.PhpSettings - * @instance - * @returns {Object.} JSON object + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - PhpSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); }; - + /** - * Gets the default type url for PhpSettings - * @function getTypeUrl - * @memberof google.api.PhpSettings + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @function decode + * @memberof google.api.CustomHttpPattern * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PhpSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CustomHttpPattern(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.kind = reader.string(); + break; + } + case 2: { + message.path = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } } - return typeUrlPrefix + "/google.api.PhpSettings"; + return message; }; - - return PhpSettings; - })(); - - api.PythonSettings = (function() { - - /** - * Properties of a PythonSettings. - * @memberof google.api - * @interface IPythonSettings - * @property {google.api.ICommonLanguageSettings|null} [common] PythonSettings common - */ - + /** - * Constructs a new PythonSettings. - * @memberof google.api - * @classdesc Represents a PythonSettings. - * @implements IPythonSettings - * @constructor - * @param {google.api.IPythonSettings=} [properties] Properties to set + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - function PythonSettings(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]]; - } - + CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + /** - * PythonSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.PythonSettings - * @instance + * Verifies a CustomHttpPattern message. + * @function verify + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - PythonSettings.prototype.common = null; - + CustomHttpPattern.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.kind != null && message.hasOwnProperty("kind")) + if (!$util.isString(message.kind)) + return "kind: string expected"; + if (message.path != null && message.hasOwnProperty("path")) + if (!$util.isString(message.path)) + return "path: string expected"; + return null; + }; + /** - * Creates a PythonSettings message from a plain object. Also converts values to their respective internal types. + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.api.PythonSettings + * @memberof google.api.CustomHttpPattern * @static * @param {Object.} object Plain object - * @returns {google.api.PythonSettings} PythonSettings + * @returns {google.api.CustomHttpPattern} CustomHttpPattern */ - PythonSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.PythonSettings) + CustomHttpPattern.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CustomHttpPattern) return object; - var message = new $root.google.api.PythonSettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.PythonSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } + var message = new $root.google.api.CustomHttpPattern(); + if (object.kind != null) + message.kind = String(object.kind); + if (object.path != null) + message.path = String(object.path); return message; }; - + /** - * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. * @function toObject - * @memberof google.api.PythonSettings + * @memberof google.api.CustomHttpPattern * @static - * @param {google.api.PythonSettings} message PythonSettings + * @param {google.api.CustomHttpPattern} message CustomHttpPattern * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PythonSettings.toObject = function toObject(message, options) { + CustomHttpPattern.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + if (options.defaults) { + object.kind = ""; + object.path = ""; + } + if (message.kind != null && message.hasOwnProperty("kind")) + object.kind = message.kind; + if (message.path != null && message.hasOwnProperty("path")) + object.path = message.path; return object; }; - + /** - * Converts this PythonSettings to JSON. + * Converts this CustomHttpPattern to JSON. * @function toJSON - * @memberof google.api.PythonSettings + * @memberof google.api.CustomHttpPattern * @instance * @returns {Object.} JSON object */ - PythonSettings.prototype.toJSON = function toJSON() { + CustomHttpPattern.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - + /** - * Gets the default type url for PythonSettings + * Gets the default type url for CustomHttpPattern * @function getTypeUrl - * @memberof google.api.PythonSettings + * @memberof google.api.CustomHttpPattern * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - PythonSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + CustomHttpPattern.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.api.PythonSettings"; + return typeUrlPrefix + "/google.api.CustomHttpPattern"; }; - - return PythonSettings; + + return CustomHttpPattern; })(); - - api.NodeSettings = (function() { - + + api.CommonLanguageSettings = (function() { + /** - * Properties of a NodeSettings. + * Properties of a CommonLanguageSettings. * @memberof google.api - * @interface INodeSettings - * @property {google.api.ICommonLanguageSettings|null} [common] NodeSettings common + * @interface ICommonLanguageSettings + * @property {string|null} [referenceDocsUri] CommonLanguageSettings referenceDocsUri + * @property {Array.|null} [destinations] CommonLanguageSettings destinations */ - + /** - * Constructs a new NodeSettings. + * Constructs a new CommonLanguageSettings. * @memberof google.api - * @classdesc Represents a NodeSettings. - * @implements INodeSettings + * @classdesc Represents a CommonLanguageSettings. + * @implements ICommonLanguageSettings * @constructor - * @param {google.api.INodeSettings=} [properties] Properties to set + * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set */ - function NodeSettings(properties) { + function CommonLanguageSettings(properties) { + this.destinations = []; 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]]; } - + /** - * NodeSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.NodeSettings + * CommonLanguageSettings referenceDocsUri. + * @member {string} referenceDocsUri + * @memberof google.api.CommonLanguageSettings * @instance */ - NodeSettings.prototype.common = null; - + CommonLanguageSettings.prototype.referenceDocsUri = ""; + /** - * Creates a NodeSettings message from a plain object. Also converts values to their respective internal types. + * CommonLanguageSettings destinations. + * @member {Array.} destinations + * @memberof google.api.CommonLanguageSettings + * @instance + */ + CommonLanguageSettings.prototype.destinations = $util.emptyArray; + + /** + * Creates a new CommonLanguageSettings instance using the specified properties. + * @function create + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings instance + */ + CommonLanguageSettings.create = function create(properties) { + return new CommonLanguageSettings(properties); + }; + + /** + * Encodes the specified CommonLanguageSettings message. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @function encode + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommonLanguageSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.referenceDocsUri != null && Object.hasOwnProperty.call(message, "referenceDocsUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.referenceDocsUri); + if (message.destinations != null && message.destinations.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.destinations.length; ++i) + writer.int32(message.destinations[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified CommonLanguageSettings message, length delimited. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommonLanguageSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.CommonLanguageSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommonLanguageSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CommonLanguageSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.referenceDocsUri = reader.string(); + break; + } + case 2: { + if (!(message.destinations && message.destinations.length)) + message.destinations = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.destinations.push(reader.int32()); + } else + message.destinations.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CommonLanguageSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommonLanguageSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CommonLanguageSettings message. + * @function verify + * @memberof google.api.CommonLanguageSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CommonLanguageSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) + if (!$util.isString(message.referenceDocsUri)) + return "referenceDocsUri: string expected"; + if (message.destinations != null && message.hasOwnProperty("destinations")) { + if (!Array.isArray(message.destinations)) + return "destinations: array expected"; + for (var i = 0; i < message.destinations.length; ++i) + switch (message.destinations[i]) { + default: + return "destinations: enum value[] expected"; + case 0: + case 10: + case 20: + break; + } + } + return null; + }; + + /** + * Creates a CommonLanguageSettings message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.api.NodeSettings + * @memberof google.api.CommonLanguageSettings * @static * @param {Object.} object Plain object - * @returns {google.api.NodeSettings} NodeSettings + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings */ - NodeSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.NodeSettings) + CommonLanguageSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CommonLanguageSettings) return object; - var message = new $root.google.api.NodeSettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.NodeSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + var message = new $root.google.api.CommonLanguageSettings(); + if (object.referenceDocsUri != null) + message.referenceDocsUri = String(object.referenceDocsUri); + if (object.destinations) { + if (!Array.isArray(object.destinations)) + throw TypeError(".google.api.CommonLanguageSettings.destinations: array expected"); + message.destinations = []; + for (var i = 0; i < object.destinations.length; ++i) + switch (object.destinations[i]) { + default: + if (typeof object.destinations[i] === "number") { + message.destinations[i] = object.destinations[i]; + break; + } + case "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED": + case 0: + message.destinations[i] = 0; + break; + case "GITHUB": + case 10: + message.destinations[i] = 10; + break; + case "PACKAGE_MANAGER": + case 20: + message.destinations[i] = 20; + break; + } } return message; }; - + /** - * Creates a plain object from a NodeSettings message. Also converts values to other types if specified. + * Creates a plain object from a CommonLanguageSettings message. Also converts values to other types if specified. * @function toObject - * @memberof google.api.NodeSettings + * @memberof google.api.CommonLanguageSettings * @static - * @param {google.api.NodeSettings} message NodeSettings + * @param {google.api.CommonLanguageSettings} message CommonLanguageSettings * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - NodeSettings.toObject = function toObject(message, options) { + CommonLanguageSettings.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.destinations = []; if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + object.referenceDocsUri = ""; + if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) + object.referenceDocsUri = message.referenceDocsUri; + if (message.destinations && message.destinations.length) { + object.destinations = []; + for (var j = 0; j < message.destinations.length; ++j) + object.destinations[j] = options.enums === String ? $root.google.api.ClientLibraryDestination[message.destinations[j]] === undefined ? message.destinations[j] : $root.google.api.ClientLibraryDestination[message.destinations[j]] : message.destinations[j]; + } return object; }; - + /** - * Converts this NodeSettings to JSON. + * Converts this CommonLanguageSettings to JSON. * @function toJSON - * @memberof google.api.NodeSettings + * @memberof google.api.CommonLanguageSettings * @instance * @returns {Object.} JSON object */ - NodeSettings.prototype.toJSON = function toJSON() { + CommonLanguageSettings.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - + /** - * Gets the default type url for NodeSettings + * Gets the default type url for CommonLanguageSettings * @function getTypeUrl - * @memberof google.api.NodeSettings + * @memberof google.api.CommonLanguageSettings * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - NodeSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + CommonLanguageSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.api.NodeSettings"; + return typeUrlPrefix + "/google.api.CommonLanguageSettings"; }; - - return NodeSettings; + + return CommonLanguageSettings; })(); - - api.DotnetSettings = (function() { - + + api.ClientLibrarySettings = (function() { + /** - * Properties of a DotnetSettings. + * Properties of a ClientLibrarySettings. * @memberof google.api - * @interface IDotnetSettings - * @property {google.api.ICommonLanguageSettings|null} [common] DotnetSettings common - * @property {Object.|null} [renamedServices] DotnetSettings renamedServices - * @property {Object.|null} [renamedResources] DotnetSettings renamedResources - * @property {Array.|null} [ignoredResources] DotnetSettings ignoredResources - * @property {Array.|null} [forcedNamespaceAliases] DotnetSettings forcedNamespaceAliases - * @property {Array.|null} [handwrittenSignatures] DotnetSettings handwrittenSignatures + * @interface IClientLibrarySettings + * @property {string|null} [version] ClientLibrarySettings version + * @property {google.api.LaunchStage|null} [launchStage] ClientLibrarySettings launchStage + * @property {boolean|null} [restNumericEnums] ClientLibrarySettings restNumericEnums + * @property {google.api.IJavaSettings|null} [javaSettings] ClientLibrarySettings javaSettings + * @property {google.api.ICppSettings|null} [cppSettings] ClientLibrarySettings cppSettings + * @property {google.api.IPhpSettings|null} [phpSettings] ClientLibrarySettings phpSettings + * @property {google.api.IPythonSettings|null} [pythonSettings] ClientLibrarySettings pythonSettings + * @property {google.api.INodeSettings|null} [nodeSettings] ClientLibrarySettings nodeSettings + * @property {google.api.IDotnetSettings|null} [dotnetSettings] ClientLibrarySettings dotnetSettings + * @property {google.api.IRubySettings|null} [rubySettings] ClientLibrarySettings rubySettings + * @property {google.api.IGoSettings|null} [goSettings] ClientLibrarySettings goSettings */ - + /** - * Constructs a new DotnetSettings. + * Constructs a new ClientLibrarySettings. * @memberof google.api - * @classdesc Represents a DotnetSettings. - * @implements IDotnetSettings + * @classdesc Represents a ClientLibrarySettings. + * @implements IClientLibrarySettings * @constructor - * @param {google.api.IDotnetSettings=} [properties] Properties to set + * @param {google.api.IClientLibrarySettings=} [properties] Properties to set */ - function DotnetSettings(properties) { - this.renamedServices = {}; - this.renamedResources = {}; - this.ignoredResources = []; - this.forcedNamespaceAliases = []; - this.handwrittenSignatures = []; + function ClientLibrarySettings(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]]; } - + /** - * DotnetSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.DotnetSettings + * ClientLibrarySettings version. + * @member {string} version + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.version = ""; + + /** + * ClientLibrarySettings launchStage. + * @member {google.api.LaunchStage} launchStage + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.launchStage = 0; + + /** + * ClientLibrarySettings restNumericEnums. + * @member {boolean} restNumericEnums + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.restNumericEnums = false; + + /** + * ClientLibrarySettings javaSettings. + * @member {google.api.IJavaSettings|null|undefined} javaSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.javaSettings = null; + + /** + * ClientLibrarySettings cppSettings. + * @member {google.api.ICppSettings|null|undefined} cppSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.cppSettings = null; + + /** + * ClientLibrarySettings phpSettings. + * @member {google.api.IPhpSettings|null|undefined} phpSettings + * @memberof google.api.ClientLibrarySettings * @instance */ - DotnetSettings.prototype.common = null; - + ClientLibrarySettings.prototype.phpSettings = null; + /** - * DotnetSettings renamedServices. - * @member {Object.} renamedServices - * @memberof google.api.DotnetSettings + * ClientLibrarySettings pythonSettings. + * @member {google.api.IPythonSettings|null|undefined} pythonSettings + * @memberof google.api.ClientLibrarySettings * @instance */ - DotnetSettings.prototype.renamedServices = $util.emptyObject; - + ClientLibrarySettings.prototype.pythonSettings = null; + /** - * DotnetSettings renamedResources. - * @member {Object.} renamedResources - * @memberof google.api.DotnetSettings + * ClientLibrarySettings nodeSettings. + * @member {google.api.INodeSettings|null|undefined} nodeSettings + * @memberof google.api.ClientLibrarySettings * @instance */ - DotnetSettings.prototype.renamedResources = $util.emptyObject; - + ClientLibrarySettings.prototype.nodeSettings = null; + /** - * DotnetSettings ignoredResources. - * @member {Array.} ignoredResources - * @memberof google.api.DotnetSettings + * ClientLibrarySettings dotnetSettings. + * @member {google.api.IDotnetSettings|null|undefined} dotnetSettings + * @memberof google.api.ClientLibrarySettings * @instance */ - DotnetSettings.prototype.ignoredResources = $util.emptyArray; - + ClientLibrarySettings.prototype.dotnetSettings = null; + /** - * DotnetSettings forcedNamespaceAliases. - * @member {Array.} forcedNamespaceAliases - * @memberof google.api.DotnetSettings + * ClientLibrarySettings rubySettings. + * @member {google.api.IRubySettings|null|undefined} rubySettings + * @memberof google.api.ClientLibrarySettings * @instance */ - DotnetSettings.prototype.forcedNamespaceAliases = $util.emptyArray; - + ClientLibrarySettings.prototype.rubySettings = null; + /** - * DotnetSettings handwrittenSignatures. - * @member {Array.} handwrittenSignatures - * @memberof google.api.DotnetSettings + * ClientLibrarySettings goSettings. + * @member {google.api.IGoSettings|null|undefined} goSettings + * @memberof google.api.ClientLibrarySettings * @instance */ - DotnetSettings.prototype.handwrittenSignatures = $util.emptyArray; - + ClientLibrarySettings.prototype.goSettings = null; + /** - * Creates a DotnetSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.DotnetSettings + * Creates a new ClientLibrarySettings instance using the specified properties. + * @function create + * @memberof google.api.ClientLibrarySettings * @static - * @param {Object.} object Plain object - * @returns {google.api.DotnetSettings} DotnetSettings + * @param {google.api.IClientLibrarySettings=} [properties] Properties to set + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings instance */ - DotnetSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.DotnetSettings) - return object; - var message = new $root.google.api.DotnetSettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.DotnetSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - if (object.renamedServices) { - if (typeof object.renamedServices !== "object") - throw TypeError(".google.api.DotnetSettings.renamedServices: object expected"); - message.renamedServices = {}; - for (var keys = Object.keys(object.renamedServices), i = 0; i < keys.length; ++i) - message.renamedServices[keys[i]] = String(object.renamedServices[keys[i]]); - } - if (object.renamedResources) { - if (typeof object.renamedResources !== "object") - throw TypeError(".google.api.DotnetSettings.renamedResources: object expected"); - message.renamedResources = {}; - for (var keys = Object.keys(object.renamedResources), i = 0; i < keys.length; ++i) - message.renamedResources[keys[i]] = String(object.renamedResources[keys[i]]); - } - if (object.ignoredResources) { - if (!Array.isArray(object.ignoredResources)) - throw TypeError(".google.api.DotnetSettings.ignoredResources: array expected"); - message.ignoredResources = []; - for (var i = 0; i < object.ignoredResources.length; ++i) - message.ignoredResources[i] = String(object.ignoredResources[i]); - } - if (object.forcedNamespaceAliases) { - if (!Array.isArray(object.forcedNamespaceAliases)) - throw TypeError(".google.api.DotnetSettings.forcedNamespaceAliases: array expected"); - message.forcedNamespaceAliases = []; - for (var i = 0; i < object.forcedNamespaceAliases.length; ++i) - message.forcedNamespaceAliases[i] = String(object.forcedNamespaceAliases[i]); - } - if (object.handwrittenSignatures) { - if (!Array.isArray(object.handwrittenSignatures)) - throw TypeError(".google.api.DotnetSettings.handwrittenSignatures: array expected"); - message.handwrittenSignatures = []; - for (var i = 0; i < object.handwrittenSignatures.length; ++i) - message.handwrittenSignatures[i] = String(object.handwrittenSignatures[i]); + ClientLibrarySettings.create = function create(properties) { + return new ClientLibrarySettings(properties); + }; + + /** + * Encodes the specified ClientLibrarySettings message. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @function encode + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientLibrarySettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.version); + if (message.launchStage != null && Object.hasOwnProperty.call(message, "launchStage")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.launchStage); + if (message.restNumericEnums != null && Object.hasOwnProperty.call(message, "restNumericEnums")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.restNumericEnums); + if (message.javaSettings != null && Object.hasOwnProperty.call(message, "javaSettings")) + $root.google.api.JavaSettings.encode(message.javaSettings, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.cppSettings != null && Object.hasOwnProperty.call(message, "cppSettings")) + $root.google.api.CppSettings.encode(message.cppSettings, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + if (message.phpSettings != null && Object.hasOwnProperty.call(message, "phpSettings")) + $root.google.api.PhpSettings.encode(message.phpSettings, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); + if (message.pythonSettings != null && Object.hasOwnProperty.call(message, "pythonSettings")) + $root.google.api.PythonSettings.encode(message.pythonSettings, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); + if (message.nodeSettings != null && Object.hasOwnProperty.call(message, "nodeSettings")) + $root.google.api.NodeSettings.encode(message.nodeSettings, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); + if (message.dotnetSettings != null && Object.hasOwnProperty.call(message, "dotnetSettings")) + $root.google.api.DotnetSettings.encode(message.dotnetSettings, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); + if (message.rubySettings != null && Object.hasOwnProperty.call(message, "rubySettings")) + $root.google.api.RubySettings.encode(message.rubySettings, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); + if (message.goSettings != null && Object.hasOwnProperty.call(message, "goSettings")) + $root.google.api.GoSettings.encode(message.goSettings, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ClientLibrarySettings message, length delimited. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientLibrarySettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.ClientLibrarySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientLibrarySettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ClientLibrarySettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.version = reader.string(); + break; + } + case 2: { + message.launchStage = reader.int32(); + break; + } + case 3: { + message.restNumericEnums = reader.bool(); + break; + } + case 21: { + message.javaSettings = $root.google.api.JavaSettings.decode(reader, reader.uint32()); + break; + } + case 22: { + message.cppSettings = $root.google.api.CppSettings.decode(reader, reader.uint32()); + break; + } + case 23: { + message.phpSettings = $root.google.api.PhpSettings.decode(reader, reader.uint32()); + break; + } + case 24: { + message.pythonSettings = $root.google.api.PythonSettings.decode(reader, reader.uint32()); + break; + } + case 25: { + message.nodeSettings = $root.google.api.NodeSettings.decode(reader, reader.uint32()); + break; + } + case 26: { + message.dotnetSettings = $root.google.api.DotnetSettings.decode(reader, reader.uint32()); + break; + } + case 27: { + message.rubySettings = $root.google.api.RubySettings.decode(reader, reader.uint32()); + break; + } + case 28: { + message.goSettings = $root.google.api.GoSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } } return message; }; - + /** - * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.DotnetSettings + * Decodes a ClientLibrarySettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ClientLibrarySettings * @static - * @param {google.api.DotnetSettings} message DotnetSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DotnetSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.ignoredResources = []; - object.forcedNamespaceAliases = []; - object.handwrittenSignatures = []; + ClientLibrarySettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClientLibrarySettings message. + * @function verify + * @memberof google.api.ClientLibrarySettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClientLibrarySettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + if (message.launchStage != null && message.hasOwnProperty("launchStage")) + switch (message.launchStage) { + default: + return "launchStage: enum value expected"; + case 0: + case 6: + case 7: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.restNumericEnums != null && message.hasOwnProperty("restNumericEnums")) + if (typeof message.restNumericEnums !== "boolean") + return "restNumericEnums: boolean expected"; + if (message.javaSettings != null && message.hasOwnProperty("javaSettings")) { + var error = $root.google.api.JavaSettings.verify(message.javaSettings); + if (error) + return "javaSettings." + error; + } + if (message.cppSettings != null && message.hasOwnProperty("cppSettings")) { + var error = $root.google.api.CppSettings.verify(message.cppSettings); + if (error) + return "cppSettings." + error; + } + if (message.phpSettings != null && message.hasOwnProperty("phpSettings")) { + var error = $root.google.api.PhpSettings.verify(message.phpSettings); + if (error) + return "phpSettings." + error; + } + if (message.pythonSettings != null && message.hasOwnProperty("pythonSettings")) { + var error = $root.google.api.PythonSettings.verify(message.pythonSettings); + if (error) + return "pythonSettings." + error; + } + if (message.nodeSettings != null && message.hasOwnProperty("nodeSettings")) { + var error = $root.google.api.NodeSettings.verify(message.nodeSettings); + if (error) + return "nodeSettings." + error; + } + if (message.dotnetSettings != null && message.hasOwnProperty("dotnetSettings")) { + var error = $root.google.api.DotnetSettings.verify(message.dotnetSettings); + if (error) + return "dotnetSettings." + error; + } + if (message.rubySettings != null && message.hasOwnProperty("rubySettings")) { + var error = $root.google.api.RubySettings.verify(message.rubySettings); + if (error) + return "rubySettings." + error; + } + if (message.goSettings != null && message.hasOwnProperty("goSettings")) { + var error = $root.google.api.GoSettings.verify(message.goSettings); + if (error) + return "goSettings." + error; + } + return null; + }; + + /** + * Creates a ClientLibrarySettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ClientLibrarySettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + */ + ClientLibrarySettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ClientLibrarySettings) + return object; + var message = new $root.google.api.ClientLibrarySettings(); + if (object.version != null) + message.version = String(object.version); + switch (object.launchStage) { + default: + if (typeof object.launchStage === "number") { + message.launchStage = object.launchStage; + break; + } + break; + case "LAUNCH_STAGE_UNSPECIFIED": + case 0: + message.launchStage = 0; + break; + case "UNIMPLEMENTED": + case 6: + message.launchStage = 6; + break; + case "PRELAUNCH": + case 7: + message.launchStage = 7; + break; + case "EARLY_ACCESS": + case 1: + message.launchStage = 1; + break; + case "ALPHA": + case 2: + message.launchStage = 2; + break; + case "BETA": + case 3: + message.launchStage = 3; + break; + case "GA": + case 4: + message.launchStage = 4; + break; + case "DEPRECATED": + case 5: + message.launchStage = 5; + break; } - if (options.objects || options.defaults) { - object.renamedServices = {}; - object.renamedResources = {}; + if (object.restNumericEnums != null) + message.restNumericEnums = Boolean(object.restNumericEnums); + if (object.javaSettings != null) { + if (typeof object.javaSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.javaSettings: object expected"); + message.javaSettings = $root.google.api.JavaSettings.fromObject(object.javaSettings); } - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - var keys2; - if (message.renamedServices && (keys2 = Object.keys(message.renamedServices)).length) { - object.renamedServices = {}; - for (var j = 0; j < keys2.length; ++j) - object.renamedServices[keys2[j]] = message.renamedServices[keys2[j]]; + if (object.cppSettings != null) { + if (typeof object.cppSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.cppSettings: object expected"); + message.cppSettings = $root.google.api.CppSettings.fromObject(object.cppSettings); } - if (message.renamedResources && (keys2 = Object.keys(message.renamedResources)).length) { - object.renamedResources = {}; - for (var j = 0; j < keys2.length; ++j) - object.renamedResources[keys2[j]] = message.renamedResources[keys2[j]]; + if (object.phpSettings != null) { + if (typeof object.phpSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.phpSettings: object expected"); + message.phpSettings = $root.google.api.PhpSettings.fromObject(object.phpSettings); + } + if (object.pythonSettings != null) { + if (typeof object.pythonSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.pythonSettings: object expected"); + message.pythonSettings = $root.google.api.PythonSettings.fromObject(object.pythonSettings); + } + if (object.nodeSettings != null) { + if (typeof object.nodeSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.nodeSettings: object expected"); + message.nodeSettings = $root.google.api.NodeSettings.fromObject(object.nodeSettings); + } + if (object.dotnetSettings != null) { + if (typeof object.dotnetSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.dotnetSettings: object expected"); + message.dotnetSettings = $root.google.api.DotnetSettings.fromObject(object.dotnetSettings); } - if (message.ignoredResources && message.ignoredResources.length) { - object.ignoredResources = []; - for (var j = 0; j < message.ignoredResources.length; ++j) - object.ignoredResources[j] = message.ignoredResources[j]; + if (object.rubySettings != null) { + if (typeof object.rubySettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.rubySettings: object expected"); + message.rubySettings = $root.google.api.RubySettings.fromObject(object.rubySettings); } - if (message.forcedNamespaceAliases && message.forcedNamespaceAliases.length) { - object.forcedNamespaceAliases = []; - for (var j = 0; j < message.forcedNamespaceAliases.length; ++j) - object.forcedNamespaceAliases[j] = message.forcedNamespaceAliases[j]; + if (object.goSettings != null) { + if (typeof object.goSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.goSettings: object expected"); + message.goSettings = $root.google.api.GoSettings.fromObject(object.goSettings); } - if (message.handwrittenSignatures && message.handwrittenSignatures.length) { - object.handwrittenSignatures = []; - for (var j = 0; j < message.handwrittenSignatures.length; ++j) - object.handwrittenSignatures[j] = message.handwrittenSignatures[j]; + return message; + }; + + /** + * Creates a plain object from a ClientLibrarySettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.ClientLibrarySettings} message ClientLibrarySettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClientLibrarySettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.version = ""; + object.launchStage = options.enums === String ? "LAUNCH_STAGE_UNSPECIFIED" : 0; + object.restNumericEnums = false; + object.javaSettings = null; + object.cppSettings = null; + object.phpSettings = null; + object.pythonSettings = null; + object.nodeSettings = null; + object.dotnetSettings = null; + object.rubySettings = null; + object.goSettings = null; } + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.launchStage != null && message.hasOwnProperty("launchStage")) + object.launchStage = options.enums === String ? $root.google.api.LaunchStage[message.launchStage] === undefined ? message.launchStage : $root.google.api.LaunchStage[message.launchStage] : message.launchStage; + if (message.restNumericEnums != null && message.hasOwnProperty("restNumericEnums")) + object.restNumericEnums = message.restNumericEnums; + if (message.javaSettings != null && message.hasOwnProperty("javaSettings")) + object.javaSettings = $root.google.api.JavaSettings.toObject(message.javaSettings, options); + if (message.cppSettings != null && message.hasOwnProperty("cppSettings")) + object.cppSettings = $root.google.api.CppSettings.toObject(message.cppSettings, options); + if (message.phpSettings != null && message.hasOwnProperty("phpSettings")) + object.phpSettings = $root.google.api.PhpSettings.toObject(message.phpSettings, options); + if (message.pythonSettings != null && message.hasOwnProperty("pythonSettings")) + object.pythonSettings = $root.google.api.PythonSettings.toObject(message.pythonSettings, options); + if (message.nodeSettings != null && message.hasOwnProperty("nodeSettings")) + object.nodeSettings = $root.google.api.NodeSettings.toObject(message.nodeSettings, options); + if (message.dotnetSettings != null && message.hasOwnProperty("dotnetSettings")) + object.dotnetSettings = $root.google.api.DotnetSettings.toObject(message.dotnetSettings, options); + if (message.rubySettings != null && message.hasOwnProperty("rubySettings")) + object.rubySettings = $root.google.api.RubySettings.toObject(message.rubySettings, options); + if (message.goSettings != null && message.hasOwnProperty("goSettings")) + object.goSettings = $root.google.api.GoSettings.toObject(message.goSettings, options); return object; }; - + /** - * Converts this DotnetSettings to JSON. + * Converts this ClientLibrarySettings to JSON. * @function toJSON - * @memberof google.api.DotnetSettings + * @memberof google.api.ClientLibrarySettings * @instance * @returns {Object.} JSON object */ - DotnetSettings.prototype.toJSON = function toJSON() { + ClientLibrarySettings.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - + /** - * Gets the default type url for DotnetSettings + * Gets the default type url for ClientLibrarySettings * @function getTypeUrl - * @memberof google.api.DotnetSettings + * @memberof google.api.ClientLibrarySettings * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - DotnetSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ClientLibrarySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.api.DotnetSettings"; + return typeUrlPrefix + "/google.api.ClientLibrarySettings"; }; - - return DotnetSettings; + + return ClientLibrarySettings; })(); - - api.RubySettings = (function() { - + + api.Publishing = (function() { + /** - * Properties of a RubySettings. + * Properties of a Publishing. * @memberof google.api - * @interface IRubySettings - * @property {google.api.ICommonLanguageSettings|null} [common] RubySettings common + * @interface IPublishing + * @property {Array.|null} [methodSettings] Publishing methodSettings + * @property {string|null} [newIssueUri] Publishing newIssueUri + * @property {string|null} [documentationUri] Publishing documentationUri + * @property {string|null} [apiShortName] Publishing apiShortName + * @property {string|null} [githubLabel] Publishing githubLabel + * @property {Array.|null} [codeownerGithubTeams] Publishing codeownerGithubTeams + * @property {string|null} [docTagPrefix] Publishing docTagPrefix + * @property {google.api.ClientLibraryOrganization|null} [organization] Publishing organization + * @property {Array.|null} [librarySettings] Publishing librarySettings + * @property {string|null} [protoReferenceDocumentationUri] Publishing protoReferenceDocumentationUri */ - + /** - * Constructs a new RubySettings. + * Constructs a new Publishing. * @memberof google.api - * @classdesc Represents a RubySettings. - * @implements IRubySettings + * @classdesc Represents a Publishing. + * @implements IPublishing * @constructor - * @param {google.api.IRubySettings=} [properties] Properties to set + * @param {google.api.IPublishing=} [properties] Properties to set */ - function RubySettings(properties) { + function Publishing(properties) { + this.methodSettings = []; + this.codeownerGithubTeams = []; + this.librarySettings = []; 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]]; } - + /** - * RubySettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.RubySettings + * Publishing methodSettings. + * @member {Array.} methodSettings + * @memberof google.api.Publishing * @instance */ - RubySettings.prototype.common = null; - + Publishing.prototype.methodSettings = $util.emptyArray; + /** - * Creates a RubySettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.RubySettings + * Publishing newIssueUri. + * @member {string} newIssueUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.newIssueUri = ""; + + /** + * Publishing documentationUri. + * @member {string} documentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.documentationUri = ""; + + /** + * Publishing apiShortName. + * @member {string} apiShortName + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.apiShortName = ""; + + /** + * Publishing githubLabel. + * @member {string} githubLabel + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.githubLabel = ""; + + /** + * Publishing codeownerGithubTeams. + * @member {Array.} codeownerGithubTeams + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.codeownerGithubTeams = $util.emptyArray; + + /** + * Publishing docTagPrefix. + * @member {string} docTagPrefix + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.docTagPrefix = ""; + + /** + * Publishing organization. + * @member {google.api.ClientLibraryOrganization} organization + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.organization = 0; + + /** + * Publishing librarySettings. + * @member {Array.} librarySettings + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.librarySettings = $util.emptyArray; + + /** + * Publishing protoReferenceDocumentationUri. + * @member {string} protoReferenceDocumentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.protoReferenceDocumentationUri = ""; + + /** + * Creates a new Publishing instance using the specified properties. + * @function create + * @memberof google.api.Publishing * @static - * @param {Object.} object Plain object - * @returns {google.api.RubySettings} RubySettings + * @param {google.api.IPublishing=} [properties] Properties to set + * @returns {google.api.Publishing} Publishing instance */ - RubySettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.RubySettings) - return object; - var message = new $root.google.api.RubySettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.RubySettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + Publishing.create = function create(properties) { + return new Publishing(properties); + }; + + /** + * Encodes the specified Publishing message. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @function encode + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing} message Publishing message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Publishing.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.methodSettings != null && message.methodSettings.length) + for (var i = 0; i < message.methodSettings.length; ++i) + $root.google.api.MethodSettings.encode(message.methodSettings[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.newIssueUri != null && Object.hasOwnProperty.call(message, "newIssueUri")) + writer.uint32(/* id 101, wireType 2 =*/810).string(message.newIssueUri); + if (message.documentationUri != null && Object.hasOwnProperty.call(message, "documentationUri")) + writer.uint32(/* id 102, wireType 2 =*/818).string(message.documentationUri); + if (message.apiShortName != null && Object.hasOwnProperty.call(message, "apiShortName")) + writer.uint32(/* id 103, wireType 2 =*/826).string(message.apiShortName); + if (message.githubLabel != null && Object.hasOwnProperty.call(message, "githubLabel")) + writer.uint32(/* id 104, wireType 2 =*/834).string(message.githubLabel); + if (message.codeownerGithubTeams != null && message.codeownerGithubTeams.length) + for (var i = 0; i < message.codeownerGithubTeams.length; ++i) + writer.uint32(/* id 105, wireType 2 =*/842).string(message.codeownerGithubTeams[i]); + if (message.docTagPrefix != null && Object.hasOwnProperty.call(message, "docTagPrefix")) + writer.uint32(/* id 106, wireType 2 =*/850).string(message.docTagPrefix); + if (message.organization != null && Object.hasOwnProperty.call(message, "organization")) + writer.uint32(/* id 107, wireType 0 =*/856).int32(message.organization); + if (message.librarySettings != null && message.librarySettings.length) + for (var i = 0; i < message.librarySettings.length; ++i) + $root.google.api.ClientLibrarySettings.encode(message.librarySettings[i], writer.uint32(/* id 109, wireType 2 =*/874).fork()).ldelim(); + if (message.protoReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "protoReferenceDocumentationUri")) + writer.uint32(/* id 110, wireType 2 =*/882).string(message.protoReferenceDocumentationUri); + return writer; + }; + + /** + * Encodes the specified Publishing message, length delimited. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing} message Publishing message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Publishing.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Publishing message from the specified reader or buffer. + * @function decode + * @memberof google.api.Publishing + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Publishing} Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Publishing.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Publishing(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + if (!(message.methodSettings && message.methodSettings.length)) + message.methodSettings = []; + message.methodSettings.push($root.google.api.MethodSettings.decode(reader, reader.uint32())); + break; + } + case 101: { + message.newIssueUri = reader.string(); + break; + } + case 102: { + message.documentationUri = reader.string(); + break; + } + case 103: { + message.apiShortName = reader.string(); + break; + } + case 104: { + message.githubLabel = reader.string(); + break; + } + case 105: { + if (!(message.codeownerGithubTeams && message.codeownerGithubTeams.length)) + message.codeownerGithubTeams = []; + message.codeownerGithubTeams.push(reader.string()); + break; + } + case 106: { + message.docTagPrefix = reader.string(); + break; + } + case 107: { + message.organization = reader.int32(); + break; + } + case 109: { + if (!(message.librarySettings && message.librarySettings.length)) + message.librarySettings = []; + message.librarySettings.push($root.google.api.ClientLibrarySettings.decode(reader, reader.uint32())); + break; + } + case 110: { + message.protoReferenceDocumentationUri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } } return message; }; - + /** - * Creates a plain object from a RubySettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.RubySettings + * Decodes a Publishing message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Publishing * @static - * @param {google.api.RubySettings} message RubySettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RubySettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this RubySettings to JSON. - * @function toJSON - * @memberof google.api.RubySettings - * @instance - * @returns {Object.} JSON object + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Publishing} Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RubySettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + Publishing.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); }; - + /** - * Gets the default type url for RubySettings - * @function getTypeUrl - * @memberof google.api.RubySettings + * Verifies a Publishing message. + * @function verify + * @memberof google.api.Publishing * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - RubySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; + Publishing.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.methodSettings != null && message.hasOwnProperty("methodSettings")) { + if (!Array.isArray(message.methodSettings)) + return "methodSettings: array expected"; + for (var i = 0; i < message.methodSettings.length; ++i) { + var error = $root.google.api.MethodSettings.verify(message.methodSettings[i]); + if (error) + return "methodSettings." + error; + } } - return typeUrlPrefix + "/google.api.RubySettings"; + if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) + if (!$util.isString(message.newIssueUri)) + return "newIssueUri: string expected"; + if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) + if (!$util.isString(message.documentationUri)) + return "documentationUri: string expected"; + if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) + if (!$util.isString(message.apiShortName)) + return "apiShortName: string expected"; + if (message.githubLabel != null && message.hasOwnProperty("githubLabel")) + if (!$util.isString(message.githubLabel)) + return "githubLabel: string expected"; + if (message.codeownerGithubTeams != null && message.hasOwnProperty("codeownerGithubTeams")) { + if (!Array.isArray(message.codeownerGithubTeams)) + return "codeownerGithubTeams: array expected"; + for (var i = 0; i < message.codeownerGithubTeams.length; ++i) + if (!$util.isString(message.codeownerGithubTeams[i])) + return "codeownerGithubTeams: string[] expected"; + } + if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix")) + if (!$util.isString(message.docTagPrefix)) + return "docTagPrefix: string expected"; + if (message.organization != null && message.hasOwnProperty("organization")) + switch (message.organization) { + default: + return "organization: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + if (message.librarySettings != null && message.hasOwnProperty("librarySettings")) { + if (!Array.isArray(message.librarySettings)) + return "librarySettings: array expected"; + for (var i = 0; i < message.librarySettings.length; ++i) { + var error = $root.google.api.ClientLibrarySettings.verify(message.librarySettings[i]); + if (error) + return "librarySettings." + error; + } + } + if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) + if (!$util.isString(message.protoReferenceDocumentationUri)) + return "protoReferenceDocumentationUri: string expected"; + return null; }; - - return RubySettings; - })(); - - api.GoSettings = (function() { - - /** - * Properties of a GoSettings. - * @memberof google.api - * @interface IGoSettings - * @property {google.api.ICommonLanguageSettings|null} [common] GoSettings common - */ - - /** - * Constructs a new GoSettings. - * @memberof google.api - * @classdesc Represents a GoSettings. - * @implements IGoSettings - * @constructor - * @param {google.api.IGoSettings=} [properties] Properties to set - */ - function GoSettings(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]]; - } - - /** - * GoSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.GoSettings - * @instance - */ - GoSettings.prototype.common = null; - + /** - * Creates a GoSettings message from a plain object. Also converts values to their respective internal types. + * Creates a Publishing message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.api.GoSettings + * @memberof google.api.Publishing * @static * @param {Object.} object Plain object - * @returns {google.api.GoSettings} GoSettings + * @returns {google.api.Publishing} Publishing */ - GoSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.GoSettings) + Publishing.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Publishing) return object; - var message = new $root.google.api.GoSettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.GoSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + var message = new $root.google.api.Publishing(); + if (object.methodSettings) { + if (!Array.isArray(object.methodSettings)) + throw TypeError(".google.api.Publishing.methodSettings: array expected"); + message.methodSettings = []; + for (var i = 0; i < object.methodSettings.length; ++i) { + if (typeof object.methodSettings[i] !== "object") + throw TypeError(".google.api.Publishing.methodSettings: object expected"); + message.methodSettings[i] = $root.google.api.MethodSettings.fromObject(object.methodSettings[i]); + } + } + if (object.newIssueUri != null) + message.newIssueUri = String(object.newIssueUri); + if (object.documentationUri != null) + message.documentationUri = String(object.documentationUri); + if (object.apiShortName != null) + message.apiShortName = String(object.apiShortName); + if (object.githubLabel != null) + message.githubLabel = String(object.githubLabel); + if (object.codeownerGithubTeams) { + if (!Array.isArray(object.codeownerGithubTeams)) + throw TypeError(".google.api.Publishing.codeownerGithubTeams: array expected"); + message.codeownerGithubTeams = []; + for (var i = 0; i < object.codeownerGithubTeams.length; ++i) + message.codeownerGithubTeams[i] = String(object.codeownerGithubTeams[i]); + } + if (object.docTagPrefix != null) + message.docTagPrefix = String(object.docTagPrefix); + switch (object.organization) { + default: + if (typeof object.organization === "number") { + message.organization = object.organization; + break; + } + break; + case "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": + case 0: + message.organization = 0; + break; + case "CLOUD": + case 1: + message.organization = 1; + break; + case "ADS": + case 2: + message.organization = 2; + break; + case "PHOTOS": + case 3: + message.organization = 3; + break; + case "STREET_VIEW": + case 4: + message.organization = 4; + break; + case "SHOPPING": + case 5: + message.organization = 5; + break; + case "GEO": + case 6: + message.organization = 6; + break; + case "GENERATIVE_AI": + case 7: + message.organization = 7; + break; + } + if (object.librarySettings) { + if (!Array.isArray(object.librarySettings)) + throw TypeError(".google.api.Publishing.librarySettings: array expected"); + message.librarySettings = []; + for (var i = 0; i < object.librarySettings.length; ++i) { + if (typeof object.librarySettings[i] !== "object") + throw TypeError(".google.api.Publishing.librarySettings: object expected"); + message.librarySettings[i] = $root.google.api.ClientLibrarySettings.fromObject(object.librarySettings[i]); + } } + if (object.protoReferenceDocumentationUri != null) + message.protoReferenceDocumentationUri = String(object.protoReferenceDocumentationUri); return message; }; - + /** - * Creates a plain object from a GoSettings message. Also converts values to other types if specified. + * Creates a plain object from a Publishing message. Also converts values to other types if specified. * @function toObject - * @memberof google.api.GoSettings + * @memberof google.api.Publishing * @static - * @param {google.api.GoSettings} message GoSettings + * @param {google.api.Publishing} message Publishing * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GoSettings.toObject = function toObject(message, options) { + Publishing.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + if (options.arrays || options.defaults) { + object.methodSettings = []; + object.codeownerGithubTeams = []; + object.librarySettings = []; + } + if (options.defaults) { + object.newIssueUri = ""; + object.documentationUri = ""; + object.apiShortName = ""; + object.githubLabel = ""; + object.docTagPrefix = ""; + object.organization = options.enums === String ? "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED" : 0; + object.protoReferenceDocumentationUri = ""; + } + if (message.methodSettings && message.methodSettings.length) { + object.methodSettings = []; + for (var j = 0; j < message.methodSettings.length; ++j) + object.methodSettings[j] = $root.google.api.MethodSettings.toObject(message.methodSettings[j], options); + } + if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) + object.newIssueUri = message.newIssueUri; + if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) + object.documentationUri = message.documentationUri; + if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) + object.apiShortName = message.apiShortName; + if (message.githubLabel != null && message.hasOwnProperty("githubLabel")) + object.githubLabel = message.githubLabel; + if (message.codeownerGithubTeams && message.codeownerGithubTeams.length) { + object.codeownerGithubTeams = []; + for (var j = 0; j < message.codeownerGithubTeams.length; ++j) + object.codeownerGithubTeams[j] = message.codeownerGithubTeams[j]; + } + if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix")) + object.docTagPrefix = message.docTagPrefix; + if (message.organization != null && message.hasOwnProperty("organization")) + object.organization = options.enums === String ? $root.google.api.ClientLibraryOrganization[message.organization] === undefined ? message.organization : $root.google.api.ClientLibraryOrganization[message.organization] : message.organization; + if (message.librarySettings && message.librarySettings.length) { + object.librarySettings = []; + for (var j = 0; j < message.librarySettings.length; ++j) + object.librarySettings[j] = $root.google.api.ClientLibrarySettings.toObject(message.librarySettings[j], options); + } + if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) + object.protoReferenceDocumentationUri = message.protoReferenceDocumentationUri; return object; }; - + /** - * Converts this GoSettings to JSON. + * Converts this Publishing to JSON. * @function toJSON - * @memberof google.api.GoSettings + * @memberof google.api.Publishing * @instance * @returns {Object.} JSON object */ - GoSettings.prototype.toJSON = function toJSON() { + Publishing.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - + /** - * Gets the default type url for GoSettings + * Gets the default type url for Publishing * @function getTypeUrl - * @memberof google.api.GoSettings + * @memberof google.api.Publishing * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - GoSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Publishing.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.api.GoSettings"; + return typeUrlPrefix + "/google.api.Publishing"; }; - - return GoSettings; + + return Publishing; })(); - - api.MethodSettings = (function() { - + + api.JavaSettings = (function() { + /** - * Properties of a MethodSettings. + * Properties of a JavaSettings. * @memberof google.api - * @interface IMethodSettings - * @property {string|null} [selector] MethodSettings selector - * @property {google.api.MethodSettings.ILongRunning|null} [longRunning] MethodSettings longRunning - * @property {Array.|null} [autoPopulatedFields] MethodSettings autoPopulatedFields + * @interface IJavaSettings + * @property {string|null} [libraryPackage] JavaSettings libraryPackage + * @property {Object.|null} [serviceClassNames] JavaSettings serviceClassNames + * @property {google.api.ICommonLanguageSettings|null} [common] JavaSettings common */ - + /** - * Constructs a new MethodSettings. + * Constructs a new JavaSettings. * @memberof google.api - * @classdesc Represents a MethodSettings. - * @implements IMethodSettings + * @classdesc Represents a JavaSettings. + * @implements IJavaSettings * @constructor - * @param {google.api.IMethodSettings=} [properties] Properties to set + * @param {google.api.IJavaSettings=} [properties] Properties to set */ - function MethodSettings(properties) { - this.autoPopulatedFields = []; + function JavaSettings(properties) { + this.serviceClassNames = {}; 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]]; } - + /** - * MethodSettings selector. - * @member {string} selector - * @memberof google.api.MethodSettings + * JavaSettings libraryPackage. + * @member {string} libraryPackage + * @memberof google.api.JavaSettings * @instance */ - MethodSettings.prototype.selector = ""; - + JavaSettings.prototype.libraryPackage = ""; + /** - * MethodSettings longRunning. - * @member {google.api.MethodSettings.ILongRunning|null|undefined} longRunning - * @memberof google.api.MethodSettings + * JavaSettings serviceClassNames. + * @member {Object.} serviceClassNames + * @memberof google.api.JavaSettings * @instance */ - MethodSettings.prototype.longRunning = null; - + JavaSettings.prototype.serviceClassNames = $util.emptyObject; + /** - * MethodSettings autoPopulatedFields. - * @member {Array.} autoPopulatedFields - * @memberof google.api.MethodSettings + * JavaSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.JavaSettings * @instance */ - MethodSettings.prototype.autoPopulatedFields = $util.emptyArray; - + JavaSettings.prototype.common = null; + /** - * Creates a MethodSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.MethodSettings + * Creates a new JavaSettings instance using the specified properties. + * @function create + * @memberof google.api.JavaSettings * @static - * @param {Object.} object Plain object - * @returns {google.api.MethodSettings} MethodSettings + * @param {google.api.IJavaSettings=} [properties] Properties to set + * @returns {google.api.JavaSettings} JavaSettings instance */ - MethodSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.MethodSettings) - return object; - var message = new $root.google.api.MethodSettings(); - if (object.selector != null) - message.selector = String(object.selector); - if (object.longRunning != null) { - if (typeof object.longRunning !== "object") - throw TypeError(".google.api.MethodSettings.longRunning: object expected"); - message.longRunning = $root.google.api.MethodSettings.LongRunning.fromObject(object.longRunning); - } - if (object.autoPopulatedFields) { - if (!Array.isArray(object.autoPopulatedFields)) - throw TypeError(".google.api.MethodSettings.autoPopulatedFields: array expected"); - message.autoPopulatedFields = []; - for (var i = 0; i < object.autoPopulatedFields.length; ++i) - message.autoPopulatedFields[i] = String(object.autoPopulatedFields[i]); - } - return message; + JavaSettings.create = function create(properties) { + return new JavaSettings(properties); }; - + /** - * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.MethodSettings + * Encodes the specified JavaSettings message. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @function encode + * @memberof google.api.JavaSettings * @static - * @param {google.api.MethodSettings} message MethodSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MethodSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.autoPopulatedFields = []; - if (options.defaults) { - object.selector = ""; - object.longRunning = null; - } - if (message.selector != null && message.hasOwnProperty("selector")) - object.selector = message.selector; - if (message.longRunning != null && message.hasOwnProperty("longRunning")) - object.longRunning = $root.google.api.MethodSettings.LongRunning.toObject(message.longRunning, options); - if (message.autoPopulatedFields && message.autoPopulatedFields.length) { - object.autoPopulatedFields = []; - for (var j = 0; j < message.autoPopulatedFields.length; ++j) - object.autoPopulatedFields[j] = message.autoPopulatedFields[j]; - } - return object; - }; - - /** - * Converts this MethodSettings to JSON. - * @function toJSON - * @memberof google.api.MethodSettings - * @instance - * @returns {Object.} JSON object - */ - MethodSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JavaSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.libraryPackage != null && Object.hasOwnProperty.call(message, "libraryPackage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.libraryPackage); + if (message.serviceClassNames != null && Object.hasOwnProperty.call(message, "serviceClassNames")) + for (var keys = Object.keys(message.serviceClassNames), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.serviceClassNames[keys[i]]).ldelim(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; }; - + /** - * Gets the default type url for MethodSettings - * @function getTypeUrl - * @memberof google.api.MethodSettings + * Encodes the specified JavaSettings message, length delimited. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.JavaSettings * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MethodSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.MethodSettings"; - }; - - MethodSettings.LongRunning = (function() { - - /** - * Properties of a LongRunning. - * @memberof google.api.MethodSettings - * @interface ILongRunning - * @property {google.protobuf.IDuration|null} [initialPollDelay] LongRunning initialPollDelay - * @property {number|null} [pollDelayMultiplier] LongRunning pollDelayMultiplier - * @property {google.protobuf.IDuration|null} [maxPollDelay] LongRunning maxPollDelay - * @property {google.protobuf.IDuration|null} [totalPollTimeout] LongRunning totalPollTimeout - */ - - /** - * Constructs a new LongRunning. - * @memberof google.api.MethodSettings - * @classdesc Represents a LongRunning. - * @implements ILongRunning - * @constructor - * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set - */ - function LongRunning(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]]; - } - - /** - * LongRunning initialPollDelay. - * @member {google.protobuf.IDuration|null|undefined} initialPollDelay - * @memberof google.api.MethodSettings.LongRunning - * @instance - */ - LongRunning.prototype.initialPollDelay = null; - - /** - * LongRunning pollDelayMultiplier. - * @member {number} pollDelayMultiplier - * @memberof google.api.MethodSettings.LongRunning - * @instance - */ - LongRunning.prototype.pollDelayMultiplier = 0; - - /** - * LongRunning maxPollDelay. - * @member {google.protobuf.IDuration|null|undefined} maxPollDelay - * @memberof google.api.MethodSettings.LongRunning - * @instance - */ - LongRunning.prototype.maxPollDelay = null; - - /** - * LongRunning totalPollTimeout. - * @member {google.protobuf.IDuration|null|undefined} totalPollTimeout - * @memberof google.api.MethodSettings.LongRunning - * @instance - */ - LongRunning.prototype.totalPollTimeout = null; - - /** - * Creates a LongRunning message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {Object.} object Plain object - * @returns {google.api.MethodSettings.LongRunning} LongRunning - */ - LongRunning.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.MethodSettings.LongRunning) - return object; - var message = new $root.google.api.MethodSettings.LongRunning(); - if (object.initialPollDelay != null) { - if (typeof object.initialPollDelay !== "object") - throw TypeError(".google.api.MethodSettings.LongRunning.initialPollDelay: object expected"); - message.initialPollDelay = $root.google.protobuf.Duration.fromObject(object.initialPollDelay); - } - if (object.pollDelayMultiplier != null) - message.pollDelayMultiplier = Number(object.pollDelayMultiplier); - if (object.maxPollDelay != null) { - if (typeof object.maxPollDelay !== "object") - throw TypeError(".google.api.MethodSettings.LongRunning.maxPollDelay: object expected"); - message.maxPollDelay = $root.google.protobuf.Duration.fromObject(object.maxPollDelay); - } - if (object.totalPollTimeout != null) { - if (typeof object.totalPollTimeout !== "object") - throw TypeError(".google.api.MethodSettings.LongRunning.totalPollTimeout: object expected"); - message.totalPollTimeout = $root.google.protobuf.Duration.fromObject(object.totalPollTimeout); - } - return message; - }; - - /** - * Creates a plain object from a LongRunning message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {google.api.MethodSettings.LongRunning} message LongRunning - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - LongRunning.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.initialPollDelay = null; - object.pollDelayMultiplier = 0; - object.maxPollDelay = null; - object.totalPollTimeout = null; - } - if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay")) - object.initialPollDelay = $root.google.protobuf.Duration.toObject(message.initialPollDelay, options); - if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier")) - object.pollDelayMultiplier = options.json && !isFinite(message.pollDelayMultiplier) ? String(message.pollDelayMultiplier) : message.pollDelayMultiplier; - if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay")) - object.maxPollDelay = $root.google.protobuf.Duration.toObject(message.maxPollDelay, options); - if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout")) - object.totalPollTimeout = $root.google.protobuf.Duration.toObject(message.totalPollTimeout, options); - return object; - }; - - /** - * Converts this LongRunning to JSON. - * @function toJSON - * @memberof google.api.MethodSettings.LongRunning - * @instance - * @returns {Object.} JSON object - */ - LongRunning.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for LongRunning - * @function getTypeUrl - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - LongRunning.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; + * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JavaSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a JavaSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.JavaSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.JavaSettings} JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JavaSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.JavaSettings(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.libraryPackage = reader.string(); + break; + } + case 2: { + if (message.serviceClassNames === $util.emptyObject) + message.serviceClassNames = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.serviceClassNames[key] = value; + break; + } + case 3: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; } - return typeUrlPrefix + "/google.api.MethodSettings.LongRunning"; - }; - - return LongRunning; - })(); - - return MethodSettings; - })(); - - /** - * ClientLibraryOrganization enum. - * @name google.api.ClientLibraryOrganization - * @enum {string} - * @property {string} CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED=CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED value - * @property {string} CLOUD=CLOUD CLOUD value - * @property {string} ADS=ADS ADS value - * @property {string} PHOTOS=PHOTOS PHOTOS value - * @property {string} STREET_VIEW=STREET_VIEW STREET_VIEW value - * @property {string} SHOPPING=SHOPPING SHOPPING value - * @property {string} GEO=GEO GEO value - * @property {string} GENERATIVE_AI=GENERATIVE_AI GENERATIVE_AI value - */ - api.ClientLibraryOrganization = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED"] = "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED"; - values[valuesById[1] = "CLOUD"] = "CLOUD"; - values[valuesById[2] = "ADS"] = "ADS"; - values[valuesById[3] = "PHOTOS"] = "PHOTOS"; - values[valuesById[4] = "STREET_VIEW"] = "STREET_VIEW"; - values[valuesById[5] = "SHOPPING"] = "SHOPPING"; - values[valuesById[6] = "GEO"] = "GEO"; - values[valuesById[7] = "GENERATIVE_AI"] = "GENERATIVE_AI"; - return values; - })(); - - /** - * ClientLibraryDestination enum. - * @name google.api.ClientLibraryDestination - * @enum {string} - * @property {string} CLIENT_LIBRARY_DESTINATION_UNSPECIFIED=CLIENT_LIBRARY_DESTINATION_UNSPECIFIED CLIENT_LIBRARY_DESTINATION_UNSPECIFIED value - * @property {string} GITHUB=GITHUB GITHUB value - * @property {string} PACKAGE_MANAGER=PACKAGE_MANAGER PACKAGE_MANAGER value - */ - api.ClientLibraryDestination = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED"] = "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED"; - values[valuesById[10] = "GITHUB"] = "GITHUB"; - values[valuesById[20] = "PACKAGE_MANAGER"] = "PACKAGE_MANAGER"; - return values; - })(); - - /** - * FieldBehavior enum. - * @name google.api.FieldBehavior - * @enum {string} - * @property {string} FIELD_BEHAVIOR_UNSPECIFIED=FIELD_BEHAVIOR_UNSPECIFIED FIELD_BEHAVIOR_UNSPECIFIED value - * @property {string} OPTIONAL=OPTIONAL OPTIONAL value - * @property {string} REQUIRED=REQUIRED REQUIRED value - * @property {string} OUTPUT_ONLY=OUTPUT_ONLY OUTPUT_ONLY value - * @property {string} INPUT_ONLY=INPUT_ONLY INPUT_ONLY value - * @property {string} IMMUTABLE=IMMUTABLE IMMUTABLE value - * @property {string} UNORDERED_LIST=UNORDERED_LIST UNORDERED_LIST value - * @property {string} NON_EMPTY_DEFAULT=NON_EMPTY_DEFAULT NON_EMPTY_DEFAULT value - * @property {string} IDENTIFIER=IDENTIFIER IDENTIFIER value - */ - api.FieldBehavior = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "FIELD_BEHAVIOR_UNSPECIFIED"] = "FIELD_BEHAVIOR_UNSPECIFIED"; - values[valuesById[1] = "OPTIONAL"] = "OPTIONAL"; - values[valuesById[2] = "REQUIRED"] = "REQUIRED"; - values[valuesById[3] = "OUTPUT_ONLY"] = "OUTPUT_ONLY"; - values[valuesById[4] = "INPUT_ONLY"] = "INPUT_ONLY"; - values[valuesById[5] = "IMMUTABLE"] = "IMMUTABLE"; - values[valuesById[6] = "UNORDERED_LIST"] = "UNORDERED_LIST"; - values[valuesById[7] = "NON_EMPTY_DEFAULT"] = "NON_EMPTY_DEFAULT"; - values[valuesById[8] = "IDENTIFIER"] = "IDENTIFIER"; - return values; - })(); - - /** - * LaunchStage enum. - * @name google.api.LaunchStage - * @enum {string} - * @property {string} LAUNCH_STAGE_UNSPECIFIED=LAUNCH_STAGE_UNSPECIFIED LAUNCH_STAGE_UNSPECIFIED value - * @property {string} UNIMPLEMENTED=UNIMPLEMENTED UNIMPLEMENTED value - * @property {string} PRELAUNCH=PRELAUNCH PRELAUNCH value - * @property {string} EARLY_ACCESS=EARLY_ACCESS EARLY_ACCESS value - * @property {string} ALPHA=ALPHA ALPHA value - * @property {string} BETA=BETA BETA value - * @property {string} GA=GA GA value - * @property {string} DEPRECATED=DEPRECATED DEPRECATED value - */ - api.LaunchStage = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "LAUNCH_STAGE_UNSPECIFIED"] = "LAUNCH_STAGE_UNSPECIFIED"; - values[valuesById[6] = "UNIMPLEMENTED"] = "UNIMPLEMENTED"; - values[valuesById[7] = "PRELAUNCH"] = "PRELAUNCH"; - values[valuesById[1] = "EARLY_ACCESS"] = "EARLY_ACCESS"; - values[valuesById[2] = "ALPHA"] = "ALPHA"; - values[valuesById[3] = "BETA"] = "BETA"; - values[valuesById[4] = "GA"] = "GA"; - values[valuesById[5] = "DEPRECATED"] = "DEPRECATED"; - return values; + } + return message; + }; + + /** + * Decodes a JavaSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.JavaSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.JavaSettings} JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JavaSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a JavaSettings message. + * @function verify + * @memberof google.api.JavaSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + JavaSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) + if (!$util.isString(message.libraryPackage)) + return "libraryPackage: string expected"; + if (message.serviceClassNames != null && message.hasOwnProperty("serviceClassNames")) { + if (!$util.isObject(message.serviceClassNames)) + return "serviceClassNames: object expected"; + var key = Object.keys(message.serviceClassNames); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.serviceClassNames[key[i]])) + return "serviceClassNames: string{k:string} expected"; + } + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a JavaSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.JavaSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.JavaSettings} JavaSettings + */ + JavaSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.JavaSettings) + return object; + var message = new $root.google.api.JavaSettings(); + if (object.libraryPackage != null) + message.libraryPackage = String(object.libraryPackage); + if (object.serviceClassNames) { + if (typeof object.serviceClassNames !== "object") + throw TypeError(".google.api.JavaSettings.serviceClassNames: object expected"); + message.serviceClassNames = {}; + for (var keys = Object.keys(object.serviceClassNames), i = 0; i < keys.length; ++i) + message.serviceClassNames[keys[i]] = String(object.serviceClassNames[keys[i]]); + } + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.JavaSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a JavaSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.JavaSettings + * @static + * @param {google.api.JavaSettings} message JavaSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + JavaSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.serviceClassNames = {}; + if (options.defaults) { + object.libraryPackage = ""; + object.common = null; + } + if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) + object.libraryPackage = message.libraryPackage; + var keys2; + if (message.serviceClassNames && (keys2 = Object.keys(message.serviceClassNames)).length) { + object.serviceClassNames = {}; + for (var j = 0; j < keys2.length; ++j) + object.serviceClassNames[keys2[j]] = message.serviceClassNames[keys2[j]]; + } + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this JavaSettings to JSON. + * @function toJSON + * @memberof google.api.JavaSettings + * @instance + * @returns {Object.} JSON object + */ + JavaSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for JavaSettings + * @function getTypeUrl + * @memberof google.api.JavaSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + JavaSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.JavaSettings"; + }; + + return JavaSettings; })(); - - api.ResourceDescriptor = (function() { - + + api.CppSettings = (function() { + /** - * Properties of a ResourceDescriptor. + * Properties of a CppSettings. * @memberof google.api - * @interface IResourceDescriptor - * @property {string|null} [type] ResourceDescriptor type - * @property {Array.|null} [pattern] ResourceDescriptor pattern - * @property {string|null} [nameField] ResourceDescriptor nameField - * @property {google.api.ResourceDescriptor.History|null} [history] ResourceDescriptor history - * @property {string|null} [plural] ResourceDescriptor plural - * @property {string|null} [singular] ResourceDescriptor singular - * @property {Array.|null} [style] ResourceDescriptor style - */ - - /** - * Constructs a new ResourceDescriptor. + * @interface ICppSettings + * @property {google.api.ICommonLanguageSettings|null} [common] CppSettings common + */ + + /** + * Constructs a new CppSettings. * @memberof google.api - * @classdesc Represents a ResourceDescriptor. - * @implements IResourceDescriptor + * @classdesc Represents a CppSettings. + * @implements ICppSettings * @constructor - * @param {google.api.IResourceDescriptor=} [properties] Properties to set + * @param {google.api.ICppSettings=} [properties] Properties to set */ - function ResourceDescriptor(properties) { - this.pattern = []; - this.style = []; + function CppSettings(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]]; } - + /** - * ResourceDescriptor type. - * @member {string} type - * @memberof google.api.ResourceDescriptor + * CppSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.CppSettings * @instance */ - ResourceDescriptor.prototype.type = ""; - + CppSettings.prototype.common = null; + /** - * ResourceDescriptor pattern. - * @member {Array.} pattern - * @memberof google.api.ResourceDescriptor - * @instance + * Creates a new CppSettings instance using the specified properties. + * @function create + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings=} [properties] Properties to set + * @returns {google.api.CppSettings} CppSettings instance */ - ResourceDescriptor.prototype.pattern = $util.emptyArray; - + CppSettings.create = function create(properties) { + return new CppSettings(properties); + }; + /** - * ResourceDescriptor nameField. - * @member {string} nameField - * @memberof google.api.ResourceDescriptor - * @instance + * Encodes the specified CppSettings message. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @function encode + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings} message CppSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - ResourceDescriptor.prototype.nameField = ""; - + CppSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + /** - * ResourceDescriptor history. - * @member {google.api.ResourceDescriptor.History} history - * @memberof google.api.ResourceDescriptor - * @instance + * Encodes the specified CppSettings message, length delimited. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings} message CppSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - ResourceDescriptor.prototype.history = 0; - + CppSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + /** - * ResourceDescriptor plural. - * @member {string} plural - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.plural = ""; - + * Decodes a CppSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.CppSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CppSettings} CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CppSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CppSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + /** - * ResourceDescriptor singular. - * @member {string} singular - * @memberof google.api.ResourceDescriptor - * @instance + * Decodes a CppSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CppSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CppSettings} CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ResourceDescriptor.prototype.singular = ""; - + CppSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + /** - * ResourceDescriptor style. - * @member {Array.} style - * @memberof google.api.ResourceDescriptor - * @instance + * Verifies a CppSettings message. + * @function verify + * @memberof google.api.CppSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ResourceDescriptor.prototype.style = $util.emptyArray; - + CppSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + /** - * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * Creates a CppSettings message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.api.ResourceDescriptor + * @memberof google.api.CppSettings * @static * @param {Object.} object Plain object - * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @returns {google.api.CppSettings} CppSettings */ - ResourceDescriptor.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.ResourceDescriptor) + CppSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CppSettings) return object; - var message = new $root.google.api.ResourceDescriptor(); - if (object.type != null) - message.type = String(object.type); - if (object.pattern) { - if (!Array.isArray(object.pattern)) - throw TypeError(".google.api.ResourceDescriptor.pattern: array expected"); - message.pattern = []; - for (var i = 0; i < object.pattern.length; ++i) - message.pattern[i] = String(object.pattern[i]); - } - if (object.nameField != null) - message.nameField = String(object.nameField); - switch (object.history) { - default: - if (typeof object.history === "number") { - message.history = object.history; - break; - } - break; - case "HISTORY_UNSPECIFIED": - case 0: - message.history = 0; - break; - case "ORIGINALLY_SINGLE_PATTERN": - case 1: - message.history = 1; - break; - case "FUTURE_MULTI_PATTERN": - case 2: - message.history = 2; - break; - } - if (object.plural != null) - message.plural = String(object.plural); - if (object.singular != null) - message.singular = String(object.singular); - if (object.style) { - if (!Array.isArray(object.style)) - throw TypeError(".google.api.ResourceDescriptor.style: array expected"); - message.style = []; - for (var i = 0; i < object.style.length; ++i) - switch (object.style[i]) { - default: - if (typeof object.style[i] === "number") { - message.style[i] = object.style[i]; - break; - } - case "STYLE_UNSPECIFIED": - case 0: - message.style[i] = 0; - break; - case "DECLARATIVE_FRIENDLY": - case 1: - message.style[i] = 1; - break; - } + var message = new $root.google.api.CppSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.CppSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); } return message; }; - + /** - * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * Creates a plain object from a CppSettings message. Also converts values to other types if specified. * @function toObject - * @memberof google.api.ResourceDescriptor + * @memberof google.api.CppSettings * @static - * @param {google.api.ResourceDescriptor} message ResourceDescriptor + * @param {google.api.CppSettings} message CppSettings * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ResourceDescriptor.toObject = function toObject(message, options) { + CppSettings.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.pattern = []; - object.style = []; - } - if (options.defaults) { - object.type = ""; - object.nameField = ""; - object.history = options.enums === String ? "HISTORY_UNSPECIFIED" : 0; - object.plural = ""; - object.singular = ""; - } - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.pattern && message.pattern.length) { - object.pattern = []; - for (var j = 0; j < message.pattern.length; ++j) - object.pattern[j] = message.pattern[j]; - } - if (message.nameField != null && message.hasOwnProperty("nameField")) - object.nameField = message.nameField; - if (message.history != null && message.hasOwnProperty("history")) - object.history = options.enums === String ? $root.google.api.ResourceDescriptor.History[message.history] === undefined ? message.history : $root.google.api.ResourceDescriptor.History[message.history] : message.history; - if (message.plural != null && message.hasOwnProperty("plural")) - object.plural = message.plural; - if (message.singular != null && message.hasOwnProperty("singular")) - object.singular = message.singular; - if (message.style && message.style.length) { - object.style = []; - for (var j = 0; j < message.style.length; ++j) - object.style[j] = options.enums === String ? $root.google.api.ResourceDescriptor.Style[message.style[j]] === undefined ? message.style[j] : $root.google.api.ResourceDescriptor.Style[message.style[j]] : message.style[j]; - } + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); return object; }; - + /** - * Converts this ResourceDescriptor to JSON. + * Converts this CppSettings to JSON. * @function toJSON - * @memberof google.api.ResourceDescriptor + * @memberof google.api.CppSettings * @instance * @returns {Object.} JSON object */ - ResourceDescriptor.prototype.toJSON = function toJSON() { + CppSettings.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - + /** - * Gets the default type url for ResourceDescriptor + * Gets the default type url for CppSettings * @function getTypeUrl - * @memberof google.api.ResourceDescriptor + * @memberof google.api.CppSettings * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ResourceDescriptor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + CppSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.api.ResourceDescriptor"; + return typeUrlPrefix + "/google.api.CppSettings"; }; - - /** - * History enum. - * @name google.api.ResourceDescriptor.History - * @enum {string} - * @property {string} HISTORY_UNSPECIFIED=HISTORY_UNSPECIFIED HISTORY_UNSPECIFIED value - * @property {string} ORIGINALLY_SINGLE_PATTERN=ORIGINALLY_SINGLE_PATTERN ORIGINALLY_SINGLE_PATTERN value - * @property {string} FUTURE_MULTI_PATTERN=FUTURE_MULTI_PATTERN FUTURE_MULTI_PATTERN value - */ - ResourceDescriptor.History = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "HISTORY_UNSPECIFIED"] = "HISTORY_UNSPECIFIED"; - values[valuesById[1] = "ORIGINALLY_SINGLE_PATTERN"] = "ORIGINALLY_SINGLE_PATTERN"; - values[valuesById[2] = "FUTURE_MULTI_PATTERN"] = "FUTURE_MULTI_PATTERN"; - return values; - })(); - - /** - * Style enum. - * @name google.api.ResourceDescriptor.Style - * @enum {string} - * @property {string} STYLE_UNSPECIFIED=STYLE_UNSPECIFIED STYLE_UNSPECIFIED value - * @property {string} DECLARATIVE_FRIENDLY=DECLARATIVE_FRIENDLY DECLARATIVE_FRIENDLY value - */ - ResourceDescriptor.Style = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STYLE_UNSPECIFIED"] = "STYLE_UNSPECIFIED"; - values[valuesById[1] = "DECLARATIVE_FRIENDLY"] = "DECLARATIVE_FRIENDLY"; - return values; - })(); - - return ResourceDescriptor; + + return CppSettings; })(); - - api.ResourceReference = (function() { - + + api.PhpSettings = (function() { + /** - * Properties of a ResourceReference. + * Properties of a PhpSettings. * @memberof google.api - * @interface IResourceReference - * @property {string|null} [type] ResourceReference type - * @property {string|null} [childType] ResourceReference childType + * @interface IPhpSettings + * @property {google.api.ICommonLanguageSettings|null} [common] PhpSettings common */ - + /** - * Constructs a new ResourceReference. + * Constructs a new PhpSettings. * @memberof google.api - * @classdesc Represents a ResourceReference. - * @implements IResourceReference + * @classdesc Represents a PhpSettings. + * @implements IPhpSettings * @constructor - * @param {google.api.IResourceReference=} [properties] Properties to set + * @param {google.api.IPhpSettings=} [properties] Properties to set */ - function ResourceReference(properties) { + function PhpSettings(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]]; } - + /** - * ResourceReference type. - * @member {string} type - * @memberof google.api.ResourceReference + * PhpSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.PhpSettings * @instance */ - ResourceReference.prototype.type = ""; - + PhpSettings.prototype.common = null; + /** - * ResourceReference childType. - * @member {string} childType - * @memberof google.api.ResourceReference - * @instance + * Creates a new PhpSettings instance using the specified properties. + * @function create + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings=} [properties] Properties to set + * @returns {google.api.PhpSettings} PhpSettings instance + */ + PhpSettings.create = function create(properties) { + return new PhpSettings(properties); + }; + + /** + * Encodes the specified PhpSettings message. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @function encode + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PhpSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PhpSettings message, length delimited. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PhpSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PhpSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.PhpSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.PhpSettings} PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PhpSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PhpSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PhpSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.PhpSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.PhpSettings} PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PhpSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PhpSettings message. + * @function verify + * @memberof google.api.PhpSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ResourceReference.prototype.childType = ""; - + PhpSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + /** - * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * Creates a PhpSettings message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.api.ResourceReference + * @memberof google.api.PhpSettings * @static * @param {Object.} object Plain object - * @returns {google.api.ResourceReference} ResourceReference + * @returns {google.api.PhpSettings} PhpSettings */ - ResourceReference.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.ResourceReference) + PhpSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.PhpSettings) return object; - var message = new $root.google.api.ResourceReference(); - if (object.type != null) - message.type = String(object.type); - if (object.childType != null) - message.childType = String(object.childType); + var message = new $root.google.api.PhpSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.PhpSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } return message; }; - + /** - * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. * @function toObject - * @memberof google.api.ResourceReference + * @memberof google.api.PhpSettings * @static - * @param {google.api.ResourceReference} message ResourceReference + * @param {google.api.PhpSettings} message PhpSettings * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ResourceReference.toObject = function toObject(message, options) { + PhpSettings.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.type = ""; - object.childType = ""; - } - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.childType != null && message.hasOwnProperty("childType")) - object.childType = message.childType; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); return object; }; - + /** - * Converts this ResourceReference to JSON. + * Converts this PhpSettings to JSON. * @function toJSON - * @memberof google.api.ResourceReference + * @memberof google.api.PhpSettings * @instance * @returns {Object.} JSON object */ - ResourceReference.prototype.toJSON = function toJSON() { + PhpSettings.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - + /** - * Gets the default type url for ResourceReference + * Gets the default type url for PhpSettings * @function getTypeUrl - * @memberof google.api.ResourceReference + * @memberof google.api.PhpSettings * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ResourceReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + PhpSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.api.ResourceReference"; + return typeUrlPrefix + "/google.api.PhpSettings"; }; - - return ResourceReference; + + return PhpSettings; })(); - - return api; - })(); - - google.type = (function() { - - /** - * Namespace type. - * @memberof google - * @namespace - */ - var type = {}; - - type.LatLng = (function() { - + + api.PythonSettings = (function() { + /** - * Properties of a LatLng. - * @memberof google.type - * @interface ILatLng - * @property {number|null} [latitude] LatLng latitude - * @property {number|null} [longitude] LatLng longitude + * Properties of a PythonSettings. + * @memberof google.api + * @interface IPythonSettings + * @property {google.api.ICommonLanguageSettings|null} [common] PythonSettings common */ - + /** - * Constructs a new LatLng. - * @memberof google.type - * @classdesc Represents a LatLng. - * @implements ILatLng + * Constructs a new PythonSettings. + * @memberof google.api + * @classdesc Represents a PythonSettings. + * @implements IPythonSettings * @constructor - * @param {google.type.ILatLng=} [properties] Properties to set + * @param {google.api.IPythonSettings=} [properties] Properties to set */ - function LatLng(properties) { + function PythonSettings(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]]; } - + /** - * LatLng latitude. - * @member {number} latitude - * @memberof google.type.LatLng + * PythonSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.PythonSettings * @instance */ - LatLng.prototype.latitude = 0; - + PythonSettings.prototype.common = null; + /** - * LatLng longitude. - * @member {number} longitude - * @memberof google.type.LatLng - * @instance + * Creates a new PythonSettings instance using the specified properties. + * @function create + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings=} [properties] Properties to set + * @returns {google.api.PythonSettings} PythonSettings instance */ - LatLng.prototype.longitude = 0; - + PythonSettings.create = function create(properties) { + return new PythonSettings(properties); + }; + /** - * Creates a LatLng message from a plain object. Also converts values to their respective internal types. + * Encodes the specified PythonSettings message. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @function encode + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PythonSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PythonSettings message, length delimited. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PythonSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PythonSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.PythonSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.PythonSettings} PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PythonSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PythonSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PythonSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.PythonSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.PythonSettings} PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PythonSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PythonSettings message. + * @function verify + * @memberof google.api.PythonSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PythonSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a PythonSettings message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.type.LatLng + * @memberof google.api.PythonSettings * @static * @param {Object.} object Plain object - * @returns {google.type.LatLng} LatLng + * @returns {google.api.PythonSettings} PythonSettings */ - LatLng.fromObject = function fromObject(object) { - if (object instanceof $root.google.type.LatLng) + PythonSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.PythonSettings) return object; - var message = new $root.google.type.LatLng(); - if (object.latitude != null) - message.latitude = Number(object.latitude); - if (object.longitude != null) - message.longitude = Number(object.longitude); + var message = new $root.google.api.PythonSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.PythonSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } return message; }; - + /** - * Creates a plain object from a LatLng message. Also converts values to other types if specified. + * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. * @function toObject - * @memberof google.type.LatLng + * @memberof google.api.PythonSettings * @static - * @param {google.type.LatLng} message LatLng + * @param {google.api.PythonSettings} message PythonSettings * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - LatLng.toObject = function toObject(message, options) { + PythonSettings.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.latitude = 0; - object.longitude = 0; - } - if (message.latitude != null && message.hasOwnProperty("latitude")) - object.latitude = options.json && !isFinite(message.latitude) ? String(message.latitude) : message.latitude; - if (message.longitude != null && message.hasOwnProperty("longitude")) - object.longitude = options.json && !isFinite(message.longitude) ? String(message.longitude) : message.longitude; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); return object; }; - + /** - * Converts this LatLng to JSON. + * Converts this PythonSettings to JSON. * @function toJSON - * @memberof google.type.LatLng + * @memberof google.api.PythonSettings * @instance * @returns {Object.} JSON object */ - LatLng.prototype.toJSON = function toJSON() { + PythonSettings.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - + /** - * Gets the default type url for LatLng + * Gets the default type url for PythonSettings * @function getTypeUrl - * @memberof google.type.LatLng + * @memberof google.api.PythonSettings * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - LatLng.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + PythonSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.type.LatLng"; + return typeUrlPrefix + "/google.api.PythonSettings"; }; - - return LatLng; + + return PythonSettings; })(); - - return type; - })(); - - google.rpc = (function() { - - /** - * Namespace rpc. - * @memberof google - * @namespace - */ - var rpc = {}; - - rpc.Status = (function() { - + + api.NodeSettings = (function() { + /** - * Properties of a Status. - * @memberof google.rpc - * @interface IStatus - * @property {number|null} [code] Status code - * @property {string|null} [message] Status message - * @property {Array.|null} [details] Status details + * Properties of a NodeSettings. + * @memberof google.api + * @interface INodeSettings + * @property {google.api.ICommonLanguageSettings|null} [common] NodeSettings common */ - + /** - * Constructs a new Status. - * @memberof google.rpc - * @classdesc Represents a Status. - * @implements IStatus + * Constructs a new NodeSettings. + * @memberof google.api + * @classdesc Represents a NodeSettings. + * @implements INodeSettings * @constructor - * @param {google.rpc.IStatus=} [properties] Properties to set + * @param {google.api.INodeSettings=} [properties] Properties to set */ - function Status(properties) { - this.details = []; + function NodeSettings(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]]; } - + /** - * Status code. - * @member {number} code - * @memberof google.rpc.Status + * NodeSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.NodeSettings * @instance */ - Status.prototype.code = 0; - + NodeSettings.prototype.common = null; + /** - * Status message. - * @member {string} message - * @memberof google.rpc.Status - * @instance + * Creates a new NodeSettings instance using the specified properties. + * @function create + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings=} [properties] Properties to set + * @returns {google.api.NodeSettings} NodeSettings instance */ - Status.prototype.message = ""; - + NodeSettings.create = function create(properties) { + return new NodeSettings(properties); + }; + /** - * Status details. - * @member {Array.} details - * @memberof google.rpc.Status - * @instance + * Encodes the specified NodeSettings message. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @function encode + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Status.prototype.details = $util.emptyArray; - + NodeSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + /** - * Creates a Status message from a plain object. Also converts values to their respective internal types. + * Encodes the specified NodeSettings message, length delimited. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NodeSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.NodeSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.NodeSettings} NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.NodeSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NodeSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.NodeSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.NodeSettings} NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NodeSettings message. + * @function verify + * @memberof google.api.NodeSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NodeSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a NodeSettings message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.rpc.Status + * @memberof google.api.NodeSettings * @static * @param {Object.} object Plain object - * @returns {google.rpc.Status} Status + * @returns {google.api.NodeSettings} NodeSettings */ - Status.fromObject = function fromObject(object) { - if (object instanceof $root.google.rpc.Status) + NodeSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.NodeSettings) return object; - var message = new $root.google.rpc.Status(); - if (object.code != null) - message.code = object.code | 0; - if (object.message != null) - message.message = String(object.message); - if (object.details) { - if (!Array.isArray(object.details)) - throw TypeError(".google.rpc.Status.details: array expected"); - message.details = []; - for (var i = 0; i < object.details.length; ++i) { - if (typeof object.details[i] !== "object") - throw TypeError(".google.rpc.Status.details: object expected"); - message.details[i] = $root.google.protobuf.Any.fromObject(object.details[i]); - } + var message = new $root.google.api.NodeSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.NodeSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); } return message; }; - + /** - * Creates a plain object from a Status message. Also converts values to other types if specified. + * Creates a plain object from a NodeSettings message. Also converts values to other types if specified. * @function toObject - * @memberof google.rpc.Status + * @memberof google.api.NodeSettings * @static - * @param {google.rpc.Status} message Status + * @param {google.api.NodeSettings} message NodeSettings * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Status.toObject = function toObject(message, options) { + NodeSettings.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.details = []; - if (options.defaults) { - object.code = 0; - object.message = ""; - } - if (message.code != null && message.hasOwnProperty("code")) - object.code = message.code; - if (message.message != null && message.hasOwnProperty("message")) - object.message = message.message; - if (message.details && message.details.length) { - object.details = []; - for (var j = 0; j < message.details.length; ++j) - object.details[j] = $root.google.protobuf.Any.toObject(message.details[j], options); - } + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); return object; }; - + /** - * Converts this Status to JSON. + * Converts this NodeSettings to JSON. * @function toJSON - * @memberof google.rpc.Status + * @memberof google.api.NodeSettings * @instance * @returns {Object.} JSON object */ - Status.prototype.toJSON = function toJSON() { + NodeSettings.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - + /** - * Gets the default type url for Status + * Gets the default type url for NodeSettings * @function getTypeUrl - * @memberof google.rpc.Status + * @memberof google.api.NodeSettings * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - Status.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + NodeSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.rpc.Status"; + return typeUrlPrefix + "/google.api.NodeSettings"; }; - - return Status; + + return NodeSettings; })(); - - return rpc; - })(); - - google.longrunning = (function() { - - /** - * Namespace longrunning. - * @memberof google - * @namespace - */ - var longrunning = {}; - - longrunning.Operations = (function() { - - /** - * Constructs a new Operations service. - * @memberof google.longrunning - * @classdesc Represents an Operations - * @extends $protobuf.rpc.Service - * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ - function Operations(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (Operations.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Operations; - - /** - * Callback as used by {@link google.longrunning.Operations#listOperations}. - * @memberof google.longrunning.Operations - * @typedef ListOperationsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.ListOperationsResponse} [response] ListOperationsResponse - */ - - /** - * Calls ListOperations. - * @function listOperations - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object - * @param {google.longrunning.Operations.ListOperationsCallback} callback Node-style callback called with the error, if any, and ListOperationsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Operations.prototype.listOperations = function listOperations(request, callback) { - return this.rpcCall(listOperations, $root.google.longrunning.ListOperationsRequest, $root.google.longrunning.ListOperationsResponse, request, callback); - }, "name", { value: "ListOperations" }); - - /** - * Calls ListOperations. - * @function listOperations - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.longrunning.Operations#getOperation}. - * @memberof google.longrunning.Operations - * @typedef GetOperationCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls GetOperation. - * @function getOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object - * @param {google.longrunning.Operations.GetOperationCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Operations.prototype.getOperation = function getOperation(request, callback) { - return this.rpcCall(getOperation, $root.google.longrunning.GetOperationRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "GetOperation" }); - - /** - * Calls GetOperation. - * @function getOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.longrunning.Operations#deleteOperation}. - * @memberof google.longrunning.Operations - * @typedef DeleteOperationCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls DeleteOperation. - * @function deleteOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object - * @param {google.longrunning.Operations.DeleteOperationCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Operations.prototype.deleteOperation = function deleteOperation(request, callback) { - return this.rpcCall(deleteOperation, $root.google.longrunning.DeleteOperationRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteOperation" }); - - /** - * Calls DeleteOperation. - * @function deleteOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.longrunning.Operations#cancelOperation}. - * @memberof google.longrunning.Operations - * @typedef CancelOperationCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls CancelOperation. - * @function cancelOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object - * @param {google.longrunning.Operations.CancelOperationCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Operations.prototype.cancelOperation = function cancelOperation(request, callback) { - return this.rpcCall(cancelOperation, $root.google.longrunning.CancelOperationRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "CancelOperation" }); - - /** - * Calls CancelOperation. - * @function cancelOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.longrunning.Operations#waitOperation}. - * @memberof google.longrunning.Operations - * @typedef WaitOperationCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls WaitOperation. - * @function waitOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object - * @param {google.longrunning.Operations.WaitOperationCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Operations.prototype.waitOperation = function waitOperation(request, callback) { - return this.rpcCall(waitOperation, $root.google.longrunning.WaitOperationRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "WaitOperation" }); - + + api.DotnetSettings = (function() { + /** - * Calls WaitOperation. - * @function waitOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Properties of a DotnetSettings. + * @memberof google.api + * @interface IDotnetSettings + * @property {google.api.ICommonLanguageSettings|null} [common] DotnetSettings common + * @property {Object.|null} [renamedServices] DotnetSettings renamedServices + * @property {Object.|null} [renamedResources] DotnetSettings renamedResources + * @property {Array.|null} [ignoredResources] DotnetSettings ignoredResources + * @property {Array.|null} [forcedNamespaceAliases] DotnetSettings forcedNamespaceAliases + * @property {Array.|null} [handwrittenSignatures] DotnetSettings handwrittenSignatures */ - - return Operations; - })(); - - longrunning.Operation = (function() { - - /** - * Properties of an Operation. - * @memberof google.longrunning - * @interface IOperation - * @property {string|null} [name] Operation name - * @property {google.protobuf.IAny|null} [metadata] Operation metadata - * @property {boolean|null} [done] Operation done - * @property {google.rpc.IStatus|null} [error] Operation error - * @property {google.protobuf.IAny|null} [response] Operation response - */ - - /** - * Constructs a new Operation. - * @memberof google.longrunning - * @classdesc Represents an Operation. - * @implements IOperation + + /** + * Constructs a new DotnetSettings. + * @memberof google.api + * @classdesc Represents a DotnetSettings. + * @implements IDotnetSettings * @constructor - * @param {google.longrunning.IOperation=} [properties] Properties to set + * @param {google.api.IDotnetSettings=} [properties] Properties to set */ - function Operation(properties) { + function DotnetSettings(properties) { + this.renamedServices = {}; + this.renamedResources = {}; + this.ignoredResources = []; + this.forcedNamespaceAliases = []; + this.handwrittenSignatures = []; 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]]; } - + /** - * Operation name. - * @member {string} name - * @memberof google.longrunning.Operation + * DotnetSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.common = null; + + /** + * DotnetSettings renamedServices. + * @member {Object.} renamedServices + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.renamedServices = $util.emptyObject; + + /** + * DotnetSettings renamedResources. + * @member {Object.} renamedResources + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.renamedResources = $util.emptyObject; + + /** + * DotnetSettings ignoredResources. + * @member {Array.} ignoredResources + * @memberof google.api.DotnetSettings * @instance */ - Operation.prototype.name = ""; - + DotnetSettings.prototype.ignoredResources = $util.emptyArray; + /** - * Operation metadata. - * @member {google.protobuf.IAny|null|undefined} metadata - * @memberof google.longrunning.Operation + * DotnetSettings forcedNamespaceAliases. + * @member {Array.} forcedNamespaceAliases + * @memberof google.api.DotnetSettings * @instance */ - Operation.prototype.metadata = null; - + DotnetSettings.prototype.forcedNamespaceAliases = $util.emptyArray; + /** - * Operation done. - * @member {boolean} done - * @memberof google.longrunning.Operation + * DotnetSettings handwrittenSignatures. + * @member {Array.} handwrittenSignatures + * @memberof google.api.DotnetSettings * @instance */ - Operation.prototype.done = false; - + DotnetSettings.prototype.handwrittenSignatures = $util.emptyArray; + /** - * Operation error. - * @member {google.rpc.IStatus|null|undefined} error - * @memberof google.longrunning.Operation - * @instance + * Creates a new DotnetSettings instance using the specified properties. + * @function create + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings=} [properties] Properties to set + * @returns {google.api.DotnetSettings} DotnetSettings instance */ - Operation.prototype.error = null; - + DotnetSettings.create = function create(properties) { + return new DotnetSettings(properties); + }; + /** - * Operation response. - * @member {google.protobuf.IAny|null|undefined} response - * @memberof google.longrunning.Operation - * @instance + * Encodes the specified DotnetSettings message. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @function encode + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DotnetSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.renamedServices != null && Object.hasOwnProperty.call(message, "renamedServices")) + for (var keys = Object.keys(message.renamedServices), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedServices[keys[i]]).ldelim(); + if (message.renamedResources != null && Object.hasOwnProperty.call(message, "renamedResources")) + for (var keys = Object.keys(message.renamedResources), i = 0; i < keys.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedResources[keys[i]]).ldelim(); + if (message.ignoredResources != null && message.ignoredResources.length) + for (var i = 0; i < message.ignoredResources.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.ignoredResources[i]); + if (message.forcedNamespaceAliases != null && message.forcedNamespaceAliases.length) + for (var i = 0; i < message.forcedNamespaceAliases.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.forcedNamespaceAliases[i]); + if (message.handwrittenSignatures != null && message.handwrittenSignatures.length) + for (var i = 0; i < message.handwrittenSignatures.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.handwrittenSignatures[i]); + return writer; + }; + + /** + * Encodes the specified DotnetSettings message, length delimited. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Operation.prototype.response = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - + DotnetSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + /** - * Operation result. - * @member {"error"|"response"|undefined} result - * @memberof google.longrunning.Operation - * @instance + * Decodes a DotnetSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.DotnetSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.DotnetSettings} DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DotnetSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.DotnetSettings(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + case 2: { + if (message.renamedServices === $util.emptyObject) + message.renamedServices = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.renamedServices[key] = value; + break; + } + case 3: { + if (message.renamedResources === $util.emptyObject) + message.renamedResources = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.renamedResources[key] = value; + break; + } + case 4: { + if (!(message.ignoredResources && message.ignoredResources.length)) + message.ignoredResources = []; + message.ignoredResources.push(reader.string()); + break; + } + case 5: { + if (!(message.forcedNamespaceAliases && message.forcedNamespaceAliases.length)) + message.forcedNamespaceAliases = []; + message.forcedNamespaceAliases.push(reader.string()); + break; + } + case 6: { + if (!(message.handwrittenSignatures && message.handwrittenSignatures.length)) + message.handwrittenSignatures = []; + message.handwrittenSignatures.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.DotnetSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.DotnetSettings} DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Object.defineProperty(Operation.prototype, "result", { - get: $util.oneOfGetter($oneOfFields = ["error", "response"]), - set: $util.oneOfSetter($oneOfFields) - }); - + DotnetSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DotnetSettings message. + * @function verify + * @memberof google.api.DotnetSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DotnetSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + if (message.renamedServices != null && message.hasOwnProperty("renamedServices")) { + if (!$util.isObject(message.renamedServices)) + return "renamedServices: object expected"; + var key = Object.keys(message.renamedServices); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.renamedServices[key[i]])) + return "renamedServices: string{k:string} expected"; + } + if (message.renamedResources != null && message.hasOwnProperty("renamedResources")) { + if (!$util.isObject(message.renamedResources)) + return "renamedResources: object expected"; + var key = Object.keys(message.renamedResources); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.renamedResources[key[i]])) + return "renamedResources: string{k:string} expected"; + } + if (message.ignoredResources != null && message.hasOwnProperty("ignoredResources")) { + if (!Array.isArray(message.ignoredResources)) + return "ignoredResources: array expected"; + for (var i = 0; i < message.ignoredResources.length; ++i) + if (!$util.isString(message.ignoredResources[i])) + return "ignoredResources: string[] expected"; + } + if (message.forcedNamespaceAliases != null && message.hasOwnProperty("forcedNamespaceAliases")) { + if (!Array.isArray(message.forcedNamespaceAliases)) + return "forcedNamespaceAliases: array expected"; + for (var i = 0; i < message.forcedNamespaceAliases.length; ++i) + if (!$util.isString(message.forcedNamespaceAliases[i])) + return "forcedNamespaceAliases: string[] expected"; + } + if (message.handwrittenSignatures != null && message.hasOwnProperty("handwrittenSignatures")) { + if (!Array.isArray(message.handwrittenSignatures)) + return "handwrittenSignatures: array expected"; + for (var i = 0; i < message.handwrittenSignatures.length; ++i) + if (!$util.isString(message.handwrittenSignatures[i])) + return "handwrittenSignatures: string[] expected"; + } + return null; + }; + /** - * Creates an Operation message from a plain object. Also converts values to their respective internal types. + * Creates a DotnetSettings message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.longrunning.Operation + * @memberof google.api.DotnetSettings * @static * @param {Object.} object Plain object - * @returns {google.longrunning.Operation} Operation + * @returns {google.api.DotnetSettings} DotnetSettings */ - Operation.fromObject = function fromObject(object) { - if (object instanceof $root.google.longrunning.Operation) + DotnetSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.DotnetSettings) return object; - var message = new $root.google.longrunning.Operation(); - if (object.name != null) - message.name = String(object.name); - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".google.longrunning.Operation.metadata: object expected"); - message.metadata = $root.google.protobuf.Any.fromObject(object.metadata); - } - if (object.done != null) - message.done = Boolean(object.done); - if (object.error != null) { - if (typeof object.error !== "object") - throw TypeError(".google.longrunning.Operation.error: object expected"); - message.error = $root.google.rpc.Status.fromObject(object.error); - } - if (object.response != null) { - if (typeof object.response !== "object") - throw TypeError(".google.longrunning.Operation.response: object expected"); - message.response = $root.google.protobuf.Any.fromObject(object.response); + var message = new $root.google.api.DotnetSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.DotnetSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + if (object.renamedServices) { + if (typeof object.renamedServices !== "object") + throw TypeError(".google.api.DotnetSettings.renamedServices: object expected"); + message.renamedServices = {}; + for (var keys = Object.keys(object.renamedServices), i = 0; i < keys.length; ++i) + message.renamedServices[keys[i]] = String(object.renamedServices[keys[i]]); + } + if (object.renamedResources) { + if (typeof object.renamedResources !== "object") + throw TypeError(".google.api.DotnetSettings.renamedResources: object expected"); + message.renamedResources = {}; + for (var keys = Object.keys(object.renamedResources), i = 0; i < keys.length; ++i) + message.renamedResources[keys[i]] = String(object.renamedResources[keys[i]]); + } + if (object.ignoredResources) { + if (!Array.isArray(object.ignoredResources)) + throw TypeError(".google.api.DotnetSettings.ignoredResources: array expected"); + message.ignoredResources = []; + for (var i = 0; i < object.ignoredResources.length; ++i) + message.ignoredResources[i] = String(object.ignoredResources[i]); + } + if (object.forcedNamespaceAliases) { + if (!Array.isArray(object.forcedNamespaceAliases)) + throw TypeError(".google.api.DotnetSettings.forcedNamespaceAliases: array expected"); + message.forcedNamespaceAliases = []; + for (var i = 0; i < object.forcedNamespaceAliases.length; ++i) + message.forcedNamespaceAliases[i] = String(object.forcedNamespaceAliases[i]); + } + if (object.handwrittenSignatures) { + if (!Array.isArray(object.handwrittenSignatures)) + throw TypeError(".google.api.DotnetSettings.handwrittenSignatures: array expected"); + message.handwrittenSignatures = []; + for (var i = 0; i < object.handwrittenSignatures.length; ++i) + message.handwrittenSignatures[i] = String(object.handwrittenSignatures[i]); } return message; }; - + /** - * Creates a plain object from an Operation message. Also converts values to other types if specified. + * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. * @function toObject - * @memberof google.longrunning.Operation + * @memberof google.api.DotnetSettings * @static - * @param {google.longrunning.Operation} message Operation + * @param {google.api.DotnetSettings} message DotnetSettings * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Operation.toObject = function toObject(message, options) { + DotnetSettings.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.name = ""; - object.metadata = null; - object.done = false; + if (options.arrays || options.defaults) { + object.ignoredResources = []; + object.forcedNamespaceAliases = []; + object.handwrittenSignatures = []; } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.google.protobuf.Any.toObject(message.metadata, options); - if (message.done != null && message.hasOwnProperty("done")) - object.done = message.done; - if (message.error != null && message.hasOwnProperty("error")) { - object.error = $root.google.rpc.Status.toObject(message.error, options); - if (options.oneofs) - object.result = "error"; + if (options.objects || options.defaults) { + object.renamedServices = {}; + object.renamedResources = {}; } - if (message.response != null && message.hasOwnProperty("response")) { - object.response = $root.google.protobuf.Any.toObject(message.response, options); - if (options.oneofs) - object.result = "response"; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + var keys2; + if (message.renamedServices && (keys2 = Object.keys(message.renamedServices)).length) { + object.renamedServices = {}; + for (var j = 0; j < keys2.length; ++j) + object.renamedServices[keys2[j]] = message.renamedServices[keys2[j]]; + } + if (message.renamedResources && (keys2 = Object.keys(message.renamedResources)).length) { + object.renamedResources = {}; + for (var j = 0; j < keys2.length; ++j) + object.renamedResources[keys2[j]] = message.renamedResources[keys2[j]]; + } + if (message.ignoredResources && message.ignoredResources.length) { + object.ignoredResources = []; + for (var j = 0; j < message.ignoredResources.length; ++j) + object.ignoredResources[j] = message.ignoredResources[j]; + } + if (message.forcedNamespaceAliases && message.forcedNamespaceAliases.length) { + object.forcedNamespaceAliases = []; + for (var j = 0; j < message.forcedNamespaceAliases.length; ++j) + object.forcedNamespaceAliases[j] = message.forcedNamespaceAliases[j]; + } + if (message.handwrittenSignatures && message.handwrittenSignatures.length) { + object.handwrittenSignatures = []; + for (var j = 0; j < message.handwrittenSignatures.length; ++j) + object.handwrittenSignatures[j] = message.handwrittenSignatures[j]; } return object; }; - + /** - * Converts this Operation to JSON. + * Converts this DotnetSettings to JSON. * @function toJSON - * @memberof google.longrunning.Operation + * @memberof google.api.DotnetSettings * @instance * @returns {Object.} JSON object */ - Operation.prototype.toJSON = function toJSON() { + DotnetSettings.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - + /** - * Gets the default type url for Operation + * Gets the default type url for DotnetSettings * @function getTypeUrl - * @memberof google.longrunning.Operation + * @memberof google.api.DotnetSettings * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - Operation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + DotnetSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.longrunning.Operation"; + return typeUrlPrefix + "/google.api.DotnetSettings"; }; - - return Operation; + + return DotnetSettings; })(); - - longrunning.GetOperationRequest = (function() { - + + api.RubySettings = (function() { + /** - * Properties of a GetOperationRequest. - * @memberof google.longrunning - * @interface IGetOperationRequest - * @property {string|null} [name] GetOperationRequest name + * Properties of a RubySettings. + * @memberof google.api + * @interface IRubySettings + * @property {google.api.ICommonLanguageSettings|null} [common] RubySettings common */ - + /** - * Constructs a new GetOperationRequest. - * @memberof google.longrunning - * @classdesc Represents a GetOperationRequest. - * @implements IGetOperationRequest + * Constructs a new RubySettings. + * @memberof google.api + * @classdesc Represents a RubySettings. + * @implements IRubySettings * @constructor - * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set + * @param {google.api.IRubySettings=} [properties] Properties to set */ - function GetOperationRequest(properties) { + function RubySettings(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]]; } - + /** - * GetOperationRequest name. - * @member {string} name - * @memberof google.longrunning.GetOperationRequest + * RubySettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.RubySettings * @instance */ - GetOperationRequest.prototype.name = ""; - + RubySettings.prototype.common = null; + + /** + * Creates a new RubySettings instance using the specified properties. + * @function create + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings=} [properties] Properties to set + * @returns {google.api.RubySettings} RubySettings instance + */ + RubySettings.create = function create(properties) { + return new RubySettings(properties); + }; + + /** + * Encodes the specified RubySettings message. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @function encode + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings} message RubySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RubySettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RubySettings message, length delimited. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings} message RubySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RubySettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RubySettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.RubySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.RubySettings} RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RubySettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.RubySettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RubySettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.RubySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.RubySettings} RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RubySettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RubySettings message. + * @function verify + * @memberof google.api.RubySettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RubySettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + /** - * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types. + * Creates a RubySettings message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.longrunning.GetOperationRequest + * @memberof google.api.RubySettings * @static * @param {Object.} object Plain object - * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + * @returns {google.api.RubySettings} RubySettings */ - GetOperationRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.longrunning.GetOperationRequest) + RubySettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.RubySettings) return object; - var message = new $root.google.longrunning.GetOperationRequest(); - if (object.name != null) - message.name = String(object.name); + var message = new $root.google.api.RubySettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.RubySettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } return message; }; - + /** - * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. + * Creates a plain object from a RubySettings message. Also converts values to other types if specified. * @function toObject - * @memberof google.longrunning.GetOperationRequest + * @memberof google.api.RubySettings * @static - * @param {google.longrunning.GetOperationRequest} message GetOperationRequest + * @param {google.api.RubySettings} message RubySettings * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetOperationRequest.toObject = function toObject(message, options) { + RubySettings.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); return object; }; - + /** - * Converts this GetOperationRequest to JSON. + * Converts this RubySettings to JSON. * @function toJSON - * @memberof google.longrunning.GetOperationRequest + * @memberof google.api.RubySettings * @instance * @returns {Object.} JSON object */ - GetOperationRequest.prototype.toJSON = function toJSON() { + RubySettings.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - + /** - * Gets the default type url for GetOperationRequest + * Gets the default type url for RubySettings * @function getTypeUrl - * @memberof google.longrunning.GetOperationRequest + * @memberof google.api.RubySettings * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - GetOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + RubySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.longrunning.GetOperationRequest"; + return typeUrlPrefix + "/google.api.RubySettings"; }; - - return GetOperationRequest; + + return RubySettings; })(); - - longrunning.ListOperationsRequest = (function() { - - /** - * Properties of a ListOperationsRequest. - * @memberof google.longrunning - * @interface IListOperationsRequest - * @property {string|null} [name] ListOperationsRequest name - * @property {string|null} [filter] ListOperationsRequest filter - * @property {number|null} [pageSize] ListOperationsRequest pageSize - * @property {string|null} [pageToken] ListOperationsRequest pageToken - */ - - /** - * Constructs a new ListOperationsRequest. - * @memberof google.longrunning - * @classdesc Represents a ListOperationsRequest. - * @implements IListOperationsRequest + + api.GoSettings = (function() { + + /** + * Properties of a GoSettings. + * @memberof google.api + * @interface IGoSettings + * @property {google.api.ICommonLanguageSettings|null} [common] GoSettings common + */ + + /** + * Constructs a new GoSettings. + * @memberof google.api + * @classdesc Represents a GoSettings. + * @implements IGoSettings * @constructor - * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set + * @param {google.api.IGoSettings=} [properties] Properties to set */ - function ListOperationsRequest(properties) { + function GoSettings(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]]; } - + /** - * ListOperationsRequest name. - * @member {string} name - * @memberof google.longrunning.ListOperationsRequest + * GoSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.GoSettings * @instance */ - ListOperationsRequest.prototype.name = ""; - + GoSettings.prototype.common = null; + /** - * ListOperationsRequest filter. - * @member {string} filter - * @memberof google.longrunning.ListOperationsRequest - * @instance + * Creates a new GoSettings instance using the specified properties. + * @function create + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings=} [properties] Properties to set + * @returns {google.api.GoSettings} GoSettings instance */ - ListOperationsRequest.prototype.filter = ""; - + GoSettings.create = function create(properties) { + return new GoSettings(properties); + }; + /** - * ListOperationsRequest pageSize. - * @member {number} pageSize - * @memberof google.longrunning.ListOperationsRequest - * @instance + * Encodes the specified GoSettings message. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @function encode + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings} message GoSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GoSettings message, length delimited. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings} message GoSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - ListOperationsRequest.prototype.pageSize = 0; - + GoSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + /** - * ListOperationsRequest pageToken. - * @member {string} pageToken - * @memberof google.longrunning.ListOperationsRequest - * @instance + * Decodes a GoSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.GoSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.GoSettings} GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.GoSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GoSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.GoSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.GoSettings} GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GoSettings message. + * @function verify + * @memberof google.api.GoSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListOperationsRequest.prototype.pageToken = ""; - + GoSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + /** - * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GoSettings message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.longrunning.ListOperationsRequest + * @memberof google.api.GoSettings * @static * @param {Object.} object Plain object - * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + * @returns {google.api.GoSettings} GoSettings */ - ListOperationsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.longrunning.ListOperationsRequest) + GoSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.GoSettings) return object; - var message = new $root.google.longrunning.ListOperationsRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.filter != null) - message.filter = String(object.filter); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); + var message = new $root.google.api.GoSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.GoSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } return message; }; - + /** - * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. + * Creates a plain object from a GoSettings message. Also converts values to other types if specified. * @function toObject - * @memberof google.longrunning.ListOperationsRequest + * @memberof google.api.GoSettings * @static - * @param {google.longrunning.ListOperationsRequest} message ListOperationsRequest + * @param {google.api.GoSettings} message GoSettings * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListOperationsRequest.toObject = function toObject(message, options) { + GoSettings.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.filter = ""; - object.pageSize = 0; - object.pageToken = ""; - object.name = ""; - } - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); return object; }; - + /** - * Converts this ListOperationsRequest to JSON. + * Converts this GoSettings to JSON. * @function toJSON - * @memberof google.longrunning.ListOperationsRequest + * @memberof google.api.GoSettings * @instance * @returns {Object.} JSON object */ - ListOperationsRequest.prototype.toJSON = function toJSON() { + GoSettings.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - + /** - * Gets the default type url for ListOperationsRequest + * Gets the default type url for GoSettings * @function getTypeUrl - * @memberof google.longrunning.ListOperationsRequest + * @memberof google.api.GoSettings * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ListOperationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + GoSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.longrunning.ListOperationsRequest"; + return typeUrlPrefix + "/google.api.GoSettings"; }; - - return ListOperationsRequest; + + return GoSettings; })(); - - longrunning.ListOperationsResponse = (function() { - - /** - * Properties of a ListOperationsResponse. - * @memberof google.longrunning - * @interface IListOperationsResponse - * @property {Array.|null} [operations] ListOperationsResponse operations - * @property {string|null} [nextPageToken] ListOperationsResponse nextPageToken - */ - - /** - * Constructs a new ListOperationsResponse. - * @memberof google.longrunning - * @classdesc Represents a ListOperationsResponse. - * @implements IListOperationsResponse + + api.MethodSettings = (function() { + + /** + * Properties of a MethodSettings. + * @memberof google.api + * @interface IMethodSettings + * @property {string|null} [selector] MethodSettings selector + * @property {google.api.MethodSettings.ILongRunning|null} [longRunning] MethodSettings longRunning + * @property {Array.|null} [autoPopulatedFields] MethodSettings autoPopulatedFields + */ + + /** + * Constructs a new MethodSettings. + * @memberof google.api + * @classdesc Represents a MethodSettings. + * @implements IMethodSettings * @constructor - * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set + * @param {google.api.IMethodSettings=} [properties] Properties to set */ - function ListOperationsResponse(properties) { - this.operations = []; + function MethodSettings(properties) { + this.autoPopulatedFields = []; 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]]; } - + + /** + * MethodSettings selector. + * @member {string} selector + * @memberof google.api.MethodSettings + * @instance + */ + MethodSettings.prototype.selector = ""; + /** - * ListOperationsResponse operations. - * @member {Array.} operations - * @memberof google.longrunning.ListOperationsResponse + * MethodSettings longRunning. + * @member {google.api.MethodSettings.ILongRunning|null|undefined} longRunning + * @memberof google.api.MethodSettings * @instance */ - ListOperationsResponse.prototype.operations = $util.emptyArray; - + MethodSettings.prototype.longRunning = null; + /** - * ListOperationsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.longrunning.ListOperationsResponse + * MethodSettings autoPopulatedFields. + * @member {Array.} autoPopulatedFields + * @memberof google.api.MethodSettings * @instance */ - ListOperationsResponse.prototype.nextPageToken = ""; - + MethodSettings.prototype.autoPopulatedFields = $util.emptyArray; + + /** + * Creates a new MethodSettings instance using the specified properties. + * @function create + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings=} [properties] Properties to set + * @returns {google.api.MethodSettings} MethodSettings instance + */ + MethodSettings.create = function create(properties) { + return new MethodSettings(properties); + }; + + /** + * Encodes the specified MethodSettings message. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @function encode + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); + if (message.longRunning != null && Object.hasOwnProperty.call(message, "longRunning")) + $root.google.api.MethodSettings.LongRunning.encode(message.longRunning, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.autoPopulatedFields != null && message.autoPopulatedFields.length) + for (var i = 0; i < message.autoPopulatedFields.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.autoPopulatedFields[i]); + return writer; + }; + + /** + * Encodes the specified MethodSettings message, length delimited. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.MethodSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.MethodSettings} MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MethodSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.selector = reader.string(); + break; + } + case 2: { + message.longRunning = $root.google.api.MethodSettings.LongRunning.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.autoPopulatedFields && message.autoPopulatedFields.length)) + message.autoPopulatedFields = []; + message.autoPopulatedFields.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.MethodSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.MethodSettings} MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodSettings message. + * @function verify + * @memberof google.api.MethodSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.selector != null && message.hasOwnProperty("selector")) + if (!$util.isString(message.selector)) + return "selector: string expected"; + if (message.longRunning != null && message.hasOwnProperty("longRunning")) { + var error = $root.google.api.MethodSettings.LongRunning.verify(message.longRunning); + if (error) + return "longRunning." + error; + } + if (message.autoPopulatedFields != null && message.hasOwnProperty("autoPopulatedFields")) { + if (!Array.isArray(message.autoPopulatedFields)) + return "autoPopulatedFields: array expected"; + for (var i = 0; i < message.autoPopulatedFields.length; ++i) + if (!$util.isString(message.autoPopulatedFields[i])) + return "autoPopulatedFields: string[] expected"; + } + return null; + }; + /** - * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a MethodSettings message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.longrunning.ListOperationsResponse + * @memberof google.api.MethodSettings * @static * @param {Object.} object Plain object - * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + * @returns {google.api.MethodSettings} MethodSettings */ - ListOperationsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.longrunning.ListOperationsResponse) + MethodSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.MethodSettings) return object; - var message = new $root.google.longrunning.ListOperationsResponse(); - if (object.operations) { - if (!Array.isArray(object.operations)) - throw TypeError(".google.longrunning.ListOperationsResponse.operations: array expected"); - message.operations = []; - for (var i = 0; i < object.operations.length; ++i) { - if (typeof object.operations[i] !== "object") - throw TypeError(".google.longrunning.ListOperationsResponse.operations: object expected"); - message.operations[i] = $root.google.longrunning.Operation.fromObject(object.operations[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); + var message = new $root.google.api.MethodSettings(); + if (object.selector != null) + message.selector = String(object.selector); + if (object.longRunning != null) { + if (typeof object.longRunning !== "object") + throw TypeError(".google.api.MethodSettings.longRunning: object expected"); + message.longRunning = $root.google.api.MethodSettings.LongRunning.fromObject(object.longRunning); + } + if (object.autoPopulatedFields) { + if (!Array.isArray(object.autoPopulatedFields)) + throw TypeError(".google.api.MethodSettings.autoPopulatedFields: array expected"); + message.autoPopulatedFields = []; + for (var i = 0; i < object.autoPopulatedFields.length; ++i) + message.autoPopulatedFields[i] = String(object.autoPopulatedFields[i]); + } return message; }; - + /** - * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. + * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. * @function toObject - * @memberof google.longrunning.ListOperationsResponse + * @memberof google.api.MethodSettings * @static - * @param {google.longrunning.ListOperationsResponse} message ListOperationsResponse + * @param {google.api.MethodSettings} message MethodSettings * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListOperationsResponse.toObject = function toObject(message, options) { + MethodSettings.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) - object.operations = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.operations && message.operations.length) { - object.operations = []; - for (var j = 0; j < message.operations.length; ++j) - object.operations[j] = $root.google.longrunning.Operation.toObject(message.operations[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; + object.autoPopulatedFields = []; + if (options.defaults) { + object.selector = ""; + object.longRunning = null; + } + if (message.selector != null && message.hasOwnProperty("selector")) + object.selector = message.selector; + if (message.longRunning != null && message.hasOwnProperty("longRunning")) + object.longRunning = $root.google.api.MethodSettings.LongRunning.toObject(message.longRunning, options); + if (message.autoPopulatedFields && message.autoPopulatedFields.length) { + object.autoPopulatedFields = []; + for (var j = 0; j < message.autoPopulatedFields.length; ++j) + object.autoPopulatedFields[j] = message.autoPopulatedFields[j]; + } return object; }; - + /** - * Converts this ListOperationsResponse to JSON. + * Converts this MethodSettings to JSON. * @function toJSON - * @memberof google.longrunning.ListOperationsResponse + * @memberof google.api.MethodSettings * @instance * @returns {Object.} JSON object */ - ListOperationsResponse.prototype.toJSON = function toJSON() { + MethodSettings.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - + /** - * Gets the default type url for ListOperationsResponse + * Gets the default type url for MethodSettings * @function getTypeUrl - * @memberof google.longrunning.ListOperationsResponse + * @memberof google.api.MethodSettings * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ListOperationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + MethodSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.longrunning.ListOperationsResponse"; + return typeUrlPrefix + "/google.api.MethodSettings"; }; - - return ListOperationsResponse; + + MethodSettings.LongRunning = (function() { + + /** + * Properties of a LongRunning. + * @memberof google.api.MethodSettings + * @interface ILongRunning + * @property {google.protobuf.IDuration|null} [initialPollDelay] LongRunning initialPollDelay + * @property {number|null} [pollDelayMultiplier] LongRunning pollDelayMultiplier + * @property {google.protobuf.IDuration|null} [maxPollDelay] LongRunning maxPollDelay + * @property {google.protobuf.IDuration|null} [totalPollTimeout] LongRunning totalPollTimeout + */ + + /** + * Constructs a new LongRunning. + * @memberof google.api.MethodSettings + * @classdesc Represents a LongRunning. + * @implements ILongRunning + * @constructor + * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set + */ + function LongRunning(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]]; + } + + /** + * LongRunning initialPollDelay. + * @member {google.protobuf.IDuration|null|undefined} initialPollDelay + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.initialPollDelay = null; + + /** + * LongRunning pollDelayMultiplier. + * @member {number} pollDelayMultiplier + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.pollDelayMultiplier = 0; + + /** + * LongRunning maxPollDelay. + * @member {google.protobuf.IDuration|null|undefined} maxPollDelay + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.maxPollDelay = null; + + /** + * LongRunning totalPollTimeout. + * @member {google.protobuf.IDuration|null|undefined} totalPollTimeout + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.totalPollTimeout = null; + + /** + * Creates a new LongRunning instance using the specified properties. + * @function create + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set + * @returns {google.api.MethodSettings.LongRunning} LongRunning instance + */ + LongRunning.create = function create(properties) { + return new LongRunning(properties); + }; + + /** + * Encodes the specified LongRunning message. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @function encode + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LongRunning.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.initialPollDelay != null && Object.hasOwnProperty.call(message, "initialPollDelay")) + $root.google.protobuf.Duration.encode(message.initialPollDelay, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.pollDelayMultiplier != null && Object.hasOwnProperty.call(message, "pollDelayMultiplier")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.pollDelayMultiplier); + if (message.maxPollDelay != null && Object.hasOwnProperty.call(message, "maxPollDelay")) + $root.google.protobuf.Duration.encode(message.maxPollDelay, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.totalPollTimeout != null && Object.hasOwnProperty.call(message, "totalPollTimeout")) + $root.google.protobuf.Duration.encode(message.totalPollTimeout, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LongRunning message, length delimited. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LongRunning.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LongRunning message from the specified reader or buffer. + * @function decode + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.MethodSettings.LongRunning} LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LongRunning.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MethodSettings.LongRunning(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.initialPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 2: { + message.pollDelayMultiplier = reader.float(); + break; + } + case 3: { + message.maxPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 4: { + message.totalPollTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LongRunning message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.MethodSettings.LongRunning} LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LongRunning.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LongRunning message. + * @function verify + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LongRunning.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay")) { + var error = $root.google.protobuf.Duration.verify(message.initialPollDelay); + if (error) + return "initialPollDelay." + error; + } + if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier")) + if (typeof message.pollDelayMultiplier !== "number") + return "pollDelayMultiplier: number expected"; + if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay")) { + var error = $root.google.protobuf.Duration.verify(message.maxPollDelay); + if (error) + return "maxPollDelay." + error; + } + if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout")) { + var error = $root.google.protobuf.Duration.verify(message.totalPollTimeout); + if (error) + return "totalPollTimeout." + error; + } + return null; + }; + + /** + * Creates a LongRunning message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {Object.} object Plain object + * @returns {google.api.MethodSettings.LongRunning} LongRunning + */ + LongRunning.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.MethodSettings.LongRunning) + return object; + var message = new $root.google.api.MethodSettings.LongRunning(); + if (object.initialPollDelay != null) { + if (typeof object.initialPollDelay !== "object") + throw TypeError(".google.api.MethodSettings.LongRunning.initialPollDelay: object expected"); + message.initialPollDelay = $root.google.protobuf.Duration.fromObject(object.initialPollDelay); + } + if (object.pollDelayMultiplier != null) + message.pollDelayMultiplier = Number(object.pollDelayMultiplier); + if (object.maxPollDelay != null) { + if (typeof object.maxPollDelay !== "object") + throw TypeError(".google.api.MethodSettings.LongRunning.maxPollDelay: object expected"); + message.maxPollDelay = $root.google.protobuf.Duration.fromObject(object.maxPollDelay); + } + if (object.totalPollTimeout != null) { + if (typeof object.totalPollTimeout !== "object") + throw TypeError(".google.api.MethodSettings.LongRunning.totalPollTimeout: object expected"); + message.totalPollTimeout = $root.google.protobuf.Duration.fromObject(object.totalPollTimeout); + } + return message; + }; + + /** + * Creates a plain object from a LongRunning message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.LongRunning} message LongRunning + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LongRunning.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.initialPollDelay = null; + object.pollDelayMultiplier = 0; + object.maxPollDelay = null; + object.totalPollTimeout = null; + } + if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay")) + object.initialPollDelay = $root.google.protobuf.Duration.toObject(message.initialPollDelay, options); + if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier")) + object.pollDelayMultiplier = options.json && !isFinite(message.pollDelayMultiplier) ? String(message.pollDelayMultiplier) : message.pollDelayMultiplier; + if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay")) + object.maxPollDelay = $root.google.protobuf.Duration.toObject(message.maxPollDelay, options); + if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout")) + object.totalPollTimeout = $root.google.protobuf.Duration.toObject(message.totalPollTimeout, options); + return object; + }; + + /** + * Converts this LongRunning to JSON. + * @function toJSON + * @memberof google.api.MethodSettings.LongRunning + * @instance + * @returns {Object.} JSON object + */ + LongRunning.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LongRunning + * @function getTypeUrl + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LongRunning.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.MethodSettings.LongRunning"; + }; + + return LongRunning; + })(); + + return MethodSettings; + })(); + + /** + * ClientLibraryOrganization enum. + * @name google.api.ClientLibraryOrganization + * @enum {number} + * @property {number} CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED=0 CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED value + * @property {number} CLOUD=1 CLOUD value + * @property {number} ADS=2 ADS value + * @property {number} PHOTOS=3 PHOTOS value + * @property {number} STREET_VIEW=4 STREET_VIEW value + * @property {number} SHOPPING=5 SHOPPING value + * @property {number} GEO=6 GEO value + * @property {number} GENERATIVE_AI=7 GENERATIVE_AI value + */ + api.ClientLibraryOrganization = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED"] = 0; + values[valuesById[1] = "CLOUD"] = 1; + values[valuesById[2] = "ADS"] = 2; + values[valuesById[3] = "PHOTOS"] = 3; + values[valuesById[4] = "STREET_VIEW"] = 4; + values[valuesById[5] = "SHOPPING"] = 5; + values[valuesById[6] = "GEO"] = 6; + values[valuesById[7] = "GENERATIVE_AI"] = 7; + return values; + })(); + + /** + * ClientLibraryDestination enum. + * @name google.api.ClientLibraryDestination + * @enum {number} + * @property {number} CLIENT_LIBRARY_DESTINATION_UNSPECIFIED=0 CLIENT_LIBRARY_DESTINATION_UNSPECIFIED value + * @property {number} GITHUB=10 GITHUB value + * @property {number} PACKAGE_MANAGER=20 PACKAGE_MANAGER value + */ + api.ClientLibraryDestination = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED"] = 0; + values[valuesById[10] = "GITHUB"] = 10; + values[valuesById[20] = "PACKAGE_MANAGER"] = 20; + return values; + })(); + + /** + * LaunchStage enum. + * @name google.api.LaunchStage + * @enum {number} + * @property {number} LAUNCH_STAGE_UNSPECIFIED=0 LAUNCH_STAGE_UNSPECIFIED value + * @property {number} UNIMPLEMENTED=6 UNIMPLEMENTED value + * @property {number} PRELAUNCH=7 PRELAUNCH value + * @property {number} EARLY_ACCESS=1 EARLY_ACCESS value + * @property {number} ALPHA=2 ALPHA value + * @property {number} BETA=3 BETA value + * @property {number} GA=4 GA value + * @property {number} DEPRECATED=5 DEPRECATED value + */ + api.LaunchStage = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LAUNCH_STAGE_UNSPECIFIED"] = 0; + values[valuesById[6] = "UNIMPLEMENTED"] = 6; + values[valuesById[7] = "PRELAUNCH"] = 7; + values[valuesById[1] = "EARLY_ACCESS"] = 1; + values[valuesById[2] = "ALPHA"] = 2; + values[valuesById[3] = "BETA"] = 3; + values[valuesById[4] = "GA"] = 4; + values[valuesById[5] = "DEPRECATED"] = 5; + return values; + })(); + + /** + * FieldBehavior enum. + * @name google.api.FieldBehavior + * @enum {number} + * @property {number} FIELD_BEHAVIOR_UNSPECIFIED=0 FIELD_BEHAVIOR_UNSPECIFIED value + * @property {number} OPTIONAL=1 OPTIONAL value + * @property {number} REQUIRED=2 REQUIRED value + * @property {number} OUTPUT_ONLY=3 OUTPUT_ONLY value + * @property {number} INPUT_ONLY=4 INPUT_ONLY value + * @property {number} IMMUTABLE=5 IMMUTABLE value + * @property {number} UNORDERED_LIST=6 UNORDERED_LIST value + * @property {number} NON_EMPTY_DEFAULT=7 NON_EMPTY_DEFAULT value + * @property {number} IDENTIFIER=8 IDENTIFIER value + */ + api.FieldBehavior = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FIELD_BEHAVIOR_UNSPECIFIED"] = 0; + values[valuesById[1] = "OPTIONAL"] = 1; + values[valuesById[2] = "REQUIRED"] = 2; + values[valuesById[3] = "OUTPUT_ONLY"] = 3; + values[valuesById[4] = "INPUT_ONLY"] = 4; + values[valuesById[5] = "IMMUTABLE"] = 5; + values[valuesById[6] = "UNORDERED_LIST"] = 6; + values[valuesById[7] = "NON_EMPTY_DEFAULT"] = 7; + values[valuesById[8] = "IDENTIFIER"] = 8; + return values; })(); - - longrunning.CancelOperationRequest = (function() { - + + return api; + })(); + + google.rpc = (function() { + + /** + * Namespace rpc. + * @memberof google + * @namespace + */ + var rpc = {}; + + rpc.Status = (function() { + /** - * Properties of a CancelOperationRequest. - * @memberof google.longrunning - * @interface ICancelOperationRequest - * @property {string|null} [name] CancelOperationRequest name + * Properties of a Status. + * @memberof google.rpc + * @interface IStatus + * @property {number|null} [code] Status code + * @property {string|null} [message] Status message + * @property {Array.|null} [details] Status details */ - + /** - * Constructs a new CancelOperationRequest. - * @memberof google.longrunning - * @classdesc Represents a CancelOperationRequest. - * @implements ICancelOperationRequest + * Constructs a new Status. + * @memberof google.rpc + * @classdesc Represents a Status. + * @implements IStatus * @constructor - * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set + * @param {google.rpc.IStatus=} [properties] Properties to set */ - function CancelOperationRequest(properties) { + function Status(properties) { + this.details = []; 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]]; } - + /** - * CancelOperationRequest name. - * @member {string} name - * @memberof google.longrunning.CancelOperationRequest + * Status code. + * @member {number} code + * @memberof google.rpc.Status * @instance */ - CancelOperationRequest.prototype.name = ""; - - /** - * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest - */ - CancelOperationRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.longrunning.CancelOperationRequest) - return object; - var message = new $root.google.longrunning.CancelOperationRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {google.longrunning.CancelOperationRequest} message CancelOperationRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CancelOperationRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - return object; - }; - + Status.prototype.code = 0; + /** - * Converts this CancelOperationRequest to JSON. - * @function toJSON - * @memberof google.longrunning.CancelOperationRequest + * Status message. + * @member {string} message + * @memberof google.rpc.Status * @instance - * @returns {Object.} JSON object - */ - CancelOperationRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CancelOperationRequest - * @function getTypeUrl - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url */ - CancelOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.longrunning.CancelOperationRequest"; - }; - - return CancelOperationRequest; - })(); - - longrunning.DeleteOperationRequest = (function() { - - /** - * Properties of a DeleteOperationRequest. - * @memberof google.longrunning - * @interface IDeleteOperationRequest - * @property {string|null} [name] DeleteOperationRequest name - */ - - /** - * Constructs a new DeleteOperationRequest. - * @memberof google.longrunning - * @classdesc Represents a DeleteOperationRequest. - * @implements IDeleteOperationRequest - * @constructor - * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set - */ - function DeleteOperationRequest(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]]; - } - + Status.prototype.message = ""; + /** - * DeleteOperationRequest name. - * @member {string} name - * @memberof google.longrunning.DeleteOperationRequest + * Status details. + * @member {Array.} details + * @memberof google.rpc.Status * @instance */ - DeleteOperationRequest.prototype.name = ""; - + Status.prototype.details = $util.emptyArray; + /** - * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.DeleteOperationRequest + * Creates a new Status instance using the specified properties. + * @function create + * @memberof google.rpc.Status * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + * @param {google.rpc.IStatus=} [properties] Properties to set + * @returns {google.rpc.Status} Status instance */ - DeleteOperationRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.longrunning.DeleteOperationRequest) - return object; - var message = new $root.google.longrunning.DeleteOperationRequest(); - if (object.name != null) - message.name = String(object.name); - return message; + Status.create = function create(properties) { + return new Status(properties); }; - + /** - * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.DeleteOperationRequest + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encode + * @memberof google.rpc.Status * @static - * @param {google.longrunning.DeleteOperationRequest} message DeleteOperationRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteOperationRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - return object; - }; - - /** - * Converts this DeleteOperationRequest to JSON. - * @function toJSON - * @memberof google.longrunning.DeleteOperationRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteOperationRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.code != null && Object.hasOwnProperty.call(message, "code")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); + if (message.details != null && message.details.length) + for (var i = 0; i < message.details.length; ++i) + $root.google.protobuf.Any.encode(message.details[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; }; - + /** - * Gets the default type url for DeleteOperationRequest - * @function getTypeUrl - * @memberof google.longrunning.DeleteOperationRequest + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encodeDelimited + * @memberof google.rpc.Status * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - DeleteOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.longrunning.DeleteOperationRequest"; + Status.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); }; - - return DeleteOperationRequest; - })(); - - longrunning.WaitOperationRequest = (function() { - - /** - * Properties of a WaitOperationRequest. - * @memberof google.longrunning - * @interface IWaitOperationRequest - * @property {string|null} [name] WaitOperationRequest name - * @property {google.protobuf.IDuration|null} [timeout] WaitOperationRequest timeout - */ - - /** - * Constructs a new WaitOperationRequest. - * @memberof google.longrunning - * @classdesc Represents a WaitOperationRequest. - * @implements IWaitOperationRequest - * @constructor - * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set - */ - function WaitOperationRequest(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]]; - } - - /** - * WaitOperationRequest name. - * @member {string} name - * @memberof google.longrunning.WaitOperationRequest - * @instance - */ - WaitOperationRequest.prototype.name = ""; - - /** - * WaitOperationRequest timeout. - * @member {google.protobuf.IDuration|null|undefined} timeout - * @memberof google.longrunning.WaitOperationRequest - * @instance - */ - WaitOperationRequest.prototype.timeout = null; - + /** - * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.WaitOperationRequest + * Decodes a Status message from the specified reader or buffer. + * @function decode + * @memberof google.rpc.Status * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest - */ - WaitOperationRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.longrunning.WaitOperationRequest) - return object; - var message = new $root.google.longrunning.WaitOperationRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.timeout != null) { - if (typeof object.timeout !== "object") - throw TypeError(".google.longrunning.WaitOperationRequest.timeout: object expected"); - message.timeout = $root.google.protobuf.Duration.fromObject(object.timeout); + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.rpc.Status(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.code = reader.int32(); + break; + } + case 2: { + message.message = reader.string(); + break; + } + case 3: { + if (!(message.details && message.details.length)) + message.details = []; + message.details.push($root.google.protobuf.Any.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } } return message; }; - + /** - * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.WaitOperationRequest + * Decodes a Status message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.rpc.Status * @static - * @param {google.longrunning.WaitOperationRequest} message WaitOperationRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - WaitOperationRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.timeout = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.timeout != null && message.hasOwnProperty("timeout")) - object.timeout = $root.google.protobuf.Duration.toObject(message.timeout, options); - return object; - }; - - /** - * Converts this WaitOperationRequest to JSON. - * @function toJSON - * @memberof google.longrunning.WaitOperationRequest - * @instance - * @returns {Object.} JSON object + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - WaitOperationRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + Status.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); }; - + /** - * Gets the default type url for WaitOperationRequest - * @function getTypeUrl - * @memberof google.longrunning.WaitOperationRequest + * Verifies a Status message. + * @function verify + * @memberof google.rpc.Status * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - WaitOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; + Status.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.code != null && message.hasOwnProperty("code")) + if (!$util.isInteger(message.code)) + return "code: integer expected"; + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + if (message.details != null && message.hasOwnProperty("details")) { + if (!Array.isArray(message.details)) + return "details: array expected"; + for (var i = 0; i < message.details.length; ++i) { + var error = $root.google.protobuf.Any.verify(message.details[i]); + if (error) + return "details." + error; + } } - return typeUrlPrefix + "/google.longrunning.WaitOperationRequest"; + return null; }; - - return WaitOperationRequest; - })(); - - longrunning.OperationInfo = (function() { - - /** - * Properties of an OperationInfo. - * @memberof google.longrunning - * @interface IOperationInfo - * @property {string|null} [responseType] OperationInfo responseType - * @property {string|null} [metadataType] OperationInfo metadataType - */ - - /** - * Constructs a new OperationInfo. - * @memberof google.longrunning - * @classdesc Represents an OperationInfo. - * @implements IOperationInfo - * @constructor - * @param {google.longrunning.IOperationInfo=} [properties] Properties to set - */ - function OperationInfo(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]]; - } - - /** - * OperationInfo responseType. - * @member {string} responseType - * @memberof google.longrunning.OperationInfo - * @instance - */ - OperationInfo.prototype.responseType = ""; - - /** - * OperationInfo metadataType. - * @member {string} metadataType - * @memberof google.longrunning.OperationInfo - * @instance - */ - OperationInfo.prototype.metadataType = ""; - + /** - * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. + * Creates a Status message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.longrunning.OperationInfo + * @memberof google.rpc.Status * @static * @param {Object.} object Plain object - * @returns {google.longrunning.OperationInfo} OperationInfo + * @returns {google.rpc.Status} Status */ - OperationInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.longrunning.OperationInfo) + Status.fromObject = function fromObject(object) { + if (object instanceof $root.google.rpc.Status) return object; - var message = new $root.google.longrunning.OperationInfo(); - if (object.responseType != null) - message.responseType = String(object.responseType); - if (object.metadataType != null) - message.metadataType = String(object.metadataType); + var message = new $root.google.rpc.Status(); + if (object.code != null) + message.code = object.code | 0; + if (object.message != null) + message.message = String(object.message); + if (object.details) { + if (!Array.isArray(object.details)) + throw TypeError(".google.rpc.Status.details: array expected"); + message.details = []; + for (var i = 0; i < object.details.length; ++i) { + if (typeof object.details[i] !== "object") + throw TypeError(".google.rpc.Status.details: object expected"); + message.details[i] = $root.google.protobuf.Any.fromObject(object.details[i]); + } + } return message; }; - + /** - * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. + * Creates a plain object from a Status message. Also converts values to other types if specified. * @function toObject - * @memberof google.longrunning.OperationInfo + * @memberof google.rpc.Status * @static - * @param {google.longrunning.OperationInfo} message OperationInfo + * @param {google.rpc.Status} message Status * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - OperationInfo.toObject = function toObject(message, options) { + Status.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.details = []; if (options.defaults) { - object.responseType = ""; - object.metadataType = ""; + object.code = 0; + object.message = ""; + } + if (message.code != null && message.hasOwnProperty("code")) + object.code = message.code; + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + if (message.details && message.details.length) { + object.details = []; + for (var j = 0; j < message.details.length; ++j) + object.details[j] = $root.google.protobuf.Any.toObject(message.details[j], options); } - if (message.responseType != null && message.hasOwnProperty("responseType")) - object.responseType = message.responseType; - if (message.metadataType != null && message.hasOwnProperty("metadataType")) - object.metadataType = message.metadataType; return object; }; - + /** - * Converts this OperationInfo to JSON. + * Converts this Status to JSON. * @function toJSON - * @memberof google.longrunning.OperationInfo + * @memberof google.rpc.Status * @instance * @returns {Object.} JSON object */ - OperationInfo.prototype.toJSON = function toJSON() { + Status.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - + /** - * Gets the default type url for OperationInfo + * Gets the default type url for Status * @function getTypeUrl - * @memberof google.longrunning.OperationInfo + * @memberof google.rpc.Status * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - OperationInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Status.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.longrunning.OperationInfo"; + return typeUrlPrefix + "/google.rpc.Status"; }; - - return OperationInfo; + + return Status; })(); - - return longrunning; + + return rpc; })(); - + return google; })(); diff --git a/dev/protos/v1.json b/dev/protos/v1.json index db0e96384..583aeb959 100644 --- a/dev/protos/v1.json +++ b/dev/protos/v1.json @@ -13,18 +13,6 @@ "optimize_for": "SPEED" }, "nested": { - "Timestamp": { - "fields": { - "seconds": { - "type": "int64", - "id": 1 - }, - "nanos": { - "type": "int32", - "id": 2 - } - } - }, "Struct": { "fields": { "fields": { @@ -88,6 +76,18 @@ } } }, + "Timestamp": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, "FileDescriptorSet": { "fields": { "file": { @@ -97,6 +97,21 @@ } } }, + "Edition": { + "values": { + "EDITION_UNKNOWN": 0, + "EDITION_PROTO2": 998, + "EDITION_PROTO3": 999, + "EDITION_2023": 1000, + "EDITION_2024": 1001, + "EDITION_1_TEST_ONLY": 1, + "EDITION_2_TEST_ONLY": 2, + "EDITION_99997_TEST_ONLY": 99997, + "EDITION_99998_TEST_ONLY": 99998, + "EDITION_99999_TEST_ONLY": 99999, + "EDITION_MAX": 2147483647 + } + }, "FileDescriptorProto": { "fields": { "name": { @@ -159,6 +174,10 @@ "syntax": { "type": "string", "id": 12 + }, + "edition": { + "type": "Edition", + "id": 14 } } }, @@ -223,6 +242,10 @@ "end": { "type": "int32", "id": 2 + }, + "options": { + "type": "ExtensionRangeOptions", + "id": 3 } } }, @@ -240,6 +263,79 @@ } } }, + "ExtensionRangeOptions": { + "fields": { + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + }, + "declaration": { + "rule": "repeated", + "type": "Declaration", + "id": 2, + "options": { + "retention": "RETENTION_SOURCE" + } + }, + "features": { + "type": "FeatureSet", + "id": 50 + }, + "verification": { + "type": "VerificationState", + "id": 3, + "options": { + "default": "UNVERIFIED", + "retention": "RETENTION_SOURCE" + } + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "nested": { + "Declaration": { + "fields": { + "number": { + "type": "int32", + "id": 1 + }, + "fullName": { + "type": "string", + "id": 2 + }, + "type": { + "type": "string", + "id": 3 + }, + "reserved": { + "type": "bool", + "id": 5 + }, + "repeated": { + "type": "bool", + "id": 6 + } + }, + "reserved": [ + [ + 4, + 4 + ] + ] + }, + "VerificationState": { + "values": { + "DECLARATION": 0, + "UNVERIFIED": 1 + } + } + } + }, "FieldDescriptorProto": { "fields": { "name": { @@ -281,6 +377,10 @@ "options": { "type": "FieldOptions", "id": 8 + }, + "proto3Optional": { + "type": "bool", + "id": 17 } }, "nested": { @@ -309,8 +409,8 @@ "Label": { "values": { "LABEL_OPTIONAL": 1, - "LABEL_REQUIRED": 2, - "LABEL_REPEATED": 3 + "LABEL_REPEATED": 3, + "LABEL_REQUIRED": 2 } } } @@ -341,6 +441,30 @@ "options": { "type": "EnumOptions", "id": 3 + }, + "reservedRange": { + "rule": "repeated", + "type": "EnumReservedRange", + "id": 4 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 5 + } + }, + "nested": { + "EnumReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } } } }, @@ -397,11 +521,17 @@ }, "clientStreaming": { "type": "bool", - "id": 5 + "id": 5, + "options": { + "default": false + } }, "serverStreaming": { "type": "bool", - "id": 6 + "id": 6, + "options": { + "default": false + } } } }, @@ -417,7 +547,10 @@ }, "javaMultipleFiles": { "type": "bool", - "id": 10 + "id": 10, + "options": { + "default": false + } }, "javaGenerateEqualsAndHash": { "type": "bool", @@ -428,7 +561,10 @@ }, "javaStringCheckUtf8": { "type": "bool", - "id": 27 + "id": 27, + "options": { + "default": false + } }, "optimizeFor": { "type": "OptimizeMode", @@ -443,23 +579,38 @@ }, "ccGenericServices": { "type": "bool", - "id": 16 + "id": 16, + "options": { + "default": false + } }, "javaGenericServices": { "type": "bool", - "id": 17 + "id": 17, + "options": { + "default": false + } }, "pyGenericServices": { "type": "bool", - "id": 18 + "id": 18, + "options": { + "default": false + } }, "deprecated": { "type": "bool", - "id": 23 + "id": 23, + "options": { + "default": false + } }, "ccEnableArenas": { "type": "bool", - "id": 31 + "id": 31, + "options": { + "default": true + } }, "objcClassPrefix": { "type": "string", @@ -469,6 +620,30 @@ "type": "string", "id": 37 }, + "swiftPrefix": { + "type": "string", + "id": 39 + }, + "phpClassPrefix": { + "type": "string", + "id": 40 + }, + "phpNamespace": { + "type": "string", + "id": 41 + }, + "phpMetadataNamespace": { + "type": "string", + "id": 44 + }, + "rubyPackage": { + "type": "string", + "id": 45 + }, + "features": { + "type": "FeatureSet", + "id": 50 + }, "uninterpretedOption": { "rule": "repeated", "type": "UninterpretedOption", @@ -482,6 +657,10 @@ ] ], "reserved": [ + [ + 42, + 42 + ], [ 38, 38 @@ -501,20 +680,40 @@ "fields": { "messageSetWireFormat": { "type": "bool", - "id": 1 + "id": 1, + "options": { + "default": false + } }, "noStandardDescriptorAccessor": { "type": "bool", - "id": 2 + "id": 2, + "options": { + "default": false + } }, "deprecated": { "type": "bool", - "id": 3 + "id": 3, + "options": { + "default": false + } }, "mapEntry": { "type": "bool", "id": 7 }, + "deprecatedLegacyJsonFieldConflicts": { + "type": "bool", + "id": 11, + "options": { + "deprecated": true + } + }, + "features": { + "type": "FeatureSet", + "id": 12 + }, "uninterpretedOption": { "rule": "repeated", "type": "UninterpretedOption", @@ -528,9 +727,25 @@ ] ], "reserved": [ + [ + 4, + 4 + ], + [ + 5, + 5 + ], + [ + 6, + 6 + ], [ 8, 8 + ], + [ + 9, + 9 ] ] }, @@ -556,15 +771,59 @@ }, "lazy": { "type": "bool", - "id": 5 + "id": 5, + "options": { + "default": false + } + }, + "unverifiedLazy": { + "type": "bool", + "id": 15, + "options": { + "default": false + } }, "deprecated": { "type": "bool", - "id": 3 + "id": 3, + "options": { + "default": false + } }, "weak": { "type": "bool", - "id": 10 + "id": 10, + "options": { + "default": false + } + }, + "debugRedact": { + "type": "bool", + "id": 16, + "options": { + "default": false + } + }, + "retention": { + "type": "OptionRetention", + "id": 17 + }, + "targets": { + "rule": "repeated", + "type": "OptionTargetType", + "id": 19, + "options": { + "packed": false + } + }, + "editionDefaults": { + "rule": "repeated", + "type": "EditionDefault", + "id": 20 + }, + "features": { + "type": "FeatureSet", + "id": 21 }, "uninterpretedOption": { "rule": "repeated", @@ -582,6 +841,10 @@ [ 4, 4 + ], + [ + 18, + 18 ] ], "nested": { @@ -598,11 +861,48 @@ "JS_STRING": 1, "JS_NUMBER": 2 } + }, + "OptionRetention": { + "values": { + "RETENTION_UNKNOWN": 0, + "RETENTION_RUNTIME": 1, + "RETENTION_SOURCE": 2 + } + }, + "OptionTargetType": { + "values": { + "TARGET_TYPE_UNKNOWN": 0, + "TARGET_TYPE_FILE": 1, + "TARGET_TYPE_EXTENSION_RANGE": 2, + "TARGET_TYPE_MESSAGE": 3, + "TARGET_TYPE_FIELD": 4, + "TARGET_TYPE_ONEOF": 5, + "TARGET_TYPE_ENUM": 6, + "TARGET_TYPE_ENUM_ENTRY": 7, + "TARGET_TYPE_SERVICE": 8, + "TARGET_TYPE_METHOD": 9 + } + }, + "EditionDefault": { + "fields": { + "edition": { + "type": "Edition", + "id": 3 + }, + "value": { + "type": "string", + "id": 2 + } + } } } }, "OneofOptions": { "fields": { + "features": { + "type": "FeatureSet", + "id": 1 + }, "uninterpretedOption": { "rule": "repeated", "type": "UninterpretedOption", @@ -624,7 +924,21 @@ }, "deprecated": { "type": "bool", - "id": 3 + "id": 3, + "options": { + "default": false + } + }, + "deprecatedLegacyJsonFieldConflicts": { + "type": "bool", + "id": 6, + "options": { + "deprecated": true + } + }, + "features": { + "type": "FeatureSet", + "id": 7 }, "uninterpretedOption": { "rule": "repeated", @@ -637,13 +951,33 @@ 1000, 536870911 ] + ], + "reserved": [ + [ + 5, + 5 + ] ] }, "EnumValueOptions": { "fields": { "deprecated": { "type": "bool", - "id": 1 + "id": 1, + "options": { + "default": false + } + }, + "features": { + "type": "FeatureSet", + "id": 2 + }, + "debugRedact": { + "type": "bool", + "id": 3, + "options": { + "default": false + } }, "uninterpretedOption": { "rule": "repeated", @@ -660,9 +994,16 @@ }, "ServiceOptions": { "fields": { + "features": { + "type": "FeatureSet", + "id": 34 + }, "deprecated": { "type": "bool", - "id": 33 + "id": 33, + "options": { + "default": false + } }, "uninterpretedOption": { "rule": "repeated", @@ -681,7 +1022,21 @@ "fields": { "deprecated": { "type": "bool", - "id": 33 + "id": 33, + "options": { + "default": false + } + }, + "idempotencyLevel": { + "type": "IdempotencyLevel", + "id": 34, + "options": { + "default": "IDEMPOTENCY_UNKNOWN" + } + }, + "features": { + "type": "FeatureSet", + "id": 35 }, "uninterpretedOption": { "rule": "repeated", @@ -694,7 +1049,16 @@ 1000, 536870911 ] - ] + ], + "nested": { + "IdempotencyLevel": { + "values": { + "IDEMPOTENCY_UNKNOWN": 0, + "NO_SIDE_EFFECTS": 1, + "IDEMPOTENT": 2 + } + } + } }, "UninterpretedOption": { "fields": { @@ -745,14 +1109,174 @@ } } }, - "SourceCodeInfo": { + "FeatureSet": { "fields": { - "location": { - "rule": "repeated", - "type": "Location", - "id": 1 - } - }, + "fieldPresence": { + "type": "FieldPresence", + "id": 1, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_2023", + "edition_defaults.value": "EXPLICIT" + } + }, + "enumType": { + "type": "EnumType", + "id": 2, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "OPEN" + } + }, + "repeatedFieldEncoding": { + "type": "RepeatedFieldEncoding", + "id": 3, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "PACKED" + } + }, + "utf8Validation": { + "type": "Utf8Validation", + "id": 4, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "VERIFY" + } + }, + "messageEncoding": { + "type": "MessageEncoding", + "id": 5, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO2", + "edition_defaults.value": "LENGTH_PREFIXED" + } + }, + "jsonFormat": { + "type": "JsonFormat", + "id": 6, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "ALLOW" + } + } + }, + "extensions": [ + [ + 1000, + 1000 + ], + [ + 1001, + 1001 + ], + [ + 9995, + 9999 + ] + ], + "reserved": [ + [ + 999, + 999 + ] + ], + "nested": { + "FieldPresence": { + "values": { + "FIELD_PRESENCE_UNKNOWN": 0, + "EXPLICIT": 1, + "IMPLICIT": 2, + "LEGACY_REQUIRED": 3 + } + }, + "EnumType": { + "values": { + "ENUM_TYPE_UNKNOWN": 0, + "OPEN": 1, + "CLOSED": 2 + } + }, + "RepeatedFieldEncoding": { + "values": { + "REPEATED_FIELD_ENCODING_UNKNOWN": 0, + "PACKED": 1, + "EXPANDED": 2 + } + }, + "Utf8Validation": { + "values": { + "UTF8_VALIDATION_UNKNOWN": 0, + "VERIFY": 2, + "NONE": 3 + } + }, + "MessageEncoding": { + "values": { + "MESSAGE_ENCODING_UNKNOWN": 0, + "LENGTH_PREFIXED": 1, + "DELIMITED": 2 + } + }, + "JsonFormat": { + "values": { + "JSON_FORMAT_UNKNOWN": 0, + "ALLOW": 1, + "LEGACY_BEST_EFFORT": 2 + } + } + } + }, + "FeatureSetDefaults": { + "fields": { + "defaults": { + "rule": "repeated", + "type": "FeatureSetEditionDefault", + "id": 1 + }, + "minimumEdition": { + "type": "Edition", + "id": 4 + }, + "maximumEdition": { + "type": "Edition", + "id": 5 + } + }, + "nested": { + "FeatureSetEditionDefault": { + "fields": { + "edition": { + "type": "Edition", + "id": 3 + }, + "features": { + "type": "FeatureSet", + "id": 2 + } + } + } + } + }, + "SourceCodeInfo": { + "fields": { + "location": { + "rule": "repeated", + "type": "Location", + "id": 1 + } + }, "nested": { "Location": { "fields": { @@ -810,13 +1334,35 @@ "end": { "type": "int32", "id": 4 + }, + "semantic": { + "type": "Semantic", + "id": 5 + } + }, + "nested": { + "Semantic": { + "values": { + "NONE": 0, + "SET": 1, + "ALIAS": 2 + } } } } } }, - "Empty": { - "fields": {} + "Duration": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } }, "DoubleValue": { "fields": { @@ -890,6 +1436,9 @@ } } }, + "Empty": { + "fields": {} + }, "Any": { "fields": { "type_url": { @@ -901,27 +1450,6 @@ "id": 2 } } - }, - "FieldMask": { - "fields": { - "paths": { - "rule": "repeated", - "type": "string", - "id": 1 - } - } - }, - "Duration": { - "fields": { - "seconds": { - "type": "int64", - "id": 1 - }, - "nanos": { - "type": "int32", - "id": 2 - } - } } } }, @@ -948,104 +1476,6 @@ } } }, - "BitSequence": { - "fields": { - "bitmap": { - "type": "bytes", - "id": 1 - }, - "padding": { - "type": "int32", - "id": 2 - } - } - }, - "BloomFilter": { - "fields": { - "bits": { - "type": "BitSequence", - "id": 1 - }, - "hashCount": { - "type": "int32", - "id": 2 - } - } - }, - "DocumentMask": { - "fields": { - "fieldPaths": { - "rule": "repeated", - "type": "string", - "id": 1 - } - } - }, - "Precondition": { - "oneofs": { - "conditionType": { - "oneof": [ - "exists", - "updateTime" - ] - } - }, - "fields": { - "exists": { - "type": "bool", - "id": 1 - }, - "updateTime": { - "type": "google.protobuf.Timestamp", - "id": 2 - } - } - }, - "TransactionOptions": { - "oneofs": { - "mode": { - "oneof": [ - "readOnly", - "readWrite" - ] - } - }, - "fields": { - "readOnly": { - "type": "ReadOnly", - "id": 2 - }, - "readWrite": { - "type": "ReadWrite", - "id": 3 - } - }, - "nested": { - "ReadWrite": { - "fields": { - "retryTransaction": { - "type": "bytes", - "id": 1 - } - } - }, - "ReadOnly": { - "oneofs": { - "consistencySelector": { - "oneof": [ - "readTime" - ] - } - }, - "fields": { - "readTime": { - "type": "google.protobuf.Timestamp", - "id": 2 - } - } - } - } - }, "Document": { "fields": { "name": { @@ -1150,6 +1580,104 @@ } } }, + "BitSequence": { + "fields": { + "bitmap": { + "type": "bytes", + "id": 1 + }, + "padding": { + "type": "int32", + "id": 2 + } + } + }, + "BloomFilter": { + "fields": { + "bits": { + "type": "BitSequence", + "id": 1 + }, + "hashCount": { + "type": "int32", + "id": 2 + } + } + }, + "DocumentMask": { + "fields": { + "fieldPaths": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "Precondition": { + "oneofs": { + "conditionType": { + "oneof": [ + "exists", + "updateTime" + ] + } + }, + "fields": { + "exists": { + "type": "bool", + "id": 1 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + } + } + }, + "TransactionOptions": { + "oneofs": { + "mode": { + "oneof": [ + "readOnly", + "readWrite" + ] + } + }, + "fields": { + "readOnly": { + "type": "ReadOnly", + "id": 2 + }, + "readWrite": { + "type": "ReadWrite", + "id": 3 + } + }, + "nested": { + "ReadWrite": { + "fields": { + "retryTransaction": { + "type": "bytes", + "id": 1 + } + } + }, + "ReadOnly": { + "oneofs": { + "consistencySelector": { + "oneof": [ + "readTime" + ] + } + }, + "fields": { + "readTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + } + } + } + } + }, "Firestore": { "options": { "(google.api.default_host)": "firestore.googleapis.com", @@ -1830,9 +2358,9 @@ "type": "google.protobuf.Timestamp", "id": 7 }, - "mode": { - "type": "QueryMode", - "id": 9, + "explainOptions": { + "type": "ExplainOptions", + "id": 10, "options": { "(google.api.field_behavior)": "OPTIONAL" } @@ -1868,9 +2396,9 @@ "type": "bool", "id": 6 }, - "stats": { - "type": "ResultSetStats", - "id": 7 + "explainMetrics": { + "type": "ExplainMetrics", + "id": 11 } } }, @@ -1913,9 +2441,9 @@ "type": "google.protobuf.Timestamp", "id": 6 }, - "mode": { - "type": "QueryMode", - "id": 7, + "explainOptions": { + "type": "ExplainOptions", + "id": 8, "options": { "(google.api.field_behavior)": "OPTIONAL" } @@ -1936,9 +2464,9 @@ "type": "google.protobuf.Timestamp", "id": 3 }, - "stats": { - "type": "ResultSetStats", - "id": 6 + "explainMetrics": { + "type": "ExplainMetrics", + "id": 10 } } }, @@ -2305,33 +2833,6 @@ } } }, - "QueryMode": { - "values": { - "NORMAL": 0, - "PLAN": 1, - "PROFILE": 2 - } - }, - "QueryPlan": { - "fields": { - "planInfo": { - "type": "google.protobuf.Struct", - "id": 1 - } - } - }, - "ResultSetStats": { - "fields": { - "queryPlan": { - "type": "QueryPlan", - "id": 1 - }, - "queryStats": { - "type": "google.protobuf.Struct", - "id": 2 - } - } - }, "StructuredQuery": { "fields": { "select": { @@ -2367,6 +2868,13 @@ "limit": { "type": "google.protobuf.Int32Value", "id": 5 + }, + "findNearest": { + "type": "FindNearest", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } }, "nested": { @@ -2527,6 +3035,48 @@ "id": 2 } } + }, + "FindNearest": { + "fields": { + "vectorField": { + "type": "FieldReference", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "queryVector": { + "type": "Value", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "distanceMeasure": { + "type": "DistanceMeasure", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "limit": { + "type": "google.protobuf.Int32Value", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "DistanceMeasure": { + "values": { + "DISTANCE_MEASURE_UNSPECIFIED": 0, + "EUCLIDEAN": 1, + "COSINE": 2, + "DOT_PRODUCT": 3 + } + } + } } } }, @@ -2629,6 +3179,62 @@ } } }, + "ExplainOptions": { + "fields": { + "analyze": { + "type": "bool", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ExplainMetrics": { + "fields": { + "planSummary": { + "type": "PlanSummary", + "id": 1 + }, + "executionStats": { + "type": "ExecutionStats", + "id": 2 + } + } + }, + "PlanSummary": { + "fields": { + "indexesUsed": { + "rule": "repeated", + "type": "google.protobuf.Struct", + "id": 1 + } + } + }, + "ExecutionStats": { + "fields": { + "resultsReturned": { + "type": "int64", + "id": 1 + }, + "bytesReturned": { + "type": "int64", + "id": 2 + }, + "executionDuration": { + "type": "google.protobuf.Duration", + "id": 3 + }, + "readOperations": { + "type": "int64", + "id": 4 + }, + "debugStats": { + "type": "google.protobuf.Struct", + "id": 5 + } + } + }, "Write": { "oneofs": { "operation": { @@ -2819,11 +3425,35 @@ } } }, + "type": { + "options": { + "cc_enable_arenas": true, + "go_package": "google.golang.org/genproto/googleapis/type/latlng;latlng", + "java_multiple_files": true, + "java_outer_classname": "LatLngProto", + "java_package": "com.google.type", + "objc_class_prefix": "GTP" + }, + "nested": { + "LatLng": { + "fields": { + "latitude": { + "type": "double", + "id": 1 + }, + "longitude": { + "type": "double", + "id": 2 + } + } + } + } + }, "api": { "options": { "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", "java_multiple_files": true, - "java_outer_classname": "ResourceProto", + "java_outer_classname": "FieldBehaviorProto", "java_package": "com.google.api", "objc_class_prefix": "GAPI", "cc_enable_arenas": true @@ -2840,6 +3470,10 @@ "rule": "repeated", "type": "HttpRule", "id": 1 + }, + "fullyDecodeReservedExpansion": { + "type": "bool", + "id": 2 } } }, @@ -2857,6 +3491,10 @@ } }, "fields": { + "selector": { + "type": "string", + "id": 1 + }, "get": { "type": "string", "id": 2 @@ -2881,14 +3519,14 @@ "type": "CustomHttpPattern", "id": 8 }, - "selector": { - "type": "string", - "id": 1 - }, "body": { "type": "string", "id": 7 }, + "responseBody": { + "type": "string", + "id": 12 + }, "additionalBindings": { "rule": "repeated", "type": "HttpRule", @@ -3191,6 +3829,18 @@ "PACKAGE_MANAGER": 20 } }, + "LaunchStage": { + "values": { + "LAUNCH_STAGE_UNSPECIFIED": 0, + "UNIMPLEMENTED": 6, + "PRELAUNCH": 7, + "EARLY_ACCESS": 1, + "ALPHA": 2, + "BETA": 3, + "GA": 4, + "DEPRECATED": 5 + } + }, "fieldBehavior": { "rule": "repeated", "type": "google.api.FieldBehavior", @@ -3209,119 +3859,6 @@ "NON_EMPTY_DEFAULT": 7, "IDENTIFIER": 8 } - }, - "LaunchStage": { - "values": { - "LAUNCH_STAGE_UNSPECIFIED": 0, - "UNIMPLEMENTED": 6, - "PRELAUNCH": 7, - "EARLY_ACCESS": 1, - "ALPHA": 2, - "BETA": 3, - "GA": 4, - "DEPRECATED": 5 - } - }, - "resourceReference": { - "type": "google.api.ResourceReference", - "id": 1055, - "extend": "google.protobuf.FieldOptions" - }, - "resourceDefinition": { - "rule": "repeated", - "type": "google.api.ResourceDescriptor", - "id": 1053, - "extend": "google.protobuf.FileOptions" - }, - "resource": { - "type": "google.api.ResourceDescriptor", - "id": 1053, - "extend": "google.protobuf.MessageOptions" - }, - "ResourceDescriptor": { - "fields": { - "type": { - "type": "string", - "id": 1 - }, - "pattern": { - "rule": "repeated", - "type": "string", - "id": 2 - }, - "nameField": { - "type": "string", - "id": 3 - }, - "history": { - "type": "History", - "id": 4 - }, - "plural": { - "type": "string", - "id": 5 - }, - "singular": { - "type": "string", - "id": 6 - }, - "style": { - "rule": "repeated", - "type": "Style", - "id": 10 - } - }, - "nested": { - "History": { - "values": { - "HISTORY_UNSPECIFIED": 0, - "ORIGINALLY_SINGLE_PATTERN": 1, - "FUTURE_MULTI_PATTERN": 2 - } - }, - "Style": { - "values": { - "STYLE_UNSPECIFIED": 0, - "DECLARATIVE_FRIENDLY": 1 - } - } - } - }, - "ResourceReference": { - "fields": { - "type": { - "type": "string", - "id": 1 - }, - "childType": { - "type": "string", - "id": 2 - } - } - } - } - }, - "type": { - "options": { - "cc_enable_arenas": true, - "go_package": "google.golang.org/genproto/googleapis/type/latlng;latlng", - "java_multiple_files": true, - "java_outer_classname": "LatLngProto", - "java_package": "com.google.type", - "objc_class_prefix": "GTP" - }, - "nested": { - "LatLng": { - "fields": { - "latitude": { - "type": "double", - "id": 1 - }, - "longitude": { - "type": "double", - "id": 2 - } - } } } },