From 06dfeee5bb7cf6066304f669a1f83b406283f7e6 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Wed, 10 Jul 2024 19:38:41 +0000 Subject: [PATCH 1/5] feat: add use_topic_schema for Cloud Storage Subscriptions PiperOrigin-RevId: 643385701 Source-Link: https://github.com/googleapis/googleapis/commit/f29a82a206156fd665eaa01cb7987170ac0250f0 Source-Link: https://github.com/googleapis/googleapis-gen/commit/f8f3f60ad2ab4e81fe024368ad0430900174e82b Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZjhmM2Y2MGFkMmFiNGU4MWZlMDI0MzY4YWQwNDMwOTAwMTc0ZTgyYiJ9 --- owl-bot-staging/v1/.eslintignore | 7 + owl-bot-staging/v1/.eslintrc.json | 3 + owl-bot-staging/v1/.gitignore | 14 + owl-bot-staging/v1/.jsdoc.js | 55 + owl-bot-staging/v1/.mocharc.js | 33 + owl-bot-staging/v1/.prettierrc.js | 22 + owl-bot-staging/v1/README.md | 1 + owl-bot-staging/v1/package.json | 60 + .../v1/protos/google/pubsub/v1/pubsub.proto | 1777 + .../v1/protos/google/pubsub/v1/schema.proto | 410 + owl-bot-staging/v1/protos/protos.d.ts | 15218 ++++++ owl-bot-staging/v1/protos/protos.js | 38732 ++++++++++++++++ owl-bot-staging/v1/protos/protos.json | 4338 ++ owl-bot-staging/v1/src/index.ts | 29 + owl-bot-staging/v1/src/v1/index.ts | 21 + owl-bot-staging/v1/src/v1/publisher_client.ts | 1701 + .../v1/src/v1/publisher_client_config.json | 103 + .../v1/src/v1/publisher_proto_list.json | 4 + .../v1/src/v1/schema_service_client.ts | 1643 + .../src/v1/schema_service_client_config.json | 79 + .../v1/src/v1/schema_service_proto_list.json | 4 + .../v1/src/v1/subscriber_client.ts | 2235 + .../v1/src/v1/subscriber_client_config.json | 136 + .../v1/src/v1/subscriber_proto_list.json | 4 + owl-bot-staging/v1/test/gapic_publisher_v1.ts | 2077 + .../v1/test/gapic_schema_service_v1.ts | 2076 + .../v1/test/gapic_subscriber_v1.ts | 2697 ++ owl-bot-staging/v1/tsconfig.json | 19 + owl-bot-staging/v1/webpack.config.js | 64 + 29 files changed, 73562 insertions(+) create mode 100644 owl-bot-staging/v1/.eslintignore create mode 100644 owl-bot-staging/v1/.eslintrc.json create mode 100644 owl-bot-staging/v1/.gitignore create mode 100644 owl-bot-staging/v1/.jsdoc.js create mode 100644 owl-bot-staging/v1/.mocharc.js create mode 100644 owl-bot-staging/v1/.prettierrc.js create mode 100644 owl-bot-staging/v1/README.md create mode 100644 owl-bot-staging/v1/package.json create mode 100644 owl-bot-staging/v1/protos/google/pubsub/v1/pubsub.proto create mode 100644 owl-bot-staging/v1/protos/google/pubsub/v1/schema.proto create mode 100644 owl-bot-staging/v1/protos/protos.d.ts create mode 100644 owl-bot-staging/v1/protos/protos.js create mode 100644 owl-bot-staging/v1/protos/protos.json create mode 100644 owl-bot-staging/v1/src/index.ts create mode 100644 owl-bot-staging/v1/src/v1/index.ts create mode 100644 owl-bot-staging/v1/src/v1/publisher_client.ts create mode 100644 owl-bot-staging/v1/src/v1/publisher_client_config.json create mode 100644 owl-bot-staging/v1/src/v1/publisher_proto_list.json create mode 100644 owl-bot-staging/v1/src/v1/schema_service_client.ts create mode 100644 owl-bot-staging/v1/src/v1/schema_service_client_config.json create mode 100644 owl-bot-staging/v1/src/v1/schema_service_proto_list.json create mode 100644 owl-bot-staging/v1/src/v1/subscriber_client.ts create mode 100644 owl-bot-staging/v1/src/v1/subscriber_client_config.json create mode 100644 owl-bot-staging/v1/src/v1/subscriber_proto_list.json create mode 100644 owl-bot-staging/v1/test/gapic_publisher_v1.ts create mode 100644 owl-bot-staging/v1/test/gapic_schema_service_v1.ts create mode 100644 owl-bot-staging/v1/test/gapic_subscriber_v1.ts create mode 100644 owl-bot-staging/v1/tsconfig.json create mode 100644 owl-bot-staging/v1/webpack.config.js diff --git a/owl-bot-staging/v1/.eslintignore b/owl-bot-staging/v1/.eslintignore new file mode 100644 index 000000000..cfc348ec4 --- /dev/null +++ b/owl-bot-staging/v1/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/.coverage +build/ +docs/ +protos/ +system-test/ +samples/generated/ diff --git a/owl-bot-staging/v1/.eslintrc.json b/owl-bot-staging/v1/.eslintrc.json new file mode 100644 index 000000000..782153495 --- /dev/null +++ b/owl-bot-staging/v1/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/owl-bot-staging/v1/.gitignore b/owl-bot-staging/v1/.gitignore new file mode 100644 index 000000000..d4f03a0df --- /dev/null +++ b/owl-bot-staging/v1/.gitignore @@ -0,0 +1,14 @@ +**/*.log +**/node_modules +/.coverage +/coverage +/.nyc_output +/docs/ +/out/ +/build/ +system-test/secrets.js +system-test/*key.json +*.lock +.DS_Store +package-lock.json +__pycache__ diff --git a/owl-bot-staging/v1/.jsdoc.js b/owl-bot-staging/v1/.jsdoc.js new file mode 100644 index 000000000..0093b3142 --- /dev/null +++ b/owl-bot-staging/v1/.jsdoc.js @@ -0,0 +1,55 @@ +// 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +'use strict'; + +module.exports = { + opts: { + readme: './README.md', + package: './package.json', + template: './node_modules/jsdoc-fresh', + recurse: true, + verbose: true, + destination: './docs/' + }, + plugins: [ + 'plugins/markdown', + 'jsdoc-region-tag' + ], + source: { + excludePattern: '(^|\\/|\\\\)[._]', + include: [ + 'build/src', + 'protos' + ], + includePattern: '\\.js$' + }, + templates: { + copyright: 'Copyright 2024 Google LLC', + includeDate: false, + sourceFiles: false, + systemName: '@google-cloud/pubsub', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/owl-bot-staging/v1/.mocharc.js b/owl-bot-staging/v1/.mocharc.js new file mode 100644 index 000000000..13b67c34e --- /dev/null +++ b/owl-bot-staging/v1/.mocharc.js @@ -0,0 +1,33 @@ +// 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +const config = { + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000 +} +if (process.env.MOCHA_THROW_DEPRECATION === 'false') { + delete config['throw-deprecation']; +} +if (process.env.MOCHA_REPORTER) { + config.reporter = process.env.MOCHA_REPORTER; +} +if (process.env.MOCHA_REPORTER_OUTPUT) { + config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`; +} +module.exports = config diff --git a/owl-bot-staging/v1/.prettierrc.js b/owl-bot-staging/v1/.prettierrc.js new file mode 100644 index 000000000..9a8fd6909 --- /dev/null +++ b/owl-bot-staging/v1/.prettierrc.js @@ -0,0 +1,22 @@ +// 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + +module.exports = { + ...require('gts/.prettierrc.json') +} diff --git a/owl-bot-staging/v1/README.md b/owl-bot-staging/v1/README.md new file mode 100644 index 000000000..cdb58308f --- /dev/null +++ b/owl-bot-staging/v1/README.md @@ -0,0 +1 @@ +Pubsub: Nodejs Client diff --git a/owl-bot-staging/v1/package.json b/owl-bot-staging/v1/package.json new file mode 100644 index 000000000..db5207cc6 --- /dev/null +++ b/owl-bot-staging/v1/package.json @@ -0,0 +1,60 @@ +{ + "name": "@google-cloud/pubsub", + "version": "0.1.0", + "description": "Pubsub client for Node.js", + "repository": "googleapis/nodejs-pubsub", + "license": "Apache-2.0", + "author": "Google LLC", + "main": "build/src/index.js", + "files": [ + "build/src", + "build/protos" + ], + "keywords": [ + "google apis client", + "google api client", + "google apis", + "google api", + "google", + "google cloud platform", + "google cloud", + "cloud", + "google pubsub", + "pubsub", + "publisher", + "schema service", + "subscriber" + ], + "scripts": { + "clean": "gts clean", + "compile": "tsc -p . && cp -r protos build/ && minifyProtoJson", + "compile-protos": "compileProtos src", + "docs": "jsdoc -c .jsdoc.js", + "fix": "gts fix", + "lint": "gts check", + "prepare": "npm run compile-protos && npm run compile", + "system-test": "c8 mocha build/system-test", + "test": "c8 mocha build/test" + }, + "dependencies": { + "google-gax": "^4.3.4" + }, + "devDependencies": { + "@types/mocha": "^10.0.6", + "@types/node": "^20.12.12", + "@types/sinon": "^10.0.20", + "c8": "^9.1.0", + "gapic-tools": "^0.4.2", + "gts": "5.3.0", + "jsdoc": "^4.0.3", + "jsdoc-fresh": "^3.0.0", + "jsdoc-region-tag": "^3.0.0", + "mocha": "^10.4.0", + "pack-n-play": "^2.0.3", + "sinon": "^15.2.0", + "typescript": "5.1.6" + }, + "engines": { + "node": ">=v14" + } +} diff --git a/owl-bot-staging/v1/protos/google/pubsub/v1/pubsub.proto b/owl-bot-staging/v1/protos/google/pubsub/v1/pubsub.proto new file mode 100644 index 000000000..b70bda11a --- /dev/null +++ b/owl-bot-staging/v1/protos/google/pubsub/v1/pubsub.proto @@ -0,0 +1,1777 @@ +// 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. + +syntax = "proto3"; + +package google.pubsub.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; +import "google/pubsub/v1/schema.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.PubSub.V1"; +option go_package = "cloud.google.com/go/pubsub/apiv1/pubsubpb;pubsubpb"; +option java_multiple_files = true; +option java_outer_classname = "PubsubProto"; +option java_package = "com.google.pubsub.v1"; +option php_namespace = "Google\\Cloud\\PubSub\\V1"; +option ruby_package = "Google::Cloud::PubSub::V1"; + +// The service that an application uses to manipulate topics, and to send +// messages to a topic. +service Publisher { + option (google.api.default_host) = "pubsub.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/pubsub"; + + // Creates the given topic with the given name. See the [resource name rules] + // (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). + rpc CreateTopic(Topic) returns (Topic) { + option (google.api.http) = { + put: "/v1/{name=projects/*/topics/*}" + body: "*" + }; + option (google.api.method_signature) = "name"; + } + + // Updates an existing topic by updating the fields specified in the update + // mask. Note that certain properties of a topic are not modifiable. + rpc UpdateTopic(UpdateTopicRequest) returns (Topic) { + option (google.api.http) = { + patch: "/v1/{topic.name=projects/*/topics/*}" + body: "*" + }; + option (google.api.method_signature) = "topic,update_mask"; + } + + // Adds one or more messages to the topic. Returns `NOT_FOUND` if the topic + // does not exist. + rpc Publish(PublishRequest) returns (PublishResponse) { + option (google.api.http) = { + post: "/v1/{topic=projects/*/topics/*}:publish" + body: "*" + }; + option (google.api.method_signature) = "topic,messages"; + } + + // Gets the configuration of a topic. + rpc GetTopic(GetTopicRequest) returns (Topic) { + option (google.api.http) = { + get: "/v1/{topic=projects/*/topics/*}" + }; + option (google.api.method_signature) = "topic"; + } + + // Lists matching topics. + rpc ListTopics(ListTopicsRequest) returns (ListTopicsResponse) { + option (google.api.http) = { + get: "/v1/{project=projects/*}/topics" + }; + option (google.api.method_signature) = "project"; + } + + // Lists the names of the attached subscriptions on this topic. + rpc ListTopicSubscriptions(ListTopicSubscriptionsRequest) + returns (ListTopicSubscriptionsResponse) { + option (google.api.http) = { + get: "/v1/{topic=projects/*/topics/*}/subscriptions" + }; + option (google.api.method_signature) = "topic"; + } + + // Lists the names of the snapshots on this topic. Snapshots are used in + // [Seek](https://cloud.google.com/pubsub/docs/replay-overview) operations, + // which allow you to manage message acknowledgments in bulk. That is, you can + // set the acknowledgment state of messages in an existing subscription to the + // state captured by a snapshot. + rpc ListTopicSnapshots(ListTopicSnapshotsRequest) + returns (ListTopicSnapshotsResponse) { + option (google.api.http) = { + get: "/v1/{topic=projects/*/topics/*}/snapshots" + }; + option (google.api.method_signature) = "topic"; + } + + // Deletes the topic with the given name. Returns `NOT_FOUND` if the topic + // does not exist. After a topic is deleted, a new topic may be created with + // the same name; this is an entirely new topic with none of the old + // configuration or subscriptions. Existing subscriptions to this topic are + // not deleted, but their `topic` field is set to `_deleted-topic_`. + rpc DeleteTopic(DeleteTopicRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{topic=projects/*/topics/*}" + }; + option (google.api.method_signature) = "topic"; + } + + // Detaches a subscription from this topic. All messages retained in the + // subscription are dropped. Subsequent `Pull` and `StreamingPull` requests + // will return FAILED_PRECONDITION. If the subscription is a push + // subscription, pushes to the endpoint will stop. + rpc DetachSubscription(DetachSubscriptionRequest) + returns (DetachSubscriptionResponse) { + option (google.api.http) = { + post: "/v1/{subscription=projects/*/subscriptions/*}:detach" + }; + } +} + +// A policy constraining the storage of messages published to the topic. +message MessageStoragePolicy { + // Optional. A list of IDs of Google Cloud regions where messages that are + // published to the topic may be persisted in storage. Messages published by + // publishers running in non-allowed Google Cloud regions (or running outside + // of Google Cloud altogether) are routed for storage in one of the allowed + // regions. An empty list means that no regions are allowed, and is not a + // valid configuration. + repeated string allowed_persistence_regions = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If true, `allowed_persistence_regions` is also used to enforce + // in-transit guarantees for messages. That is, Pub/Sub will fail + // Publish operations on this topic and subscribe operations + // on any subscription attached to this topic in any region that is + // not in `allowed_persistence_regions`. + bool enforce_in_transit = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Settings for validating messages published against a schema. +message SchemaSettings { + // Required. The name of the schema that messages published should be + // validated against. Format is `projects/{project}/schemas/{schema}`. The + // value of this field will be `_deleted-schema_` if the schema has been + // deleted. + string schema = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "pubsub.googleapis.com/Schema" } + ]; + + // Optional. The encoding of messages validated against `schema`. + Encoding encoding = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The minimum (inclusive) revision allowed for validating messages. + // If empty or not present, allow any revision to be validated against + // last_revision or any revision created before. + string first_revision_id = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The maximum (inclusive) revision allowed for validating messages. + // If empty or not present, allow any revision to be validated against + // first_revision or any revision created after. + string last_revision_id = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Settings for an ingestion data source on a topic. +message IngestionDataSourceSettings { + // Ingestion settings for Amazon Kinesis Data Streams. + message AwsKinesis { + // Possible states for ingestion from Amazon Kinesis Data Streams. + enum State { + // Default value. This value is unused. + STATE_UNSPECIFIED = 0; + + // Ingestion is active. + ACTIVE = 1; + + // Permission denied encountered while consuming data from Kinesis. + // This can happen if: + // - The provided `aws_role_arn` does not exist or does not have the + // appropriate permissions attached. + // - The provided `aws_role_arn` is not set up properly for Identity + // Federation using `gcp_service_account`. + // - The Pub/Sub SA is not granted the + // `iam.serviceAccounts.getOpenIdToken` permission on + // `gcp_service_account`. + KINESIS_PERMISSION_DENIED = 2; + + // Permission denied encountered while publishing to the topic. This can + // happen if the Pub/Sub SA has not been granted the [appropriate publish + // permissions](https://cloud.google.com/pubsub/docs/access-control#pubsub.publisher) + PUBLISH_PERMISSION_DENIED = 3; + + // The Kinesis stream does not exist. + STREAM_NOT_FOUND = 4; + + // The Kinesis consumer does not exist. + CONSUMER_NOT_FOUND = 5; + } + + // Output only. An output-only field that indicates the state of the Kinesis + // ingestion source. + State state = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The Kinesis stream ARN to ingest data from. + string stream_arn = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The Kinesis consumer ARN to used for ingestion in Enhanced + // Fan-Out mode. The consumer must be already created and ready to be used. + string consumer_arn = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. AWS role ARN to be used for Federated Identity authentication + // with Kinesis. Check the Pub/Sub docs for how to set up this role and the + // required permissions that need to be attached to it. + string aws_role_arn = 4 [(google.api.field_behavior) = REQUIRED]; + + // Required. The GCP service account to be used for Federated Identity + // authentication with Kinesis (via a `AssumeRoleWithWebIdentity` call for + // the provided role). The `aws_role_arn` must be set up with + // `accounts.google.com:sub` equals to this service account number. + string gcp_service_account = 5 [(google.api.field_behavior) = REQUIRED]; + } + + // Only one source type can have settings set. + oneof source { + // Optional. Amazon Kinesis Data Streams. + AwsKinesis aws_kinesis = 1 [(google.api.field_behavior) = OPTIONAL]; + } +} + +// A topic resource. +message Topic { + option (google.api.resource) = { + type: "pubsub.googleapis.com/Topic" + pattern: "projects/{project}/topics/{topic}" + pattern: "_deleted-topic_" + }; + + // The state of the topic. + enum State { + // Default value. This value is unused. + STATE_UNSPECIFIED = 0; + + // The topic does not have any persistent errors. + ACTIVE = 1; + + // Ingestion from the data source has encountered a permanent error. + // See the more detailed error state in the corresponding ingestion + // source configuration. + INGESTION_RESOURCE_ERROR = 2; + } + + // Required. The name of the topic. It must have the format + // `"projects/{project}/topics/{topic}"`. `{topic}` must start with a letter, + // and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), + // underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent + // signs (`%`). It must be between 3 and 255 characters in length, and it + // must not start with `"goog"`. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. See [Creating and managing labels] + // (https://cloud.google.com/pubsub/docs/labels). + map labels = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Policy constraining the set of Google Cloud Platform regions + // where messages published to the topic may be stored. If not present, then + // no constraints are in effect. + MessageStoragePolicy message_storage_policy = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The resource name of the Cloud KMS CryptoKey to be used to + // protect access to messages published on this topic. + // + // The expected format is `projects/*/locations/*/keyRings/*/cryptoKeys/*`. + string kms_key_name = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Settings for validating messages published against a schema. + SchemaSettings schema_settings = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Reserved for future use. This field is set only in responses from + // the server; it is ignored if it is set in any requests. + bool satisfies_pzs = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Indicates the minimum duration to retain a message after it is + // published to the topic. If this field is set, messages published to the + // topic in the last `message_retention_duration` are always available to + // subscribers. For instance, it allows any attached subscription to [seek to + // a + // timestamp](https://cloud.google.com/pubsub/docs/replay-overview#seek_to_a_time) + // that is up to `message_retention_duration` in the past. If this field is + // not set, message retention is controlled by settings on individual + // subscriptions. Cannot be more than 31 days or less than 10 minutes. + google.protobuf.Duration message_retention_duration = 8 + [(google.api.field_behavior) = OPTIONAL]; + + // Output only. An output-only field indicating the state of the topic. + State state = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Settings for ingestion from a data source into this topic. + IngestionDataSourceSettings ingestion_data_source_settings = 10 + [(google.api.field_behavior) = OPTIONAL]; +} + +// A message that is published by publishers and consumed by subscribers. The +// message must contain either a non-empty data field or at least one attribute. +// Note that client libraries represent this object differently +// depending on the language. See the corresponding [client library +// documentation](https://cloud.google.com/pubsub/docs/reference/libraries) for +// more information. See [quotas and limits] +// (https://cloud.google.com/pubsub/quotas) for more information about message +// limits. +message PubsubMessage { + // Optional. The message data field. If this field is empty, the message must + // contain at least one attribute. + bytes data = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Attributes for this message. If this field is empty, the message + // must contain non-empty data. This can be used to filter messages on the + // subscription. + map attributes = 2 [(google.api.field_behavior) = OPTIONAL]; + + // ID of this message, assigned by the server when the message is published. + // Guaranteed to be unique within the topic. This value may be read by a + // subscriber that receives a `PubsubMessage` via a `Pull` call or a push + // delivery. It must not be populated by the publisher in a `Publish` call. + string message_id = 3; + + // The time at which the message was published, populated by the server when + // it receives the `Publish` call. It must not be populated by the + // publisher in a `Publish` call. + google.protobuf.Timestamp publish_time = 4; + + // Optional. If non-empty, identifies related messages for which publish order + // should be respected. If a `Subscription` has `enable_message_ordering` set + // to `true`, messages published with the same non-empty `ordering_key` value + // will be delivered to subscribers in the order in which they are received by + // the Pub/Sub system. All `PubsubMessage`s published in a given + // `PublishRequest` must specify the same `ordering_key` value. For more + // information, see [ordering + // messages](https://cloud.google.com/pubsub/docs/ordering). + string ordering_key = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request for the GetTopic method. +message GetTopicRequest { + // Required. The name of the topic to get. + // Format is `projects/{project}/topics/{topic}`. + string topic = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "pubsub.googleapis.com/Topic" } + ]; +} + +// Request for the UpdateTopic method. +message UpdateTopicRequest { + // Required. The updated topic object. + Topic topic = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Indicates which fields in the provided topic to update. Must be + // specified and non-empty. Note that if `update_mask` contains + // "message_storage_policy" but the `message_storage_policy` is not set in + // the `topic` provided above, then the updated value is determined by the + // policy configured at the project or organization level. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// Request for the Publish method. +message PublishRequest { + // Required. The messages in the request will be published on this topic. + // Format is `projects/{project}/topics/{topic}`. + string topic = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "pubsub.googleapis.com/Topic" } + ]; + + // Required. The messages to publish. + repeated PubsubMessage messages = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Response for the `Publish` method. +message PublishResponse { + // Optional. The server-assigned ID of each published message, in the same + // order as the messages in the request. IDs are guaranteed to be unique + // within the topic. + repeated string message_ids = 1 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request for the `ListTopics` method. +message ListTopicsRequest { + // Required. The name of the project in which to list topics. + // Format is `projects/{project-id}`. + string project = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Project" + } + ]; + + // Optional. Maximum number of topics to return. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The value returned by the last `ListTopicsResponse`; indicates + // that this is a continuation of a prior `ListTopics` call, and that the + // system should return the next page of data. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response for the `ListTopics` method. +message ListTopicsResponse { + // Optional. The resulting topics. + repeated Topic topics = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If not empty, indicates that there may be more topics that match + // the request; this value should be passed in a new `ListTopicsRequest`. + string next_page_token = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request for the `ListTopicSubscriptions` method. +message ListTopicSubscriptionsRequest { + // Required. The name of the topic that subscriptions are attached to. + // Format is `projects/{project}/topics/{topic}`. + string topic = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "pubsub.googleapis.com/Topic" } + ]; + + // Optional. Maximum number of subscription names to return. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The value returned by the last `ListTopicSubscriptionsResponse`; + // indicates that this is a continuation of a prior `ListTopicSubscriptions` + // call, and that the system should return the next page of data. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response for the `ListTopicSubscriptions` method. +message ListTopicSubscriptionsResponse { + // Optional. The names of subscriptions attached to the topic specified in the + // request. + repeated string subscriptions = 1 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "pubsub.googleapis.com/Subscription" + } + ]; + + // Optional. If not empty, indicates that there may be more subscriptions that + // match the request; this value should be passed in a new + // `ListTopicSubscriptionsRequest` to get more subscriptions. + string next_page_token = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request for the `ListTopicSnapshots` method. +message ListTopicSnapshotsRequest { + // Required. The name of the topic that snapshots are attached to. + // Format is `projects/{project}/topics/{topic}`. + string topic = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "pubsub.googleapis.com/Topic" } + ]; + + // Optional. Maximum number of snapshot names to return. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The value returned by the last `ListTopicSnapshotsResponse`; + // indicates that this is a continuation of a prior `ListTopicSnapshots` call, + // and that the system should return the next page of data. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response for the `ListTopicSnapshots` method. +message ListTopicSnapshotsResponse { + // Optional. The names of the snapshots that match the request. + repeated string snapshots = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If not empty, indicates that there may be more snapshots that + // match the request; this value should be passed in a new + // `ListTopicSnapshotsRequest` to get more snapshots. + string next_page_token = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request for the `DeleteTopic` method. +message DeleteTopicRequest { + // Required. Name of the topic to delete. + // Format is `projects/{project}/topics/{topic}`. + string topic = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "pubsub.googleapis.com/Topic" } + ]; +} + +// Request for the DetachSubscription method. +message DetachSubscriptionRequest { + // Required. The subscription to detach. + // Format is `projects/{project}/subscriptions/{subscription}`. + string subscription = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "pubsub.googleapis.com/Subscription" + } + ]; +} + +// Response for the DetachSubscription method. +// Reserved for future use. +message DetachSubscriptionResponse {} + +// The service that an application uses to manipulate subscriptions and to +// consume messages from a subscription via the `Pull` method or by +// establishing a bi-directional stream using the `StreamingPull` method. +service Subscriber { + option (google.api.default_host) = "pubsub.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/pubsub"; + + // Creates a subscription to a given topic. See the [resource name rules] + // (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). + // If the subscription already exists, returns `ALREADY_EXISTS`. + // If the corresponding topic doesn't exist, returns `NOT_FOUND`. + // + // If the name is not provided in the request, the server will assign a random + // name for this subscription on the same project as the topic, conforming + // to the [resource name format] + // (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). The + // generated name is populated in the returned Subscription object. Note that + // for REST API requests, you must specify a name in the request. + rpc CreateSubscription(Subscription) returns (Subscription) { + option (google.api.http) = { + put: "/v1/{name=projects/*/subscriptions/*}" + body: "*" + }; + option (google.api.method_signature) = + "name,topic,push_config,ack_deadline_seconds"; + } + + // Gets the configuration details of a subscription. + rpc GetSubscription(GetSubscriptionRequest) returns (Subscription) { + option (google.api.http) = { + get: "/v1/{subscription=projects/*/subscriptions/*}" + }; + option (google.api.method_signature) = "subscription"; + } + + // Updates an existing subscription by updating the fields specified in the + // update mask. Note that certain properties of a subscription, such as its + // topic, are not modifiable. + rpc UpdateSubscription(UpdateSubscriptionRequest) returns (Subscription) { + option (google.api.http) = { + patch: "/v1/{subscription.name=projects/*/subscriptions/*}" + body: "*" + }; + option (google.api.method_signature) = "subscription,update_mask"; + } + + // Lists matching subscriptions. + rpc ListSubscriptions(ListSubscriptionsRequest) + returns (ListSubscriptionsResponse) { + option (google.api.http) = { + get: "/v1/{project=projects/*}/subscriptions" + }; + option (google.api.method_signature) = "project"; + } + + // Deletes an existing subscription. All messages retained in the subscription + // are immediately dropped. Calls to `Pull` after deletion will return + // `NOT_FOUND`. After a subscription is deleted, a new one may be created with + // the same name, but the new one has no association with the old + // subscription or its topic unless the same topic is specified. + rpc DeleteSubscription(DeleteSubscriptionRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{subscription=projects/*/subscriptions/*}" + }; + option (google.api.method_signature) = "subscription"; + } + + // Modifies the ack deadline for a specific message. This method is useful + // to indicate that more time is needed to process a message by the + // subscriber, or to make the message available for redelivery if the + // processing was interrupted. Note that this does not modify the + // subscription-level `ackDeadlineSeconds` used for subsequent messages. + rpc ModifyAckDeadline(ModifyAckDeadlineRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/v1/{subscription=projects/*/subscriptions/*}:modifyAckDeadline" + body: "*" + }; + option (google.api.method_signature) = + "subscription,ack_ids,ack_deadline_seconds"; + } + + // Acknowledges the messages associated with the `ack_ids` in the + // `AcknowledgeRequest`. The Pub/Sub system can remove the relevant messages + // from the subscription. + // + // Acknowledging a message whose ack deadline has expired may succeed, + // but such a message may be redelivered later. Acknowledging a message more + // than once will not result in an error. + rpc Acknowledge(AcknowledgeRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/v1/{subscription=projects/*/subscriptions/*}:acknowledge" + body: "*" + }; + option (google.api.method_signature) = "subscription,ack_ids"; + } + + // Pulls messages from the server. + rpc Pull(PullRequest) returns (PullResponse) { + option (google.api.http) = { + post: "/v1/{subscription=projects/*/subscriptions/*}:pull" + body: "*" + }; + option (google.api.method_signature) = + "subscription,return_immediately,max_messages"; + option (google.api.method_signature) = "subscription,max_messages"; + } + + // Establishes a stream with the server, which sends messages down to the + // client. The client streams acknowledgements and ack deadline modifications + // back to the server. The server will close the stream and return the status + // on any error. The server may close the stream with status `UNAVAILABLE` to + // reassign server-side resources, in which case, the client should + // re-establish the stream. Flow control can be achieved by configuring the + // underlying RPC channel. + rpc StreamingPull(stream StreamingPullRequest) + returns (stream StreamingPullResponse) {} + + // Modifies the `PushConfig` for a specified subscription. + // + // This may be used to change a push subscription to a pull one (signified by + // an empty `PushConfig`) or vice versa, or change the endpoint URL and other + // attributes of a push subscription. Messages will accumulate for delivery + // continuously through the call regardless of changes to the `PushConfig`. + rpc ModifyPushConfig(ModifyPushConfigRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/v1/{subscription=projects/*/subscriptions/*}:modifyPushConfig" + body: "*" + }; + option (google.api.method_signature) = "subscription,push_config"; + } + + // Gets the configuration details of a snapshot. Snapshots are used in + // [Seek](https://cloud.google.com/pubsub/docs/replay-overview) operations, + // which allow you to manage message acknowledgments in bulk. That is, you can + // set the acknowledgment state of messages in an existing subscription to the + // state captured by a snapshot. + rpc GetSnapshot(GetSnapshotRequest) returns (Snapshot) { + option (google.api.http) = { + get: "/v1/{snapshot=projects/*/snapshots/*}" + }; + option (google.api.method_signature) = "snapshot"; + } + + // Lists the existing snapshots. Snapshots are used in [Seek]( + // https://cloud.google.com/pubsub/docs/replay-overview) operations, which + // allow you to manage message acknowledgments in bulk. That is, you can set + // the acknowledgment state of messages in an existing subscription to the + // state captured by a snapshot. + rpc ListSnapshots(ListSnapshotsRequest) returns (ListSnapshotsResponse) { + option (google.api.http) = { + get: "/v1/{project=projects/*}/snapshots" + }; + option (google.api.method_signature) = "project"; + } + + // Creates a snapshot from the requested subscription. Snapshots are used in + // [Seek](https://cloud.google.com/pubsub/docs/replay-overview) operations, + // which allow you to manage message acknowledgments in bulk. That is, you can + // set the acknowledgment state of messages in an existing subscription to the + // state captured by a snapshot. + // If the snapshot already exists, returns `ALREADY_EXISTS`. + // If the requested subscription doesn't exist, returns `NOT_FOUND`. + // If the backlog in the subscription is too old -- and the resulting snapshot + // would expire in less than 1 hour -- then `FAILED_PRECONDITION` is returned. + // See also the `Snapshot.expire_time` field. If the name is not provided in + // the request, the server will assign a random + // name for this snapshot on the same project as the subscription, conforming + // to the [resource name format] + // (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). The + // generated name is populated in the returned Snapshot object. Note that for + // REST API requests, you must specify a name in the request. + rpc CreateSnapshot(CreateSnapshotRequest) returns (Snapshot) { + option (google.api.http) = { + put: "/v1/{name=projects/*/snapshots/*}" + body: "*" + }; + option (google.api.method_signature) = "name,subscription"; + } + + // Updates an existing snapshot by updating the fields specified in the update + // mask. Snapshots are used in + // [Seek](https://cloud.google.com/pubsub/docs/replay-overview) operations, + // which allow you to manage message acknowledgments in bulk. That is, you can + // set the acknowledgment state of messages in an existing subscription to the + // state captured by a snapshot. + rpc UpdateSnapshot(UpdateSnapshotRequest) returns (Snapshot) { + option (google.api.http) = { + patch: "/v1/{snapshot.name=projects/*/snapshots/*}" + body: "*" + }; + option (google.api.method_signature) = "snapshot,update_mask"; + } + + // Removes an existing snapshot. Snapshots are used in [Seek] + // (https://cloud.google.com/pubsub/docs/replay-overview) operations, which + // allow you to manage message acknowledgments in bulk. That is, you can set + // the acknowledgment state of messages in an existing subscription to the + // state captured by a snapshot. + // When the snapshot is deleted, all messages retained in the snapshot + // are immediately dropped. After a snapshot is deleted, a new one may be + // created with the same name, but the new one has no association with the old + // snapshot or its subscription, unless the same subscription is specified. + rpc DeleteSnapshot(DeleteSnapshotRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{snapshot=projects/*/snapshots/*}" + }; + option (google.api.method_signature) = "snapshot"; + } + + // Seeks an existing subscription to a point in time or to a given snapshot, + // whichever is provided in the request. Snapshots are used in [Seek] + // (https://cloud.google.com/pubsub/docs/replay-overview) operations, which + // allow you to manage message acknowledgments in bulk. That is, you can set + // the acknowledgment state of messages in an existing subscription to the + // state captured by a snapshot. Note that both the subscription and the + // snapshot must be on the same topic. + rpc Seek(SeekRequest) returns (SeekResponse) { + option (google.api.http) = { + post: "/v1/{subscription=projects/*/subscriptions/*}:seek" + body: "*" + }; + } +} + +// A subscription resource. If none of `push_config`, `bigquery_config`, or +// `cloud_storage_config` is set, then the subscriber will pull and ack messages +// using API methods. At most one of these fields may be set. +message Subscription { + option (google.api.resource) = { + type: "pubsub.googleapis.com/Subscription" + pattern: "projects/{project}/subscriptions/{subscription}" + }; + + // Possible states for a subscription. + enum State { + // Default value. This value is unused. + STATE_UNSPECIFIED = 0; + + // The subscription can actively receive messages + ACTIVE = 1; + + // The subscription cannot receive messages because of an error with the + // resource to which it pushes messages. See the more detailed error state + // in the corresponding configuration. + RESOURCE_ERROR = 2; + } + + // Required. The name of the subscription. It must have the format + // `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must + // start with a letter, and contain only letters (`[A-Za-z]`), numbers + // (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`), + // plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters + // in length, and it must not start with `"goog"`. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The name of the topic from which this subscription is receiving + // messages. Format is `projects/{project}/topics/{topic}`. The value of this + // field will be `_deleted-topic_` if the topic has been deleted. + string topic = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "pubsub.googleapis.com/Topic" } + ]; + + // Optional. If push delivery is used with this subscription, this field is + // used to configure it. + PushConfig push_config = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If delivery to BigQuery is used with this subscription, this + // field is used to configure it. + BigQueryConfig bigquery_config = 18 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If delivery to Google Cloud Storage is used with this + // subscription, this field is used to configure it. + CloudStorageConfig cloud_storage_config = 22 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The approximate amount of time (on a best-effort basis) Pub/Sub + // waits for the subscriber to acknowledge receipt before resending the + // message. In the interval after the message is delivered and before it is + // acknowledged, it is considered to be _outstanding_. During that time + // period, the message will not be redelivered (on a best-effort basis). + // + // For pull subscriptions, this value is used as the initial value for the ack + // deadline. To override this value for a given message, call + // `ModifyAckDeadline` with the corresponding `ack_id` if using + // non-streaming pull or send the `ack_id` in a + // `StreamingModifyAckDeadlineRequest` if using streaming pull. + // The minimum custom deadline you can specify is 10 seconds. + // The maximum custom deadline you can specify is 600 seconds (10 minutes). + // If this parameter is 0, a default value of 10 seconds is used. + // + // For push delivery, this value is also used to set the request timeout for + // the call to the push endpoint. + // + // If the subscriber never acknowledges the message, the Pub/Sub + // system will eventually redeliver the message. + int32 ack_deadline_seconds = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Indicates whether to retain acknowledged messages. If true, then + // messages are not expunged from the subscription's backlog, even if they are + // acknowledged, until they fall out of the `message_retention_duration` + // window. This must be true if you would like to [`Seek` to a timestamp] + // (https://cloud.google.com/pubsub/docs/replay-overview#seek_to_a_time) in + // the past to replay previously-acknowledged messages. + bool retain_acked_messages = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. How long to retain unacknowledged messages in the subscription's + // backlog, from the moment a message is published. If `retain_acked_messages` + // is true, then this also configures the retention of acknowledged messages, + // and thus configures how far back in time a `Seek` can be done. Defaults to + // 7 days. Cannot be more than 7 days or less than 10 minutes. + google.protobuf.Duration message_retention_duration = 8 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. See [Creating and managing + // labels](https://cloud.google.com/pubsub/docs/labels). + map labels = 9 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If true, messages published with the same `ordering_key` in + // `PubsubMessage` will be delivered to the subscribers in the order in which + // they are received by the Pub/Sub system. Otherwise, they may be delivered + // in any order. + bool enable_message_ordering = 10 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A policy that specifies the conditions for this subscription's + // expiration. A subscription is considered active as long as any connected + // subscriber is successfully consuming messages from the subscription or is + // issuing operations on the subscription. If `expiration_policy` is not set, + // a *default policy* with `ttl` of 31 days will be used. The minimum allowed + // value for `expiration_policy.ttl` is 1 day. If `expiration_policy` is set, + // but `expiration_policy.ttl` is not set, the subscription never expires. + ExpirationPolicy expiration_policy = 11 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. An expression written in the Pub/Sub [filter + // language](https://cloud.google.com/pubsub/docs/filtering). If non-empty, + // then only `PubsubMessage`s whose `attributes` field matches the filter are + // delivered on this subscription. If empty, then no messages are filtered + // out. + string filter = 12 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A policy that specifies the conditions for dead lettering + // messages in this subscription. If dead_letter_policy is not set, dead + // lettering is disabled. + // + // The Pub/Sub service account associated with this subscriptions's + // parent project (i.e., + // service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have + // permission to Acknowledge() messages on this subscription. + DeadLetterPolicy dead_letter_policy = 13 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A policy that specifies how Pub/Sub retries message delivery for + // this subscription. + // + // If not set, the default retry policy is applied. This generally implies + // that messages will be retried as soon as possible for healthy subscribers. + // RetryPolicy will be triggered on NACKs or acknowledgement deadline + // exceeded events for a given message. + RetryPolicy retry_policy = 14 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Indicates whether the subscription is detached from its topic. + // Detached subscriptions don't receive messages from their topic and don't + // retain any backlog. `Pull` and `StreamingPull` requests will return + // FAILED_PRECONDITION. If the subscription is a push subscription, pushes to + // the endpoint will not be made. + bool detached = 15 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If true, Pub/Sub provides the following guarantees for the + // delivery of a message with a given value of `message_id` on this + // subscription: + // + // * The message sent to a subscriber is guaranteed not to be resent + // before the message's acknowledgement deadline expires. + // * An acknowledged message will not be resent to a subscriber. + // + // Note that subscribers may still receive multiple copies of a message + // when `enable_exactly_once_delivery` is true if the message was published + // multiple times by a publisher client. These copies are considered distinct + // by Pub/Sub and have distinct `message_id` values. + bool enable_exactly_once_delivery = 16 + [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Indicates the minimum duration for which a message is retained + // after it is published to the subscription's topic. If this field is set, + // messages published to the subscription's topic in the last + // `topic_message_retention_duration` are always available to subscribers. See + // the `message_retention_duration` field in `Topic`. This field is set only + // in responses from the server; it is ignored if it is set in any requests. + google.protobuf.Duration topic_message_retention_duration = 17 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. An output-only field indicating whether or not the + // subscription can receive messages. + State state = 19 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// A policy that specifies how Pub/Sub retries message delivery. +// +// Retry delay will be exponential based on provided minimum and maximum +// backoffs. https://en.wikipedia.org/wiki/Exponential_backoff. +// +// RetryPolicy will be triggered on NACKs or acknowledgement deadline exceeded +// events for a given message. +// +// Retry Policy is implemented on a best effort basis. At times, the delay +// between consecutive deliveries may not match the configuration. That is, +// delay can be more or less than configured backoff. +message RetryPolicy { + // Optional. The minimum delay between consecutive deliveries of a given + // message. Value should be between 0 and 600 seconds. Defaults to 10 seconds. + google.protobuf.Duration minimum_backoff = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The maximum delay between consecutive deliveries of a given + // message. Value should be between 0 and 600 seconds. Defaults to 600 + // seconds. + google.protobuf.Duration maximum_backoff = 2 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Dead lettering is done on a best effort basis. The same message might be +// dead lettered multiple times. +// +// If validation on any of the fields fails at subscription creation/updation, +// the create/update subscription request will fail. +message DeadLetterPolicy { + // Optional. The name of the topic to which dead letter messages should be + // published. Format is `projects/{project}/topics/{topic}`.The Pub/Sub + // service account associated with the enclosing subscription's parent project + // (i.e., service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must + // have permission to Publish() to this topic. + // + // The operation will fail if the topic does not exist. + // Users should ensure that there is a subscription attached to this topic + // since messages published to a topic with no subscriptions are lost. + string dead_letter_topic = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The maximum number of delivery attempts for any message. The + // value must be between 5 and 100. + // + // The number of delivery attempts is defined as 1 + (the sum of number of + // NACKs and number of times the acknowledgement deadline has been exceeded + // for the message). + // + // A NACK is any call to ModifyAckDeadline with a 0 deadline. Note that + // client libraries may automatically extend ack_deadlines. + // + // This field will be honored on a best effort basis. + // + // If this parameter is 0, a default value of 5 is used. + int32 max_delivery_attempts = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// A policy that specifies the conditions for resource expiration (i.e., +// automatic resource deletion). +message ExpirationPolicy { + // Optional. Specifies the "time-to-live" duration for an associated resource. + // The resource expires if it is not active for a period of `ttl`. The + // definition of "activity" depends on the type of the associated resource. + // The minimum and maximum allowed values for `ttl` depend on the type of the + // associated resource, as well. If `ttl` is not set, the associated resource + // never expires. + google.protobuf.Duration ttl = 1 [(google.api.field_behavior) = OPTIONAL]; +} + +// Configuration for a push delivery endpoint. +message PushConfig { + // Contains information needed for generating an + // [OpenID Connect + // token](https://developers.google.com/identity/protocols/OpenIDConnect). + message OidcToken { + // Optional. [Service account + // email](https://cloud.google.com/iam/docs/service-accounts) + // used for generating the OIDC token. For more information + // on setting up authentication, see + // [Push subscriptions](https://cloud.google.com/pubsub/docs/push). + string service_account_email = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Audience to be used when generating OIDC token. The audience + // claim identifies the recipients that the JWT is intended for. The + // audience value is a single case-sensitive string. Having multiple values + // (array) for the audience field is not supported. More info about the OIDC + // JWT token audience here: + // https://tools.ietf.org/html/rfc7519#section-4.1.3 Note: if not specified, + // the Push endpoint URL will be used. + string audience = 2 [(google.api.field_behavior) = OPTIONAL]; + } + + // The payload to the push endpoint is in the form of the JSON representation + // of a PubsubMessage + // (https://cloud.google.com/pubsub/docs/reference/rpc/google.pubsub.v1#pubsubmessage). + message PubsubWrapper {} + + // Sets the `data` field as the HTTP body for delivery. + message NoWrapper { + // Optional. When true, writes the Pub/Sub message metadata to + // `x-goog-pubsub-:` headers of the HTTP request. Writes the + // Pub/Sub message attributes to `:` headers of the HTTP request. + bool write_metadata = 1 [(google.api.field_behavior) = OPTIONAL]; + } + + // Optional. A URL locating the endpoint to which messages should be pushed. + // For example, a Webhook endpoint might use `https://example.com/push`. + string push_endpoint = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Endpoint configuration attributes that can be used to control + // different aspects of the message delivery. + // + // The only currently supported attribute is `x-goog-version`, which you can + // use to change the format of the pushed message. This attribute + // indicates the version of the data expected by the endpoint. This + // controls the shape of the pushed message (i.e., its fields and metadata). + // + // If not present during the `CreateSubscription` call, it will default to + // the version of the Pub/Sub API used to make such call. If not present in a + // `ModifyPushConfig` call, its value will not be changed. `GetSubscription` + // calls will always return a valid version, even if the subscription was + // created without this attribute. + // + // The only supported values for the `x-goog-version` attribute are: + // + // * `v1beta1`: uses the push format defined in the v1beta1 Pub/Sub API. + // * `v1` or `v1beta2`: uses the push format defined in the v1 Pub/Sub API. + // + // For example: + // `attributes { "x-goog-version": "v1" }` + map attributes = 2 [(google.api.field_behavior) = OPTIONAL]; + + // An authentication method used by push endpoints to verify the source of + // push requests. This can be used with push endpoints that are private by + // default to allow requests only from the Pub/Sub system, for example. + // This field is optional and should be set only by users interested in + // authenticated push. + oneof authentication_method { + // Optional. If specified, Pub/Sub will generate and attach an OIDC JWT + // token as an `Authorization` header in the HTTP request for every pushed + // message. + OidcToken oidc_token = 3 [(google.api.field_behavior) = OPTIONAL]; + } + + // The format of the delivered message to the push endpoint is defined by + // the chosen wrapper. When unset, `PubsubWrapper` is used. + oneof wrapper { + // Optional. When set, the payload to the push endpoint is in the form of + // the JSON representation of a PubsubMessage + // (https://cloud.google.com/pubsub/docs/reference/rpc/google.pubsub.v1#pubsubmessage). + PubsubWrapper pubsub_wrapper = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. When set, the payload to the push endpoint is not wrapped. + NoWrapper no_wrapper = 5 [(google.api.field_behavior) = OPTIONAL]; + } +} + +// Configuration for a BigQuery subscription. +message BigQueryConfig { + // Possible states for a BigQuery subscription. + enum State { + // Default value. This value is unused. + STATE_UNSPECIFIED = 0; + + // The subscription can actively send messages to BigQuery + ACTIVE = 1; + + // Cannot write to the BigQuery table because of permission denied errors. + // This can happen if + // - Pub/Sub SA has not been granted the [appropriate BigQuery IAM + // permissions](https://cloud.google.com/pubsub/docs/create-subscription#assign_bigquery_service_account) + // - bigquery.googleapis.com API is not enabled for the project + // ([instructions](https://cloud.google.com/service-usage/docs/enable-disable)) + PERMISSION_DENIED = 2; + + // Cannot write to the BigQuery table because it does not exist. + NOT_FOUND = 3; + + // Cannot write to the BigQuery table due to a schema mismatch. + SCHEMA_MISMATCH = 4; + + // Cannot write to the destination because enforce_in_transit is set to true + // and the destination locations are not in the allowed regions. + IN_TRANSIT_LOCATION_RESTRICTION = 5; + } + + // Optional. The name of the table to which to write data, of the form + // {projectId}.{datasetId}.{tableId} + string table = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. When true, use the topic's schema as the columns to write to in + // BigQuery, if it exists. `use_topic_schema` and `use_table_schema` cannot be + // enabled at the same time. + bool use_topic_schema = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. When true, write the subscription name, message_id, publish_time, + // attributes, and ordering_key to additional columns in the table. The + // subscription name, message_id, and publish_time fields are put in their own + // columns while all other message properties (other than data) are written to + // a JSON object in the attributes column. + bool write_metadata = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. When true and use_topic_schema is true, any fields that are a + // part of the topic schema that are not part of the BigQuery table schema are + // dropped when writing to BigQuery. Otherwise, the schemas must be kept in + // sync and any messages with extra fields are not written and remain in the + // subscription's backlog. + bool drop_unknown_fields = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. An output-only field that indicates whether or not the + // subscription can receive messages. + State state = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. When true, use the BigQuery table's schema as the columns to + // write to in BigQuery. `use_table_schema` and `use_topic_schema` cannot be + // enabled at the same time. + bool use_table_schema = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The service account to use to write to BigQuery. The subscription + // creator or updater that specifies this field must have + // `iam.serviceAccounts.actAs` permission on the service account. If not + // specified, the Pub/Sub [service + // agent](https://cloud.google.com/iam/docs/service-agents), + // service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com, is used. + string service_account_email = 7 [(google.api.field_behavior) = OPTIONAL]; +} + +// Configuration for a Cloud Storage subscription. +message CloudStorageConfig { + // Configuration for writing message data in text format. + // Message payloads will be written to files as raw text, separated by a + // newline. + message TextConfig {} + + // Configuration for writing message data in Avro format. + // Message payloads and metadata will be written to files as an Avro binary. + message AvroConfig { + // Optional. When true, write the subscription name, message_id, + // publish_time, attributes, and ordering_key as additional fields in the + // output. The subscription name, message_id, and publish_time fields are + // put in their own fields while all other message properties other than + // data (for example, an ordering_key, if present) are added as entries in + // the attributes map. + bool write_metadata = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. When true, the output Cloud Storage file will be serialized + // using the topic schema, if it exists. + bool use_topic_schema = 2 [(google.api.field_behavior) = OPTIONAL]; + } + + // Possible states for a Cloud Storage subscription. + enum State { + // Default value. This value is unused. + STATE_UNSPECIFIED = 0; + + // The subscription can actively send messages to Cloud Storage. + ACTIVE = 1; + + // Cannot write to the Cloud Storage bucket because of permission denied + // errors. + PERMISSION_DENIED = 2; + + // Cannot write to the Cloud Storage bucket because it does not exist. + NOT_FOUND = 3; + + // Cannot write to the destination because enforce_in_transit is set to true + // and the destination locations are not in the allowed regions. + IN_TRANSIT_LOCATION_RESTRICTION = 4; + + // Cannot write to the Cloud Storage bucket due to an incompatibility + // between the topic schema and subscription settings. + SCHEMA_MISMATCH = 5; + } + + // Required. User-provided name for the Cloud Storage bucket. + // The bucket must be created by the user. The bucket name must be without + // any prefix like "gs://". See the [bucket naming + // requirements] (https://cloud.google.com/storage/docs/buckets#naming). + string bucket = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. User-provided prefix for Cloud Storage filename. See the [object + // naming requirements](https://cloud.google.com/storage/docs/objects#naming). + string filename_prefix = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. User-provided suffix for Cloud Storage filename. See the [object + // naming requirements](https://cloud.google.com/storage/docs/objects#naming). + // Must not end in "/". + string filename_suffix = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. User-provided format string specifying how to represent datetimes + // in Cloud Storage filenames. See the [datetime format + // guidance](https://cloud.google.com/pubsub/docs/create-cloudstorage-subscription#file_names). + string filename_datetime_format = 10 [(google.api.field_behavior) = OPTIONAL]; + + // Defaults to text format. + oneof output_format { + // Optional. If set, message data will be written to Cloud Storage in text + // format. + TextConfig text_config = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, message data will be written to Cloud Storage in Avro + // format. + AvroConfig avro_config = 5 [(google.api.field_behavior) = OPTIONAL]; + } + + // Optional. The maximum duration that can elapse before a new Cloud Storage + // file is created. Min 1 minute, max 10 minutes, default 5 minutes. May not + // exceed the subscription's acknowledgement deadline. + google.protobuf.Duration max_duration = 6 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The maximum bytes that can be written to a Cloud Storage file + // before a new file is created. Min 1 KB, max 10 GiB. The max_bytes limit may + // be exceeded in cases where messages are larger than the limit. + int64 max_bytes = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. An output-only field that indicates whether or not the + // subscription can receive messages. + State state = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The service account to use to write to Cloud Storage. The + // subscription creator or updater that specifies this field must have + // `iam.serviceAccounts.actAs` permission on the service account. If not + // specified, the Pub/Sub + // [service agent](https://cloud.google.com/iam/docs/service-agents), + // service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com, is used. + string service_account_email = 11 [(google.api.field_behavior) = OPTIONAL]; +} + +// A message and its corresponding acknowledgment ID. +message ReceivedMessage { + // Optional. This ID can be used to acknowledge the received message. + string ack_id = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The message. + PubsubMessage message = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The approximate number of times that Pub/Sub has attempted to + // deliver the associated message to a subscriber. + // + // More precisely, this is 1 + (number of NACKs) + + // (number of ack_deadline exceeds) for this message. + // + // A NACK is any call to ModifyAckDeadline with a 0 deadline. An ack_deadline + // exceeds event is whenever a message is not acknowledged within + // ack_deadline. Note that ack_deadline is initially + // Subscription.ackDeadlineSeconds, but may get extended automatically by + // the client library. + // + // Upon the first delivery of a given message, `delivery_attempt` will have a + // value of 1. The value is calculated at best effort and is approximate. + // + // If a DeadLetterPolicy is not set on the subscription, this will be 0. + int32 delivery_attempt = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request for the GetSubscription method. +message GetSubscriptionRequest { + // Required. The name of the subscription to get. + // Format is `projects/{project}/subscriptions/{sub}`. + string subscription = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "pubsub.googleapis.com/Subscription" + } + ]; +} + +// Request for the UpdateSubscription method. +message UpdateSubscriptionRequest { + // Required. The updated subscription object. + Subscription subscription = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Indicates which fields in the provided subscription to update. + // Must be specified and non-empty. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// Request for the `ListSubscriptions` method. +message ListSubscriptionsRequest { + // Required. The name of the project in which to list subscriptions. + // Format is `projects/{project-id}`. + string project = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Project" + } + ]; + + // Optional. Maximum number of subscriptions to return. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The value returned by the last `ListSubscriptionsResponse`; + // indicates that this is a continuation of a prior `ListSubscriptions` call, + // and that the system should return the next page of data. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response for the `ListSubscriptions` method. +message ListSubscriptionsResponse { + // Optional. The subscriptions that match the request. + repeated Subscription subscriptions = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If not empty, indicates that there may be more subscriptions that + // match the request; this value should be passed in a new + // `ListSubscriptionsRequest` to get more subscriptions. + string next_page_token = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request for the DeleteSubscription method. +message DeleteSubscriptionRequest { + // Required. The subscription to delete. + // Format is `projects/{project}/subscriptions/{sub}`. + string subscription = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "pubsub.googleapis.com/Subscription" + } + ]; +} + +// Request for the ModifyPushConfig method. +message ModifyPushConfigRequest { + // Required. The name of the subscription. + // Format is `projects/{project}/subscriptions/{sub}`. + string subscription = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "pubsub.googleapis.com/Subscription" + } + ]; + + // Required. The push configuration for future deliveries. + // + // An empty `pushConfig` indicates that the Pub/Sub system should + // stop pushing messages from the given subscription and allow + // messages to be pulled and acknowledged - effectively pausing + // the subscription if `Pull` or `StreamingPull` is not called. + PushConfig push_config = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request for the `Pull` method. +message PullRequest { + // Required. The subscription from which messages should be pulled. + // Format is `projects/{project}/subscriptions/{sub}`. + string subscription = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "pubsub.googleapis.com/Subscription" + } + ]; + + // Optional. If this field set to true, the system will respond immediately + // even if it there are no messages available to return in the `Pull` + // response. Otherwise, the system may wait (for a bounded amount of time) + // until at least one message is available, rather than returning no messages. + // Warning: setting this field to `true` is discouraged because it adversely + // impacts the performance of `Pull` operations. We recommend that users do + // not set this field. + bool return_immediately = 2 + [deprecated = true, (google.api.field_behavior) = OPTIONAL]; + + // Required. The maximum number of messages to return for this request. Must + // be a positive integer. The Pub/Sub system may return fewer than the number + // specified. + int32 max_messages = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Response for the `Pull` method. +message PullResponse { + // Optional. Received Pub/Sub messages. The list will be empty if there are no + // more messages available in the backlog, or if no messages could be returned + // before the request timeout. For JSON, the response can be entirely + // empty. The Pub/Sub system may return fewer than the `maxMessages` requested + // even if there are more messages available in the backlog. + repeated ReceivedMessage received_messages = 1 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Request for the ModifyAckDeadline method. +message ModifyAckDeadlineRequest { + // Required. The name of the subscription. + // Format is `projects/{project}/subscriptions/{sub}`. + string subscription = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "pubsub.googleapis.com/Subscription" + } + ]; + + // Required. List of acknowledgment IDs. + repeated string ack_ids = 4 [(google.api.field_behavior) = REQUIRED]; + + // Required. The new ack deadline with respect to the time this request was + // sent to the Pub/Sub system. For example, if the value is 10, the new ack + // deadline will expire 10 seconds after the `ModifyAckDeadline` call was + // made. Specifying zero might immediately make the message available for + // delivery to another subscriber client. This typically results in an + // increase in the rate of message redeliveries (that is, duplicates). + // The minimum deadline you can specify is 0 seconds. + // The maximum deadline you can specify in a single request is 600 seconds + // (10 minutes). + int32 ack_deadline_seconds = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request for the Acknowledge method. +message AcknowledgeRequest { + // Required. The subscription whose message is being acknowledged. + // Format is `projects/{project}/subscriptions/{sub}`. + string subscription = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "pubsub.googleapis.com/Subscription" + } + ]; + + // Required. The acknowledgment ID for the messages being acknowledged that + // was returned by the Pub/Sub system in the `Pull` response. Must not be + // empty. + repeated string ack_ids = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request for the `StreamingPull` streaming RPC method. This request is used to +// establish the initial stream as well as to stream acknowledgements and ack +// deadline modifications from the client to the server. +message StreamingPullRequest { + // Required. The subscription for which to initialize the new stream. This + // must be provided in the first request on the stream, and must not be set in + // subsequent requests from client to server. + // Format is `projects/{project}/subscriptions/{sub}`. + string subscription = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "pubsub.googleapis.com/Subscription" + } + ]; + + // Optional. List of acknowledgement IDs for acknowledging previously received + // messages (received on this stream or a different stream). If an ack ID has + // expired, the corresponding message may be redelivered later. Acknowledging + // a message more than once will not result in an error. If the + // acknowledgement ID is malformed, the stream will be aborted with status + // `INVALID_ARGUMENT`. + repeated string ack_ids = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The list of new ack deadlines for the IDs listed in + // `modify_deadline_ack_ids`. The size of this list must be the same as the + // size of `modify_deadline_ack_ids`. If it differs the stream will be aborted + // with `INVALID_ARGUMENT`. Each element in this list is applied to the + // element in the same position in `modify_deadline_ack_ids`. The new ack + // deadline is with respect to the time this request was sent to the Pub/Sub + // system. Must be >= 0. For example, if the value is 10, the new ack deadline + // will expire 10 seconds after this request is received. If the value is 0, + // the message is immediately made available for another streaming or + // non-streaming pull request. If the value is < 0 (an error), the stream will + // be aborted with status `INVALID_ARGUMENT`. + repeated int32 modify_deadline_seconds = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. List of acknowledgement IDs whose deadline will be modified based + // on the corresponding element in `modify_deadline_seconds`. This field can + // be used to indicate that more time is needed to process a message by the + // subscriber, or to make the message available for redelivery if the + // processing was interrupted. + repeated string modify_deadline_ack_ids = 4 + [(google.api.field_behavior) = OPTIONAL]; + + // Required. The ack deadline to use for the stream. This must be provided in + // the first request on the stream, but it can also be updated on subsequent + // requests from client to server. The minimum deadline you can specify is 10 + // seconds. The maximum deadline you can specify is 600 seconds (10 minutes). + int32 stream_ack_deadline_seconds = 5 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. A unique identifier that is used to distinguish client instances + // from each other. Only needs to be provided on the initial request. When a + // stream disconnects and reconnects for the same stream, the client_id should + // be set to the same value so that state associated with the old stream can + // be transferred to the new stream. The same client_id should not be used for + // different client instances. + string client_id = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Flow control settings for the maximum number of outstanding + // messages. When there are `max_outstanding_messages` currently sent to the + // streaming pull client that have not yet been acked or nacked, the server + // stops sending more messages. The sending of messages resumes once the + // number of outstanding messages is less than this value. If the value is + // <= 0, there is no limit to the number of outstanding messages. This + // property can only be set on the initial StreamingPullRequest. If it is set + // on a subsequent request, the stream will be aborted with status + // `INVALID_ARGUMENT`. + int64 max_outstanding_messages = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Flow control settings for the maximum number of outstanding + // bytes. When there are `max_outstanding_bytes` or more worth of messages + // currently sent to the streaming pull client that have not yet been acked or + // nacked, the server will stop sending more messages. The sending of messages + // resumes once the number of outstanding bytes is less than this value. If + // the value is <= 0, there is no limit to the number of outstanding bytes. + // This property can only be set on the initial StreamingPullRequest. If it is + // set on a subsequent request, the stream will be aborted with status + // `INVALID_ARGUMENT`. + int64 max_outstanding_bytes = 8 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response for the `StreamingPull` method. This response is used to stream +// messages from the server to the client. +message StreamingPullResponse { + // Acknowledgement IDs sent in one or more previous requests to acknowledge a + // previously received message. + message AcknowledgeConfirmation { + // Optional. Successfully processed acknowledgement IDs. + repeated string ack_ids = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. List of acknowledgement IDs that were malformed or whose + // acknowledgement deadline has expired. + repeated string invalid_ack_ids = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. List of acknowledgement IDs that were out of order. + repeated string unordered_ack_ids = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. List of acknowledgement IDs that failed processing with + // temporary issues. + repeated string temporary_failed_ack_ids = 4 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Acknowledgement IDs sent in one or more previous requests to modify the + // deadline for a specific message. + message ModifyAckDeadlineConfirmation { + // Optional. Successfully processed acknowledgement IDs. + repeated string ack_ids = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. List of acknowledgement IDs that were malformed or whose + // acknowledgement deadline has expired. + repeated string invalid_ack_ids = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. List of acknowledgement IDs that failed processing with + // temporary issues. + repeated string temporary_failed_ack_ids = 3 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Subscription properties sent as part of the response. + message SubscriptionProperties { + // Optional. True iff exactly once delivery is enabled for this + // subscription. + bool exactly_once_delivery_enabled = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. True iff message ordering is enabled for this subscription. + bool message_ordering_enabled = 2 [(google.api.field_behavior) = OPTIONAL]; + } + + // Optional. Received Pub/Sub messages. This will not be empty. + repeated ReceivedMessage received_messages = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. This field will only be set if `enable_exactly_once_delivery` is + // set to `true`. + AcknowledgeConfirmation acknowledge_confirmation = 5 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. This field will only be set if `enable_exactly_once_delivery` is + // set to `true`. + ModifyAckDeadlineConfirmation modify_ack_deadline_confirmation = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Properties associated with this subscription. + SubscriptionProperties subscription_properties = 4 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Request for the `CreateSnapshot` method. +message CreateSnapshotRequest { + // Required. User-provided name for this snapshot. If the name is not provided + // in the request, the server will assign a random name for this snapshot on + // the same project as the subscription. Note that for REST API requests, you + // must specify a name. See the [resource name + // rules](https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). + // Format is `projects/{project}/snapshots/{snap}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "pubsub.googleapis.com/Snapshot" } + ]; + + // Required. The subscription whose backlog the snapshot retains. + // Specifically, the created snapshot is guaranteed to retain: + // (a) The existing backlog on the subscription. More precisely, this is + // defined as the messages in the subscription's backlog that are + // unacknowledged upon the successful completion of the + // `CreateSnapshot` request; as well as: + // (b) Any messages published to the subscription's topic following the + // successful completion of the CreateSnapshot request. + // Format is `projects/{project}/subscriptions/{sub}`. + string subscription = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "pubsub.googleapis.com/Subscription" + } + ]; + + // Optional. See [Creating and managing + // labels](https://cloud.google.com/pubsub/docs/labels). + map labels = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request for the UpdateSnapshot method. +message UpdateSnapshotRequest { + // Required. The updated snapshot object. + Snapshot snapshot = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Indicates which fields in the provided snapshot to update. + // Must be specified and non-empty. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// A snapshot resource. Snapshots are used in +// [Seek](https://cloud.google.com/pubsub/docs/replay-overview) +// operations, which allow you to manage message acknowledgments in bulk. That +// is, you can set the acknowledgment state of messages in an existing +// subscription to the state captured by a snapshot. +message Snapshot { + option (google.api.resource) = { + type: "pubsub.googleapis.com/Snapshot" + pattern: "projects/{project}/snapshots/{snapshot}" + }; + + // Optional. The name of the snapshot. + string name = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The name of the topic from which this snapshot is retaining + // messages. + string topic = 2 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { type: "pubsub.googleapis.com/Topic" } + ]; + + // Optional. The snapshot is guaranteed to exist up until this time. + // A newly-created snapshot expires no later than 7 days from the time of its + // creation. Its exact lifetime is determined at creation by the existing + // backlog in the source subscription. Specifically, the lifetime of the + // snapshot is `7 days - (age of oldest unacked message in the subscription)`. + // For example, consider a subscription whose oldest unacked message is 3 days + // old. If a snapshot is created from this subscription, the snapshot -- which + // will always capture this 3-day-old backlog as long as the snapshot + // exists -- will expire in 4 days. The service will refuse to create a + // snapshot that would expire in less than 1 hour after creation. + google.protobuf.Timestamp expire_time = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. See [Creating and managing labels] + // (https://cloud.google.com/pubsub/docs/labels). + map labels = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request for the GetSnapshot method. +message GetSnapshotRequest { + // Required. The name of the snapshot to get. + // Format is `projects/{project}/snapshots/{snap}`. + string snapshot = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "pubsub.googleapis.com/Snapshot" } + ]; +} + +// Request for the `ListSnapshots` method. +message ListSnapshotsRequest { + // Required. The name of the project in which to list snapshots. + // Format is `projects/{project-id}`. + string project = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Project" + } + ]; + + // Optional. Maximum number of snapshots to return. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The value returned by the last `ListSnapshotsResponse`; indicates + // that this is a continuation of a prior `ListSnapshots` call, and that the + // system should return the next page of data. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response for the `ListSnapshots` method. +message ListSnapshotsResponse { + // Optional. The resulting snapshots. + repeated Snapshot snapshots = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If not empty, indicates that there may be more snapshot that + // match the request; this value should be passed in a new + // `ListSnapshotsRequest`. + string next_page_token = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request for the `DeleteSnapshot` method. +message DeleteSnapshotRequest { + // Required. The name of the snapshot to delete. + // Format is `projects/{project}/snapshots/{snap}`. + string snapshot = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "pubsub.googleapis.com/Snapshot" } + ]; +} + +// Request for the `Seek` method. +message SeekRequest { + // Required. The subscription to affect. + string subscription = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "pubsub.googleapis.com/Subscription" + } + ]; + + oneof target { + // Optional. The time to seek to. + // Messages retained in the subscription that were published before this + // time are marked as acknowledged, and messages retained in the + // subscription that were published after this time are marked as + // unacknowledged. Note that this operation affects only those messages + // retained in the subscription (configured by the combination of + // `message_retention_duration` and `retain_acked_messages`). For example, + // if `time` corresponds to a point before the message retention + // window (or to a point before the system's notion of the subscription + // creation time), only retained messages will be marked as unacknowledged, + // and already-expunged messages will not be restored. + google.protobuf.Timestamp time = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The snapshot to seek to. The snapshot's topic must be the same + // as that of the provided subscription. Format is + // `projects/{project}/snapshots/{snap}`. + string snapshot = 3 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "pubsub.googleapis.com/Snapshot" + } + ]; + } +} + +// Response for the `Seek` method (this response is empty). +message SeekResponse {} diff --git a/owl-bot-staging/v1/protos/google/pubsub/v1/schema.proto b/owl-bot-staging/v1/protos/google/pubsub/v1/schema.proto new file mode 100644 index 000000000..d52c678c5 --- /dev/null +++ b/owl-bot-staging/v1/protos/google/pubsub/v1/schema.proto @@ -0,0 +1,410 @@ +// 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. + +syntax = "proto3"; + +package google.pubsub.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/timestamp.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.PubSub.V1"; +option go_package = "cloud.google.com/go/pubsub/apiv1/pubsubpb;pubsubpb"; +option java_multiple_files = true; +option java_outer_classname = "SchemaProto"; +option java_package = "com.google.pubsub.v1"; +option php_namespace = "Google\\Cloud\\PubSub\\V1"; +option ruby_package = "Google::Cloud::PubSub::V1"; + +// Service for doing schema-related operations. +service SchemaService { + option (google.api.default_host) = "pubsub.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/pubsub"; + + // Creates a schema. + rpc CreateSchema(CreateSchemaRequest) returns (Schema) { + option (google.api.http) = { + post: "/v1/{parent=projects/*}/schemas" + body: "schema" + }; + option (google.api.method_signature) = "parent,schema,schema_id"; + } + + // Gets a schema. + rpc GetSchema(GetSchemaRequest) returns (Schema) { + option (google.api.http) = { + get: "/v1/{name=projects/*/schemas/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists schemas in a project. + rpc ListSchemas(ListSchemasRequest) returns (ListSchemasResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*}/schemas" + }; + option (google.api.method_signature) = "parent"; + } + + // Lists all schema revisions for the named schema. + rpc ListSchemaRevisions(ListSchemaRevisionsRequest) + returns (ListSchemaRevisionsResponse) { + option (google.api.http) = { + get: "/v1/{name=projects/*/schemas/*}:listRevisions" + }; + option (google.api.method_signature) = "name"; + } + + // Commits a new schema revision to an existing schema. + rpc CommitSchema(CommitSchemaRequest) returns (Schema) { + option (google.api.http) = { + post: "/v1/{name=projects/*/schemas/*}:commit" + body: "*" + }; + option (google.api.method_signature) = "name,schema"; + } + + // Creates a new schema revision that is a copy of the provided revision_id. + rpc RollbackSchema(RollbackSchemaRequest) returns (Schema) { + option (google.api.http) = { + post: "/v1/{name=projects/*/schemas/*}:rollback" + body: "*" + }; + option (google.api.method_signature) = "name,revision_id"; + } + + // Deletes a specific schema revision. + rpc DeleteSchemaRevision(DeleteSchemaRevisionRequest) returns (Schema) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/schemas/*}:deleteRevision" + }; + option (google.api.method_signature) = "name,revision_id"; + } + + // Deletes a schema. + rpc DeleteSchema(DeleteSchemaRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/schemas/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Validates a schema. + rpc ValidateSchema(ValidateSchemaRequest) returns (ValidateSchemaResponse) { + option (google.api.http) = { + post: "/v1/{parent=projects/*}/schemas:validate" + body: "*" + }; + option (google.api.method_signature) = "parent,schema"; + } + + // Validates a message against a schema. + rpc ValidateMessage(ValidateMessageRequest) + returns (ValidateMessageResponse) { + option (google.api.http) = { + post: "/v1/{parent=projects/*}/schemas:validateMessage" + body: "*" + }; + } +} + +// A schema resource. +message Schema { + option (google.api.resource) = { + type: "pubsub.googleapis.com/Schema" + pattern: "projects/{project}/schemas/{schema}" + }; + + // Possible schema definition types. + enum Type { + // Default value. This value is unused. + TYPE_UNSPECIFIED = 0; + + // A Protocol Buffer schema definition. + PROTOCOL_BUFFER = 1; + + // An Avro schema definition. + AVRO = 2; + } + + // Required. Name of the schema. + // Format is `projects/{project}/schemas/{schema}`. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // The type of the schema definition. + Type type = 2; + + // The definition of the schema. This should contain a string representing + // the full definition of the schema that is a valid schema definition of + // the type specified in `type`. + string definition = 3; + + // Output only. Immutable. The revision ID of the schema. + string revision_id = 4 [ + (google.api.field_behavior) = IMMUTABLE, + (google.api.field_behavior) = OUTPUT_ONLY + ]; + + // Output only. The timestamp that the revision was created. + google.protobuf.Timestamp revision_create_time = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// View of Schema object fields to be returned by GetSchema and ListSchemas. +enum SchemaView { + // The default / unset value. + // The API will default to the BASIC view. + SCHEMA_VIEW_UNSPECIFIED = 0; + + // Include the name and type of the schema, but not the definition. + BASIC = 1; + + // Include all Schema object fields. + FULL = 2; +} + +// Request for the CreateSchema method. +message CreateSchemaRequest { + // Required. The name of the project in which to create the schema. + // Format is `projects/{project-id}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "pubsub.googleapis.com/Schema" + } + ]; + + // Required. The schema object to create. + // + // This schema's `name` parameter is ignored. The schema object returned + // by CreateSchema will have a `name` made using the given `parent` and + // `schema_id`. + Schema schema = 2 [(google.api.field_behavior) = REQUIRED]; + + // The ID to use for the schema, which will become the final component of + // the schema's resource name. + // + // See https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names for + // resource name constraints. + string schema_id = 3; +} + +// Request for the GetSchema method. +message GetSchemaRequest { + // Required. The name of the schema to get. + // Format is `projects/{project}/schemas/{schema}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "pubsub.googleapis.com/Schema" } + ]; + + // The set of fields to return in the response. If not set, returns a Schema + // with all fields filled out. Set to `BASIC` to omit the `definition`. + SchemaView view = 2; +} + +// Request for the `ListSchemas` method. +message ListSchemasRequest { + // Required. The name of the project in which to list schemas. + // Format is `projects/{project-id}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Project" + } + ]; + + // The set of Schema fields to return in the response. If not set, returns + // Schemas with `name` and `type`, but not `definition`. Set to `FULL` to + // retrieve all fields. + SchemaView view = 2; + + // Maximum number of schemas to return. + int32 page_size = 3; + + // The value returned by the last `ListSchemasResponse`; indicates that + // this is a continuation of a prior `ListSchemas` call, and that the + // system should return the next page of data. + string page_token = 4; +} + +// Response for the `ListSchemas` method. +message ListSchemasResponse { + // The resulting schemas. + repeated Schema schemas = 1; + + // If not empty, indicates that there may be more schemas that match the + // request; this value should be passed in a new `ListSchemasRequest`. + string next_page_token = 2; +} + +// Request for the `ListSchemaRevisions` method. +message ListSchemaRevisionsRequest { + // Required. The name of the schema to list revisions for. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "pubsub.googleapis.com/Schema" } + ]; + + // The set of Schema fields to return in the response. If not set, returns + // Schemas with `name` and `type`, but not `definition`. Set to `FULL` to + // retrieve all fields. + SchemaView view = 2; + + // The maximum number of revisions to return per page. + int32 page_size = 3; + + // The page token, received from a previous ListSchemaRevisions call. + // Provide this to retrieve the subsequent page. + string page_token = 4; +} + +// Response for the `ListSchemaRevisions` method. +message ListSchemaRevisionsResponse { + // The revisions of the schema. + repeated Schema schemas = 1; + + // A token that can be sent as `page_token` to retrieve the next page. + // If this field is empty, there are no subsequent pages. + string next_page_token = 2; +} + +// Request for CommitSchema method. +message CommitSchemaRequest { + // Required. The name of the schema we are revising. + // Format is `projects/{project}/schemas/{schema}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "pubsub.googleapis.com/Schema" } + ]; + + // Required. The schema revision to commit. + Schema schema = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request for the `RollbackSchema` method. +message RollbackSchemaRequest { + // Required. The schema being rolled back with revision id. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "pubsub.googleapis.com/Schema" } + ]; + + // Required. The revision ID to roll back to. + // It must be a revision of the same schema. + // + // Example: c7cfa2a8 + string revision_id = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request for the `DeleteSchemaRevision` method. +message DeleteSchemaRevisionRequest { + // Required. The name of the schema revision to be deleted, with a revision ID + // explicitly included. + // + // Example: `projects/123/schemas/my-schema@c7cfa2a8` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "pubsub.googleapis.com/Schema" } + ]; + + // Optional. This field is deprecated and should not be used for specifying + // the revision ID. The revision ID should be specified via the `name` + // parameter. + string revision_id = 2 + [deprecated = true, (google.api.field_behavior) = OPTIONAL]; +} + +// Request for the `DeleteSchema` method. +message DeleteSchemaRequest { + // Required. Name of the schema to delete. + // Format is `projects/{project}/schemas/{schema}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "pubsub.googleapis.com/Schema" } + ]; +} + +// Request for the `ValidateSchema` method. +message ValidateSchemaRequest { + // Required. The name of the project in which to validate schemas. + // Format is `projects/{project-id}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Project" + } + ]; + + // Required. The schema object to validate. + Schema schema = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Response for the `ValidateSchema` method. +// Empty for now. +message ValidateSchemaResponse {} + +// Request for the `ValidateMessage` method. +message ValidateMessageRequest { + // Required. The name of the project in which to validate schemas. + // Format is `projects/{project-id}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Project" + } + ]; + + oneof schema_spec { + // Name of the schema against which to validate. + // + // Format is `projects/{project}/schemas/{schema}`. + string name = 2 [ + (google.api.resource_reference) = { type: "pubsub.googleapis.com/Schema" } + ]; + + // Ad-hoc schema against which to validate + Schema schema = 3; + } + + // Message to validate against the provided `schema_spec`. + bytes message = 4; + + // The encoding expected for messages + Encoding encoding = 5; +} + +// Response for the `ValidateMessage` method. +// Empty for now. +message ValidateMessageResponse {} + +// Possible encoding types for messages. +enum Encoding { + // Unspecified + ENCODING_UNSPECIFIED = 0; + + // JSON encoding + JSON = 1; + + // Binary encoding, as defined by the schema type. For some schema types, + // binary encoding may not be available. + BINARY = 2; +} diff --git a/owl-bot-staging/v1/protos/protos.d.ts b/owl-bot-staging/v1/protos/protos.d.ts new file mode 100644 index 000000000..19956f26c --- /dev/null +++ b/owl-bot-staging/v1/protos/protos.d.ts @@ -0,0 +1,15218 @@ +// 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 google. */ +export namespace google { + + /** Namespace pubsub. */ + namespace pubsub { + + /** Namespace v1. */ + namespace v1 { + + /** Represents a Publisher */ + class Publisher extends $protobuf.rpc.Service { + + /** + * Constructs a new Publisher service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new Publisher 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): Publisher; + + /** + * Calls CreateTopic. + * @param request Topic message or plain object + * @param callback Node-style callback called with the error, if any, and Topic + */ + public createTopic(request: google.pubsub.v1.ITopic, callback: google.pubsub.v1.Publisher.CreateTopicCallback): void; + + /** + * Calls CreateTopic. + * @param request Topic message or plain object + * @returns Promise + */ + public createTopic(request: google.pubsub.v1.ITopic): Promise; + + /** + * Calls UpdateTopic. + * @param request UpdateTopicRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Topic + */ + public updateTopic(request: google.pubsub.v1.IUpdateTopicRequest, callback: google.pubsub.v1.Publisher.UpdateTopicCallback): void; + + /** + * Calls UpdateTopic. + * @param request UpdateTopicRequest message or plain object + * @returns Promise + */ + public updateTopic(request: google.pubsub.v1.IUpdateTopicRequest): Promise; + + /** + * Calls Publish. + * @param request PublishRequest message or plain object + * @param callback Node-style callback called with the error, if any, and PublishResponse + */ + public publish(request: google.pubsub.v1.IPublishRequest, callback: google.pubsub.v1.Publisher.PublishCallback): void; + + /** + * Calls Publish. + * @param request PublishRequest message or plain object + * @returns Promise + */ + public publish(request: google.pubsub.v1.IPublishRequest): Promise; + + /** + * Calls GetTopic. + * @param request GetTopicRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Topic + */ + public getTopic(request: google.pubsub.v1.IGetTopicRequest, callback: google.pubsub.v1.Publisher.GetTopicCallback): void; + + /** + * Calls GetTopic. + * @param request GetTopicRequest message or plain object + * @returns Promise + */ + public getTopic(request: google.pubsub.v1.IGetTopicRequest): Promise; + + /** + * Calls ListTopics. + * @param request ListTopicsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListTopicsResponse + */ + public listTopics(request: google.pubsub.v1.IListTopicsRequest, callback: google.pubsub.v1.Publisher.ListTopicsCallback): void; + + /** + * Calls ListTopics. + * @param request ListTopicsRequest message or plain object + * @returns Promise + */ + public listTopics(request: google.pubsub.v1.IListTopicsRequest): Promise; + + /** + * Calls ListTopicSubscriptions. + * @param request ListTopicSubscriptionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListTopicSubscriptionsResponse + */ + public listTopicSubscriptions(request: google.pubsub.v1.IListTopicSubscriptionsRequest, callback: google.pubsub.v1.Publisher.ListTopicSubscriptionsCallback): void; + + /** + * Calls ListTopicSubscriptions. + * @param request ListTopicSubscriptionsRequest message or plain object + * @returns Promise + */ + public listTopicSubscriptions(request: google.pubsub.v1.IListTopicSubscriptionsRequest): Promise; + + /** + * Calls ListTopicSnapshots. + * @param request ListTopicSnapshotsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListTopicSnapshotsResponse + */ + public listTopicSnapshots(request: google.pubsub.v1.IListTopicSnapshotsRequest, callback: google.pubsub.v1.Publisher.ListTopicSnapshotsCallback): void; + + /** + * Calls ListTopicSnapshots. + * @param request ListTopicSnapshotsRequest message or plain object + * @returns Promise + */ + public listTopicSnapshots(request: google.pubsub.v1.IListTopicSnapshotsRequest): Promise; + + /** + * Calls DeleteTopic. + * @param request DeleteTopicRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteTopic(request: google.pubsub.v1.IDeleteTopicRequest, callback: google.pubsub.v1.Publisher.DeleteTopicCallback): void; + + /** + * Calls DeleteTopic. + * @param request DeleteTopicRequest message or plain object + * @returns Promise + */ + public deleteTopic(request: google.pubsub.v1.IDeleteTopicRequest): Promise; + + /** + * Calls DetachSubscription. + * @param request DetachSubscriptionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and DetachSubscriptionResponse + */ + public detachSubscription(request: google.pubsub.v1.IDetachSubscriptionRequest, callback: google.pubsub.v1.Publisher.DetachSubscriptionCallback): void; + + /** + * Calls DetachSubscription. + * @param request DetachSubscriptionRequest message or plain object + * @returns Promise + */ + public detachSubscription(request: google.pubsub.v1.IDetachSubscriptionRequest): Promise; + } + + namespace Publisher { + + /** + * Callback as used by {@link google.pubsub.v1.Publisher|createTopic}. + * @param error Error, if any + * @param [response] Topic + */ + type CreateTopicCallback = (error: (Error|null), response?: google.pubsub.v1.Topic) => void; + + /** + * Callback as used by {@link google.pubsub.v1.Publisher|updateTopic}. + * @param error Error, if any + * @param [response] Topic + */ + type UpdateTopicCallback = (error: (Error|null), response?: google.pubsub.v1.Topic) => void; + + /** + * Callback as used by {@link google.pubsub.v1.Publisher|publish}. + * @param error Error, if any + * @param [response] PublishResponse + */ + type PublishCallback = (error: (Error|null), response?: google.pubsub.v1.PublishResponse) => void; + + /** + * Callback as used by {@link google.pubsub.v1.Publisher|getTopic}. + * @param error Error, if any + * @param [response] Topic + */ + type GetTopicCallback = (error: (Error|null), response?: google.pubsub.v1.Topic) => void; + + /** + * Callback as used by {@link google.pubsub.v1.Publisher|listTopics}. + * @param error Error, if any + * @param [response] ListTopicsResponse + */ + type ListTopicsCallback = (error: (Error|null), response?: google.pubsub.v1.ListTopicsResponse) => void; + + /** + * Callback as used by {@link google.pubsub.v1.Publisher|listTopicSubscriptions}. + * @param error Error, if any + * @param [response] ListTopicSubscriptionsResponse + */ + type ListTopicSubscriptionsCallback = (error: (Error|null), response?: google.pubsub.v1.ListTopicSubscriptionsResponse) => void; + + /** + * Callback as used by {@link google.pubsub.v1.Publisher|listTopicSnapshots}. + * @param error Error, if any + * @param [response] ListTopicSnapshotsResponse + */ + type ListTopicSnapshotsCallback = (error: (Error|null), response?: google.pubsub.v1.ListTopicSnapshotsResponse) => void; + + /** + * Callback as used by {@link google.pubsub.v1.Publisher|deleteTopic}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteTopicCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.pubsub.v1.Publisher|detachSubscription}. + * @param error Error, if any + * @param [response] DetachSubscriptionResponse + */ + type DetachSubscriptionCallback = (error: (Error|null), response?: google.pubsub.v1.DetachSubscriptionResponse) => void; + } + + /** Properties of a MessageStoragePolicy. */ + interface IMessageStoragePolicy { + + /** MessageStoragePolicy allowedPersistenceRegions */ + allowedPersistenceRegions?: (string[]|null); + + /** MessageStoragePolicy enforceInTransit */ + enforceInTransit?: (boolean|null); + } + + /** Represents a MessageStoragePolicy. */ + class MessageStoragePolicy implements IMessageStoragePolicy { + + /** + * Constructs a new MessageStoragePolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IMessageStoragePolicy); + + /** MessageStoragePolicy allowedPersistenceRegions. */ + public allowedPersistenceRegions: string[]; + + /** MessageStoragePolicy enforceInTransit. */ + public enforceInTransit: boolean; + + /** + * Creates a new MessageStoragePolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns MessageStoragePolicy instance + */ + public static create(properties?: google.pubsub.v1.IMessageStoragePolicy): google.pubsub.v1.MessageStoragePolicy; + + /** + * Encodes the specified MessageStoragePolicy message. Does not implicitly {@link google.pubsub.v1.MessageStoragePolicy.verify|verify} messages. + * @param message MessageStoragePolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IMessageStoragePolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MessageStoragePolicy message, length delimited. Does not implicitly {@link google.pubsub.v1.MessageStoragePolicy.verify|verify} messages. + * @param message MessageStoragePolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IMessageStoragePolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MessageStoragePolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MessageStoragePolicy + * @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.pubsub.v1.MessageStoragePolicy; + + /** + * Decodes a MessageStoragePolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MessageStoragePolicy + * @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.pubsub.v1.MessageStoragePolicy; + + /** + * Verifies a MessageStoragePolicy 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 MessageStoragePolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MessageStoragePolicy + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.MessageStoragePolicy; + + /** + * Creates a plain object from a MessageStoragePolicy message. Also converts values to other types if specified. + * @param message MessageStoragePolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.MessageStoragePolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MessageStoragePolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MessageStoragePolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SchemaSettings. */ + interface ISchemaSettings { + + /** SchemaSettings schema */ + schema?: (string|null); + + /** SchemaSettings encoding */ + encoding?: (google.pubsub.v1.Encoding|keyof typeof google.pubsub.v1.Encoding|null); + + /** SchemaSettings firstRevisionId */ + firstRevisionId?: (string|null); + + /** SchemaSettings lastRevisionId */ + lastRevisionId?: (string|null); + } + + /** Represents a SchemaSettings. */ + class SchemaSettings implements ISchemaSettings { + + /** + * Constructs a new SchemaSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.ISchemaSettings); + + /** SchemaSettings schema. */ + public schema: string; + + /** SchemaSettings encoding. */ + public encoding: (google.pubsub.v1.Encoding|keyof typeof google.pubsub.v1.Encoding); + + /** SchemaSettings firstRevisionId. */ + public firstRevisionId: string; + + /** SchemaSettings lastRevisionId. */ + public lastRevisionId: string; + + /** + * Creates a new SchemaSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns SchemaSettings instance + */ + public static create(properties?: google.pubsub.v1.ISchemaSettings): google.pubsub.v1.SchemaSettings; + + /** + * Encodes the specified SchemaSettings message. Does not implicitly {@link google.pubsub.v1.SchemaSettings.verify|verify} messages. + * @param message SchemaSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.ISchemaSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SchemaSettings message, length delimited. Does not implicitly {@link google.pubsub.v1.SchemaSettings.verify|verify} messages. + * @param message SchemaSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.ISchemaSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SchemaSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SchemaSettings + * @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.pubsub.v1.SchemaSettings; + + /** + * Decodes a SchemaSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SchemaSettings + * @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.pubsub.v1.SchemaSettings; + + /** + * Verifies a SchemaSettings 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 SchemaSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SchemaSettings + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.SchemaSettings; + + /** + * Creates a plain object from a SchemaSettings message. Also converts values to other types if specified. + * @param message SchemaSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.SchemaSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SchemaSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SchemaSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an IngestionDataSourceSettings. */ + interface IIngestionDataSourceSettings { + + /** IngestionDataSourceSettings awsKinesis */ + awsKinesis?: (google.pubsub.v1.IngestionDataSourceSettings.IAwsKinesis|null); + } + + /** Represents an IngestionDataSourceSettings. */ + class IngestionDataSourceSettings implements IIngestionDataSourceSettings { + + /** + * Constructs a new IngestionDataSourceSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IIngestionDataSourceSettings); + + /** IngestionDataSourceSettings awsKinesis. */ + public awsKinesis?: (google.pubsub.v1.IngestionDataSourceSettings.IAwsKinesis|null); + + /** IngestionDataSourceSettings source. */ + public source?: "awsKinesis"; + + /** + * Creates a new IngestionDataSourceSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns IngestionDataSourceSettings instance + */ + public static create(properties?: google.pubsub.v1.IIngestionDataSourceSettings): google.pubsub.v1.IngestionDataSourceSettings; + + /** + * Encodes the specified IngestionDataSourceSettings message. Does not implicitly {@link google.pubsub.v1.IngestionDataSourceSettings.verify|verify} messages. + * @param message IngestionDataSourceSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IIngestionDataSourceSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IngestionDataSourceSettings message, length delimited. Does not implicitly {@link google.pubsub.v1.IngestionDataSourceSettings.verify|verify} messages. + * @param message IngestionDataSourceSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IIngestionDataSourceSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IngestionDataSourceSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IngestionDataSourceSettings + * @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.pubsub.v1.IngestionDataSourceSettings; + + /** + * Decodes an IngestionDataSourceSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IngestionDataSourceSettings + * @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.pubsub.v1.IngestionDataSourceSettings; + + /** + * Verifies an IngestionDataSourceSettings 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 IngestionDataSourceSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IngestionDataSourceSettings + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.IngestionDataSourceSettings; + + /** + * Creates a plain object from an IngestionDataSourceSettings message. Also converts values to other types if specified. + * @param message IngestionDataSourceSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.IngestionDataSourceSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IngestionDataSourceSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IngestionDataSourceSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace IngestionDataSourceSettings { + + /** Properties of an AwsKinesis. */ + interface IAwsKinesis { + + /** AwsKinesis state */ + state?: (google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis.State|keyof typeof google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis.State|null); + + /** AwsKinesis streamArn */ + streamArn?: (string|null); + + /** AwsKinesis consumerArn */ + consumerArn?: (string|null); + + /** AwsKinesis awsRoleArn */ + awsRoleArn?: (string|null); + + /** AwsKinesis gcpServiceAccount */ + gcpServiceAccount?: (string|null); + } + + /** Represents an AwsKinesis. */ + class AwsKinesis implements IAwsKinesis { + + /** + * Constructs a new AwsKinesis. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IngestionDataSourceSettings.IAwsKinesis); + + /** AwsKinesis state. */ + public state: (google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis.State|keyof typeof google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis.State); + + /** AwsKinesis streamArn. */ + public streamArn: string; + + /** AwsKinesis consumerArn. */ + public consumerArn: string; + + /** AwsKinesis awsRoleArn. */ + public awsRoleArn: string; + + /** AwsKinesis gcpServiceAccount. */ + public gcpServiceAccount: string; + + /** + * Creates a new AwsKinesis instance using the specified properties. + * @param [properties] Properties to set + * @returns AwsKinesis instance + */ + public static create(properties?: google.pubsub.v1.IngestionDataSourceSettings.IAwsKinesis): google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis; + + /** + * Encodes the specified AwsKinesis message. Does not implicitly {@link google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis.verify|verify} messages. + * @param message AwsKinesis message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IngestionDataSourceSettings.IAwsKinesis, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AwsKinesis message, length delimited. Does not implicitly {@link google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis.verify|verify} messages. + * @param message AwsKinesis message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IngestionDataSourceSettings.IAwsKinesis, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AwsKinesis message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AwsKinesis + * @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.pubsub.v1.IngestionDataSourceSettings.AwsKinesis; + + /** + * Decodes an AwsKinesis message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AwsKinesis + * @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.pubsub.v1.IngestionDataSourceSettings.AwsKinesis; + + /** + * Verifies an AwsKinesis 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 AwsKinesis message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AwsKinesis + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis; + + /** + * Creates a plain object from an AwsKinesis message. Also converts values to other types if specified. + * @param message AwsKinesis + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AwsKinesis to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AwsKinesis + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AwsKinesis { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + ACTIVE = 1, + KINESIS_PERMISSION_DENIED = 2, + PUBLISH_PERMISSION_DENIED = 3, + STREAM_NOT_FOUND = 4, + CONSUMER_NOT_FOUND = 5 + } + } + } + + /** Properties of a Topic. */ + interface ITopic { + + /** Topic name */ + name?: (string|null); + + /** Topic labels */ + labels?: ({ [k: string]: string }|null); + + /** Topic messageStoragePolicy */ + messageStoragePolicy?: (google.pubsub.v1.IMessageStoragePolicy|null); + + /** Topic kmsKeyName */ + kmsKeyName?: (string|null); + + /** Topic schemaSettings */ + schemaSettings?: (google.pubsub.v1.ISchemaSettings|null); + + /** Topic satisfiesPzs */ + satisfiesPzs?: (boolean|null); + + /** Topic messageRetentionDuration */ + messageRetentionDuration?: (google.protobuf.IDuration|null); + + /** Topic state */ + state?: (google.pubsub.v1.Topic.State|keyof typeof google.pubsub.v1.Topic.State|null); + + /** Topic ingestionDataSourceSettings */ + ingestionDataSourceSettings?: (google.pubsub.v1.IIngestionDataSourceSettings|null); + } + + /** Represents a Topic. */ + class Topic implements ITopic { + + /** + * Constructs a new Topic. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.ITopic); + + /** Topic name. */ + public name: string; + + /** Topic labels. */ + public labels: { [k: string]: string }; + + /** Topic messageStoragePolicy. */ + public messageStoragePolicy?: (google.pubsub.v1.IMessageStoragePolicy|null); + + /** Topic kmsKeyName. */ + public kmsKeyName: string; + + /** Topic schemaSettings. */ + public schemaSettings?: (google.pubsub.v1.ISchemaSettings|null); + + /** Topic satisfiesPzs. */ + public satisfiesPzs: boolean; + + /** Topic messageRetentionDuration. */ + public messageRetentionDuration?: (google.protobuf.IDuration|null); + + /** Topic state. */ + public state: (google.pubsub.v1.Topic.State|keyof typeof google.pubsub.v1.Topic.State); + + /** Topic ingestionDataSourceSettings. */ + public ingestionDataSourceSettings?: (google.pubsub.v1.IIngestionDataSourceSettings|null); + + /** + * Creates a new Topic instance using the specified properties. + * @param [properties] Properties to set + * @returns Topic instance + */ + public static create(properties?: google.pubsub.v1.ITopic): google.pubsub.v1.Topic; + + /** + * Encodes the specified Topic message. Does not implicitly {@link google.pubsub.v1.Topic.verify|verify} messages. + * @param message Topic message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.ITopic, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Topic message, length delimited. Does not implicitly {@link google.pubsub.v1.Topic.verify|verify} messages. + * @param message Topic message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.ITopic, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Topic message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Topic + * @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.pubsub.v1.Topic; + + /** + * Decodes a Topic message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Topic + * @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.pubsub.v1.Topic; + + /** + * Verifies a Topic 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 Topic message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Topic + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.Topic; + + /** + * Creates a plain object from a Topic message. Also converts values to other types if specified. + * @param message Topic + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.Topic, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Topic to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Topic + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Topic { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + ACTIVE = 1, + INGESTION_RESOURCE_ERROR = 2 + } + } + + /** Properties of a PubsubMessage. */ + interface IPubsubMessage { + + /** PubsubMessage data */ + data?: (Uint8Array|string|null); + + /** PubsubMessage attributes */ + attributes?: ({ [k: string]: string }|null); + + /** PubsubMessage messageId */ + messageId?: (string|null); + + /** PubsubMessage publishTime */ + publishTime?: (google.protobuf.ITimestamp|null); + + /** PubsubMessage orderingKey */ + orderingKey?: (string|null); + } + + /** Represents a PubsubMessage. */ + class PubsubMessage implements IPubsubMessage { + + /** + * Constructs a new PubsubMessage. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IPubsubMessage); + + /** PubsubMessage data. */ + public data: (Uint8Array|string); + + /** PubsubMessage attributes. */ + public attributes: { [k: string]: string }; + + /** PubsubMessage messageId. */ + public messageId: string; + + /** PubsubMessage publishTime. */ + public publishTime?: (google.protobuf.ITimestamp|null); + + /** PubsubMessage orderingKey. */ + public orderingKey: string; + + /** + * Creates a new PubsubMessage instance using the specified properties. + * @param [properties] Properties to set + * @returns PubsubMessage instance + */ + public static create(properties?: google.pubsub.v1.IPubsubMessage): google.pubsub.v1.PubsubMessage; + + /** + * Encodes the specified PubsubMessage message. Does not implicitly {@link google.pubsub.v1.PubsubMessage.verify|verify} messages. + * @param message PubsubMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IPubsubMessage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PubsubMessage message, length delimited. Does not implicitly {@link google.pubsub.v1.PubsubMessage.verify|verify} messages. + * @param message PubsubMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IPubsubMessage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PubsubMessage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PubsubMessage + * @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.pubsub.v1.PubsubMessage; + + /** + * Decodes a PubsubMessage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PubsubMessage + * @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.pubsub.v1.PubsubMessage; + + /** + * Verifies a PubsubMessage 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 PubsubMessage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PubsubMessage + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.PubsubMessage; + + /** + * Creates a plain object from a PubsubMessage message. Also converts values to other types if specified. + * @param message PubsubMessage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.PubsubMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PubsubMessage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PubsubMessage + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetTopicRequest. */ + interface IGetTopicRequest { + + /** GetTopicRequest topic */ + topic?: (string|null); + } + + /** Represents a GetTopicRequest. */ + class GetTopicRequest implements IGetTopicRequest { + + /** + * Constructs a new GetTopicRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IGetTopicRequest); + + /** GetTopicRequest topic. */ + public topic: string; + + /** + * Creates a new GetTopicRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetTopicRequest instance + */ + public static create(properties?: google.pubsub.v1.IGetTopicRequest): google.pubsub.v1.GetTopicRequest; + + /** + * Encodes the specified GetTopicRequest message. Does not implicitly {@link google.pubsub.v1.GetTopicRequest.verify|verify} messages. + * @param message GetTopicRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IGetTopicRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetTopicRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.GetTopicRequest.verify|verify} messages. + * @param message GetTopicRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IGetTopicRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetTopicRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetTopicRequest + * @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.pubsub.v1.GetTopicRequest; + + /** + * Decodes a GetTopicRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetTopicRequest + * @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.pubsub.v1.GetTopicRequest; + + /** + * Verifies a GetTopicRequest 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 GetTopicRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetTopicRequest + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.GetTopicRequest; + + /** + * Creates a plain object from a GetTopicRequest message. Also converts values to other types if specified. + * @param message GetTopicRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.GetTopicRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetTopicRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetTopicRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateTopicRequest. */ + interface IUpdateTopicRequest { + + /** UpdateTopicRequest topic */ + topic?: (google.pubsub.v1.ITopic|null); + + /** UpdateTopicRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateTopicRequest. */ + class UpdateTopicRequest implements IUpdateTopicRequest { + + /** + * Constructs a new UpdateTopicRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IUpdateTopicRequest); + + /** UpdateTopicRequest topic. */ + public topic?: (google.pubsub.v1.ITopic|null); + + /** UpdateTopicRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateTopicRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateTopicRequest instance + */ + public static create(properties?: google.pubsub.v1.IUpdateTopicRequest): google.pubsub.v1.UpdateTopicRequest; + + /** + * Encodes the specified UpdateTopicRequest message. Does not implicitly {@link google.pubsub.v1.UpdateTopicRequest.verify|verify} messages. + * @param message UpdateTopicRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IUpdateTopicRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateTopicRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.UpdateTopicRequest.verify|verify} messages. + * @param message UpdateTopicRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IUpdateTopicRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateTopicRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateTopicRequest + * @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.pubsub.v1.UpdateTopicRequest; + + /** + * Decodes an UpdateTopicRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateTopicRequest + * @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.pubsub.v1.UpdateTopicRequest; + + /** + * Verifies an UpdateTopicRequest 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 UpdateTopicRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateTopicRequest + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.UpdateTopicRequest; + + /** + * Creates a plain object from an UpdateTopicRequest message. Also converts values to other types if specified. + * @param message UpdateTopicRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.UpdateTopicRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateTopicRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateTopicRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PublishRequest. */ + interface IPublishRequest { + + /** PublishRequest topic */ + topic?: (string|null); + + /** PublishRequest messages */ + messages?: (google.pubsub.v1.IPubsubMessage[]|null); + } + + /** Represents a PublishRequest. */ + class PublishRequest implements IPublishRequest { + + /** + * Constructs a new PublishRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IPublishRequest); + + /** PublishRequest topic. */ + public topic: string; + + /** PublishRequest messages. */ + public messages: google.pubsub.v1.IPubsubMessage[]; + + /** + * Creates a new PublishRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns PublishRequest instance + */ + public static create(properties?: google.pubsub.v1.IPublishRequest): google.pubsub.v1.PublishRequest; + + /** + * Encodes the specified PublishRequest message. Does not implicitly {@link google.pubsub.v1.PublishRequest.verify|verify} messages. + * @param message PublishRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IPublishRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PublishRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.PublishRequest.verify|verify} messages. + * @param message PublishRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IPublishRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PublishRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PublishRequest + * @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.pubsub.v1.PublishRequest; + + /** + * Decodes a PublishRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PublishRequest + * @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.pubsub.v1.PublishRequest; + + /** + * Verifies a PublishRequest 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 PublishRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PublishRequest + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.PublishRequest; + + /** + * Creates a plain object from a PublishRequest message. Also converts values to other types if specified. + * @param message PublishRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.PublishRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PublishRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PublishRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PublishResponse. */ + interface IPublishResponse { + + /** PublishResponse messageIds */ + messageIds?: (string[]|null); + } + + /** Represents a PublishResponse. */ + class PublishResponse implements IPublishResponse { + + /** + * Constructs a new PublishResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IPublishResponse); + + /** PublishResponse messageIds. */ + public messageIds: string[]; + + /** + * Creates a new PublishResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns PublishResponse instance + */ + public static create(properties?: google.pubsub.v1.IPublishResponse): google.pubsub.v1.PublishResponse; + + /** + * Encodes the specified PublishResponse message. Does not implicitly {@link google.pubsub.v1.PublishResponse.verify|verify} messages. + * @param message PublishResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IPublishResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PublishResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.PublishResponse.verify|verify} messages. + * @param message PublishResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IPublishResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PublishResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PublishResponse + * @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.pubsub.v1.PublishResponse; + + /** + * Decodes a PublishResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PublishResponse + * @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.pubsub.v1.PublishResponse; + + /** + * Verifies a PublishResponse 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 PublishResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PublishResponse + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.PublishResponse; + + /** + * Creates a plain object from a PublishResponse message. Also converts values to other types if specified. + * @param message PublishResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.PublishResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PublishResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PublishResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListTopicsRequest. */ + interface IListTopicsRequest { + + /** ListTopicsRequest project */ + project?: (string|null); + + /** ListTopicsRequest pageSize */ + pageSize?: (number|null); + + /** ListTopicsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListTopicsRequest. */ + class ListTopicsRequest implements IListTopicsRequest { + + /** + * Constructs a new ListTopicsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IListTopicsRequest); + + /** ListTopicsRequest project. */ + public project: string; + + /** ListTopicsRequest pageSize. */ + public pageSize: number; + + /** ListTopicsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListTopicsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListTopicsRequest instance + */ + public static create(properties?: google.pubsub.v1.IListTopicsRequest): google.pubsub.v1.ListTopicsRequest; + + /** + * Encodes the specified ListTopicsRequest message. Does not implicitly {@link google.pubsub.v1.ListTopicsRequest.verify|verify} messages. + * @param message ListTopicsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IListTopicsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListTopicsRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.ListTopicsRequest.verify|verify} messages. + * @param message ListTopicsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IListTopicsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListTopicsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListTopicsRequest + * @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.pubsub.v1.ListTopicsRequest; + + /** + * Decodes a ListTopicsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListTopicsRequest + * @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.pubsub.v1.ListTopicsRequest; + + /** + * Verifies a ListTopicsRequest 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 ListTopicsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListTopicsRequest + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.ListTopicsRequest; + + /** + * Creates a plain object from a ListTopicsRequest message. Also converts values to other types if specified. + * @param message ListTopicsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.ListTopicsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListTopicsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListTopicsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListTopicsResponse. */ + interface IListTopicsResponse { + + /** ListTopicsResponse topics */ + topics?: (google.pubsub.v1.ITopic[]|null); + + /** ListTopicsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListTopicsResponse. */ + class ListTopicsResponse implements IListTopicsResponse { + + /** + * Constructs a new ListTopicsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IListTopicsResponse); + + /** ListTopicsResponse topics. */ + public topics: google.pubsub.v1.ITopic[]; + + /** ListTopicsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListTopicsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListTopicsResponse instance + */ + public static create(properties?: google.pubsub.v1.IListTopicsResponse): google.pubsub.v1.ListTopicsResponse; + + /** + * Encodes the specified ListTopicsResponse message. Does not implicitly {@link google.pubsub.v1.ListTopicsResponse.verify|verify} messages. + * @param message ListTopicsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IListTopicsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListTopicsResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.ListTopicsResponse.verify|verify} messages. + * @param message ListTopicsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IListTopicsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListTopicsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListTopicsResponse + * @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.pubsub.v1.ListTopicsResponse; + + /** + * Decodes a ListTopicsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListTopicsResponse + * @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.pubsub.v1.ListTopicsResponse; + + /** + * Verifies a ListTopicsResponse 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 ListTopicsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListTopicsResponse + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.ListTopicsResponse; + + /** + * Creates a plain object from a ListTopicsResponse message. Also converts values to other types if specified. + * @param message ListTopicsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.ListTopicsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListTopicsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListTopicsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListTopicSubscriptionsRequest. */ + interface IListTopicSubscriptionsRequest { + + /** ListTopicSubscriptionsRequest topic */ + topic?: (string|null); + + /** ListTopicSubscriptionsRequest pageSize */ + pageSize?: (number|null); + + /** ListTopicSubscriptionsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListTopicSubscriptionsRequest. */ + class ListTopicSubscriptionsRequest implements IListTopicSubscriptionsRequest { + + /** + * Constructs a new ListTopicSubscriptionsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IListTopicSubscriptionsRequest); + + /** ListTopicSubscriptionsRequest topic. */ + public topic: string; + + /** ListTopicSubscriptionsRequest pageSize. */ + public pageSize: number; + + /** ListTopicSubscriptionsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListTopicSubscriptionsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListTopicSubscriptionsRequest instance + */ + public static create(properties?: google.pubsub.v1.IListTopicSubscriptionsRequest): google.pubsub.v1.ListTopicSubscriptionsRequest; + + /** + * Encodes the specified ListTopicSubscriptionsRequest message. Does not implicitly {@link google.pubsub.v1.ListTopicSubscriptionsRequest.verify|verify} messages. + * @param message ListTopicSubscriptionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IListTopicSubscriptionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListTopicSubscriptionsRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.ListTopicSubscriptionsRequest.verify|verify} messages. + * @param message ListTopicSubscriptionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IListTopicSubscriptionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListTopicSubscriptionsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListTopicSubscriptionsRequest + * @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.pubsub.v1.ListTopicSubscriptionsRequest; + + /** + * Decodes a ListTopicSubscriptionsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListTopicSubscriptionsRequest + * @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.pubsub.v1.ListTopicSubscriptionsRequest; + + /** + * Verifies a ListTopicSubscriptionsRequest 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 ListTopicSubscriptionsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListTopicSubscriptionsRequest + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.ListTopicSubscriptionsRequest; + + /** + * Creates a plain object from a ListTopicSubscriptionsRequest message. Also converts values to other types if specified. + * @param message ListTopicSubscriptionsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.ListTopicSubscriptionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListTopicSubscriptionsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListTopicSubscriptionsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListTopicSubscriptionsResponse. */ + interface IListTopicSubscriptionsResponse { + + /** ListTopicSubscriptionsResponse subscriptions */ + subscriptions?: (string[]|null); + + /** ListTopicSubscriptionsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListTopicSubscriptionsResponse. */ + class ListTopicSubscriptionsResponse implements IListTopicSubscriptionsResponse { + + /** + * Constructs a new ListTopicSubscriptionsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IListTopicSubscriptionsResponse); + + /** ListTopicSubscriptionsResponse subscriptions. */ + public subscriptions: string[]; + + /** ListTopicSubscriptionsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListTopicSubscriptionsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListTopicSubscriptionsResponse instance + */ + public static create(properties?: google.pubsub.v1.IListTopicSubscriptionsResponse): google.pubsub.v1.ListTopicSubscriptionsResponse; + + /** + * Encodes the specified ListTopicSubscriptionsResponse message. Does not implicitly {@link google.pubsub.v1.ListTopicSubscriptionsResponse.verify|verify} messages. + * @param message ListTopicSubscriptionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IListTopicSubscriptionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListTopicSubscriptionsResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.ListTopicSubscriptionsResponse.verify|verify} messages. + * @param message ListTopicSubscriptionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IListTopicSubscriptionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListTopicSubscriptionsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListTopicSubscriptionsResponse + * @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.pubsub.v1.ListTopicSubscriptionsResponse; + + /** + * Decodes a ListTopicSubscriptionsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListTopicSubscriptionsResponse + * @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.pubsub.v1.ListTopicSubscriptionsResponse; + + /** + * Verifies a ListTopicSubscriptionsResponse 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 ListTopicSubscriptionsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListTopicSubscriptionsResponse + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.ListTopicSubscriptionsResponse; + + /** + * Creates a plain object from a ListTopicSubscriptionsResponse message. Also converts values to other types if specified. + * @param message ListTopicSubscriptionsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.ListTopicSubscriptionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListTopicSubscriptionsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListTopicSubscriptionsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListTopicSnapshotsRequest. */ + interface IListTopicSnapshotsRequest { + + /** ListTopicSnapshotsRequest topic */ + topic?: (string|null); + + /** ListTopicSnapshotsRequest pageSize */ + pageSize?: (number|null); + + /** ListTopicSnapshotsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListTopicSnapshotsRequest. */ + class ListTopicSnapshotsRequest implements IListTopicSnapshotsRequest { + + /** + * Constructs a new ListTopicSnapshotsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IListTopicSnapshotsRequest); + + /** ListTopicSnapshotsRequest topic. */ + public topic: string; + + /** ListTopicSnapshotsRequest pageSize. */ + public pageSize: number; + + /** ListTopicSnapshotsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListTopicSnapshotsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListTopicSnapshotsRequest instance + */ + public static create(properties?: google.pubsub.v1.IListTopicSnapshotsRequest): google.pubsub.v1.ListTopicSnapshotsRequest; + + /** + * Encodes the specified ListTopicSnapshotsRequest message. Does not implicitly {@link google.pubsub.v1.ListTopicSnapshotsRequest.verify|verify} messages. + * @param message ListTopicSnapshotsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IListTopicSnapshotsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListTopicSnapshotsRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.ListTopicSnapshotsRequest.verify|verify} messages. + * @param message ListTopicSnapshotsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IListTopicSnapshotsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListTopicSnapshotsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListTopicSnapshotsRequest + * @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.pubsub.v1.ListTopicSnapshotsRequest; + + /** + * Decodes a ListTopicSnapshotsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListTopicSnapshotsRequest + * @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.pubsub.v1.ListTopicSnapshotsRequest; + + /** + * Verifies a ListTopicSnapshotsRequest 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 ListTopicSnapshotsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListTopicSnapshotsRequest + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.ListTopicSnapshotsRequest; + + /** + * Creates a plain object from a ListTopicSnapshotsRequest message. Also converts values to other types if specified. + * @param message ListTopicSnapshotsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.ListTopicSnapshotsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListTopicSnapshotsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListTopicSnapshotsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListTopicSnapshotsResponse. */ + interface IListTopicSnapshotsResponse { + + /** ListTopicSnapshotsResponse snapshots */ + snapshots?: (string[]|null); + + /** ListTopicSnapshotsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListTopicSnapshotsResponse. */ + class ListTopicSnapshotsResponse implements IListTopicSnapshotsResponse { + + /** + * Constructs a new ListTopicSnapshotsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IListTopicSnapshotsResponse); + + /** ListTopicSnapshotsResponse snapshots. */ + public snapshots: string[]; + + /** ListTopicSnapshotsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListTopicSnapshotsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListTopicSnapshotsResponse instance + */ + public static create(properties?: google.pubsub.v1.IListTopicSnapshotsResponse): google.pubsub.v1.ListTopicSnapshotsResponse; + + /** + * Encodes the specified ListTopicSnapshotsResponse message. Does not implicitly {@link google.pubsub.v1.ListTopicSnapshotsResponse.verify|verify} messages. + * @param message ListTopicSnapshotsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IListTopicSnapshotsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListTopicSnapshotsResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.ListTopicSnapshotsResponse.verify|verify} messages. + * @param message ListTopicSnapshotsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IListTopicSnapshotsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListTopicSnapshotsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListTopicSnapshotsResponse + * @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.pubsub.v1.ListTopicSnapshotsResponse; + + /** + * Decodes a ListTopicSnapshotsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListTopicSnapshotsResponse + * @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.pubsub.v1.ListTopicSnapshotsResponse; + + /** + * Verifies a ListTopicSnapshotsResponse 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 ListTopicSnapshotsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListTopicSnapshotsResponse + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.ListTopicSnapshotsResponse; + + /** + * Creates a plain object from a ListTopicSnapshotsResponse message. Also converts values to other types if specified. + * @param message ListTopicSnapshotsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.ListTopicSnapshotsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListTopicSnapshotsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListTopicSnapshotsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteTopicRequest. */ + interface IDeleteTopicRequest { + + /** DeleteTopicRequest topic */ + topic?: (string|null); + } + + /** Represents a DeleteTopicRequest. */ + class DeleteTopicRequest implements IDeleteTopicRequest { + + /** + * Constructs a new DeleteTopicRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IDeleteTopicRequest); + + /** DeleteTopicRequest topic. */ + public topic: string; + + /** + * Creates a new DeleteTopicRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteTopicRequest instance + */ + public static create(properties?: google.pubsub.v1.IDeleteTopicRequest): google.pubsub.v1.DeleteTopicRequest; + + /** + * Encodes the specified DeleteTopicRequest message. Does not implicitly {@link google.pubsub.v1.DeleteTopicRequest.verify|verify} messages. + * @param message DeleteTopicRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IDeleteTopicRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteTopicRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.DeleteTopicRequest.verify|verify} messages. + * @param message DeleteTopicRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IDeleteTopicRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteTopicRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteTopicRequest + * @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.pubsub.v1.DeleteTopicRequest; + + /** + * Decodes a DeleteTopicRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteTopicRequest + * @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.pubsub.v1.DeleteTopicRequest; + + /** + * Verifies a DeleteTopicRequest 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 DeleteTopicRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteTopicRequest + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.DeleteTopicRequest; + + /** + * Creates a plain object from a DeleteTopicRequest message. Also converts values to other types if specified. + * @param message DeleteTopicRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.DeleteTopicRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteTopicRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteTopicRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DetachSubscriptionRequest. */ + interface IDetachSubscriptionRequest { + + /** DetachSubscriptionRequest subscription */ + subscription?: (string|null); + } + + /** Represents a DetachSubscriptionRequest. */ + class DetachSubscriptionRequest implements IDetachSubscriptionRequest { + + /** + * Constructs a new DetachSubscriptionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IDetachSubscriptionRequest); + + /** DetachSubscriptionRequest subscription. */ + public subscription: string; + + /** + * Creates a new DetachSubscriptionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DetachSubscriptionRequest instance + */ + public static create(properties?: google.pubsub.v1.IDetachSubscriptionRequest): google.pubsub.v1.DetachSubscriptionRequest; + + /** + * Encodes the specified DetachSubscriptionRequest message. Does not implicitly {@link google.pubsub.v1.DetachSubscriptionRequest.verify|verify} messages. + * @param message DetachSubscriptionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IDetachSubscriptionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DetachSubscriptionRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.DetachSubscriptionRequest.verify|verify} messages. + * @param message DetachSubscriptionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IDetachSubscriptionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DetachSubscriptionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DetachSubscriptionRequest + * @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.pubsub.v1.DetachSubscriptionRequest; + + /** + * Decodes a DetachSubscriptionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DetachSubscriptionRequest + * @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.pubsub.v1.DetachSubscriptionRequest; + + /** + * Verifies a DetachSubscriptionRequest 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 DetachSubscriptionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DetachSubscriptionRequest + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.DetachSubscriptionRequest; + + /** + * Creates a plain object from a DetachSubscriptionRequest message. Also converts values to other types if specified. + * @param message DetachSubscriptionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.DetachSubscriptionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DetachSubscriptionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DetachSubscriptionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DetachSubscriptionResponse. */ + interface IDetachSubscriptionResponse { + } + + /** Represents a DetachSubscriptionResponse. */ + class DetachSubscriptionResponse implements IDetachSubscriptionResponse { + + /** + * Constructs a new DetachSubscriptionResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IDetachSubscriptionResponse); + + /** + * Creates a new DetachSubscriptionResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns DetachSubscriptionResponse instance + */ + public static create(properties?: google.pubsub.v1.IDetachSubscriptionResponse): google.pubsub.v1.DetachSubscriptionResponse; + + /** + * Encodes the specified DetachSubscriptionResponse message. Does not implicitly {@link google.pubsub.v1.DetachSubscriptionResponse.verify|verify} messages. + * @param message DetachSubscriptionResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IDetachSubscriptionResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DetachSubscriptionResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.DetachSubscriptionResponse.verify|verify} messages. + * @param message DetachSubscriptionResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IDetachSubscriptionResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DetachSubscriptionResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DetachSubscriptionResponse + * @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.pubsub.v1.DetachSubscriptionResponse; + + /** + * Decodes a DetachSubscriptionResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DetachSubscriptionResponse + * @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.pubsub.v1.DetachSubscriptionResponse; + + /** + * Verifies a DetachSubscriptionResponse 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 DetachSubscriptionResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DetachSubscriptionResponse + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.DetachSubscriptionResponse; + + /** + * Creates a plain object from a DetachSubscriptionResponse message. Also converts values to other types if specified. + * @param message DetachSubscriptionResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.DetachSubscriptionResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DetachSubscriptionResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DetachSubscriptionResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a Subscriber */ + class Subscriber extends $protobuf.rpc.Service { + + /** + * Constructs a new Subscriber service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new Subscriber 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): Subscriber; + + /** + * Calls CreateSubscription. + * @param request Subscription message or plain object + * @param callback Node-style callback called with the error, if any, and Subscription + */ + public createSubscription(request: google.pubsub.v1.ISubscription, callback: google.pubsub.v1.Subscriber.CreateSubscriptionCallback): void; + + /** + * Calls CreateSubscription. + * @param request Subscription message or plain object + * @returns Promise + */ + public createSubscription(request: google.pubsub.v1.ISubscription): Promise; + + /** + * Calls GetSubscription. + * @param request GetSubscriptionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Subscription + */ + public getSubscription(request: google.pubsub.v1.IGetSubscriptionRequest, callback: google.pubsub.v1.Subscriber.GetSubscriptionCallback): void; + + /** + * Calls GetSubscription. + * @param request GetSubscriptionRequest message or plain object + * @returns Promise + */ + public getSubscription(request: google.pubsub.v1.IGetSubscriptionRequest): Promise; + + /** + * Calls UpdateSubscription. + * @param request UpdateSubscriptionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Subscription + */ + public updateSubscription(request: google.pubsub.v1.IUpdateSubscriptionRequest, callback: google.pubsub.v1.Subscriber.UpdateSubscriptionCallback): void; + + /** + * Calls UpdateSubscription. + * @param request UpdateSubscriptionRequest message or plain object + * @returns Promise + */ + public updateSubscription(request: google.pubsub.v1.IUpdateSubscriptionRequest): Promise; + + /** + * Calls ListSubscriptions. + * @param request ListSubscriptionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListSubscriptionsResponse + */ + public listSubscriptions(request: google.pubsub.v1.IListSubscriptionsRequest, callback: google.pubsub.v1.Subscriber.ListSubscriptionsCallback): void; + + /** + * Calls ListSubscriptions. + * @param request ListSubscriptionsRequest message or plain object + * @returns Promise + */ + public listSubscriptions(request: google.pubsub.v1.IListSubscriptionsRequest): Promise; + + /** + * Calls DeleteSubscription. + * @param request DeleteSubscriptionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteSubscription(request: google.pubsub.v1.IDeleteSubscriptionRequest, callback: google.pubsub.v1.Subscriber.DeleteSubscriptionCallback): void; + + /** + * Calls DeleteSubscription. + * @param request DeleteSubscriptionRequest message or plain object + * @returns Promise + */ + public deleteSubscription(request: google.pubsub.v1.IDeleteSubscriptionRequest): Promise; + + /** + * Calls ModifyAckDeadline. + * @param request ModifyAckDeadlineRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public modifyAckDeadline(request: google.pubsub.v1.IModifyAckDeadlineRequest, callback: google.pubsub.v1.Subscriber.ModifyAckDeadlineCallback): void; + + /** + * Calls ModifyAckDeadline. + * @param request ModifyAckDeadlineRequest message or plain object + * @returns Promise + */ + public modifyAckDeadline(request: google.pubsub.v1.IModifyAckDeadlineRequest): Promise; + + /** + * Calls Acknowledge. + * @param request AcknowledgeRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public acknowledge(request: google.pubsub.v1.IAcknowledgeRequest, callback: google.pubsub.v1.Subscriber.AcknowledgeCallback): void; + + /** + * Calls Acknowledge. + * @param request AcknowledgeRequest message or plain object + * @returns Promise + */ + public acknowledge(request: google.pubsub.v1.IAcknowledgeRequest): Promise; + + /** + * Calls Pull. + * @param request PullRequest message or plain object + * @param callback Node-style callback called with the error, if any, and PullResponse + */ + public pull(request: google.pubsub.v1.IPullRequest, callback: google.pubsub.v1.Subscriber.PullCallback): void; + + /** + * Calls Pull. + * @param request PullRequest message or plain object + * @returns Promise + */ + public pull(request: google.pubsub.v1.IPullRequest): Promise; + + /** + * Calls StreamingPull. + * @param request StreamingPullRequest message or plain object + * @param callback Node-style callback called with the error, if any, and StreamingPullResponse + */ + public streamingPull(request: google.pubsub.v1.IStreamingPullRequest, callback: google.pubsub.v1.Subscriber.StreamingPullCallback): void; + + /** + * Calls StreamingPull. + * @param request StreamingPullRequest message or plain object + * @returns Promise + */ + public streamingPull(request: google.pubsub.v1.IStreamingPullRequest): Promise; + + /** + * Calls ModifyPushConfig. + * @param request ModifyPushConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public modifyPushConfig(request: google.pubsub.v1.IModifyPushConfigRequest, callback: google.pubsub.v1.Subscriber.ModifyPushConfigCallback): void; + + /** + * Calls ModifyPushConfig. + * @param request ModifyPushConfigRequest message or plain object + * @returns Promise + */ + public modifyPushConfig(request: google.pubsub.v1.IModifyPushConfigRequest): Promise; + + /** + * Calls GetSnapshot. + * @param request GetSnapshotRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Snapshot + */ + public getSnapshot(request: google.pubsub.v1.IGetSnapshotRequest, callback: google.pubsub.v1.Subscriber.GetSnapshotCallback): void; + + /** + * Calls GetSnapshot. + * @param request GetSnapshotRequest message or plain object + * @returns Promise + */ + public getSnapshot(request: google.pubsub.v1.IGetSnapshotRequest): Promise; + + /** + * Calls ListSnapshots. + * @param request ListSnapshotsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListSnapshotsResponse + */ + public listSnapshots(request: google.pubsub.v1.IListSnapshotsRequest, callback: google.pubsub.v1.Subscriber.ListSnapshotsCallback): void; + + /** + * Calls ListSnapshots. + * @param request ListSnapshotsRequest message or plain object + * @returns Promise + */ + public listSnapshots(request: google.pubsub.v1.IListSnapshotsRequest): Promise; + + /** + * Calls CreateSnapshot. + * @param request CreateSnapshotRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Snapshot + */ + public createSnapshot(request: google.pubsub.v1.ICreateSnapshotRequest, callback: google.pubsub.v1.Subscriber.CreateSnapshotCallback): void; + + /** + * Calls CreateSnapshot. + * @param request CreateSnapshotRequest message or plain object + * @returns Promise + */ + public createSnapshot(request: google.pubsub.v1.ICreateSnapshotRequest): Promise; + + /** + * Calls UpdateSnapshot. + * @param request UpdateSnapshotRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Snapshot + */ + public updateSnapshot(request: google.pubsub.v1.IUpdateSnapshotRequest, callback: google.pubsub.v1.Subscriber.UpdateSnapshotCallback): void; + + /** + * Calls UpdateSnapshot. + * @param request UpdateSnapshotRequest message or plain object + * @returns Promise + */ + public updateSnapshot(request: google.pubsub.v1.IUpdateSnapshotRequest): Promise; + + /** + * Calls DeleteSnapshot. + * @param request DeleteSnapshotRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteSnapshot(request: google.pubsub.v1.IDeleteSnapshotRequest, callback: google.pubsub.v1.Subscriber.DeleteSnapshotCallback): void; + + /** + * Calls DeleteSnapshot. + * @param request DeleteSnapshotRequest message or plain object + * @returns Promise + */ + public deleteSnapshot(request: google.pubsub.v1.IDeleteSnapshotRequest): Promise; + + /** + * Calls Seek. + * @param request SeekRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SeekResponse + */ + public seek(request: google.pubsub.v1.ISeekRequest, callback: google.pubsub.v1.Subscriber.SeekCallback): void; + + /** + * Calls Seek. + * @param request SeekRequest message or plain object + * @returns Promise + */ + public seek(request: google.pubsub.v1.ISeekRequest): Promise; + } + + namespace Subscriber { + + /** + * Callback as used by {@link google.pubsub.v1.Subscriber|createSubscription}. + * @param error Error, if any + * @param [response] Subscription + */ + type CreateSubscriptionCallback = (error: (Error|null), response?: google.pubsub.v1.Subscription) => void; + + /** + * Callback as used by {@link google.pubsub.v1.Subscriber|getSubscription}. + * @param error Error, if any + * @param [response] Subscription + */ + type GetSubscriptionCallback = (error: (Error|null), response?: google.pubsub.v1.Subscription) => void; + + /** + * Callback as used by {@link google.pubsub.v1.Subscriber|updateSubscription}. + * @param error Error, if any + * @param [response] Subscription + */ + type UpdateSubscriptionCallback = (error: (Error|null), response?: google.pubsub.v1.Subscription) => void; + + /** + * Callback as used by {@link google.pubsub.v1.Subscriber|listSubscriptions}. + * @param error Error, if any + * @param [response] ListSubscriptionsResponse + */ + type ListSubscriptionsCallback = (error: (Error|null), response?: google.pubsub.v1.ListSubscriptionsResponse) => void; + + /** + * Callback as used by {@link google.pubsub.v1.Subscriber|deleteSubscription}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteSubscriptionCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.pubsub.v1.Subscriber|modifyAckDeadline}. + * @param error Error, if any + * @param [response] Empty + */ + type ModifyAckDeadlineCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.pubsub.v1.Subscriber|acknowledge}. + * @param error Error, if any + * @param [response] Empty + */ + type AcknowledgeCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.pubsub.v1.Subscriber|pull}. + * @param error Error, if any + * @param [response] PullResponse + */ + type PullCallback = (error: (Error|null), response?: google.pubsub.v1.PullResponse) => void; + + /** + * Callback as used by {@link google.pubsub.v1.Subscriber|streamingPull}. + * @param error Error, if any + * @param [response] StreamingPullResponse + */ + type StreamingPullCallback = (error: (Error|null), response?: google.pubsub.v1.StreamingPullResponse) => void; + + /** + * Callback as used by {@link google.pubsub.v1.Subscriber|modifyPushConfig}. + * @param error Error, if any + * @param [response] Empty + */ + type ModifyPushConfigCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.pubsub.v1.Subscriber|getSnapshot}. + * @param error Error, if any + * @param [response] Snapshot + */ + type GetSnapshotCallback = (error: (Error|null), response?: google.pubsub.v1.Snapshot) => void; + + /** + * Callback as used by {@link google.pubsub.v1.Subscriber|listSnapshots}. + * @param error Error, if any + * @param [response] ListSnapshotsResponse + */ + type ListSnapshotsCallback = (error: (Error|null), response?: google.pubsub.v1.ListSnapshotsResponse) => void; + + /** + * Callback as used by {@link google.pubsub.v1.Subscriber|createSnapshot}. + * @param error Error, if any + * @param [response] Snapshot + */ + type CreateSnapshotCallback = (error: (Error|null), response?: google.pubsub.v1.Snapshot) => void; + + /** + * Callback as used by {@link google.pubsub.v1.Subscriber|updateSnapshot}. + * @param error Error, if any + * @param [response] Snapshot + */ + type UpdateSnapshotCallback = (error: (Error|null), response?: google.pubsub.v1.Snapshot) => void; + + /** + * Callback as used by {@link google.pubsub.v1.Subscriber|deleteSnapshot}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteSnapshotCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.pubsub.v1.Subscriber|seek}. + * @param error Error, if any + * @param [response] SeekResponse + */ + type SeekCallback = (error: (Error|null), response?: google.pubsub.v1.SeekResponse) => void; + } + + /** Properties of a Subscription. */ + interface ISubscription { + + /** Subscription name */ + name?: (string|null); + + /** Subscription topic */ + topic?: (string|null); + + /** Subscription pushConfig */ + pushConfig?: (google.pubsub.v1.IPushConfig|null); + + /** Subscription bigqueryConfig */ + bigqueryConfig?: (google.pubsub.v1.IBigQueryConfig|null); + + /** Subscription cloudStorageConfig */ + cloudStorageConfig?: (google.pubsub.v1.ICloudStorageConfig|null); + + /** Subscription ackDeadlineSeconds */ + ackDeadlineSeconds?: (number|null); + + /** Subscription retainAckedMessages */ + retainAckedMessages?: (boolean|null); + + /** Subscription messageRetentionDuration */ + messageRetentionDuration?: (google.protobuf.IDuration|null); + + /** Subscription labels */ + labels?: ({ [k: string]: string }|null); + + /** Subscription enableMessageOrdering */ + enableMessageOrdering?: (boolean|null); + + /** Subscription expirationPolicy */ + expirationPolicy?: (google.pubsub.v1.IExpirationPolicy|null); + + /** Subscription filter */ + filter?: (string|null); + + /** Subscription deadLetterPolicy */ + deadLetterPolicy?: (google.pubsub.v1.IDeadLetterPolicy|null); + + /** Subscription retryPolicy */ + retryPolicy?: (google.pubsub.v1.IRetryPolicy|null); + + /** Subscription detached */ + detached?: (boolean|null); + + /** Subscription enableExactlyOnceDelivery */ + enableExactlyOnceDelivery?: (boolean|null); + + /** Subscription topicMessageRetentionDuration */ + topicMessageRetentionDuration?: (google.protobuf.IDuration|null); + + /** Subscription state */ + state?: (google.pubsub.v1.Subscription.State|keyof typeof google.pubsub.v1.Subscription.State|null); + } + + /** Represents a Subscription. */ + class Subscription implements ISubscription { + + /** + * Constructs a new Subscription. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.ISubscription); + + /** Subscription name. */ + public name: string; + + /** Subscription topic. */ + public topic: string; + + /** Subscription pushConfig. */ + public pushConfig?: (google.pubsub.v1.IPushConfig|null); + + /** Subscription bigqueryConfig. */ + public bigqueryConfig?: (google.pubsub.v1.IBigQueryConfig|null); + + /** Subscription cloudStorageConfig. */ + public cloudStorageConfig?: (google.pubsub.v1.ICloudStorageConfig|null); + + /** Subscription ackDeadlineSeconds. */ + public ackDeadlineSeconds: number; + + /** Subscription retainAckedMessages. */ + public retainAckedMessages: boolean; + + /** Subscription messageRetentionDuration. */ + public messageRetentionDuration?: (google.protobuf.IDuration|null); + + /** Subscription labels. */ + public labels: { [k: string]: string }; + + /** Subscription enableMessageOrdering. */ + public enableMessageOrdering: boolean; + + /** Subscription expirationPolicy. */ + public expirationPolicy?: (google.pubsub.v1.IExpirationPolicy|null); + + /** Subscription filter. */ + public filter: string; + + /** Subscription deadLetterPolicy. */ + public deadLetterPolicy?: (google.pubsub.v1.IDeadLetterPolicy|null); + + /** Subscription retryPolicy. */ + public retryPolicy?: (google.pubsub.v1.IRetryPolicy|null); + + /** Subscription detached. */ + public detached: boolean; + + /** Subscription enableExactlyOnceDelivery. */ + public enableExactlyOnceDelivery: boolean; + + /** Subscription topicMessageRetentionDuration. */ + public topicMessageRetentionDuration?: (google.protobuf.IDuration|null); + + /** Subscription state. */ + public state: (google.pubsub.v1.Subscription.State|keyof typeof google.pubsub.v1.Subscription.State); + + /** + * Creates a new Subscription instance using the specified properties. + * @param [properties] Properties to set + * @returns Subscription instance + */ + public static create(properties?: google.pubsub.v1.ISubscription): google.pubsub.v1.Subscription; + + /** + * Encodes the specified Subscription message. Does not implicitly {@link google.pubsub.v1.Subscription.verify|verify} messages. + * @param message Subscription message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.ISubscription, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Subscription message, length delimited. Does not implicitly {@link google.pubsub.v1.Subscription.verify|verify} messages. + * @param message Subscription message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.ISubscription, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Subscription message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Subscription + * @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.pubsub.v1.Subscription; + + /** + * Decodes a Subscription message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Subscription + * @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.pubsub.v1.Subscription; + + /** + * Verifies a Subscription 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 Subscription message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Subscription + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.Subscription; + + /** + * Creates a plain object from a Subscription message. Also converts values to other types if specified. + * @param message Subscription + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.Subscription, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Subscription to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Subscription + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Subscription { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + ACTIVE = 1, + RESOURCE_ERROR = 2 + } + } + + /** Properties of a RetryPolicy. */ + interface IRetryPolicy { + + /** RetryPolicy minimumBackoff */ + minimumBackoff?: (google.protobuf.IDuration|null); + + /** RetryPolicy maximumBackoff */ + maximumBackoff?: (google.protobuf.IDuration|null); + } + + /** Represents a RetryPolicy. */ + class RetryPolicy implements IRetryPolicy { + + /** + * Constructs a new RetryPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IRetryPolicy); + + /** RetryPolicy minimumBackoff. */ + public minimumBackoff?: (google.protobuf.IDuration|null); + + /** RetryPolicy maximumBackoff. */ + public maximumBackoff?: (google.protobuf.IDuration|null); + + /** + * Creates a new RetryPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns RetryPolicy instance + */ + public static create(properties?: google.pubsub.v1.IRetryPolicy): google.pubsub.v1.RetryPolicy; + + /** + * Encodes the specified RetryPolicy message. Does not implicitly {@link google.pubsub.v1.RetryPolicy.verify|verify} messages. + * @param message RetryPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IRetryPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RetryPolicy message, length delimited. Does not implicitly {@link google.pubsub.v1.RetryPolicy.verify|verify} messages. + * @param message RetryPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IRetryPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RetryPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RetryPolicy + * @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.pubsub.v1.RetryPolicy; + + /** + * Decodes a RetryPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RetryPolicy + * @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.pubsub.v1.RetryPolicy; + + /** + * Verifies a RetryPolicy 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 RetryPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RetryPolicy + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.RetryPolicy; + + /** + * Creates a plain object from a RetryPolicy message. Also converts values to other types if specified. + * @param message RetryPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.RetryPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RetryPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RetryPolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeadLetterPolicy. */ + interface IDeadLetterPolicy { + + /** DeadLetterPolicy deadLetterTopic */ + deadLetterTopic?: (string|null); + + /** DeadLetterPolicy maxDeliveryAttempts */ + maxDeliveryAttempts?: (number|null); + } + + /** Represents a DeadLetterPolicy. */ + class DeadLetterPolicy implements IDeadLetterPolicy { + + /** + * Constructs a new DeadLetterPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IDeadLetterPolicy); + + /** DeadLetterPolicy deadLetterTopic. */ + public deadLetterTopic: string; + + /** DeadLetterPolicy maxDeliveryAttempts. */ + public maxDeliveryAttempts: number; + + /** + * Creates a new DeadLetterPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns DeadLetterPolicy instance + */ + public static create(properties?: google.pubsub.v1.IDeadLetterPolicy): google.pubsub.v1.DeadLetterPolicy; + + /** + * Encodes the specified DeadLetterPolicy message. Does not implicitly {@link google.pubsub.v1.DeadLetterPolicy.verify|verify} messages. + * @param message DeadLetterPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IDeadLetterPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeadLetterPolicy message, length delimited. Does not implicitly {@link google.pubsub.v1.DeadLetterPolicy.verify|verify} messages. + * @param message DeadLetterPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IDeadLetterPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeadLetterPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeadLetterPolicy + * @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.pubsub.v1.DeadLetterPolicy; + + /** + * Decodes a DeadLetterPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeadLetterPolicy + * @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.pubsub.v1.DeadLetterPolicy; + + /** + * Verifies a DeadLetterPolicy 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 DeadLetterPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeadLetterPolicy + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.DeadLetterPolicy; + + /** + * Creates a plain object from a DeadLetterPolicy message. Also converts values to other types if specified. + * @param message DeadLetterPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.DeadLetterPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeadLetterPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeadLetterPolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExpirationPolicy. */ + interface IExpirationPolicy { + + /** ExpirationPolicy ttl */ + ttl?: (google.protobuf.IDuration|null); + } + + /** Represents an ExpirationPolicy. */ + class ExpirationPolicy implements IExpirationPolicy { + + /** + * Constructs a new ExpirationPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IExpirationPolicy); + + /** ExpirationPolicy ttl. */ + public ttl?: (google.protobuf.IDuration|null); + + /** + * Creates a new ExpirationPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns ExpirationPolicy instance + */ + public static create(properties?: google.pubsub.v1.IExpirationPolicy): google.pubsub.v1.ExpirationPolicy; + + /** + * Encodes the specified ExpirationPolicy message. Does not implicitly {@link google.pubsub.v1.ExpirationPolicy.verify|verify} messages. + * @param message ExpirationPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IExpirationPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExpirationPolicy message, length delimited. Does not implicitly {@link google.pubsub.v1.ExpirationPolicy.verify|verify} messages. + * @param message ExpirationPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IExpirationPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExpirationPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExpirationPolicy + * @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.pubsub.v1.ExpirationPolicy; + + /** + * Decodes an ExpirationPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExpirationPolicy + * @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.pubsub.v1.ExpirationPolicy; + + /** + * Verifies an ExpirationPolicy 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 ExpirationPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExpirationPolicy + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.ExpirationPolicy; + + /** + * Creates a plain object from an ExpirationPolicy message. Also converts values to other types if specified. + * @param message ExpirationPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.ExpirationPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExpirationPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExpirationPolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PushConfig. */ + interface IPushConfig { + + /** PushConfig pushEndpoint */ + pushEndpoint?: (string|null); + + /** PushConfig attributes */ + attributes?: ({ [k: string]: string }|null); + + /** PushConfig oidcToken */ + oidcToken?: (google.pubsub.v1.PushConfig.IOidcToken|null); + + /** PushConfig pubsubWrapper */ + pubsubWrapper?: (google.pubsub.v1.PushConfig.IPubsubWrapper|null); + + /** PushConfig noWrapper */ + noWrapper?: (google.pubsub.v1.PushConfig.INoWrapper|null); + } + + /** Represents a PushConfig. */ + class PushConfig implements IPushConfig { + + /** + * Constructs a new PushConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IPushConfig); + + /** PushConfig pushEndpoint. */ + public pushEndpoint: string; + + /** PushConfig attributes. */ + public attributes: { [k: string]: string }; + + /** PushConfig oidcToken. */ + public oidcToken?: (google.pubsub.v1.PushConfig.IOidcToken|null); + + /** PushConfig pubsubWrapper. */ + public pubsubWrapper?: (google.pubsub.v1.PushConfig.IPubsubWrapper|null); + + /** PushConfig noWrapper. */ + public noWrapper?: (google.pubsub.v1.PushConfig.INoWrapper|null); + + /** PushConfig authenticationMethod. */ + public authenticationMethod?: "oidcToken"; + + /** PushConfig wrapper. */ + public wrapper?: ("pubsubWrapper"|"noWrapper"); + + /** + * Creates a new PushConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns PushConfig instance + */ + public static create(properties?: google.pubsub.v1.IPushConfig): google.pubsub.v1.PushConfig; + + /** + * Encodes the specified PushConfig message. Does not implicitly {@link google.pubsub.v1.PushConfig.verify|verify} messages. + * @param message PushConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IPushConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PushConfig message, length delimited. Does not implicitly {@link google.pubsub.v1.PushConfig.verify|verify} messages. + * @param message PushConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IPushConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PushConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PushConfig + * @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.pubsub.v1.PushConfig; + + /** + * Decodes a PushConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PushConfig + * @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.pubsub.v1.PushConfig; + + /** + * Verifies a PushConfig 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 PushConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PushConfig + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.PushConfig; + + /** + * Creates a plain object from a PushConfig message. Also converts values to other types if specified. + * @param message PushConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.PushConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PushConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PushConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace PushConfig { + + /** Properties of an OidcToken. */ + interface IOidcToken { + + /** OidcToken serviceAccountEmail */ + serviceAccountEmail?: (string|null); + + /** OidcToken audience */ + audience?: (string|null); + } + + /** Represents an OidcToken. */ + class OidcToken implements IOidcToken { + + /** + * Constructs a new OidcToken. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.PushConfig.IOidcToken); + + /** OidcToken serviceAccountEmail. */ + public serviceAccountEmail: string; + + /** OidcToken audience. */ + public audience: string; + + /** + * Creates a new OidcToken instance using the specified properties. + * @param [properties] Properties to set + * @returns OidcToken instance + */ + public static create(properties?: google.pubsub.v1.PushConfig.IOidcToken): google.pubsub.v1.PushConfig.OidcToken; + + /** + * Encodes the specified OidcToken message. Does not implicitly {@link google.pubsub.v1.PushConfig.OidcToken.verify|verify} messages. + * @param message OidcToken message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.PushConfig.IOidcToken, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OidcToken message, length delimited. Does not implicitly {@link google.pubsub.v1.PushConfig.OidcToken.verify|verify} messages. + * @param message OidcToken message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.PushConfig.IOidcToken, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OidcToken message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OidcToken + * @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.pubsub.v1.PushConfig.OidcToken; + + /** + * Decodes an OidcToken message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OidcToken + * @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.pubsub.v1.PushConfig.OidcToken; + + /** + * Verifies an OidcToken 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 OidcToken message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OidcToken + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.PushConfig.OidcToken; + + /** + * Creates a plain object from an OidcToken message. Also converts values to other types if specified. + * @param message OidcToken + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.PushConfig.OidcToken, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OidcToken to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OidcToken + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PubsubWrapper. */ + interface IPubsubWrapper { + } + + /** Represents a PubsubWrapper. */ + class PubsubWrapper implements IPubsubWrapper { + + /** + * Constructs a new PubsubWrapper. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.PushConfig.IPubsubWrapper); + + /** + * Creates a new PubsubWrapper instance using the specified properties. + * @param [properties] Properties to set + * @returns PubsubWrapper instance + */ + public static create(properties?: google.pubsub.v1.PushConfig.IPubsubWrapper): google.pubsub.v1.PushConfig.PubsubWrapper; + + /** + * Encodes the specified PubsubWrapper message. Does not implicitly {@link google.pubsub.v1.PushConfig.PubsubWrapper.verify|verify} messages. + * @param message PubsubWrapper message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.PushConfig.IPubsubWrapper, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PubsubWrapper message, length delimited. Does not implicitly {@link google.pubsub.v1.PushConfig.PubsubWrapper.verify|verify} messages. + * @param message PubsubWrapper message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.PushConfig.IPubsubWrapper, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PubsubWrapper message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PubsubWrapper + * @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.pubsub.v1.PushConfig.PubsubWrapper; + + /** + * Decodes a PubsubWrapper message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PubsubWrapper + * @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.pubsub.v1.PushConfig.PubsubWrapper; + + /** + * Verifies a PubsubWrapper 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 PubsubWrapper message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PubsubWrapper + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.PushConfig.PubsubWrapper; + + /** + * Creates a plain object from a PubsubWrapper message. Also converts values to other types if specified. + * @param message PubsubWrapper + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.PushConfig.PubsubWrapper, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PubsubWrapper to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PubsubWrapper + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NoWrapper. */ + interface INoWrapper { + + /** NoWrapper writeMetadata */ + writeMetadata?: (boolean|null); + } + + /** Represents a NoWrapper. */ + class NoWrapper implements INoWrapper { + + /** + * Constructs a new NoWrapper. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.PushConfig.INoWrapper); + + /** NoWrapper writeMetadata. */ + public writeMetadata: boolean; + + /** + * Creates a new NoWrapper instance using the specified properties. + * @param [properties] Properties to set + * @returns NoWrapper instance + */ + public static create(properties?: google.pubsub.v1.PushConfig.INoWrapper): google.pubsub.v1.PushConfig.NoWrapper; + + /** + * Encodes the specified NoWrapper message. Does not implicitly {@link google.pubsub.v1.PushConfig.NoWrapper.verify|verify} messages. + * @param message NoWrapper message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.PushConfig.INoWrapper, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NoWrapper message, length delimited. Does not implicitly {@link google.pubsub.v1.PushConfig.NoWrapper.verify|verify} messages. + * @param message NoWrapper message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.PushConfig.INoWrapper, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NoWrapper message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NoWrapper + * @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.pubsub.v1.PushConfig.NoWrapper; + + /** + * Decodes a NoWrapper message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NoWrapper + * @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.pubsub.v1.PushConfig.NoWrapper; + + /** + * Verifies a NoWrapper 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 NoWrapper message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NoWrapper + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.PushConfig.NoWrapper; + + /** + * Creates a plain object from a NoWrapper message. Also converts values to other types if specified. + * @param message NoWrapper + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.PushConfig.NoWrapper, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NoWrapper to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NoWrapper + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a BigQueryConfig. */ + interface IBigQueryConfig { + + /** BigQueryConfig table */ + table?: (string|null); + + /** BigQueryConfig useTopicSchema */ + useTopicSchema?: (boolean|null); + + /** BigQueryConfig writeMetadata */ + writeMetadata?: (boolean|null); + + /** BigQueryConfig dropUnknownFields */ + dropUnknownFields?: (boolean|null); + + /** BigQueryConfig state */ + state?: (google.pubsub.v1.BigQueryConfig.State|keyof typeof google.pubsub.v1.BigQueryConfig.State|null); + + /** BigQueryConfig useTableSchema */ + useTableSchema?: (boolean|null); + + /** BigQueryConfig serviceAccountEmail */ + serviceAccountEmail?: (string|null); + } + + /** Represents a BigQueryConfig. */ + class BigQueryConfig implements IBigQueryConfig { + + /** + * Constructs a new BigQueryConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IBigQueryConfig); + + /** BigQueryConfig table. */ + public table: string; + + /** BigQueryConfig useTopicSchema. */ + public useTopicSchema: boolean; + + /** BigQueryConfig writeMetadata. */ + public writeMetadata: boolean; + + /** BigQueryConfig dropUnknownFields. */ + public dropUnknownFields: boolean; + + /** BigQueryConfig state. */ + public state: (google.pubsub.v1.BigQueryConfig.State|keyof typeof google.pubsub.v1.BigQueryConfig.State); + + /** BigQueryConfig useTableSchema. */ + public useTableSchema: boolean; + + /** BigQueryConfig serviceAccountEmail. */ + public serviceAccountEmail: string; + + /** + * Creates a new BigQueryConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns BigQueryConfig instance + */ + public static create(properties?: google.pubsub.v1.IBigQueryConfig): google.pubsub.v1.BigQueryConfig; + + /** + * Encodes the specified BigQueryConfig message. Does not implicitly {@link google.pubsub.v1.BigQueryConfig.verify|verify} messages. + * @param message BigQueryConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IBigQueryConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BigQueryConfig message, length delimited. Does not implicitly {@link google.pubsub.v1.BigQueryConfig.verify|verify} messages. + * @param message BigQueryConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IBigQueryConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BigQueryConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BigQueryConfig + * @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.pubsub.v1.BigQueryConfig; + + /** + * Decodes a BigQueryConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BigQueryConfig + * @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.pubsub.v1.BigQueryConfig; + + /** + * Verifies a BigQueryConfig 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 BigQueryConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BigQueryConfig + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.BigQueryConfig; + + /** + * Creates a plain object from a BigQueryConfig message. Also converts values to other types if specified. + * @param message BigQueryConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.BigQueryConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BigQueryConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BigQueryConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace BigQueryConfig { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + ACTIVE = 1, + PERMISSION_DENIED = 2, + NOT_FOUND = 3, + SCHEMA_MISMATCH = 4, + IN_TRANSIT_LOCATION_RESTRICTION = 5 + } + } + + /** Properties of a CloudStorageConfig. */ + interface ICloudStorageConfig { + + /** CloudStorageConfig bucket */ + bucket?: (string|null); + + /** CloudStorageConfig filenamePrefix */ + filenamePrefix?: (string|null); + + /** CloudStorageConfig filenameSuffix */ + filenameSuffix?: (string|null); + + /** CloudStorageConfig filenameDatetimeFormat */ + filenameDatetimeFormat?: (string|null); + + /** CloudStorageConfig textConfig */ + textConfig?: (google.pubsub.v1.CloudStorageConfig.ITextConfig|null); + + /** CloudStorageConfig avroConfig */ + avroConfig?: (google.pubsub.v1.CloudStorageConfig.IAvroConfig|null); + + /** CloudStorageConfig maxDuration */ + maxDuration?: (google.protobuf.IDuration|null); + + /** CloudStorageConfig maxBytes */ + maxBytes?: (number|Long|string|null); + + /** CloudStorageConfig state */ + state?: (google.pubsub.v1.CloudStorageConfig.State|keyof typeof google.pubsub.v1.CloudStorageConfig.State|null); + + /** CloudStorageConfig serviceAccountEmail */ + serviceAccountEmail?: (string|null); + } + + /** Represents a CloudStorageConfig. */ + class CloudStorageConfig implements ICloudStorageConfig { + + /** + * Constructs a new CloudStorageConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.ICloudStorageConfig); + + /** CloudStorageConfig bucket. */ + public bucket: string; + + /** CloudStorageConfig filenamePrefix. */ + public filenamePrefix: string; + + /** CloudStorageConfig filenameSuffix. */ + public filenameSuffix: string; + + /** CloudStorageConfig filenameDatetimeFormat. */ + public filenameDatetimeFormat: string; + + /** CloudStorageConfig textConfig. */ + public textConfig?: (google.pubsub.v1.CloudStorageConfig.ITextConfig|null); + + /** CloudStorageConfig avroConfig. */ + public avroConfig?: (google.pubsub.v1.CloudStorageConfig.IAvroConfig|null); + + /** CloudStorageConfig maxDuration. */ + public maxDuration?: (google.protobuf.IDuration|null); + + /** CloudStorageConfig maxBytes. */ + public maxBytes: (number|Long|string); + + /** CloudStorageConfig state. */ + public state: (google.pubsub.v1.CloudStorageConfig.State|keyof typeof google.pubsub.v1.CloudStorageConfig.State); + + /** CloudStorageConfig serviceAccountEmail. */ + public serviceAccountEmail: string; + + /** CloudStorageConfig outputFormat. */ + public outputFormat?: ("textConfig"|"avroConfig"); + + /** + * Creates a new CloudStorageConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns CloudStorageConfig instance + */ + public static create(properties?: google.pubsub.v1.ICloudStorageConfig): google.pubsub.v1.CloudStorageConfig; + + /** + * Encodes the specified CloudStorageConfig message. Does not implicitly {@link google.pubsub.v1.CloudStorageConfig.verify|verify} messages. + * @param message CloudStorageConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.ICloudStorageConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CloudStorageConfig message, length delimited. Does not implicitly {@link google.pubsub.v1.CloudStorageConfig.verify|verify} messages. + * @param message CloudStorageConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.ICloudStorageConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CloudStorageConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CloudStorageConfig + * @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.pubsub.v1.CloudStorageConfig; + + /** + * Decodes a CloudStorageConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CloudStorageConfig + * @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.pubsub.v1.CloudStorageConfig; + + /** + * Verifies a CloudStorageConfig 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 CloudStorageConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CloudStorageConfig + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.CloudStorageConfig; + + /** + * Creates a plain object from a CloudStorageConfig message. Also converts values to other types if specified. + * @param message CloudStorageConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.CloudStorageConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CloudStorageConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CloudStorageConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace CloudStorageConfig { + + /** Properties of a TextConfig. */ + interface ITextConfig { + } + + /** Represents a TextConfig. */ + class TextConfig implements ITextConfig { + + /** + * Constructs a new TextConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.CloudStorageConfig.ITextConfig); + + /** + * Creates a new TextConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns TextConfig instance + */ + public static create(properties?: google.pubsub.v1.CloudStorageConfig.ITextConfig): google.pubsub.v1.CloudStorageConfig.TextConfig; + + /** + * Encodes the specified TextConfig message. Does not implicitly {@link google.pubsub.v1.CloudStorageConfig.TextConfig.verify|verify} messages. + * @param message TextConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.CloudStorageConfig.ITextConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextConfig message, length delimited. Does not implicitly {@link google.pubsub.v1.CloudStorageConfig.TextConfig.verify|verify} messages. + * @param message TextConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.CloudStorageConfig.ITextConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TextConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TextConfig + * @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.pubsub.v1.CloudStorageConfig.TextConfig; + + /** + * Decodes a TextConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TextConfig + * @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.pubsub.v1.CloudStorageConfig.TextConfig; + + /** + * Verifies a TextConfig 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 TextConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextConfig + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.CloudStorageConfig.TextConfig; + + /** + * Creates a plain object from a TextConfig message. Also converts values to other types if specified. + * @param message TextConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.CloudStorageConfig.TextConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TextConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TextConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AvroConfig. */ + interface IAvroConfig { + + /** AvroConfig writeMetadata */ + writeMetadata?: (boolean|null); + + /** AvroConfig useTopicSchema */ + useTopicSchema?: (boolean|null); + } + + /** Represents an AvroConfig. */ + class AvroConfig implements IAvroConfig { + + /** + * Constructs a new AvroConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.CloudStorageConfig.IAvroConfig); + + /** AvroConfig writeMetadata. */ + public writeMetadata: boolean; + + /** AvroConfig useTopicSchema. */ + public useTopicSchema: boolean; + + /** + * Creates a new AvroConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns AvroConfig instance + */ + public static create(properties?: google.pubsub.v1.CloudStorageConfig.IAvroConfig): google.pubsub.v1.CloudStorageConfig.AvroConfig; + + /** + * Encodes the specified AvroConfig message. Does not implicitly {@link google.pubsub.v1.CloudStorageConfig.AvroConfig.verify|verify} messages. + * @param message AvroConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.CloudStorageConfig.IAvroConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AvroConfig message, length delimited. Does not implicitly {@link google.pubsub.v1.CloudStorageConfig.AvroConfig.verify|verify} messages. + * @param message AvroConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.CloudStorageConfig.IAvroConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AvroConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AvroConfig + * @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.pubsub.v1.CloudStorageConfig.AvroConfig; + + /** + * Decodes an AvroConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AvroConfig + * @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.pubsub.v1.CloudStorageConfig.AvroConfig; + + /** + * Verifies an AvroConfig 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 AvroConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AvroConfig + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.CloudStorageConfig.AvroConfig; + + /** + * Creates a plain object from an AvroConfig message. Also converts values to other types if specified. + * @param message AvroConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.CloudStorageConfig.AvroConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AvroConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AvroConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + ACTIVE = 1, + PERMISSION_DENIED = 2, + NOT_FOUND = 3, + IN_TRANSIT_LOCATION_RESTRICTION = 4, + SCHEMA_MISMATCH = 5 + } + } + + /** Properties of a ReceivedMessage. */ + interface IReceivedMessage { + + /** ReceivedMessage ackId */ + ackId?: (string|null); + + /** ReceivedMessage message */ + message?: (google.pubsub.v1.IPubsubMessage|null); + + /** ReceivedMessage deliveryAttempt */ + deliveryAttempt?: (number|null); + } + + /** Represents a ReceivedMessage. */ + class ReceivedMessage implements IReceivedMessage { + + /** + * Constructs a new ReceivedMessage. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IReceivedMessage); + + /** ReceivedMessage ackId. */ + public ackId: string; + + /** ReceivedMessage message. */ + public message?: (google.pubsub.v1.IPubsubMessage|null); + + /** ReceivedMessage deliveryAttempt. */ + public deliveryAttempt: number; + + /** + * Creates a new ReceivedMessage instance using the specified properties. + * @param [properties] Properties to set + * @returns ReceivedMessage instance + */ + public static create(properties?: google.pubsub.v1.IReceivedMessage): google.pubsub.v1.ReceivedMessage; + + /** + * Encodes the specified ReceivedMessage message. Does not implicitly {@link google.pubsub.v1.ReceivedMessage.verify|verify} messages. + * @param message ReceivedMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IReceivedMessage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReceivedMessage message, length delimited. Does not implicitly {@link google.pubsub.v1.ReceivedMessage.verify|verify} messages. + * @param message ReceivedMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IReceivedMessage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReceivedMessage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReceivedMessage + * @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.pubsub.v1.ReceivedMessage; + + /** + * Decodes a ReceivedMessage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReceivedMessage + * @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.pubsub.v1.ReceivedMessage; + + /** + * Verifies a ReceivedMessage 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 ReceivedMessage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReceivedMessage + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.ReceivedMessage; + + /** + * Creates a plain object from a ReceivedMessage message. Also converts values to other types if specified. + * @param message ReceivedMessage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.ReceivedMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReceivedMessage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReceivedMessage + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetSubscriptionRequest. */ + interface IGetSubscriptionRequest { + + /** GetSubscriptionRequest subscription */ + subscription?: (string|null); + } + + /** Represents a GetSubscriptionRequest. */ + class GetSubscriptionRequest implements IGetSubscriptionRequest { + + /** + * Constructs a new GetSubscriptionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IGetSubscriptionRequest); + + /** GetSubscriptionRequest subscription. */ + public subscription: string; + + /** + * Creates a new GetSubscriptionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetSubscriptionRequest instance + */ + public static create(properties?: google.pubsub.v1.IGetSubscriptionRequest): google.pubsub.v1.GetSubscriptionRequest; + + /** + * Encodes the specified GetSubscriptionRequest message. Does not implicitly {@link google.pubsub.v1.GetSubscriptionRequest.verify|verify} messages. + * @param message GetSubscriptionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IGetSubscriptionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetSubscriptionRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.GetSubscriptionRequest.verify|verify} messages. + * @param message GetSubscriptionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IGetSubscriptionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetSubscriptionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetSubscriptionRequest + * @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.pubsub.v1.GetSubscriptionRequest; + + /** + * Decodes a GetSubscriptionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetSubscriptionRequest + * @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.pubsub.v1.GetSubscriptionRequest; + + /** + * Verifies a GetSubscriptionRequest 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 GetSubscriptionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetSubscriptionRequest + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.GetSubscriptionRequest; + + /** + * Creates a plain object from a GetSubscriptionRequest message. Also converts values to other types if specified. + * @param message GetSubscriptionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.GetSubscriptionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetSubscriptionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetSubscriptionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateSubscriptionRequest. */ + interface IUpdateSubscriptionRequest { + + /** UpdateSubscriptionRequest subscription */ + subscription?: (google.pubsub.v1.ISubscription|null); + + /** UpdateSubscriptionRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateSubscriptionRequest. */ + class UpdateSubscriptionRequest implements IUpdateSubscriptionRequest { + + /** + * Constructs a new UpdateSubscriptionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IUpdateSubscriptionRequest); + + /** UpdateSubscriptionRequest subscription. */ + public subscription?: (google.pubsub.v1.ISubscription|null); + + /** UpdateSubscriptionRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateSubscriptionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateSubscriptionRequest instance + */ + public static create(properties?: google.pubsub.v1.IUpdateSubscriptionRequest): google.pubsub.v1.UpdateSubscriptionRequest; + + /** + * Encodes the specified UpdateSubscriptionRequest message. Does not implicitly {@link google.pubsub.v1.UpdateSubscriptionRequest.verify|verify} messages. + * @param message UpdateSubscriptionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IUpdateSubscriptionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateSubscriptionRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.UpdateSubscriptionRequest.verify|verify} messages. + * @param message UpdateSubscriptionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IUpdateSubscriptionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateSubscriptionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateSubscriptionRequest + * @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.pubsub.v1.UpdateSubscriptionRequest; + + /** + * Decodes an UpdateSubscriptionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateSubscriptionRequest + * @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.pubsub.v1.UpdateSubscriptionRequest; + + /** + * Verifies an UpdateSubscriptionRequest 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 UpdateSubscriptionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateSubscriptionRequest + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.UpdateSubscriptionRequest; + + /** + * Creates a plain object from an UpdateSubscriptionRequest message. Also converts values to other types if specified. + * @param message UpdateSubscriptionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.UpdateSubscriptionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateSubscriptionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateSubscriptionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListSubscriptionsRequest. */ + interface IListSubscriptionsRequest { + + /** ListSubscriptionsRequest project */ + project?: (string|null); + + /** ListSubscriptionsRequest pageSize */ + pageSize?: (number|null); + + /** ListSubscriptionsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListSubscriptionsRequest. */ + class ListSubscriptionsRequest implements IListSubscriptionsRequest { + + /** + * Constructs a new ListSubscriptionsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IListSubscriptionsRequest); + + /** ListSubscriptionsRequest project. */ + public project: string; + + /** ListSubscriptionsRequest pageSize. */ + public pageSize: number; + + /** ListSubscriptionsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListSubscriptionsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSubscriptionsRequest instance + */ + public static create(properties?: google.pubsub.v1.IListSubscriptionsRequest): google.pubsub.v1.ListSubscriptionsRequest; + + /** + * Encodes the specified ListSubscriptionsRequest message. Does not implicitly {@link google.pubsub.v1.ListSubscriptionsRequest.verify|verify} messages. + * @param message ListSubscriptionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IListSubscriptionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSubscriptionsRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.ListSubscriptionsRequest.verify|verify} messages. + * @param message ListSubscriptionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IListSubscriptionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSubscriptionsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSubscriptionsRequest + * @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.pubsub.v1.ListSubscriptionsRequest; + + /** + * Decodes a ListSubscriptionsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSubscriptionsRequest + * @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.pubsub.v1.ListSubscriptionsRequest; + + /** + * Verifies a ListSubscriptionsRequest 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 ListSubscriptionsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSubscriptionsRequest + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.ListSubscriptionsRequest; + + /** + * Creates a plain object from a ListSubscriptionsRequest message. Also converts values to other types if specified. + * @param message ListSubscriptionsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.ListSubscriptionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSubscriptionsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListSubscriptionsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListSubscriptionsResponse. */ + interface IListSubscriptionsResponse { + + /** ListSubscriptionsResponse subscriptions */ + subscriptions?: (google.pubsub.v1.ISubscription[]|null); + + /** ListSubscriptionsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListSubscriptionsResponse. */ + class ListSubscriptionsResponse implements IListSubscriptionsResponse { + + /** + * Constructs a new ListSubscriptionsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IListSubscriptionsResponse); + + /** ListSubscriptionsResponse subscriptions. */ + public subscriptions: google.pubsub.v1.ISubscription[]; + + /** ListSubscriptionsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListSubscriptionsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSubscriptionsResponse instance + */ + public static create(properties?: google.pubsub.v1.IListSubscriptionsResponse): google.pubsub.v1.ListSubscriptionsResponse; + + /** + * Encodes the specified ListSubscriptionsResponse message. Does not implicitly {@link google.pubsub.v1.ListSubscriptionsResponse.verify|verify} messages. + * @param message ListSubscriptionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IListSubscriptionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSubscriptionsResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.ListSubscriptionsResponse.verify|verify} messages. + * @param message ListSubscriptionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IListSubscriptionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSubscriptionsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSubscriptionsResponse + * @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.pubsub.v1.ListSubscriptionsResponse; + + /** + * Decodes a ListSubscriptionsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSubscriptionsResponse + * @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.pubsub.v1.ListSubscriptionsResponse; + + /** + * Verifies a ListSubscriptionsResponse 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 ListSubscriptionsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSubscriptionsResponse + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.ListSubscriptionsResponse; + + /** + * Creates a plain object from a ListSubscriptionsResponse message. Also converts values to other types if specified. + * @param message ListSubscriptionsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.ListSubscriptionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSubscriptionsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListSubscriptionsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteSubscriptionRequest. */ + interface IDeleteSubscriptionRequest { + + /** DeleteSubscriptionRequest subscription */ + subscription?: (string|null); + } + + /** Represents a DeleteSubscriptionRequest. */ + class DeleteSubscriptionRequest implements IDeleteSubscriptionRequest { + + /** + * Constructs a new DeleteSubscriptionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IDeleteSubscriptionRequest); + + /** DeleteSubscriptionRequest subscription. */ + public subscription: string; + + /** + * Creates a new DeleteSubscriptionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteSubscriptionRequest instance + */ + public static create(properties?: google.pubsub.v1.IDeleteSubscriptionRequest): google.pubsub.v1.DeleteSubscriptionRequest; + + /** + * Encodes the specified DeleteSubscriptionRequest message. Does not implicitly {@link google.pubsub.v1.DeleteSubscriptionRequest.verify|verify} messages. + * @param message DeleteSubscriptionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IDeleteSubscriptionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteSubscriptionRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.DeleteSubscriptionRequest.verify|verify} messages. + * @param message DeleteSubscriptionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IDeleteSubscriptionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteSubscriptionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteSubscriptionRequest + * @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.pubsub.v1.DeleteSubscriptionRequest; + + /** + * Decodes a DeleteSubscriptionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteSubscriptionRequest + * @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.pubsub.v1.DeleteSubscriptionRequest; + + /** + * Verifies a DeleteSubscriptionRequest 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 DeleteSubscriptionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteSubscriptionRequest + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.DeleteSubscriptionRequest; + + /** + * Creates a plain object from a DeleteSubscriptionRequest message. Also converts values to other types if specified. + * @param message DeleteSubscriptionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.DeleteSubscriptionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteSubscriptionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteSubscriptionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ModifyPushConfigRequest. */ + interface IModifyPushConfigRequest { + + /** ModifyPushConfigRequest subscription */ + subscription?: (string|null); + + /** ModifyPushConfigRequest pushConfig */ + pushConfig?: (google.pubsub.v1.IPushConfig|null); + } + + /** Represents a ModifyPushConfigRequest. */ + class ModifyPushConfigRequest implements IModifyPushConfigRequest { + + /** + * Constructs a new ModifyPushConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IModifyPushConfigRequest); + + /** ModifyPushConfigRequest subscription. */ + public subscription: string; + + /** ModifyPushConfigRequest pushConfig. */ + public pushConfig?: (google.pubsub.v1.IPushConfig|null); + + /** + * Creates a new ModifyPushConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ModifyPushConfigRequest instance + */ + public static create(properties?: google.pubsub.v1.IModifyPushConfigRequest): google.pubsub.v1.ModifyPushConfigRequest; + + /** + * Encodes the specified ModifyPushConfigRequest message. Does not implicitly {@link google.pubsub.v1.ModifyPushConfigRequest.verify|verify} messages. + * @param message ModifyPushConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IModifyPushConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ModifyPushConfigRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.ModifyPushConfigRequest.verify|verify} messages. + * @param message ModifyPushConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IModifyPushConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ModifyPushConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ModifyPushConfigRequest + * @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.pubsub.v1.ModifyPushConfigRequest; + + /** + * Decodes a ModifyPushConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ModifyPushConfigRequest + * @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.pubsub.v1.ModifyPushConfigRequest; + + /** + * Verifies a ModifyPushConfigRequest 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 ModifyPushConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ModifyPushConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.ModifyPushConfigRequest; + + /** + * Creates a plain object from a ModifyPushConfigRequest message. Also converts values to other types if specified. + * @param message ModifyPushConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.ModifyPushConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ModifyPushConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ModifyPushConfigRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PullRequest. */ + interface IPullRequest { + + /** PullRequest subscription */ + subscription?: (string|null); + + /** PullRequest returnImmediately */ + returnImmediately?: (boolean|null); + + /** PullRequest maxMessages */ + maxMessages?: (number|null); + } + + /** Represents a PullRequest. */ + class PullRequest implements IPullRequest { + + /** + * Constructs a new PullRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IPullRequest); + + /** PullRequest subscription. */ + public subscription: string; + + /** PullRequest returnImmediately. */ + public returnImmediately: boolean; + + /** PullRequest maxMessages. */ + public maxMessages: number; + + /** + * Creates a new PullRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns PullRequest instance + */ + public static create(properties?: google.pubsub.v1.IPullRequest): google.pubsub.v1.PullRequest; + + /** + * Encodes the specified PullRequest message. Does not implicitly {@link google.pubsub.v1.PullRequest.verify|verify} messages. + * @param message PullRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IPullRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PullRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.PullRequest.verify|verify} messages. + * @param message PullRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IPullRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PullRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PullRequest + * @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.pubsub.v1.PullRequest; + + /** + * Decodes a PullRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PullRequest + * @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.pubsub.v1.PullRequest; + + /** + * Verifies a PullRequest 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 PullRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PullRequest + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.PullRequest; + + /** + * Creates a plain object from a PullRequest message. Also converts values to other types if specified. + * @param message PullRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.PullRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PullRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PullRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PullResponse. */ + interface IPullResponse { + + /** PullResponse receivedMessages */ + receivedMessages?: (google.pubsub.v1.IReceivedMessage[]|null); + } + + /** Represents a PullResponse. */ + class PullResponse implements IPullResponse { + + /** + * Constructs a new PullResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IPullResponse); + + /** PullResponse receivedMessages. */ + public receivedMessages: google.pubsub.v1.IReceivedMessage[]; + + /** + * Creates a new PullResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns PullResponse instance + */ + public static create(properties?: google.pubsub.v1.IPullResponse): google.pubsub.v1.PullResponse; + + /** + * Encodes the specified PullResponse message. Does not implicitly {@link google.pubsub.v1.PullResponse.verify|verify} messages. + * @param message PullResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IPullResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PullResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.PullResponse.verify|verify} messages. + * @param message PullResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IPullResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PullResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PullResponse + * @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.pubsub.v1.PullResponse; + + /** + * Decodes a PullResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PullResponse + * @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.pubsub.v1.PullResponse; + + /** + * Verifies a PullResponse 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 PullResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PullResponse + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.PullResponse; + + /** + * Creates a plain object from a PullResponse message. Also converts values to other types if specified. + * @param message PullResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.PullResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PullResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PullResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ModifyAckDeadlineRequest. */ + interface IModifyAckDeadlineRequest { + + /** ModifyAckDeadlineRequest subscription */ + subscription?: (string|null); + + /** ModifyAckDeadlineRequest ackIds */ + ackIds?: (string[]|null); + + /** ModifyAckDeadlineRequest ackDeadlineSeconds */ + ackDeadlineSeconds?: (number|null); + } + + /** Represents a ModifyAckDeadlineRequest. */ + class ModifyAckDeadlineRequest implements IModifyAckDeadlineRequest { + + /** + * Constructs a new ModifyAckDeadlineRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IModifyAckDeadlineRequest); + + /** ModifyAckDeadlineRequest subscription. */ + public subscription: string; + + /** ModifyAckDeadlineRequest ackIds. */ + public ackIds: string[]; + + /** ModifyAckDeadlineRequest ackDeadlineSeconds. */ + public ackDeadlineSeconds: number; + + /** + * Creates a new ModifyAckDeadlineRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ModifyAckDeadlineRequest instance + */ + public static create(properties?: google.pubsub.v1.IModifyAckDeadlineRequest): google.pubsub.v1.ModifyAckDeadlineRequest; + + /** + * Encodes the specified ModifyAckDeadlineRequest message. Does not implicitly {@link google.pubsub.v1.ModifyAckDeadlineRequest.verify|verify} messages. + * @param message ModifyAckDeadlineRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IModifyAckDeadlineRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ModifyAckDeadlineRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.ModifyAckDeadlineRequest.verify|verify} messages. + * @param message ModifyAckDeadlineRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IModifyAckDeadlineRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ModifyAckDeadlineRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ModifyAckDeadlineRequest + * @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.pubsub.v1.ModifyAckDeadlineRequest; + + /** + * Decodes a ModifyAckDeadlineRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ModifyAckDeadlineRequest + * @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.pubsub.v1.ModifyAckDeadlineRequest; + + /** + * Verifies a ModifyAckDeadlineRequest 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 ModifyAckDeadlineRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ModifyAckDeadlineRequest + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.ModifyAckDeadlineRequest; + + /** + * Creates a plain object from a ModifyAckDeadlineRequest message. Also converts values to other types if specified. + * @param message ModifyAckDeadlineRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.ModifyAckDeadlineRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ModifyAckDeadlineRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ModifyAckDeadlineRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AcknowledgeRequest. */ + interface IAcknowledgeRequest { + + /** AcknowledgeRequest subscription */ + subscription?: (string|null); + + /** AcknowledgeRequest ackIds */ + ackIds?: (string[]|null); + } + + /** Represents an AcknowledgeRequest. */ + class AcknowledgeRequest implements IAcknowledgeRequest { + + /** + * Constructs a new AcknowledgeRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IAcknowledgeRequest); + + /** AcknowledgeRequest subscription. */ + public subscription: string; + + /** AcknowledgeRequest ackIds. */ + public ackIds: string[]; + + /** + * Creates a new AcknowledgeRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AcknowledgeRequest instance + */ + public static create(properties?: google.pubsub.v1.IAcknowledgeRequest): google.pubsub.v1.AcknowledgeRequest; + + /** + * Encodes the specified AcknowledgeRequest message. Does not implicitly {@link google.pubsub.v1.AcknowledgeRequest.verify|verify} messages. + * @param message AcknowledgeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IAcknowledgeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AcknowledgeRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.AcknowledgeRequest.verify|verify} messages. + * @param message AcknowledgeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IAcknowledgeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AcknowledgeRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AcknowledgeRequest + * @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.pubsub.v1.AcknowledgeRequest; + + /** + * Decodes an AcknowledgeRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AcknowledgeRequest + * @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.pubsub.v1.AcknowledgeRequest; + + /** + * Verifies an AcknowledgeRequest 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 AcknowledgeRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AcknowledgeRequest + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.AcknowledgeRequest; + + /** + * Creates a plain object from an AcknowledgeRequest message. Also converts values to other types if specified. + * @param message AcknowledgeRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.AcknowledgeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AcknowledgeRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AcknowledgeRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StreamingPullRequest. */ + interface IStreamingPullRequest { + + /** StreamingPullRequest subscription */ + subscription?: (string|null); + + /** StreamingPullRequest ackIds */ + ackIds?: (string[]|null); + + /** StreamingPullRequest modifyDeadlineSeconds */ + modifyDeadlineSeconds?: (number[]|null); + + /** StreamingPullRequest modifyDeadlineAckIds */ + modifyDeadlineAckIds?: (string[]|null); + + /** StreamingPullRequest streamAckDeadlineSeconds */ + streamAckDeadlineSeconds?: (number|null); + + /** StreamingPullRequest clientId */ + clientId?: (string|null); + + /** StreamingPullRequest maxOutstandingMessages */ + maxOutstandingMessages?: (number|Long|string|null); + + /** StreamingPullRequest maxOutstandingBytes */ + maxOutstandingBytes?: (number|Long|string|null); + } + + /** Represents a StreamingPullRequest. */ + class StreamingPullRequest implements IStreamingPullRequest { + + /** + * Constructs a new StreamingPullRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IStreamingPullRequest); + + /** StreamingPullRequest subscription. */ + public subscription: string; + + /** StreamingPullRequest ackIds. */ + public ackIds: string[]; + + /** StreamingPullRequest modifyDeadlineSeconds. */ + public modifyDeadlineSeconds: number[]; + + /** StreamingPullRequest modifyDeadlineAckIds. */ + public modifyDeadlineAckIds: string[]; + + /** StreamingPullRequest streamAckDeadlineSeconds. */ + public streamAckDeadlineSeconds: number; + + /** StreamingPullRequest clientId. */ + public clientId: string; + + /** StreamingPullRequest maxOutstandingMessages. */ + public maxOutstandingMessages: (number|Long|string); + + /** StreamingPullRequest maxOutstandingBytes. */ + public maxOutstandingBytes: (number|Long|string); + + /** + * Creates a new StreamingPullRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns StreamingPullRequest instance + */ + public static create(properties?: google.pubsub.v1.IStreamingPullRequest): google.pubsub.v1.StreamingPullRequest; + + /** + * Encodes the specified StreamingPullRequest message. Does not implicitly {@link google.pubsub.v1.StreamingPullRequest.verify|verify} messages. + * @param message StreamingPullRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IStreamingPullRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StreamingPullRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.StreamingPullRequest.verify|verify} messages. + * @param message StreamingPullRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IStreamingPullRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StreamingPullRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StreamingPullRequest + * @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.pubsub.v1.StreamingPullRequest; + + /** + * Decodes a StreamingPullRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StreamingPullRequest + * @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.pubsub.v1.StreamingPullRequest; + + /** + * Verifies a StreamingPullRequest 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 StreamingPullRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StreamingPullRequest + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.StreamingPullRequest; + + /** + * Creates a plain object from a StreamingPullRequest message. Also converts values to other types if specified. + * @param message StreamingPullRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.StreamingPullRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StreamingPullRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StreamingPullRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StreamingPullResponse. */ + interface IStreamingPullResponse { + + /** StreamingPullResponse receivedMessages */ + receivedMessages?: (google.pubsub.v1.IReceivedMessage[]|null); + + /** StreamingPullResponse acknowledgeConfirmation */ + acknowledgeConfirmation?: (google.pubsub.v1.StreamingPullResponse.IAcknowledgeConfirmation|null); + + /** StreamingPullResponse modifyAckDeadlineConfirmation */ + modifyAckDeadlineConfirmation?: (google.pubsub.v1.StreamingPullResponse.IModifyAckDeadlineConfirmation|null); + + /** StreamingPullResponse subscriptionProperties */ + subscriptionProperties?: (google.pubsub.v1.StreamingPullResponse.ISubscriptionProperties|null); + } + + /** Represents a StreamingPullResponse. */ + class StreamingPullResponse implements IStreamingPullResponse { + + /** + * Constructs a new StreamingPullResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IStreamingPullResponse); + + /** StreamingPullResponse receivedMessages. */ + public receivedMessages: google.pubsub.v1.IReceivedMessage[]; + + /** StreamingPullResponse acknowledgeConfirmation. */ + public acknowledgeConfirmation?: (google.pubsub.v1.StreamingPullResponse.IAcknowledgeConfirmation|null); + + /** StreamingPullResponse modifyAckDeadlineConfirmation. */ + public modifyAckDeadlineConfirmation?: (google.pubsub.v1.StreamingPullResponse.IModifyAckDeadlineConfirmation|null); + + /** StreamingPullResponse subscriptionProperties. */ + public subscriptionProperties?: (google.pubsub.v1.StreamingPullResponse.ISubscriptionProperties|null); + + /** + * Creates a new StreamingPullResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns StreamingPullResponse instance + */ + public static create(properties?: google.pubsub.v1.IStreamingPullResponse): google.pubsub.v1.StreamingPullResponse; + + /** + * Encodes the specified StreamingPullResponse message. Does not implicitly {@link google.pubsub.v1.StreamingPullResponse.verify|verify} messages. + * @param message StreamingPullResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IStreamingPullResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StreamingPullResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.StreamingPullResponse.verify|verify} messages. + * @param message StreamingPullResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IStreamingPullResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StreamingPullResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StreamingPullResponse + * @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.pubsub.v1.StreamingPullResponse; + + /** + * Decodes a StreamingPullResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StreamingPullResponse + * @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.pubsub.v1.StreamingPullResponse; + + /** + * Verifies a StreamingPullResponse 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 StreamingPullResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StreamingPullResponse + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.StreamingPullResponse; + + /** + * Creates a plain object from a StreamingPullResponse message. Also converts values to other types if specified. + * @param message StreamingPullResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.StreamingPullResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StreamingPullResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StreamingPullResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace StreamingPullResponse { + + /** Properties of an AcknowledgeConfirmation. */ + interface IAcknowledgeConfirmation { + + /** AcknowledgeConfirmation ackIds */ + ackIds?: (string[]|null); + + /** AcknowledgeConfirmation invalidAckIds */ + invalidAckIds?: (string[]|null); + + /** AcknowledgeConfirmation unorderedAckIds */ + unorderedAckIds?: (string[]|null); + + /** AcknowledgeConfirmation temporaryFailedAckIds */ + temporaryFailedAckIds?: (string[]|null); + } + + /** Represents an AcknowledgeConfirmation. */ + class AcknowledgeConfirmation implements IAcknowledgeConfirmation { + + /** + * Constructs a new AcknowledgeConfirmation. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.StreamingPullResponse.IAcknowledgeConfirmation); + + /** AcknowledgeConfirmation ackIds. */ + public ackIds: string[]; + + /** AcknowledgeConfirmation invalidAckIds. */ + public invalidAckIds: string[]; + + /** AcknowledgeConfirmation unorderedAckIds. */ + public unorderedAckIds: string[]; + + /** AcknowledgeConfirmation temporaryFailedAckIds. */ + public temporaryFailedAckIds: string[]; + + /** + * Creates a new AcknowledgeConfirmation instance using the specified properties. + * @param [properties] Properties to set + * @returns AcknowledgeConfirmation instance + */ + public static create(properties?: google.pubsub.v1.StreamingPullResponse.IAcknowledgeConfirmation): google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation; + + /** + * Encodes the specified AcknowledgeConfirmation message. Does not implicitly {@link google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation.verify|verify} messages. + * @param message AcknowledgeConfirmation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.StreamingPullResponse.IAcknowledgeConfirmation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AcknowledgeConfirmation message, length delimited. Does not implicitly {@link google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation.verify|verify} messages. + * @param message AcknowledgeConfirmation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.StreamingPullResponse.IAcknowledgeConfirmation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AcknowledgeConfirmation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AcknowledgeConfirmation + * @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.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation; + + /** + * Decodes an AcknowledgeConfirmation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AcknowledgeConfirmation + * @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.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation; + + /** + * Verifies an AcknowledgeConfirmation 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 AcknowledgeConfirmation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AcknowledgeConfirmation + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation; + + /** + * Creates a plain object from an AcknowledgeConfirmation message. Also converts values to other types if specified. + * @param message AcknowledgeConfirmation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AcknowledgeConfirmation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AcknowledgeConfirmation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ModifyAckDeadlineConfirmation. */ + interface IModifyAckDeadlineConfirmation { + + /** ModifyAckDeadlineConfirmation ackIds */ + ackIds?: (string[]|null); + + /** ModifyAckDeadlineConfirmation invalidAckIds */ + invalidAckIds?: (string[]|null); + + /** ModifyAckDeadlineConfirmation temporaryFailedAckIds */ + temporaryFailedAckIds?: (string[]|null); + } + + /** Represents a ModifyAckDeadlineConfirmation. */ + class ModifyAckDeadlineConfirmation implements IModifyAckDeadlineConfirmation { + + /** + * Constructs a new ModifyAckDeadlineConfirmation. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.StreamingPullResponse.IModifyAckDeadlineConfirmation); + + /** ModifyAckDeadlineConfirmation ackIds. */ + public ackIds: string[]; + + /** ModifyAckDeadlineConfirmation invalidAckIds. */ + public invalidAckIds: string[]; + + /** ModifyAckDeadlineConfirmation temporaryFailedAckIds. */ + public temporaryFailedAckIds: string[]; + + /** + * Creates a new ModifyAckDeadlineConfirmation instance using the specified properties. + * @param [properties] Properties to set + * @returns ModifyAckDeadlineConfirmation instance + */ + public static create(properties?: google.pubsub.v1.StreamingPullResponse.IModifyAckDeadlineConfirmation): google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation; + + /** + * Encodes the specified ModifyAckDeadlineConfirmation message. Does not implicitly {@link google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation.verify|verify} messages. + * @param message ModifyAckDeadlineConfirmation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.StreamingPullResponse.IModifyAckDeadlineConfirmation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ModifyAckDeadlineConfirmation message, length delimited. Does not implicitly {@link google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation.verify|verify} messages. + * @param message ModifyAckDeadlineConfirmation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.StreamingPullResponse.IModifyAckDeadlineConfirmation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ModifyAckDeadlineConfirmation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ModifyAckDeadlineConfirmation + * @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.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation; + + /** + * Decodes a ModifyAckDeadlineConfirmation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ModifyAckDeadlineConfirmation + * @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.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation; + + /** + * Verifies a ModifyAckDeadlineConfirmation 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 ModifyAckDeadlineConfirmation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ModifyAckDeadlineConfirmation + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation; + + /** + * Creates a plain object from a ModifyAckDeadlineConfirmation message. Also converts values to other types if specified. + * @param message ModifyAckDeadlineConfirmation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ModifyAckDeadlineConfirmation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ModifyAckDeadlineConfirmation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SubscriptionProperties. */ + interface ISubscriptionProperties { + + /** SubscriptionProperties exactlyOnceDeliveryEnabled */ + exactlyOnceDeliveryEnabled?: (boolean|null); + + /** SubscriptionProperties messageOrderingEnabled */ + messageOrderingEnabled?: (boolean|null); + } + + /** Represents a SubscriptionProperties. */ + class SubscriptionProperties implements ISubscriptionProperties { + + /** + * Constructs a new SubscriptionProperties. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.StreamingPullResponse.ISubscriptionProperties); + + /** SubscriptionProperties exactlyOnceDeliveryEnabled. */ + public exactlyOnceDeliveryEnabled: boolean; + + /** SubscriptionProperties messageOrderingEnabled. */ + public messageOrderingEnabled: boolean; + + /** + * Creates a new SubscriptionProperties instance using the specified properties. + * @param [properties] Properties to set + * @returns SubscriptionProperties instance + */ + public static create(properties?: google.pubsub.v1.StreamingPullResponse.ISubscriptionProperties): google.pubsub.v1.StreamingPullResponse.SubscriptionProperties; + + /** + * Encodes the specified SubscriptionProperties message. Does not implicitly {@link google.pubsub.v1.StreamingPullResponse.SubscriptionProperties.verify|verify} messages. + * @param message SubscriptionProperties message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.StreamingPullResponse.ISubscriptionProperties, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SubscriptionProperties message, length delimited. Does not implicitly {@link google.pubsub.v1.StreamingPullResponse.SubscriptionProperties.verify|verify} messages. + * @param message SubscriptionProperties message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.StreamingPullResponse.ISubscriptionProperties, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SubscriptionProperties message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SubscriptionProperties + * @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.pubsub.v1.StreamingPullResponse.SubscriptionProperties; + + /** + * Decodes a SubscriptionProperties message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SubscriptionProperties + * @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.pubsub.v1.StreamingPullResponse.SubscriptionProperties; + + /** + * Verifies a SubscriptionProperties 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 SubscriptionProperties message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SubscriptionProperties + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.StreamingPullResponse.SubscriptionProperties; + + /** + * Creates a plain object from a SubscriptionProperties message. Also converts values to other types if specified. + * @param message SubscriptionProperties + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.StreamingPullResponse.SubscriptionProperties, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SubscriptionProperties to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SubscriptionProperties + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a CreateSnapshotRequest. */ + interface ICreateSnapshotRequest { + + /** CreateSnapshotRequest name */ + name?: (string|null); + + /** CreateSnapshotRequest subscription */ + subscription?: (string|null); + + /** CreateSnapshotRequest labels */ + labels?: ({ [k: string]: string }|null); + } + + /** Represents a CreateSnapshotRequest. */ + class CreateSnapshotRequest implements ICreateSnapshotRequest { + + /** + * Constructs a new CreateSnapshotRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.ICreateSnapshotRequest); + + /** CreateSnapshotRequest name. */ + public name: string; + + /** CreateSnapshotRequest subscription. */ + public subscription: string; + + /** CreateSnapshotRequest labels. */ + public labels: { [k: string]: string }; + + /** + * Creates a new CreateSnapshotRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateSnapshotRequest instance + */ + public static create(properties?: google.pubsub.v1.ICreateSnapshotRequest): google.pubsub.v1.CreateSnapshotRequest; + + /** + * Encodes the specified CreateSnapshotRequest message. Does not implicitly {@link google.pubsub.v1.CreateSnapshotRequest.verify|verify} messages. + * @param message CreateSnapshotRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.ICreateSnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateSnapshotRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.CreateSnapshotRequest.verify|verify} messages. + * @param message CreateSnapshotRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.ICreateSnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateSnapshotRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateSnapshotRequest + * @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.pubsub.v1.CreateSnapshotRequest; + + /** + * Decodes a CreateSnapshotRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateSnapshotRequest + * @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.pubsub.v1.CreateSnapshotRequest; + + /** + * Verifies a CreateSnapshotRequest 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 CreateSnapshotRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateSnapshotRequest + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.CreateSnapshotRequest; + + /** + * Creates a plain object from a CreateSnapshotRequest message. Also converts values to other types if specified. + * @param message CreateSnapshotRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.CreateSnapshotRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateSnapshotRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateSnapshotRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateSnapshotRequest. */ + interface IUpdateSnapshotRequest { + + /** UpdateSnapshotRequest snapshot */ + snapshot?: (google.pubsub.v1.ISnapshot|null); + + /** UpdateSnapshotRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateSnapshotRequest. */ + class UpdateSnapshotRequest implements IUpdateSnapshotRequest { + + /** + * Constructs a new UpdateSnapshotRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IUpdateSnapshotRequest); + + /** UpdateSnapshotRequest snapshot. */ + public snapshot?: (google.pubsub.v1.ISnapshot|null); + + /** UpdateSnapshotRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateSnapshotRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateSnapshotRequest instance + */ + public static create(properties?: google.pubsub.v1.IUpdateSnapshotRequest): google.pubsub.v1.UpdateSnapshotRequest; + + /** + * Encodes the specified UpdateSnapshotRequest message. Does not implicitly {@link google.pubsub.v1.UpdateSnapshotRequest.verify|verify} messages. + * @param message UpdateSnapshotRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IUpdateSnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateSnapshotRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.UpdateSnapshotRequest.verify|verify} messages. + * @param message UpdateSnapshotRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IUpdateSnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateSnapshotRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateSnapshotRequest + * @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.pubsub.v1.UpdateSnapshotRequest; + + /** + * Decodes an UpdateSnapshotRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateSnapshotRequest + * @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.pubsub.v1.UpdateSnapshotRequest; + + /** + * Verifies an UpdateSnapshotRequest 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 UpdateSnapshotRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateSnapshotRequest + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.UpdateSnapshotRequest; + + /** + * Creates a plain object from an UpdateSnapshotRequest message. Also converts values to other types if specified. + * @param message UpdateSnapshotRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.UpdateSnapshotRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateSnapshotRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateSnapshotRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Snapshot. */ + interface ISnapshot { + + /** Snapshot name */ + name?: (string|null); + + /** Snapshot topic */ + topic?: (string|null); + + /** Snapshot expireTime */ + expireTime?: (google.protobuf.ITimestamp|null); + + /** Snapshot labels */ + labels?: ({ [k: string]: string }|null); + } + + /** Represents a Snapshot. */ + class Snapshot implements ISnapshot { + + /** + * Constructs a new Snapshot. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.ISnapshot); + + /** Snapshot name. */ + public name: string; + + /** Snapshot topic. */ + public topic: string; + + /** Snapshot expireTime. */ + public expireTime?: (google.protobuf.ITimestamp|null); + + /** Snapshot labels. */ + public labels: { [k: string]: string }; + + /** + * Creates a new Snapshot instance using the specified properties. + * @param [properties] Properties to set + * @returns Snapshot instance + */ + public static create(properties?: google.pubsub.v1.ISnapshot): google.pubsub.v1.Snapshot; + + /** + * Encodes the specified Snapshot message. Does not implicitly {@link google.pubsub.v1.Snapshot.verify|verify} messages. + * @param message Snapshot message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.ISnapshot, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Snapshot message, length delimited. Does not implicitly {@link google.pubsub.v1.Snapshot.verify|verify} messages. + * @param message Snapshot message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.ISnapshot, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Snapshot message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Snapshot + * @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.pubsub.v1.Snapshot; + + /** + * Decodes a Snapshot message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Snapshot + * @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.pubsub.v1.Snapshot; + + /** + * Verifies a Snapshot 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 Snapshot message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Snapshot + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.Snapshot; + + /** + * Creates a plain object from a Snapshot message. Also converts values to other types if specified. + * @param message Snapshot + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.Snapshot, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Snapshot to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Snapshot + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetSnapshotRequest. */ + interface IGetSnapshotRequest { + + /** GetSnapshotRequest snapshot */ + snapshot?: (string|null); + } + + /** Represents a GetSnapshotRequest. */ + class GetSnapshotRequest implements IGetSnapshotRequest { + + /** + * Constructs a new GetSnapshotRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IGetSnapshotRequest); + + /** GetSnapshotRequest snapshot. */ + public snapshot: string; + + /** + * Creates a new GetSnapshotRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetSnapshotRequest instance + */ + public static create(properties?: google.pubsub.v1.IGetSnapshotRequest): google.pubsub.v1.GetSnapshotRequest; + + /** + * Encodes the specified GetSnapshotRequest message. Does not implicitly {@link google.pubsub.v1.GetSnapshotRequest.verify|verify} messages. + * @param message GetSnapshotRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IGetSnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetSnapshotRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.GetSnapshotRequest.verify|verify} messages. + * @param message GetSnapshotRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IGetSnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetSnapshotRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetSnapshotRequest + * @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.pubsub.v1.GetSnapshotRequest; + + /** + * Decodes a GetSnapshotRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetSnapshotRequest + * @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.pubsub.v1.GetSnapshotRequest; + + /** + * Verifies a GetSnapshotRequest 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 GetSnapshotRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetSnapshotRequest + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.GetSnapshotRequest; + + /** + * Creates a plain object from a GetSnapshotRequest message. Also converts values to other types if specified. + * @param message GetSnapshotRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.GetSnapshotRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetSnapshotRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetSnapshotRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListSnapshotsRequest. */ + interface IListSnapshotsRequest { + + /** ListSnapshotsRequest project */ + project?: (string|null); + + /** ListSnapshotsRequest pageSize */ + pageSize?: (number|null); + + /** ListSnapshotsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListSnapshotsRequest. */ + class ListSnapshotsRequest implements IListSnapshotsRequest { + + /** + * Constructs a new ListSnapshotsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IListSnapshotsRequest); + + /** ListSnapshotsRequest project. */ + public project: string; + + /** ListSnapshotsRequest pageSize. */ + public pageSize: number; + + /** ListSnapshotsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListSnapshotsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSnapshotsRequest instance + */ + public static create(properties?: google.pubsub.v1.IListSnapshotsRequest): google.pubsub.v1.ListSnapshotsRequest; + + /** + * Encodes the specified ListSnapshotsRequest message. Does not implicitly {@link google.pubsub.v1.ListSnapshotsRequest.verify|verify} messages. + * @param message ListSnapshotsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IListSnapshotsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSnapshotsRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.ListSnapshotsRequest.verify|verify} messages. + * @param message ListSnapshotsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IListSnapshotsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSnapshotsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSnapshotsRequest + * @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.pubsub.v1.ListSnapshotsRequest; + + /** + * Decodes a ListSnapshotsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSnapshotsRequest + * @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.pubsub.v1.ListSnapshotsRequest; + + /** + * Verifies a ListSnapshotsRequest 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 ListSnapshotsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSnapshotsRequest + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.ListSnapshotsRequest; + + /** + * Creates a plain object from a ListSnapshotsRequest message. Also converts values to other types if specified. + * @param message ListSnapshotsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.ListSnapshotsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSnapshotsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListSnapshotsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListSnapshotsResponse. */ + interface IListSnapshotsResponse { + + /** ListSnapshotsResponse snapshots */ + snapshots?: (google.pubsub.v1.ISnapshot[]|null); + + /** ListSnapshotsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListSnapshotsResponse. */ + class ListSnapshotsResponse implements IListSnapshotsResponse { + + /** + * Constructs a new ListSnapshotsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IListSnapshotsResponse); + + /** ListSnapshotsResponse snapshots. */ + public snapshots: google.pubsub.v1.ISnapshot[]; + + /** ListSnapshotsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListSnapshotsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSnapshotsResponse instance + */ + public static create(properties?: google.pubsub.v1.IListSnapshotsResponse): google.pubsub.v1.ListSnapshotsResponse; + + /** + * Encodes the specified ListSnapshotsResponse message. Does not implicitly {@link google.pubsub.v1.ListSnapshotsResponse.verify|verify} messages. + * @param message ListSnapshotsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IListSnapshotsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSnapshotsResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.ListSnapshotsResponse.verify|verify} messages. + * @param message ListSnapshotsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IListSnapshotsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSnapshotsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSnapshotsResponse + * @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.pubsub.v1.ListSnapshotsResponse; + + /** + * Decodes a ListSnapshotsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSnapshotsResponse + * @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.pubsub.v1.ListSnapshotsResponse; + + /** + * Verifies a ListSnapshotsResponse 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 ListSnapshotsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSnapshotsResponse + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.ListSnapshotsResponse; + + /** + * Creates a plain object from a ListSnapshotsResponse message. Also converts values to other types if specified. + * @param message ListSnapshotsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.ListSnapshotsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSnapshotsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListSnapshotsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteSnapshotRequest. */ + interface IDeleteSnapshotRequest { + + /** DeleteSnapshotRequest snapshot */ + snapshot?: (string|null); + } + + /** Represents a DeleteSnapshotRequest. */ + class DeleteSnapshotRequest implements IDeleteSnapshotRequest { + + /** + * Constructs a new DeleteSnapshotRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IDeleteSnapshotRequest); + + /** DeleteSnapshotRequest snapshot. */ + public snapshot: string; + + /** + * Creates a new DeleteSnapshotRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteSnapshotRequest instance + */ + public static create(properties?: google.pubsub.v1.IDeleteSnapshotRequest): google.pubsub.v1.DeleteSnapshotRequest; + + /** + * Encodes the specified DeleteSnapshotRequest message. Does not implicitly {@link google.pubsub.v1.DeleteSnapshotRequest.verify|verify} messages. + * @param message DeleteSnapshotRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IDeleteSnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteSnapshotRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.DeleteSnapshotRequest.verify|verify} messages. + * @param message DeleteSnapshotRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IDeleteSnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteSnapshotRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteSnapshotRequest + * @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.pubsub.v1.DeleteSnapshotRequest; + + /** + * Decodes a DeleteSnapshotRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteSnapshotRequest + * @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.pubsub.v1.DeleteSnapshotRequest; + + /** + * Verifies a DeleteSnapshotRequest 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 DeleteSnapshotRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteSnapshotRequest + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.DeleteSnapshotRequest; + + /** + * Creates a plain object from a DeleteSnapshotRequest message. Also converts values to other types if specified. + * @param message DeleteSnapshotRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.DeleteSnapshotRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteSnapshotRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteSnapshotRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SeekRequest. */ + interface ISeekRequest { + + /** SeekRequest subscription */ + subscription?: (string|null); + + /** SeekRequest time */ + time?: (google.protobuf.ITimestamp|null); + + /** SeekRequest snapshot */ + snapshot?: (string|null); + } + + /** Represents a SeekRequest. */ + class SeekRequest implements ISeekRequest { + + /** + * Constructs a new SeekRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.ISeekRequest); + + /** SeekRequest subscription. */ + public subscription: string; + + /** SeekRequest time. */ + public time?: (google.protobuf.ITimestamp|null); + + /** SeekRequest snapshot. */ + public snapshot?: (string|null); + + /** SeekRequest target. */ + public target?: ("time"|"snapshot"); + + /** + * Creates a new SeekRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SeekRequest instance + */ + public static create(properties?: google.pubsub.v1.ISeekRequest): google.pubsub.v1.SeekRequest; + + /** + * Encodes the specified SeekRequest message. Does not implicitly {@link google.pubsub.v1.SeekRequest.verify|verify} messages. + * @param message SeekRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.ISeekRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SeekRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.SeekRequest.verify|verify} messages. + * @param message SeekRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.ISeekRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SeekRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SeekRequest + * @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.pubsub.v1.SeekRequest; + + /** + * Decodes a SeekRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SeekRequest + * @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.pubsub.v1.SeekRequest; + + /** + * Verifies a SeekRequest 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 SeekRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SeekRequest + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.SeekRequest; + + /** + * Creates a plain object from a SeekRequest message. Also converts values to other types if specified. + * @param message SeekRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.SeekRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SeekRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SeekRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SeekResponse. */ + interface ISeekResponse { + } + + /** Represents a SeekResponse. */ + class SeekResponse implements ISeekResponse { + + /** + * Constructs a new SeekResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.ISeekResponse); + + /** + * Creates a new SeekResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns SeekResponse instance + */ + public static create(properties?: google.pubsub.v1.ISeekResponse): google.pubsub.v1.SeekResponse; + + /** + * Encodes the specified SeekResponse message. Does not implicitly {@link google.pubsub.v1.SeekResponse.verify|verify} messages. + * @param message SeekResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.ISeekResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SeekResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.SeekResponse.verify|verify} messages. + * @param message SeekResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.ISeekResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SeekResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SeekResponse + * @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.pubsub.v1.SeekResponse; + + /** + * Decodes a SeekResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SeekResponse + * @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.pubsub.v1.SeekResponse; + + /** + * Verifies a SeekResponse 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 SeekResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SeekResponse + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.SeekResponse; + + /** + * Creates a plain object from a SeekResponse message. Also converts values to other types if specified. + * @param message SeekResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.SeekResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SeekResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SeekResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a SchemaService */ + class SchemaService extends $protobuf.rpc.Service { + + /** + * Constructs a new SchemaService service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new SchemaService 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): SchemaService; + + /** + * Calls CreateSchema. + * @param request CreateSchemaRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Schema + */ + public createSchema(request: google.pubsub.v1.ICreateSchemaRequest, callback: google.pubsub.v1.SchemaService.CreateSchemaCallback): void; + + /** + * Calls CreateSchema. + * @param request CreateSchemaRequest message or plain object + * @returns Promise + */ + public createSchema(request: google.pubsub.v1.ICreateSchemaRequest): Promise; + + /** + * Calls GetSchema. + * @param request GetSchemaRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Schema + */ + public getSchema(request: google.pubsub.v1.IGetSchemaRequest, callback: google.pubsub.v1.SchemaService.GetSchemaCallback): void; + + /** + * Calls GetSchema. + * @param request GetSchemaRequest message or plain object + * @returns Promise + */ + public getSchema(request: google.pubsub.v1.IGetSchemaRequest): Promise; + + /** + * Calls ListSchemas. + * @param request ListSchemasRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListSchemasResponse + */ + public listSchemas(request: google.pubsub.v1.IListSchemasRequest, callback: google.pubsub.v1.SchemaService.ListSchemasCallback): void; + + /** + * Calls ListSchemas. + * @param request ListSchemasRequest message or plain object + * @returns Promise + */ + public listSchemas(request: google.pubsub.v1.IListSchemasRequest): Promise; + + /** + * Calls ListSchemaRevisions. + * @param request ListSchemaRevisionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListSchemaRevisionsResponse + */ + public listSchemaRevisions(request: google.pubsub.v1.IListSchemaRevisionsRequest, callback: google.pubsub.v1.SchemaService.ListSchemaRevisionsCallback): void; + + /** + * Calls ListSchemaRevisions. + * @param request ListSchemaRevisionsRequest message or plain object + * @returns Promise + */ + public listSchemaRevisions(request: google.pubsub.v1.IListSchemaRevisionsRequest): Promise; + + /** + * Calls CommitSchema. + * @param request CommitSchemaRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Schema + */ + public commitSchema(request: google.pubsub.v1.ICommitSchemaRequest, callback: google.pubsub.v1.SchemaService.CommitSchemaCallback): void; + + /** + * Calls CommitSchema. + * @param request CommitSchemaRequest message or plain object + * @returns Promise + */ + public commitSchema(request: google.pubsub.v1.ICommitSchemaRequest): Promise; + + /** + * Calls RollbackSchema. + * @param request RollbackSchemaRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Schema + */ + public rollbackSchema(request: google.pubsub.v1.IRollbackSchemaRequest, callback: google.pubsub.v1.SchemaService.RollbackSchemaCallback): void; + + /** + * Calls RollbackSchema. + * @param request RollbackSchemaRequest message or plain object + * @returns Promise + */ + public rollbackSchema(request: google.pubsub.v1.IRollbackSchemaRequest): Promise; + + /** + * Calls DeleteSchemaRevision. + * @param request DeleteSchemaRevisionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Schema + */ + public deleteSchemaRevision(request: google.pubsub.v1.IDeleteSchemaRevisionRequest, callback: google.pubsub.v1.SchemaService.DeleteSchemaRevisionCallback): void; + + /** + * Calls DeleteSchemaRevision. + * @param request DeleteSchemaRevisionRequest message or plain object + * @returns Promise + */ + public deleteSchemaRevision(request: google.pubsub.v1.IDeleteSchemaRevisionRequest): Promise; + + /** + * Calls DeleteSchema. + * @param request DeleteSchemaRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteSchema(request: google.pubsub.v1.IDeleteSchemaRequest, callback: google.pubsub.v1.SchemaService.DeleteSchemaCallback): void; + + /** + * Calls DeleteSchema. + * @param request DeleteSchemaRequest message or plain object + * @returns Promise + */ + public deleteSchema(request: google.pubsub.v1.IDeleteSchemaRequest): Promise; + + /** + * Calls ValidateSchema. + * @param request ValidateSchemaRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ValidateSchemaResponse + */ + public validateSchema(request: google.pubsub.v1.IValidateSchemaRequest, callback: google.pubsub.v1.SchemaService.ValidateSchemaCallback): void; + + /** + * Calls ValidateSchema. + * @param request ValidateSchemaRequest message or plain object + * @returns Promise + */ + public validateSchema(request: google.pubsub.v1.IValidateSchemaRequest): Promise; + + /** + * Calls ValidateMessage. + * @param request ValidateMessageRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ValidateMessageResponse + */ + public validateMessage(request: google.pubsub.v1.IValidateMessageRequest, callback: google.pubsub.v1.SchemaService.ValidateMessageCallback): void; + + /** + * Calls ValidateMessage. + * @param request ValidateMessageRequest message or plain object + * @returns Promise + */ + public validateMessage(request: google.pubsub.v1.IValidateMessageRequest): Promise; + } + + namespace SchemaService { + + /** + * Callback as used by {@link google.pubsub.v1.SchemaService|createSchema}. + * @param error Error, if any + * @param [response] Schema + */ + type CreateSchemaCallback = (error: (Error|null), response?: google.pubsub.v1.Schema) => void; + + /** + * Callback as used by {@link google.pubsub.v1.SchemaService|getSchema}. + * @param error Error, if any + * @param [response] Schema + */ + type GetSchemaCallback = (error: (Error|null), response?: google.pubsub.v1.Schema) => void; + + /** + * Callback as used by {@link google.pubsub.v1.SchemaService|listSchemas}. + * @param error Error, if any + * @param [response] ListSchemasResponse + */ + type ListSchemasCallback = (error: (Error|null), response?: google.pubsub.v1.ListSchemasResponse) => void; + + /** + * Callback as used by {@link google.pubsub.v1.SchemaService|listSchemaRevisions}. + * @param error Error, if any + * @param [response] ListSchemaRevisionsResponse + */ + type ListSchemaRevisionsCallback = (error: (Error|null), response?: google.pubsub.v1.ListSchemaRevisionsResponse) => void; + + /** + * Callback as used by {@link google.pubsub.v1.SchemaService|commitSchema}. + * @param error Error, if any + * @param [response] Schema + */ + type CommitSchemaCallback = (error: (Error|null), response?: google.pubsub.v1.Schema) => void; + + /** + * Callback as used by {@link google.pubsub.v1.SchemaService|rollbackSchema}. + * @param error Error, if any + * @param [response] Schema + */ + type RollbackSchemaCallback = (error: (Error|null), response?: google.pubsub.v1.Schema) => void; + + /** + * Callback as used by {@link google.pubsub.v1.SchemaService|deleteSchemaRevision}. + * @param error Error, if any + * @param [response] Schema + */ + type DeleteSchemaRevisionCallback = (error: (Error|null), response?: google.pubsub.v1.Schema) => void; + + /** + * Callback as used by {@link google.pubsub.v1.SchemaService|deleteSchema}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteSchemaCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.pubsub.v1.SchemaService|validateSchema}. + * @param error Error, if any + * @param [response] ValidateSchemaResponse + */ + type ValidateSchemaCallback = (error: (Error|null), response?: google.pubsub.v1.ValidateSchemaResponse) => void; + + /** + * Callback as used by {@link google.pubsub.v1.SchemaService|validateMessage}. + * @param error Error, if any + * @param [response] ValidateMessageResponse + */ + type ValidateMessageCallback = (error: (Error|null), response?: google.pubsub.v1.ValidateMessageResponse) => void; + } + + /** Properties of a Schema. */ + interface ISchema { + + /** Schema name */ + name?: (string|null); + + /** Schema type */ + type?: (google.pubsub.v1.Schema.Type|keyof typeof google.pubsub.v1.Schema.Type|null); + + /** Schema definition */ + definition?: (string|null); + + /** Schema revisionId */ + revisionId?: (string|null); + + /** Schema revisionCreateTime */ + revisionCreateTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a Schema. */ + class Schema implements ISchema { + + /** + * Constructs a new Schema. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.ISchema); + + /** Schema name. */ + public name: string; + + /** Schema type. */ + public type: (google.pubsub.v1.Schema.Type|keyof typeof google.pubsub.v1.Schema.Type); + + /** Schema definition. */ + public definition: string; + + /** Schema revisionId. */ + public revisionId: string; + + /** Schema revisionCreateTime. */ + public revisionCreateTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new Schema instance using the specified properties. + * @param [properties] Properties to set + * @returns Schema instance + */ + public static create(properties?: google.pubsub.v1.ISchema): google.pubsub.v1.Schema; + + /** + * Encodes the specified Schema message. Does not implicitly {@link google.pubsub.v1.Schema.verify|verify} messages. + * @param message Schema message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.ISchema, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Schema message, length delimited. Does not implicitly {@link google.pubsub.v1.Schema.verify|verify} messages. + * @param message Schema message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.ISchema, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Schema message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Schema + * @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.pubsub.v1.Schema; + + /** + * Decodes a Schema message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Schema + * @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.pubsub.v1.Schema; + + /** + * Verifies a Schema 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 Schema message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Schema + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.Schema; + + /** + * Creates a plain object from a Schema message. Also converts values to other types if specified. + * @param message Schema + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.Schema, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Schema to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Schema + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Schema { + + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + PROTOCOL_BUFFER = 1, + AVRO = 2 + } + } + + /** SchemaView enum. */ + enum SchemaView { + SCHEMA_VIEW_UNSPECIFIED = 0, + BASIC = 1, + FULL = 2 + } + + /** Properties of a CreateSchemaRequest. */ + interface ICreateSchemaRequest { + + /** CreateSchemaRequest parent */ + parent?: (string|null); + + /** CreateSchemaRequest schema */ + schema?: (google.pubsub.v1.ISchema|null); + + /** CreateSchemaRequest schemaId */ + schemaId?: (string|null); + } + + /** Represents a CreateSchemaRequest. */ + class CreateSchemaRequest implements ICreateSchemaRequest { + + /** + * Constructs a new CreateSchemaRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.ICreateSchemaRequest); + + /** CreateSchemaRequest parent. */ + public parent: string; + + /** CreateSchemaRequest schema. */ + public schema?: (google.pubsub.v1.ISchema|null); + + /** CreateSchemaRequest schemaId. */ + public schemaId: string; + + /** + * Creates a new CreateSchemaRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateSchemaRequest instance + */ + public static create(properties?: google.pubsub.v1.ICreateSchemaRequest): google.pubsub.v1.CreateSchemaRequest; + + /** + * Encodes the specified CreateSchemaRequest message. Does not implicitly {@link google.pubsub.v1.CreateSchemaRequest.verify|verify} messages. + * @param message CreateSchemaRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.ICreateSchemaRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateSchemaRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.CreateSchemaRequest.verify|verify} messages. + * @param message CreateSchemaRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.ICreateSchemaRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateSchemaRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateSchemaRequest + * @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.pubsub.v1.CreateSchemaRequest; + + /** + * Decodes a CreateSchemaRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateSchemaRequest + * @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.pubsub.v1.CreateSchemaRequest; + + /** + * Verifies a CreateSchemaRequest 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 CreateSchemaRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateSchemaRequest + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.CreateSchemaRequest; + + /** + * Creates a plain object from a CreateSchemaRequest message. Also converts values to other types if specified. + * @param message CreateSchemaRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.CreateSchemaRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateSchemaRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateSchemaRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetSchemaRequest. */ + interface IGetSchemaRequest { + + /** GetSchemaRequest name */ + name?: (string|null); + + /** GetSchemaRequest view */ + view?: (google.pubsub.v1.SchemaView|keyof typeof google.pubsub.v1.SchemaView|null); + } + + /** Represents a GetSchemaRequest. */ + class GetSchemaRequest implements IGetSchemaRequest { + + /** + * Constructs a new GetSchemaRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IGetSchemaRequest); + + /** GetSchemaRequest name. */ + public name: string; + + /** GetSchemaRequest view. */ + public view: (google.pubsub.v1.SchemaView|keyof typeof google.pubsub.v1.SchemaView); + + /** + * Creates a new GetSchemaRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetSchemaRequest instance + */ + public static create(properties?: google.pubsub.v1.IGetSchemaRequest): google.pubsub.v1.GetSchemaRequest; + + /** + * Encodes the specified GetSchemaRequest message. Does not implicitly {@link google.pubsub.v1.GetSchemaRequest.verify|verify} messages. + * @param message GetSchemaRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IGetSchemaRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetSchemaRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.GetSchemaRequest.verify|verify} messages. + * @param message GetSchemaRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IGetSchemaRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetSchemaRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetSchemaRequest + * @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.pubsub.v1.GetSchemaRequest; + + /** + * Decodes a GetSchemaRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetSchemaRequest + * @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.pubsub.v1.GetSchemaRequest; + + /** + * Verifies a GetSchemaRequest 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 GetSchemaRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetSchemaRequest + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.GetSchemaRequest; + + /** + * Creates a plain object from a GetSchemaRequest message. Also converts values to other types if specified. + * @param message GetSchemaRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.GetSchemaRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetSchemaRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetSchemaRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListSchemasRequest. */ + interface IListSchemasRequest { + + /** ListSchemasRequest parent */ + parent?: (string|null); + + /** ListSchemasRequest view */ + view?: (google.pubsub.v1.SchemaView|keyof typeof google.pubsub.v1.SchemaView|null); + + /** ListSchemasRequest pageSize */ + pageSize?: (number|null); + + /** ListSchemasRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListSchemasRequest. */ + class ListSchemasRequest implements IListSchemasRequest { + + /** + * Constructs a new ListSchemasRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IListSchemasRequest); + + /** ListSchemasRequest parent. */ + public parent: string; + + /** ListSchemasRequest view. */ + public view: (google.pubsub.v1.SchemaView|keyof typeof google.pubsub.v1.SchemaView); + + /** ListSchemasRequest pageSize. */ + public pageSize: number; + + /** ListSchemasRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListSchemasRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSchemasRequest instance + */ + public static create(properties?: google.pubsub.v1.IListSchemasRequest): google.pubsub.v1.ListSchemasRequest; + + /** + * Encodes the specified ListSchemasRequest message. Does not implicitly {@link google.pubsub.v1.ListSchemasRequest.verify|verify} messages. + * @param message ListSchemasRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IListSchemasRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSchemasRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.ListSchemasRequest.verify|verify} messages. + * @param message ListSchemasRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IListSchemasRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSchemasRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSchemasRequest + * @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.pubsub.v1.ListSchemasRequest; + + /** + * Decodes a ListSchemasRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSchemasRequest + * @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.pubsub.v1.ListSchemasRequest; + + /** + * Verifies a ListSchemasRequest 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 ListSchemasRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSchemasRequest + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.ListSchemasRequest; + + /** + * Creates a plain object from a ListSchemasRequest message. Also converts values to other types if specified. + * @param message ListSchemasRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.ListSchemasRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSchemasRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListSchemasRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListSchemasResponse. */ + interface IListSchemasResponse { + + /** ListSchemasResponse schemas */ + schemas?: (google.pubsub.v1.ISchema[]|null); + + /** ListSchemasResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListSchemasResponse. */ + class ListSchemasResponse implements IListSchemasResponse { + + /** + * Constructs a new ListSchemasResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IListSchemasResponse); + + /** ListSchemasResponse schemas. */ + public schemas: google.pubsub.v1.ISchema[]; + + /** ListSchemasResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListSchemasResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSchemasResponse instance + */ + public static create(properties?: google.pubsub.v1.IListSchemasResponse): google.pubsub.v1.ListSchemasResponse; + + /** + * Encodes the specified ListSchemasResponse message. Does not implicitly {@link google.pubsub.v1.ListSchemasResponse.verify|verify} messages. + * @param message ListSchemasResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IListSchemasResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSchemasResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.ListSchemasResponse.verify|verify} messages. + * @param message ListSchemasResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IListSchemasResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSchemasResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSchemasResponse + * @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.pubsub.v1.ListSchemasResponse; + + /** + * Decodes a ListSchemasResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSchemasResponse + * @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.pubsub.v1.ListSchemasResponse; + + /** + * Verifies a ListSchemasResponse 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 ListSchemasResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSchemasResponse + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.ListSchemasResponse; + + /** + * Creates a plain object from a ListSchemasResponse message. Also converts values to other types if specified. + * @param message ListSchemasResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.ListSchemasResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSchemasResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListSchemasResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListSchemaRevisionsRequest. */ + interface IListSchemaRevisionsRequest { + + /** ListSchemaRevisionsRequest name */ + name?: (string|null); + + /** ListSchemaRevisionsRequest view */ + view?: (google.pubsub.v1.SchemaView|keyof typeof google.pubsub.v1.SchemaView|null); + + /** ListSchemaRevisionsRequest pageSize */ + pageSize?: (number|null); + + /** ListSchemaRevisionsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListSchemaRevisionsRequest. */ + class ListSchemaRevisionsRequest implements IListSchemaRevisionsRequest { + + /** + * Constructs a new ListSchemaRevisionsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IListSchemaRevisionsRequest); + + /** ListSchemaRevisionsRequest name. */ + public name: string; + + /** ListSchemaRevisionsRequest view. */ + public view: (google.pubsub.v1.SchemaView|keyof typeof google.pubsub.v1.SchemaView); + + /** ListSchemaRevisionsRequest pageSize. */ + public pageSize: number; + + /** ListSchemaRevisionsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListSchemaRevisionsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSchemaRevisionsRequest instance + */ + public static create(properties?: google.pubsub.v1.IListSchemaRevisionsRequest): google.pubsub.v1.ListSchemaRevisionsRequest; + + /** + * Encodes the specified ListSchemaRevisionsRequest message. Does not implicitly {@link google.pubsub.v1.ListSchemaRevisionsRequest.verify|verify} messages. + * @param message ListSchemaRevisionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IListSchemaRevisionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSchemaRevisionsRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.ListSchemaRevisionsRequest.verify|verify} messages. + * @param message ListSchemaRevisionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IListSchemaRevisionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSchemaRevisionsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSchemaRevisionsRequest + * @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.pubsub.v1.ListSchemaRevisionsRequest; + + /** + * Decodes a ListSchemaRevisionsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSchemaRevisionsRequest + * @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.pubsub.v1.ListSchemaRevisionsRequest; + + /** + * Verifies a ListSchemaRevisionsRequest 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 ListSchemaRevisionsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSchemaRevisionsRequest + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.ListSchemaRevisionsRequest; + + /** + * Creates a plain object from a ListSchemaRevisionsRequest message. Also converts values to other types if specified. + * @param message ListSchemaRevisionsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.ListSchemaRevisionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSchemaRevisionsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListSchemaRevisionsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListSchemaRevisionsResponse. */ + interface IListSchemaRevisionsResponse { + + /** ListSchemaRevisionsResponse schemas */ + schemas?: (google.pubsub.v1.ISchema[]|null); + + /** ListSchemaRevisionsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListSchemaRevisionsResponse. */ + class ListSchemaRevisionsResponse implements IListSchemaRevisionsResponse { + + /** + * Constructs a new ListSchemaRevisionsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IListSchemaRevisionsResponse); + + /** ListSchemaRevisionsResponse schemas. */ + public schemas: google.pubsub.v1.ISchema[]; + + /** ListSchemaRevisionsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListSchemaRevisionsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSchemaRevisionsResponse instance + */ + public static create(properties?: google.pubsub.v1.IListSchemaRevisionsResponse): google.pubsub.v1.ListSchemaRevisionsResponse; + + /** + * Encodes the specified ListSchemaRevisionsResponse message. Does not implicitly {@link google.pubsub.v1.ListSchemaRevisionsResponse.verify|verify} messages. + * @param message ListSchemaRevisionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IListSchemaRevisionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSchemaRevisionsResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.ListSchemaRevisionsResponse.verify|verify} messages. + * @param message ListSchemaRevisionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IListSchemaRevisionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSchemaRevisionsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSchemaRevisionsResponse + * @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.pubsub.v1.ListSchemaRevisionsResponse; + + /** + * Decodes a ListSchemaRevisionsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSchemaRevisionsResponse + * @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.pubsub.v1.ListSchemaRevisionsResponse; + + /** + * Verifies a ListSchemaRevisionsResponse 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 ListSchemaRevisionsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSchemaRevisionsResponse + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.ListSchemaRevisionsResponse; + + /** + * Creates a plain object from a ListSchemaRevisionsResponse message. Also converts values to other types if specified. + * @param message ListSchemaRevisionsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.ListSchemaRevisionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSchemaRevisionsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListSchemaRevisionsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CommitSchemaRequest. */ + interface ICommitSchemaRequest { + + /** CommitSchemaRequest name */ + name?: (string|null); + + /** CommitSchemaRequest schema */ + schema?: (google.pubsub.v1.ISchema|null); + } + + /** Represents a CommitSchemaRequest. */ + class CommitSchemaRequest implements ICommitSchemaRequest { + + /** + * Constructs a new CommitSchemaRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.ICommitSchemaRequest); + + /** CommitSchemaRequest name. */ + public name: string; + + /** CommitSchemaRequest schema. */ + public schema?: (google.pubsub.v1.ISchema|null); + + /** + * Creates a new CommitSchemaRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CommitSchemaRequest instance + */ + public static create(properties?: google.pubsub.v1.ICommitSchemaRequest): google.pubsub.v1.CommitSchemaRequest; + + /** + * Encodes the specified CommitSchemaRequest message. Does not implicitly {@link google.pubsub.v1.CommitSchemaRequest.verify|verify} messages. + * @param message CommitSchemaRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.ICommitSchemaRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CommitSchemaRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.CommitSchemaRequest.verify|verify} messages. + * @param message CommitSchemaRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.ICommitSchemaRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CommitSchemaRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CommitSchemaRequest + * @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.pubsub.v1.CommitSchemaRequest; + + /** + * Decodes a CommitSchemaRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CommitSchemaRequest + * @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.pubsub.v1.CommitSchemaRequest; + + /** + * Verifies a CommitSchemaRequest 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 CommitSchemaRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CommitSchemaRequest + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.CommitSchemaRequest; + + /** + * Creates a plain object from a CommitSchemaRequest message. Also converts values to other types if specified. + * @param message CommitSchemaRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.CommitSchemaRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CommitSchemaRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CommitSchemaRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RollbackSchemaRequest. */ + interface IRollbackSchemaRequest { + + /** RollbackSchemaRequest name */ + name?: (string|null); + + /** RollbackSchemaRequest revisionId */ + revisionId?: (string|null); + } + + /** Represents a RollbackSchemaRequest. */ + class RollbackSchemaRequest implements IRollbackSchemaRequest { + + /** + * Constructs a new RollbackSchemaRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IRollbackSchemaRequest); + + /** RollbackSchemaRequest name. */ + public name: string; + + /** RollbackSchemaRequest revisionId. */ + public revisionId: string; + + /** + * Creates a new RollbackSchemaRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RollbackSchemaRequest instance + */ + public static create(properties?: google.pubsub.v1.IRollbackSchemaRequest): google.pubsub.v1.RollbackSchemaRequest; + + /** + * Encodes the specified RollbackSchemaRequest message. Does not implicitly {@link google.pubsub.v1.RollbackSchemaRequest.verify|verify} messages. + * @param message RollbackSchemaRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IRollbackSchemaRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RollbackSchemaRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.RollbackSchemaRequest.verify|verify} messages. + * @param message RollbackSchemaRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IRollbackSchemaRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RollbackSchemaRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RollbackSchemaRequest + * @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.pubsub.v1.RollbackSchemaRequest; + + /** + * Decodes a RollbackSchemaRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RollbackSchemaRequest + * @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.pubsub.v1.RollbackSchemaRequest; + + /** + * Verifies a RollbackSchemaRequest 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 RollbackSchemaRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RollbackSchemaRequest + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.RollbackSchemaRequest; + + /** + * Creates a plain object from a RollbackSchemaRequest message. Also converts values to other types if specified. + * @param message RollbackSchemaRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.RollbackSchemaRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RollbackSchemaRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RollbackSchemaRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteSchemaRevisionRequest. */ + interface IDeleteSchemaRevisionRequest { + + /** DeleteSchemaRevisionRequest name */ + name?: (string|null); + + /** DeleteSchemaRevisionRequest revisionId */ + revisionId?: (string|null); + } + + /** Represents a DeleteSchemaRevisionRequest. */ + class DeleteSchemaRevisionRequest implements IDeleteSchemaRevisionRequest { + + /** + * Constructs a new DeleteSchemaRevisionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IDeleteSchemaRevisionRequest); + + /** DeleteSchemaRevisionRequest name. */ + public name: string; + + /** DeleteSchemaRevisionRequest revisionId. */ + public revisionId: string; + + /** + * Creates a new DeleteSchemaRevisionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteSchemaRevisionRequest instance + */ + public static create(properties?: google.pubsub.v1.IDeleteSchemaRevisionRequest): google.pubsub.v1.DeleteSchemaRevisionRequest; + + /** + * Encodes the specified DeleteSchemaRevisionRequest message. Does not implicitly {@link google.pubsub.v1.DeleteSchemaRevisionRequest.verify|verify} messages. + * @param message DeleteSchemaRevisionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IDeleteSchemaRevisionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteSchemaRevisionRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.DeleteSchemaRevisionRequest.verify|verify} messages. + * @param message DeleteSchemaRevisionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IDeleteSchemaRevisionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteSchemaRevisionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteSchemaRevisionRequest + * @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.pubsub.v1.DeleteSchemaRevisionRequest; + + /** + * Decodes a DeleteSchemaRevisionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteSchemaRevisionRequest + * @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.pubsub.v1.DeleteSchemaRevisionRequest; + + /** + * Verifies a DeleteSchemaRevisionRequest 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 DeleteSchemaRevisionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteSchemaRevisionRequest + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.DeleteSchemaRevisionRequest; + + /** + * Creates a plain object from a DeleteSchemaRevisionRequest message. Also converts values to other types if specified. + * @param message DeleteSchemaRevisionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.DeleteSchemaRevisionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteSchemaRevisionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteSchemaRevisionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteSchemaRequest. */ + interface IDeleteSchemaRequest { + + /** DeleteSchemaRequest name */ + name?: (string|null); + } + + /** Represents a DeleteSchemaRequest. */ + class DeleteSchemaRequest implements IDeleteSchemaRequest { + + /** + * Constructs a new DeleteSchemaRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IDeleteSchemaRequest); + + /** DeleteSchemaRequest name. */ + public name: string; + + /** + * Creates a new DeleteSchemaRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteSchemaRequest instance + */ + public static create(properties?: google.pubsub.v1.IDeleteSchemaRequest): google.pubsub.v1.DeleteSchemaRequest; + + /** + * Encodes the specified DeleteSchemaRequest message. Does not implicitly {@link google.pubsub.v1.DeleteSchemaRequest.verify|verify} messages. + * @param message DeleteSchemaRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IDeleteSchemaRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteSchemaRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.DeleteSchemaRequest.verify|verify} messages. + * @param message DeleteSchemaRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IDeleteSchemaRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteSchemaRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteSchemaRequest + * @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.pubsub.v1.DeleteSchemaRequest; + + /** + * Decodes a DeleteSchemaRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteSchemaRequest + * @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.pubsub.v1.DeleteSchemaRequest; + + /** + * Verifies a DeleteSchemaRequest 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 DeleteSchemaRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteSchemaRequest + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.DeleteSchemaRequest; + + /** + * Creates a plain object from a DeleteSchemaRequest message. Also converts values to other types if specified. + * @param message DeleteSchemaRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.DeleteSchemaRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteSchemaRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteSchemaRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ValidateSchemaRequest. */ + interface IValidateSchemaRequest { + + /** ValidateSchemaRequest parent */ + parent?: (string|null); + + /** ValidateSchemaRequest schema */ + schema?: (google.pubsub.v1.ISchema|null); + } + + /** Represents a ValidateSchemaRequest. */ + class ValidateSchemaRequest implements IValidateSchemaRequest { + + /** + * Constructs a new ValidateSchemaRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IValidateSchemaRequest); + + /** ValidateSchemaRequest parent. */ + public parent: string; + + /** ValidateSchemaRequest schema. */ + public schema?: (google.pubsub.v1.ISchema|null); + + /** + * Creates a new ValidateSchemaRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ValidateSchemaRequest instance + */ + public static create(properties?: google.pubsub.v1.IValidateSchemaRequest): google.pubsub.v1.ValidateSchemaRequest; + + /** + * Encodes the specified ValidateSchemaRequest message. Does not implicitly {@link google.pubsub.v1.ValidateSchemaRequest.verify|verify} messages. + * @param message ValidateSchemaRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IValidateSchemaRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ValidateSchemaRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.ValidateSchemaRequest.verify|verify} messages. + * @param message ValidateSchemaRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IValidateSchemaRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ValidateSchemaRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ValidateSchemaRequest + * @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.pubsub.v1.ValidateSchemaRequest; + + /** + * Decodes a ValidateSchemaRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ValidateSchemaRequest + * @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.pubsub.v1.ValidateSchemaRequest; + + /** + * Verifies a ValidateSchemaRequest 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 ValidateSchemaRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ValidateSchemaRequest + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.ValidateSchemaRequest; + + /** + * Creates a plain object from a ValidateSchemaRequest message. Also converts values to other types if specified. + * @param message ValidateSchemaRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.ValidateSchemaRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ValidateSchemaRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ValidateSchemaRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ValidateSchemaResponse. */ + interface IValidateSchemaResponse { + } + + /** Represents a ValidateSchemaResponse. */ + class ValidateSchemaResponse implements IValidateSchemaResponse { + + /** + * Constructs a new ValidateSchemaResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IValidateSchemaResponse); + + /** + * Creates a new ValidateSchemaResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ValidateSchemaResponse instance + */ + public static create(properties?: google.pubsub.v1.IValidateSchemaResponse): google.pubsub.v1.ValidateSchemaResponse; + + /** + * Encodes the specified ValidateSchemaResponse message. Does not implicitly {@link google.pubsub.v1.ValidateSchemaResponse.verify|verify} messages. + * @param message ValidateSchemaResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IValidateSchemaResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ValidateSchemaResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.ValidateSchemaResponse.verify|verify} messages. + * @param message ValidateSchemaResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IValidateSchemaResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ValidateSchemaResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ValidateSchemaResponse + * @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.pubsub.v1.ValidateSchemaResponse; + + /** + * Decodes a ValidateSchemaResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ValidateSchemaResponse + * @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.pubsub.v1.ValidateSchemaResponse; + + /** + * Verifies a ValidateSchemaResponse 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 ValidateSchemaResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ValidateSchemaResponse + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.ValidateSchemaResponse; + + /** + * Creates a plain object from a ValidateSchemaResponse message. Also converts values to other types if specified. + * @param message ValidateSchemaResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.ValidateSchemaResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ValidateSchemaResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ValidateSchemaResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ValidateMessageRequest. */ + interface IValidateMessageRequest { + + /** ValidateMessageRequest parent */ + parent?: (string|null); + + /** ValidateMessageRequest name */ + name?: (string|null); + + /** ValidateMessageRequest schema */ + schema?: (google.pubsub.v1.ISchema|null); + + /** ValidateMessageRequest message */ + message?: (Uint8Array|string|null); + + /** ValidateMessageRequest encoding */ + encoding?: (google.pubsub.v1.Encoding|keyof typeof google.pubsub.v1.Encoding|null); + } + + /** Represents a ValidateMessageRequest. */ + class ValidateMessageRequest implements IValidateMessageRequest { + + /** + * Constructs a new ValidateMessageRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IValidateMessageRequest); + + /** ValidateMessageRequest parent. */ + public parent: string; + + /** ValidateMessageRequest name. */ + public name?: (string|null); + + /** ValidateMessageRequest schema. */ + public schema?: (google.pubsub.v1.ISchema|null); + + /** ValidateMessageRequest message. */ + public message: (Uint8Array|string); + + /** ValidateMessageRequest encoding. */ + public encoding: (google.pubsub.v1.Encoding|keyof typeof google.pubsub.v1.Encoding); + + /** ValidateMessageRequest schemaSpec. */ + public schemaSpec?: ("name"|"schema"); + + /** + * Creates a new ValidateMessageRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ValidateMessageRequest instance + */ + public static create(properties?: google.pubsub.v1.IValidateMessageRequest): google.pubsub.v1.ValidateMessageRequest; + + /** + * Encodes the specified ValidateMessageRequest message. Does not implicitly {@link google.pubsub.v1.ValidateMessageRequest.verify|verify} messages. + * @param message ValidateMessageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IValidateMessageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ValidateMessageRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.ValidateMessageRequest.verify|verify} messages. + * @param message ValidateMessageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IValidateMessageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ValidateMessageRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ValidateMessageRequest + * @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.pubsub.v1.ValidateMessageRequest; + + /** + * Decodes a ValidateMessageRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ValidateMessageRequest + * @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.pubsub.v1.ValidateMessageRequest; + + /** + * Verifies a ValidateMessageRequest 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 ValidateMessageRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ValidateMessageRequest + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.ValidateMessageRequest; + + /** + * Creates a plain object from a ValidateMessageRequest message. Also converts values to other types if specified. + * @param message ValidateMessageRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.ValidateMessageRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ValidateMessageRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ValidateMessageRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ValidateMessageResponse. */ + interface IValidateMessageResponse { + } + + /** Represents a ValidateMessageResponse. */ + class ValidateMessageResponse implements IValidateMessageResponse { + + /** + * Constructs a new ValidateMessageResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IValidateMessageResponse); + + /** + * Creates a new ValidateMessageResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ValidateMessageResponse instance + */ + public static create(properties?: google.pubsub.v1.IValidateMessageResponse): google.pubsub.v1.ValidateMessageResponse; + + /** + * Encodes the specified ValidateMessageResponse message. Does not implicitly {@link google.pubsub.v1.ValidateMessageResponse.verify|verify} messages. + * @param message ValidateMessageResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IValidateMessageResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ValidateMessageResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.ValidateMessageResponse.verify|verify} messages. + * @param message ValidateMessageResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IValidateMessageResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ValidateMessageResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ValidateMessageResponse + * @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.pubsub.v1.ValidateMessageResponse; + + /** + * Decodes a ValidateMessageResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ValidateMessageResponse + * @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.pubsub.v1.ValidateMessageResponse; + + /** + * Verifies a ValidateMessageResponse 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 ValidateMessageResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ValidateMessageResponse + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.ValidateMessageResponse; + + /** + * Creates a plain object from a ValidateMessageResponse message. Also converts values to other types if specified. + * @param message ValidateMessageResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.ValidateMessageResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ValidateMessageResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ValidateMessageResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Encoding enum. */ + enum Encoding { + ENCODING_UNSPECIFIED = 0, + JSON = 1, + BINARY = 2 + } + } + } + + /** Namespace api. */ + namespace api { + + /** Properties of a Http. */ + interface IHttp { + + /** Http rules */ + rules?: (google.api.IHttpRule[]|null); + + /** Http fullyDecodeReservedExpansion */ + fullyDecodeReservedExpansion?: (boolean|null); + } + + /** 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; + + /** + * 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 + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Http; + + /** + * 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. + * @param object Plain object + * @returns Http + */ + public static fromObject(object: { [k: string]: any }): google.api.Http; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @param message Http + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Http, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Http to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Http + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a HttpRule. */ + interface IHttpRule { + + /** HttpRule selector */ + selector?: (string|null); + + /** HttpRule get */ + get?: (string|null); + + /** HttpRule put */ + put?: (string|null); + + /** HttpRule post */ + post?: (string|null); + + /** HttpRule delete */ + "delete"?: (string|null); + + /** HttpRule patch */ + patch?: (string|null); + + /** HttpRule custom */ + custom?: (google.api.ICustomHttpPattern|null); + + /** HttpRule body */ + body?: (string|null); + + /** HttpRule responseBody */ + responseBody?: (string|null); + + /** HttpRule additionalBindings */ + additionalBindings?: (google.api.IHttpRule[]|null); + } + + /** Represents a HttpRule. */ + class HttpRule implements IHttpRule { + + /** + * Constructs a new HttpRule. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttpRule); + + /** HttpRule selector. */ + public selector: string; + + /** HttpRule get. */ + public get?: (string|null); + + /** HttpRule put. */ + public put?: (string|null); + + /** HttpRule post. */ + public post?: (string|null); + + /** HttpRule delete. */ + public delete?: (string|null); + + /** HttpRule patch. */ + public patch?: (string|null); + + /** HttpRule custom. */ + public custom?: (google.api.ICustomHttpPattern|null); + + /** 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 + * @returns HttpRule + */ + public static fromObject(object: { [k: string]: any }): google.api.HttpRule; + + /** + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @param message HttpRule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.HttpRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HttpRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HttpRule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomHttpPattern. */ + interface ICustomHttpPattern { + + /** CustomHttpPattern kind */ + kind?: (string|null); + + /** CustomHttpPattern path */ + path?: (string|null); + } + + /** Represents a CustomHttpPattern. */ + class CustomHttpPattern implements ICustomHttpPattern { + + /** + * Constructs a new CustomHttpPattern. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICustomHttpPattern); + + /** CustomHttpPattern kind. */ + public kind: string; + + /** 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 + * @returns CustomHttpPattern + */ + public static fromObject(object: { [k: string]: any }): google.api.CustomHttpPattern; + + /** + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @param message CustomHttpPattern + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CustomHttpPattern, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CustomHttpPattern to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CustomHttpPattern + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CommonLanguageSettings. */ + interface ICommonLanguageSettings { + + /** CommonLanguageSettings referenceDocsUri */ + referenceDocsUri?: (string|null); + + /** CommonLanguageSettings destinations */ + destinations?: (google.api.ClientLibraryDestination[]|null); + } + + /** Represents a CommonLanguageSettings. */ + class CommonLanguageSettings implements ICommonLanguageSettings { + + /** + * Constructs a new CommonLanguageSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICommonLanguageSettings); + + /** CommonLanguageSettings referenceDocsUri. */ + public referenceDocsUri: string; + + /** 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 + * @returns CommonLanguageSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.CommonLanguageSettings; + + /** + * Creates a plain object from a CommonLanguageSettings message. Also converts values to other types if specified. + * @param message CommonLanguageSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CommonLanguageSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CommonLanguageSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CommonLanguageSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ClientLibrarySettings. */ + interface IClientLibrarySettings { + + /** ClientLibrarySettings version */ + version?: (string|null); + + /** ClientLibrarySettings launchStage */ + launchStage?: (google.api.LaunchStage|keyof typeof google.api.LaunchStage|null); + + /** ClientLibrarySettings restNumericEnums */ + restNumericEnums?: (boolean|null); + + /** ClientLibrarySettings javaSettings */ + javaSettings?: (google.api.IJavaSettings|null); + + /** ClientLibrarySettings cppSettings */ + cppSettings?: (google.api.ICppSettings|null); + + /** ClientLibrarySettings phpSettings */ + phpSettings?: (google.api.IPhpSettings|null); + + /** ClientLibrarySettings pythonSettings */ + pythonSettings?: (google.api.IPythonSettings|null); + + /** ClientLibrarySettings nodeSettings */ + nodeSettings?: (google.api.INodeSettings|null); + + /** ClientLibrarySettings dotnetSettings */ + dotnetSettings?: (google.api.IDotnetSettings|null); + + /** ClientLibrarySettings rubySettings */ + rubySettings?: (google.api.IRubySettings|null); + + /** ClientLibrarySettings goSettings */ + goSettings?: (google.api.IGoSettings|null); + } + + /** Represents a ClientLibrarySettings. */ + class ClientLibrarySettings implements IClientLibrarySettings { + + /** + * Constructs a new ClientLibrarySettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IClientLibrarySettings); + + /** ClientLibrarySettings version. */ + public version: string; + + /** ClientLibrarySettings launchStage. */ + public launchStage: (google.api.LaunchStage|keyof typeof google.api.LaunchStage); + + /** ClientLibrarySettings restNumericEnums. */ + public restNumericEnums: boolean; + + /** ClientLibrarySettings javaSettings. */ + public javaSettings?: (google.api.IJavaSettings|null); + + /** ClientLibrarySettings cppSettings. */ + public cppSettings?: (google.api.ICppSettings|null); + + /** ClientLibrarySettings phpSettings. */ + public phpSettings?: (google.api.IPhpSettings|null); + + /** ClientLibrarySettings pythonSettings. */ + public pythonSettings?: (google.api.IPythonSettings|null); + + /** ClientLibrarySettings nodeSettings. */ + public nodeSettings?: (google.api.INodeSettings|null); + + /** ClientLibrarySettings dotnetSettings. */ + public dotnetSettings?: (google.api.IDotnetSettings|null); + + /** ClientLibrarySettings rubySettings. */ + public rubySettings?: (google.api.IRubySettings|null); + + /** ClientLibrarySettings goSettings. */ + public goSettings?: (google.api.IGoSettings|null); + + /** + * Creates a new ClientLibrarySettings instance using the specified properties. + * @param [properties] Properties to set + * @returns ClientLibrarySettings instance + */ + public static create(properties?: google.api.IClientLibrarySettings): google.api.ClientLibrarySettings; + + /** + * 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 encode(message: google.api.IClientLibrarySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * 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 static encodeDelimited(message: google.api.IClientLibrarySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * 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 decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ClientLibrarySettings; + + /** + * 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 + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ClientLibrarySettings; + + /** + * 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 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|keyof typeof google.api.ClientLibraryOrganization|null); + + /** Publishing librarySettings */ + librarySettings?: (google.api.IClientLibrarySettings[]|null); + + /** Publishing protoReferenceDocumentationUri */ + protoReferenceDocumentationUri?: (string|null); + + /** Publishing restReferenceDocumentationUri */ + restReferenceDocumentationUri?: (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|keyof typeof google.api.ClientLibraryOrganization); + + /** Publishing librarySettings. */ + public librarySettings: google.api.IClientLibrarySettings[]; + + /** Publishing protoReferenceDocumentationUri. */ + public protoReferenceDocumentationUri: string; + + /** Publishing restReferenceDocumentationUri. */ + public restReferenceDocumentationUri: string; + + /** + * Creates a new Publishing instance using the specified properties. + * @param [properties] Properties to set + * @returns Publishing instance + */ + public static create(properties?: google.api.IPublishing): google.api.Publishing; + + /** + * 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 encode(message: google.api.IPublishing, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * 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 encodeDelimited(message: google.api.IPublishing, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * 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 static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Publishing; + + /** + * 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 decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Publishing; + + /** + * Verifies a Publishing 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 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); + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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 JavaSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns JavaSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.JavaSettings; + + /** + * 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.JavaSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this JavaSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * 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 CppSettings. */ + interface ICppSettings { + + /** CppSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a CppSettings. */ + class CppSettings implements ICppSettings { + + /** + * Constructs a new CppSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICppSettings); + + /** CppSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new CppSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns CppSettings instance + */ + public static create(properties?: google.api.ICppSettings): google.api.CppSettings; + + /** + * 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 encode(message: google.api.ICppSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * 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 static encodeDelimited(message: google.api.ICppSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * 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 decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CppSettings; + + /** + * 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 + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CppSettings; + + /** + * 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 CppSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CppSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.CppSettings; + + /** + * 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.CppSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CppSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * 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 PhpSettings. */ + interface IPhpSettings { + + /** PhpSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a PhpSettings. */ + class PhpSettings implements IPhpSettings { + + /** + * Constructs a new PhpSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IPhpSettings); + + /** PhpSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new PhpSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns PhpSettings instance + */ + public static create(properties?: google.api.IPhpSettings): google.api.PhpSettings; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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 PhpSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.PhpSettings; + + /** + * 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 }; + + /** + * Converts this PhpSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * 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; + } + + /** Properties of a PythonSettings. */ + interface IPythonSettings { + + /** PythonSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a PythonSettings. */ + class PythonSettings implements IPythonSettings { + + /** + * Constructs a new PythonSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IPythonSettings); + + /** PythonSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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 PythonSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PythonSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.PythonSettings; + + /** + * 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.PythonSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PythonSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * 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; + } + + /** Properties of a NodeSettings. */ + interface INodeSettings { + + /** NodeSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a NodeSettings. */ + class NodeSettings implements INodeSettings { + + /** + * Constructs a new NodeSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.INodeSettings); + + /** NodeSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new NodeSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeSettings instance + */ + public static create(properties?: google.api.INodeSettings): google.api.NodeSettings; + + /** + * 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 encode(message: google.api.INodeSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * 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 static encodeDelimited(message: google.api.INodeSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * 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 decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.NodeSettings; + + /** + * 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 + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.NodeSettings; + + /** + * 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 NodeSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NodeSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.NodeSettings; + + /** + * 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.api.NodeSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NodeSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * 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; + } + + /** 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); + + /** DotnetSettings ignoredResources */ + ignoredResources?: (string[]|null); + + /** DotnetSettings forcedNamespaceAliases */ + forcedNamespaceAliases?: (string[]|null); + + /** DotnetSettings handwrittenSignatures */ + handwrittenSignatures?: (string[]|null); + } + + /** Represents a DotnetSettings. */ + class DotnetSettings implements IDotnetSettings { + + /** + * Constructs a new DotnetSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IDotnetSettings); + + /** DotnetSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** DotnetSettings renamedServices. */ + public renamedServices: { [k: string]: string }; + + /** DotnetSettings renamedResources. */ + public renamedResources: { [k: string]: string }; + + /** DotnetSettings ignoredResources. */ + public ignoredResources: string[]; + + /** DotnetSettings forcedNamespaceAliases. */ + public forcedNamespaceAliases: string[]; + + /** DotnetSettings handwrittenSignatures. */ + public handwrittenSignatures: string[]; + + /** + * Creates a new DotnetSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns DotnetSettings instance + */ + public static create(properties?: google.api.IDotnetSettings): google.api.DotnetSettings; + + /** + * 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 + */ + public static encode(message: google.api.IDotnetSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * 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 static encodeDelimited(message: google.api.IDotnetSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * 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 static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.DotnetSettings; + + /** + * 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 static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.DotnetSettings; + + /** + * Verifies a DotnetSettings 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. + * @param object Plain object + * @returns DotnetSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.DotnetSettings; + + /** + * 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 static toObject(message: google.api.DotnetSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DotnetSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DotnetSettings + * @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 { + + /** RubySettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a RubySettings. */ + class RubySettings implements IRubySettings { + + /** + * Constructs a new RubySettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IRubySettings); + + /** RubySettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new RubySettings instance using the specified properties. + * @param [properties] Properties to set + * @returns RubySettings instance + */ + public static create(properties?: google.api.IRubySettings): google.api.RubySettings; + + /** + * 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 + */ + public static encode(message: google.api.IRubySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * 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 + */ + public static encodeDelimited(message: google.api.IRubySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * 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 + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.RubySettings; + + /** + * 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 + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.RubySettings; + + /** + * 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 a RubySettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RubySettings + */ + public static fromObject(object: { [k: string]: any }): google.api.RubySettings; + + /** + * 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.api.RubySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RubySettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * 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 GoSettings. */ + interface IGoSettings { + + /** GoSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** 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); + + /** + * Creates a new GoSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns GoSettings instance + */ + public static create(properties?: google.api.IGoSettings): google.api.GoSettings; + + /** + * 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 encode(message: google.api.IGoSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * 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 encodeDelimited(message: google.api.IGoSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * 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 static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.GoSettings; + + /** + * 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 decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.GoSettings; + + /** + * Verifies a GoSettings 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. + * @param object Plain object + * @returns GoSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.GoSettings; + + /** + * 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.api.GoSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GoSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * 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 MethodSettings. */ + interface IMethodSettings { + + /** MethodSettings selector */ + selector?: (string|null); + + /** MethodSettings longRunning */ + longRunning?: (google.api.MethodSettings.ILongRunning|null); + + /** MethodSettings autoPopulatedFields */ + autoPopulatedFields?: (string[]|null); + } + + /** Represents a MethodSettings. */ + class MethodSettings implements IMethodSettings { + + /** + * Constructs a new MethodSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IMethodSettings); + + /** MethodSettings selector. */ + public selector: string; + + /** MethodSettings longRunning. */ + public longRunning?: (google.api.MethodSettings.ILongRunning|null); + + /** MethodSettings autoPopulatedFields. */ + public autoPopulatedFields: string[]; + + /** + * Creates a new MethodSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodSettings instance + */ + public static create(properties?: google.api.IMethodSettings): google.api.MethodSettings; + + /** + * 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 encode(message: google.api.IMethodSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * 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 static encodeDelimited(message: google.api.IMethodSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * 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 decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.MethodSettings; + + /** + * 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 + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.MethodSettings; + + /** + * 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 MethodSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.MethodSettings; + + /** + * 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.api.MethodSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * 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; + } + + 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 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; + } + } + + /** 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 + } + + /** 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 + } + + /** 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|keyof typeof google.api.ResourceDescriptor.History|null); + + /** ResourceDescriptor plural */ + plural?: (string|null); + + /** ResourceDescriptor singular */ + singular?: (string|null); + + /** ResourceDescriptor style */ + style?: (google.api.ResourceDescriptor.Style[]|null); + } + + /** Represents a ResourceDescriptor. */ + class ResourceDescriptor implements IResourceDescriptor { + + /** + * Constructs a new ResourceDescriptor. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IResourceDescriptor); + + /** ResourceDescriptor type. */ + public type: string; + + /** ResourceDescriptor pattern. */ + public pattern: string[]; + + /** ResourceDescriptor nameField. */ + public nameField: string; + + /** ResourceDescriptor history. */ + public history: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History); + + /** ResourceDescriptor plural. */ + public plural: string; + + /** ResourceDescriptor singular. */ + public singular: string; + + /** ResourceDescriptor style. */ + public style: google.api.ResourceDescriptor.Style[]; + + /** + * Creates a new ResourceDescriptor instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceDescriptor instance + */ + public static create(properties?: google.api.IResourceDescriptor): google.api.ResourceDescriptor; + + /** + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @param message ResourceDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @param message ResourceDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceDescriptor + * @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.ResourceDescriptor; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceDescriptor + * @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.ResourceDescriptor; + + /** + * Verifies a ResourceDescriptor 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. + * @param object Plain object + * @returns ResourceDescriptor + */ + public static fromObject(object: { [k: string]: any }): google.api.ResourceDescriptor; + + /** + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @param message ResourceDescriptor + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ResourceDescriptor, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceDescriptor to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceDescriptor + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ResourceDescriptor { + + /** History enum. */ + enum History { + HISTORY_UNSPECIFIED = 0, + ORIGINALLY_SINGLE_PATTERN = 1, + FUTURE_MULTI_PATTERN = 2 + } + + /** Style enum. */ + enum Style { + STYLE_UNSPECIFIED = 0, + DECLARATIVE_FRIENDLY = 1 + } + } + + /** Properties of a ResourceReference. */ + interface IResourceReference { + + /** ResourceReference type */ + type?: (string|null); + + /** ResourceReference childType */ + childType?: (string|null); + } + + /** Represents a ResourceReference. */ + class ResourceReference implements IResourceReference { + + /** + * Constructs a new ResourceReference. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IResourceReference); + + /** ResourceReference type. */ + public type: string; + + /** ResourceReference childType. */ + public childType: string; + + /** + * Creates a new ResourceReference instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceReference instance + */ + public static create(properties?: google.api.IResourceReference): google.api.ResourceReference; + + /** + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @param message ResourceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @param message ResourceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceReference message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceReference + * @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.ResourceReference; + + /** + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceReference + * @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.ResourceReference; + + /** + * Verifies a ResourceReference 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 ResourceReference message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceReference + */ + public static fromObject(object: { [k: string]: any }): google.api.ResourceReference; + + /** + * 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 + */ + public static toObject(message: google.api.ResourceReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceReference to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceReference + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace protobuf. */ + namespace protobuf { + + /** Properties of a FileDescriptorSet. */ + interface IFileDescriptorSet { + + /** FileDescriptorSet file */ + file?: (google.protobuf.IFileDescriptorProto[]|null); + } + + /** Represents a FileDescriptorSet. */ + class FileDescriptorSet implements IFileDescriptorSet { + + /** + * Constructs a new FileDescriptorSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorSet); + + /** 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 + * @returns FileDescriptorSet + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorSet; + + /** + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * @param message FileDescriptorSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileDescriptorSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileDescriptorSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileDescriptorSet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + 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 { + + /** FileDescriptorProto name */ + name?: (string|null); + + /** FileDescriptorProto package */ + "package"?: (string|null); + + /** FileDescriptorProto dependency */ + dependency?: (string[]|null); + + /** FileDescriptorProto publicDependency */ + publicDependency?: (number[]|null); + + /** FileDescriptorProto weakDependency */ + weakDependency?: (number[]|null); + + /** FileDescriptorProto messageType */ + messageType?: (google.protobuf.IDescriptorProto[]|null); + + /** FileDescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + + /** FileDescriptorProto service */ + service?: (google.protobuf.IServiceDescriptorProto[]|null); + + /** FileDescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** FileDescriptorProto options */ + options?: (google.protobuf.IFileOptions|null); + + /** FileDescriptorProto sourceCodeInfo */ + sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + + /** FileDescriptorProto syntax */ + syntax?: (string|null); + + /** FileDescriptorProto edition */ + edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + } + + /** Represents a FileDescriptorProto. */ + class FileDescriptorProto implements IFileDescriptorProto { + + /** + * Constructs a new FileDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorProto); + + /** FileDescriptorProto name. */ + public name: string; + + /** FileDescriptorProto package. */ + public package: string; + + /** FileDescriptorProto dependency. */ + public dependency: string[]; + + /** FileDescriptorProto publicDependency. */ + public publicDependency: number[]; + + /** FileDescriptorProto weakDependency. */ + public weakDependency: number[]; + + /** FileDescriptorProto messageType. */ + public messageType: google.protobuf.IDescriptorProto[]; + + /** FileDescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; + + /** FileDescriptorProto service. */ + public service: google.protobuf.IServiceDescriptorProto[]; + + /** FileDescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; + + /** FileDescriptorProto options. */ + public options?: (google.protobuf.IFileOptions|null); + + /** FileDescriptorProto sourceCodeInfo. */ + public sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + + /** FileDescriptorProto syntax. */ + public syntax: string; + + /** FileDescriptorProto edition. */ + public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FileDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFileDescriptorProto): google.protobuf.FileDescriptorProto; + + /** + * 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 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. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DescriptorProto. */ + interface IDescriptorProto { + + /** DescriptorProto name */ + name?: (string|null); + + /** DescriptorProto field */ + field?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** DescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** DescriptorProto nestedType */ + nestedType?: (google.protobuf.IDescriptorProto[]|null); + + /** DescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + + /** DescriptorProto extensionRange */ + extensionRange?: (google.protobuf.DescriptorProto.IExtensionRange[]|null); + + /** DescriptorProto oneofDecl */ + oneofDecl?: (google.protobuf.IOneofDescriptorProto[]|null); + + /** DescriptorProto options */ + options?: (google.protobuf.IMessageOptions|null); + + /** DescriptorProto reservedRange */ + reservedRange?: (google.protobuf.DescriptorProto.IReservedRange[]|null); + + /** DescriptorProto reservedName */ + reservedName?: (string[]|null); + } + + /** Represents a DescriptorProto. */ + class DescriptorProto implements IDescriptorProto { + + /** + * Constructs a new DescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDescriptorProto); + + /** DescriptorProto name. */ + public name: string; + + /** DescriptorProto field. */ + public field: google.protobuf.IFieldDescriptorProto[]; + + /** DescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; + + /** DescriptorProto nestedType. */ + public nestedType: google.protobuf.IDescriptorProto[]; + + /** DescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; + + /** DescriptorProto extensionRange. */ + public extensionRange: google.protobuf.DescriptorProto.IExtensionRange[]; + + /** DescriptorProto oneofDecl. */ + public oneofDecl: google.protobuf.IOneofDescriptorProto[]; + + /** DescriptorProto options. */ + public options?: (google.protobuf.IMessageOptions|null); + + /** DescriptorProto reservedRange. */ + public reservedRange: google.protobuf.DescriptorProto.IReservedRange[]; + + /** 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 + * @returns DescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto; + + /** + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * @param message DescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DescriptorProto { + + /** Properties of an ExtensionRange. */ + interface IExtensionRange { + + /** ExtensionRange start */ + start?: (number|null); + + /** ExtensionRange end */ + end?: (number|null); + + /** ExtensionRange options */ + options?: (google.protobuf.IExtensionRangeOptions|null); + } + + /** Represents an ExtensionRange. */ + class ExtensionRange implements IExtensionRange { + + /** + * Constructs a new ExtensionRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IExtensionRange); + + /** ExtensionRange start. */ + public start: number; + + /** 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 + * @returns ExtensionRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * @param message ExtensionRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto.ExtensionRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtensionRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExtensionRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReservedRange. */ + interface IReservedRange { + + /** ReservedRange start */ + start?: (number|null); + + /** ReservedRange end */ + end?: (number|null); + } + + /** Represents a ReservedRange. */ + class ReservedRange implements IReservedRange { + + /** + * Constructs a new ReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IReservedRange); + + /** ReservedRange start. */ + public start: number; + + /** 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 + * @returns ReservedRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @param message ReservedRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto.ReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReservedRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** 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 { + + /** FieldDescriptorProto name */ + name?: (string|null); + + /** FieldDescriptorProto number */ + number?: (number|null); + + /** FieldDescriptorProto label */ + label?: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label|null); + + /** FieldDescriptorProto type */ + type?: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type|null); + + /** FieldDescriptorProto typeName */ + typeName?: (string|null); + + /** FieldDescriptorProto extendee */ + extendee?: (string|null); + + /** FieldDescriptorProto defaultValue */ + defaultValue?: (string|null); + + /** FieldDescriptorProto oneofIndex */ + oneofIndex?: (number|null); + + /** FieldDescriptorProto jsonName */ + jsonName?: (string|null); + + /** FieldDescriptorProto options */ + options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional */ + proto3Optional?: (boolean|null); + } + + /** Represents a FieldDescriptorProto. */ + class FieldDescriptorProto implements IFieldDescriptorProto { + + /** + * Constructs a new FieldDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldDescriptorProto); + + /** FieldDescriptorProto name. */ + public name: string; + + /** FieldDescriptorProto number. */ + public number: number; + + /** FieldDescriptorProto label. */ + public label: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label); + + /** FieldDescriptorProto type. */ + public type: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type); + + /** FieldDescriptorProto typeName. */ + public typeName: string; + + /** FieldDescriptorProto extendee. */ + public extendee: string; + + /** FieldDescriptorProto defaultValue. */ + public defaultValue: string; + + /** FieldDescriptorProto oneofIndex. */ + public oneofIndex: number; + + /** FieldDescriptorProto jsonName. */ + public jsonName: string; + + /** 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 + * @returns FieldDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldDescriptorProto; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @param message FieldDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FieldDescriptorProto { + + /** Type enum. */ + 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. */ + enum Label { + LABEL_OPTIONAL = 1, + LABEL_REPEATED = 3, + LABEL_REQUIRED = 2 + } + } + + /** Properties of an OneofDescriptorProto. */ + interface IOneofDescriptorProto { + + /** OneofDescriptorProto name */ + name?: (string|null); + + /** OneofDescriptorProto options */ + options?: (google.protobuf.IOneofOptions|null); + } + + /** Represents an OneofDescriptorProto. */ + class OneofDescriptorProto implements IOneofDescriptorProto { + + /** + * Constructs a new OneofDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofDescriptorProto); + + /** OneofDescriptorProto name. */ + public name: string; + + /** OneofDescriptorProto options. */ + public options?: (google.protobuf.IOneofOptions|null); + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofDescriptorProto instance + */ + public static create(properties?: google.protobuf.IOneofDescriptorProto): google.protobuf.OneofDescriptorProto; + + /** + * 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 encode(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * 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 static encodeDelimited(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * 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 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 { + + /** EnumDescriptorProto name */ + name?: (string|null); + + /** EnumDescriptorProto value */ + value?: (google.protobuf.IEnumValueDescriptorProto[]|null); + + /** EnumDescriptorProto options */ + options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange */ + reservedRange?: (google.protobuf.EnumDescriptorProto.IEnumReservedRange[]|null); + + /** EnumDescriptorProto reservedName */ + reservedName?: (string[]|null); + } + + /** Represents an EnumDescriptorProto. */ + class EnumDescriptorProto implements IEnumDescriptorProto { + + /** + * Constructs a new EnumDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumDescriptorProto); + + /** EnumDescriptorProto name. */ + public name: string; + + /** EnumDescriptorProto value. */ + public value: google.protobuf.IEnumValueDescriptorProto[]; + + /** 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 + * @returns EnumDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto; + + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @param message EnumDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + 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 { + + /** EnumValueDescriptorProto name */ + name?: (string|null); + + /** EnumValueDescriptorProto number */ + number?: (number|null); + + /** EnumValueDescriptorProto options */ + options?: (google.protobuf.IEnumValueOptions|null); + } + + /** Represents an EnumValueDescriptorProto. */ + class EnumValueDescriptorProto implements IEnumValueDescriptorProto { + + /** + * Constructs a new EnumValueDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueDescriptorProto); + + /** EnumValueDescriptorProto name. */ + public name: string; + + /** EnumValueDescriptorProto number. */ + public number: number; + + /** 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 + * @returns EnumValueDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueDescriptorProto; + + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @param message EnumValueDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumValueDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceDescriptorProto. */ + interface IServiceDescriptorProto { + + /** ServiceDescriptorProto name */ + name?: (string|null); + + /** ServiceDescriptorProto method */ + method?: (google.protobuf.IMethodDescriptorProto[]|null); + + /** ServiceDescriptorProto options */ + options?: (google.protobuf.IServiceOptions|null); + } + + /** Represents a ServiceDescriptorProto. */ + class ServiceDescriptorProto implements IServiceDescriptorProto { + + /** + * Constructs a new ServiceDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceDescriptorProto); + + /** ServiceDescriptorProto name. */ + public name: string; + + /** ServiceDescriptorProto method. */ + public method: google.protobuf.IMethodDescriptorProto[]; + + /** 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 + * @returns ServiceDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceDescriptorProto; + + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @param message ServiceDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodDescriptorProto. */ + interface IMethodDescriptorProto { + + /** MethodDescriptorProto name */ + name?: (string|null); + + /** MethodDescriptorProto inputType */ + inputType?: (string|null); + + /** MethodDescriptorProto outputType */ + outputType?: (string|null); + + /** MethodDescriptorProto options */ + options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming */ + clientStreaming?: (boolean|null); + + /** MethodDescriptorProto serverStreaming */ + serverStreaming?: (boolean|null); + } + + /** Represents a MethodDescriptorProto. */ + class MethodDescriptorProto implements IMethodDescriptorProto { + + /** + * Constructs a new MethodDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodDescriptorProto); + + /** MethodDescriptorProto name. */ + public name: string; + + /** MethodDescriptorProto inputType. */ + public inputType: string; + + /** MethodDescriptorProto outputType. */ + public outputType: string; + + /** MethodDescriptorProto options. */ + public options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming. */ + public clientStreaming: boolean; + + /** 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 + * @returns MethodDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodDescriptorProto; + + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @param message MethodDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileOptions. */ + interface IFileOptions { + + /** FileOptions javaPackage */ + javaPackage?: (string|null); + + /** FileOptions javaOuterClassname */ + javaOuterClassname?: (string|null); + + /** FileOptions javaMultipleFiles */ + javaMultipleFiles?: (boolean|null); + + /** FileOptions javaGenerateEqualsAndHash */ + javaGenerateEqualsAndHash?: (boolean|null); + + /** FileOptions javaStringCheckUtf8 */ + javaStringCheckUtf8?: (boolean|null); + + /** FileOptions optimizeFor */ + optimizeFor?: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode|null); + + /** FileOptions goPackage */ + goPackage?: (string|null); + + /** FileOptions ccGenericServices */ + ccGenericServices?: (boolean|null); + + /** FileOptions javaGenericServices */ + javaGenericServices?: (boolean|null); + + /** FileOptions pyGenericServices */ + pyGenericServices?: (boolean|null); + + /** FileOptions deprecated */ + deprecated?: (boolean|null); + + /** FileOptions ccEnableArenas */ + ccEnableArenas?: (boolean|null); + + /** FileOptions objcClassPrefix */ + objcClassPrefix?: (string|null); + + /** 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. */ + class FileOptions implements IFileOptions { + + /** + * Constructs a new FileOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileOptions); + + /** FileOptions javaPackage. */ + public javaPackage: string; + + /** FileOptions javaOuterClassname. */ + public javaOuterClassname: string; + + /** FileOptions javaMultipleFiles. */ + public javaMultipleFiles: boolean; + + /** FileOptions javaGenerateEqualsAndHash. */ + public javaGenerateEqualsAndHash: boolean; + + /** FileOptions javaStringCheckUtf8. */ + public javaStringCheckUtf8: boolean; + + /** FileOptions optimizeFor. */ + public optimizeFor: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode); + + /** FileOptions goPackage. */ + public goPackage: string; + + /** FileOptions ccGenericServices. */ + public ccGenericServices: boolean; + + /** FileOptions javaGenericServices. */ + public javaGenericServices: boolean; + + /** FileOptions pyGenericServices. */ + public pyGenericServices: boolean; + + /** FileOptions deprecated. */ + public deprecated: boolean; + + /** FileOptions ccEnableArenas. */ + public ccEnableArenas: boolean; + + /** FileOptions objcClassPrefix. */ + public objcClassPrefix: string; + + /** 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 + * @returns FileOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileOptions; + + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @param message FileOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FileOptions { + + /** OptimizeMode enum. */ + enum OptimizeMode { + SPEED = 1, + CODE_SIZE = 2, + LITE_RUNTIME = 3 + } + } + + /** Properties of a MessageOptions. */ + interface IMessageOptions { + + /** MessageOptions messageSetWireFormat */ + messageSetWireFormat?: (boolean|null); + + /** MessageOptions noStandardDescriptorAccessor */ + noStandardDescriptorAccessor?: (boolean|null); + + /** MessageOptions deprecated */ + deprecated?: (boolean|null); + + /** 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. */ + class MessageOptions implements IMessageOptions { + + /** + * Constructs a new MessageOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMessageOptions); + + /** MessageOptions messageSetWireFormat. */ + public messageSetWireFormat: boolean; + + /** MessageOptions noStandardDescriptorAccessor. */ + public noStandardDescriptorAccessor: boolean; + + /** MessageOptions deprecated. */ + public deprecated: boolean; + + /** 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 + * @returns MessageOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MessageOptions; + + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @param message MessageOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MessageOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MessageOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MessageOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FieldOptions. */ + interface IFieldOptions { + + /** FieldOptions ctype */ + ctype?: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType|null); + + /** FieldOptions packed */ + packed?: (boolean|null); + + /** FieldOptions jstype */ + 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. */ + class FieldOptions implements IFieldOptions { + + /** + * Constructs a new FieldOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldOptions); + + /** 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|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 debugRedact. */ + public debugRedact: boolean; + + /** 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 + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions; + + /** + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * @param message FieldOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FieldOptions { + + /** CType enum. */ + enum CType { + STRING = 0, + CORD = 1, + STRING_PIECE = 2 + } + + /** JSType enum. */ + 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); + } + + /** Represents an OneofOptions. */ + class OneofOptions implements IOneofOptions { + + /** + * Constructs a new OneofOptions. + * @param [properties] Properties to set + */ + 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 + * @returns OneofOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofOptions; + + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @param message OneofOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneofOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OneofOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumOptions. */ + interface IEnumOptions { + + /** EnumOptions allowAlias */ + allowAlias?: (boolean|null); + + /** EnumOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumOptions deprecatedLegacyJsonFieldConflicts */ + deprecatedLegacyJsonFieldConflicts?: (boolean|null); + + /** EnumOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** EnumOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an EnumOptions. */ + class EnumOptions implements IEnumOptions { + + /** + * Constructs a new EnumOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumOptions); + + /** EnumOptions allowAlias. */ + public allowAlias: boolean; + + /** 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 + * @returns EnumOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumOptions; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @param message EnumOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumValueOptions. */ + interface IEnumValueOptions { + + /** EnumValueOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumValueOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** EnumValueOptions debugRedact */ + debugRedact?: (boolean|null); + + /** EnumValueOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an EnumValueOptions. */ + class EnumValueOptions implements IEnumValueOptions { + + /** + * Constructs a new EnumValueOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueOptions); + + /** 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 + * @returns EnumValueOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueOptions; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @param message EnumValueOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumValueOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceOptions. */ + interface IServiceOptions { + + /** ServiceOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** ServiceOptions deprecated */ + deprecated?: (boolean|null); + + /** ServiceOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** ServiceOptions .google.api.defaultHost */ + ".google.api.defaultHost"?: (string|null); + + /** ServiceOptions .google.api.oauthScopes */ + ".google.api.oauthScopes"?: (string|null); + + /** ServiceOptions .google.api.apiVersion */ + ".google.api.apiVersion"?: (string|null); + } + + /** Represents a ServiceOptions. */ + class ServiceOptions implements IServiceOptions { + + /** + * Constructs a new ServiceOptions. + * @param [properties] Properties to set + */ + 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 + * @returns ServiceOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceOptions; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @param message ServiceOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodOptions. */ + interface IMethodOptions { + + /** 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); + + /** MethodOptions .google.api.http */ + ".google.api.http"?: (google.api.IHttpRule|null); + + /** MethodOptions .google.api.methodSignature */ + ".google.api.methodSignature"?: (string[]|null); + } + + /** Represents a MethodOptions. */ + class MethodOptions implements IMethodOptions { + + /** + * Constructs a new MethodOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodOptions); + + /** 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 + * @returns MethodOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodOptions; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @param message MethodOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + 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 { + + /** UninterpretedOption name */ + name?: (google.protobuf.UninterpretedOption.INamePart[]|null); + + /** UninterpretedOption identifierValue */ + identifierValue?: (string|null); + + /** UninterpretedOption positiveIntValue */ + positiveIntValue?: (number|Long|string|null); + + /** UninterpretedOption negativeIntValue */ + negativeIntValue?: (number|Long|string|null); + + /** UninterpretedOption doubleValue */ + doubleValue?: (number|null); + + /** UninterpretedOption stringValue */ + stringValue?: (Uint8Array|string|null); + + /** UninterpretedOption aggregateValue */ + aggregateValue?: (string|null); + } + + /** Represents an UninterpretedOption. */ + class UninterpretedOption implements IUninterpretedOption { + + /** + * Constructs a new UninterpretedOption. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUninterpretedOption); + + /** UninterpretedOption name. */ + public name: google.protobuf.UninterpretedOption.INamePart[]; + + /** UninterpretedOption identifierValue. */ + public identifierValue: string; + + /** UninterpretedOption positiveIntValue. */ + public positiveIntValue: (number|Long|string); + + /** UninterpretedOption negativeIntValue. */ + public negativeIntValue: (number|Long|string); + + /** UninterpretedOption doubleValue. */ + public doubleValue: number; + + /** UninterpretedOption stringValue. */ + 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 + * @returns UninterpretedOption + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @param message UninterpretedOption + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UninterpretedOption to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UninterpretedOption + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace UninterpretedOption { + + /** Properties of a NamePart. */ + interface INamePart { + + /** NamePart namePart */ + namePart: string; + + /** NamePart isExtension */ + isExtension: boolean; + } + + /** Represents a NamePart. */ + class NamePart implements INamePart { + + /** + * Constructs a new NamePart. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.UninterpretedOption.INamePart); + + /** NamePart namePart. */ + public namePart: string; + + /** 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 + * @returns NamePart + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption.NamePart; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @param message NamePart + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption.NamePart, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NamePart to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NamePart + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** 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 */ + location?: (google.protobuf.SourceCodeInfo.ILocation[]|null); + } + + /** Represents a SourceCodeInfo. */ + class SourceCodeInfo implements ISourceCodeInfo { + + /** + * Constructs a new SourceCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ISourceCodeInfo); + + /** 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 + * @returns SourceCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @param message SourceCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SourceCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SourceCodeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SourceCodeInfo { + + /** Properties of a Location. */ + interface ILocation { + + /** Location path */ + path?: (number[]|null); + + /** Location span */ + span?: (number[]|null); + + /** Location leadingComments */ + leadingComments?: (string|null); + + /** Location trailingComments */ + trailingComments?: (string|null); + + /** Location leadingDetachedComments */ + leadingDetachedComments?: (string[]|null); + } + + /** Represents a Location. */ + class Location implements ILocation { + + /** + * Constructs a new Location. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.SourceCodeInfo.ILocation); + + /** Location path. */ + public path: number[]; + + /** Location span. */ + public span: number[]; + + /** Location leadingComments. */ + public leadingComments: string; + + /** Location trailingComments. */ + public trailingComments: string; + + /** 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 + * @returns Location + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo.Location; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @param message Location + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo.Location, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Location to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Location + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a GeneratedCodeInfo. */ + interface IGeneratedCodeInfo { + + /** GeneratedCodeInfo annotation */ + annotation?: (google.protobuf.GeneratedCodeInfo.IAnnotation[]|null); + } + + /** Represents a GeneratedCodeInfo. */ + class GeneratedCodeInfo implements IGeneratedCodeInfo { + + /** + * Constructs a new GeneratedCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IGeneratedCodeInfo); + + /** 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 + * @returns GeneratedCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @param message GeneratedCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GeneratedCodeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GeneratedCodeInfo { + + /** Properties of an Annotation. */ + interface IAnnotation { + + /** Annotation path */ + path?: (number[]|null); + + /** Annotation sourceFile */ + sourceFile?: (string|null); + + /** Annotation begin */ + begin?: (number|null); + + /** Annotation end */ + end?: (number|null); + + /** Annotation semantic */ + semantic?: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null); + } + + /** Represents an Annotation. */ + class Annotation implements IAnnotation { + + /** + * Constructs a new Annotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation); + + /** Annotation path. */ + public path: number[]; + + /** Annotation sourceFile. */ + public sourceFile: string; + + /** Annotation begin. */ + public begin: number; + + /** Annotation end. */ + public end: number; + + /** Annotation semantic. */ + public semantic: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic); + + /** + * Creates a new Annotation instance using the specified properties. + * @param [properties] Properties to set + * @returns Annotation instance + */ + public static create(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * 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 encode(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * 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 }; + + /** + * Gets the default type url for Annotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Annotation { + + /** Semantic enum. */ + enum Semantic { + NONE = 0, + SET = 1, + ALIAS = 2 + } + } + } + + /** Properties of a Duration. */ + interface IDuration { + + /** Duration seconds */ + seconds?: (number|Long|string|null); + + /** Duration nanos */ + nanos?: (number|null); + } + + /** Represents a Duration. */ + class Duration implements IDuration { + + /** + * Constructs a new Duration. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDuration); + + /** Duration seconds. */ + public seconds: (number|Long|string); + + /** Duration nanos. */ + public nanos: number; + + /** + * 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 Duration + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Duration; + + /** + * 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.Duration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Duration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Duration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Empty. */ + interface IEmpty { + } + + /** Represents an Empty. */ + class Empty implements IEmpty { + + /** + * Constructs a new Empty. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEmpty); + + /** + * Creates a new Empty instance using the specified properties. + * @param [properties] Properties to set + * @returns Empty instance + */ + public static create(properties?: google.protobuf.IEmpty): google.protobuf.Empty; + + /** + * 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 encode(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * 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 static encodeDelimited(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * 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 decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Empty; + + /** + * 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 + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Empty; + + /** + * 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 an Empty message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Empty + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Empty; + + /** + * 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.Empty, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Empty to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * 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 FieldMask. */ + interface IFieldMask { + + /** FieldMask paths */ + paths?: (string[]|null); + } + + /** Represents a FieldMask. */ + class FieldMask implements IFieldMask { + + /** + * Constructs a new FieldMask. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldMask); + + /** FieldMask paths. */ + public paths: string[]; + + /** + * Creates a new FieldMask instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldMask instance + */ + public static create(properties?: google.protobuf.IFieldMask): google.protobuf.FieldMask; + + /** + * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @param message FieldMask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @param message FieldMask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldMask message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldMask + * @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.FieldMask; + + /** + * Decodes a FieldMask message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldMask + * @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.FieldMask; + + /** + * Verifies a FieldMask 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. + * @param object Plain object + * @returns FieldMask + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldMask; + + /** + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. + * @param message FieldMask + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldMask, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldMask to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldMask + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + 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; + } + } +} diff --git a/owl-bot-staging/v1/protos/protos.js b/owl-bot-staging/v1/protos/protos.js new file mode 100644 index 000000000..b439f7b68 --- /dev/null +++ b/owl-bot-staging/v1/protos/protos.js @@ -0,0 +1,38732 @@ +// 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 */ + + /* AMD */ if (typeof define === 'function' && define.amd) + define(["protobufjs/minimal"], factory); + + /* CommonJS */ else if (typeof require === 'function' && typeof module === 'object' && module && module.exports) + module.exports = factory(require("google-gax/build/src/protobuf").protobufMinimal); + +})(this, function($protobuf) { + "use strict"; + + // Common aliases + var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + + // Exported root namespace + var $root = $protobuf.roots._google_cloud_pubsub_protos || ($protobuf.roots._google_cloud_pubsub_protos = {}); + + $root.google = (function() { + + /** + * Namespace google. + * @exports google + * @namespace + */ + var google = {}; + + google.pubsub = (function() { + + /** + * Namespace pubsub. + * @memberof google + * @namespace + */ + var pubsub = {}; + + pubsub.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.pubsub + * @namespace + */ + var v1 = {}; + + v1.Publisher = (function() { + + /** + * Constructs a new Publisher service. + * @memberof google.pubsub.v1 + * @classdesc Represents a Publisher + * @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 Publisher(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Publisher.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Publisher; + + /** + * Creates new Publisher service using the specified rpc implementation. + * @function create + * @memberof google.pubsub.v1.Publisher + * @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 {Publisher} RPC service. Useful where requests and/or responses are streamed. + */ + Publisher.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.pubsub.v1.Publisher|createTopic}. + * @memberof google.pubsub.v1.Publisher + * @typedef CreateTopicCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.pubsub.v1.Topic} [response] Topic + */ + + /** + * Calls CreateTopic. + * @function createTopic + * @memberof google.pubsub.v1.Publisher + * @instance + * @param {google.pubsub.v1.ITopic} request Topic message or plain object + * @param {google.pubsub.v1.Publisher.CreateTopicCallback} callback Node-style callback called with the error, if any, and Topic + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Publisher.prototype.createTopic = function createTopic(request, callback) { + return this.rpcCall(createTopic, $root.google.pubsub.v1.Topic, $root.google.pubsub.v1.Topic, request, callback); + }, "name", { value: "CreateTopic" }); + + /** + * Calls CreateTopic. + * @function createTopic + * @memberof google.pubsub.v1.Publisher + * @instance + * @param {google.pubsub.v1.ITopic} request Topic message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.pubsub.v1.Publisher|updateTopic}. + * @memberof google.pubsub.v1.Publisher + * @typedef UpdateTopicCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.pubsub.v1.Topic} [response] Topic + */ + + /** + * Calls UpdateTopic. + * @function updateTopic + * @memberof google.pubsub.v1.Publisher + * @instance + * @param {google.pubsub.v1.IUpdateTopicRequest} request UpdateTopicRequest message or plain object + * @param {google.pubsub.v1.Publisher.UpdateTopicCallback} callback Node-style callback called with the error, if any, and Topic + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Publisher.prototype.updateTopic = function updateTopic(request, callback) { + return this.rpcCall(updateTopic, $root.google.pubsub.v1.UpdateTopicRequest, $root.google.pubsub.v1.Topic, request, callback); + }, "name", { value: "UpdateTopic" }); + + /** + * Calls UpdateTopic. + * @function updateTopic + * @memberof google.pubsub.v1.Publisher + * @instance + * @param {google.pubsub.v1.IUpdateTopicRequest} request UpdateTopicRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.pubsub.v1.Publisher|publish}. + * @memberof google.pubsub.v1.Publisher + * @typedef PublishCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.pubsub.v1.PublishResponse} [response] PublishResponse + */ + + /** + * Calls Publish. + * @function publish + * @memberof google.pubsub.v1.Publisher + * @instance + * @param {google.pubsub.v1.IPublishRequest} request PublishRequest message or plain object + * @param {google.pubsub.v1.Publisher.PublishCallback} callback Node-style callback called with the error, if any, and PublishResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Publisher.prototype.publish = function publish(request, callback) { + return this.rpcCall(publish, $root.google.pubsub.v1.PublishRequest, $root.google.pubsub.v1.PublishResponse, request, callback); + }, "name", { value: "Publish" }); + + /** + * Calls Publish. + * @function publish + * @memberof google.pubsub.v1.Publisher + * @instance + * @param {google.pubsub.v1.IPublishRequest} request PublishRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.pubsub.v1.Publisher|getTopic}. + * @memberof google.pubsub.v1.Publisher + * @typedef GetTopicCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.pubsub.v1.Topic} [response] Topic + */ + + /** + * Calls GetTopic. + * @function getTopic + * @memberof google.pubsub.v1.Publisher + * @instance + * @param {google.pubsub.v1.IGetTopicRequest} request GetTopicRequest message or plain object + * @param {google.pubsub.v1.Publisher.GetTopicCallback} callback Node-style callback called with the error, if any, and Topic + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Publisher.prototype.getTopic = function getTopic(request, callback) { + return this.rpcCall(getTopic, $root.google.pubsub.v1.GetTopicRequest, $root.google.pubsub.v1.Topic, request, callback); + }, "name", { value: "GetTopic" }); + + /** + * Calls GetTopic. + * @function getTopic + * @memberof google.pubsub.v1.Publisher + * @instance + * @param {google.pubsub.v1.IGetTopicRequest} request GetTopicRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.pubsub.v1.Publisher|listTopics}. + * @memberof google.pubsub.v1.Publisher + * @typedef ListTopicsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.pubsub.v1.ListTopicsResponse} [response] ListTopicsResponse + */ + + /** + * Calls ListTopics. + * @function listTopics + * @memberof google.pubsub.v1.Publisher + * @instance + * @param {google.pubsub.v1.IListTopicsRequest} request ListTopicsRequest message or plain object + * @param {google.pubsub.v1.Publisher.ListTopicsCallback} callback Node-style callback called with the error, if any, and ListTopicsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Publisher.prototype.listTopics = function listTopics(request, callback) { + return this.rpcCall(listTopics, $root.google.pubsub.v1.ListTopicsRequest, $root.google.pubsub.v1.ListTopicsResponse, request, callback); + }, "name", { value: "ListTopics" }); + + /** + * Calls ListTopics. + * @function listTopics + * @memberof google.pubsub.v1.Publisher + * @instance + * @param {google.pubsub.v1.IListTopicsRequest} request ListTopicsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.pubsub.v1.Publisher|listTopicSubscriptions}. + * @memberof google.pubsub.v1.Publisher + * @typedef ListTopicSubscriptionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.pubsub.v1.ListTopicSubscriptionsResponse} [response] ListTopicSubscriptionsResponse + */ + + /** + * Calls ListTopicSubscriptions. + * @function listTopicSubscriptions + * @memberof google.pubsub.v1.Publisher + * @instance + * @param {google.pubsub.v1.IListTopicSubscriptionsRequest} request ListTopicSubscriptionsRequest message or plain object + * @param {google.pubsub.v1.Publisher.ListTopicSubscriptionsCallback} callback Node-style callback called with the error, if any, and ListTopicSubscriptionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Publisher.prototype.listTopicSubscriptions = function listTopicSubscriptions(request, callback) { + return this.rpcCall(listTopicSubscriptions, $root.google.pubsub.v1.ListTopicSubscriptionsRequest, $root.google.pubsub.v1.ListTopicSubscriptionsResponse, request, callback); + }, "name", { value: "ListTopicSubscriptions" }); + + /** + * Calls ListTopicSubscriptions. + * @function listTopicSubscriptions + * @memberof google.pubsub.v1.Publisher + * @instance + * @param {google.pubsub.v1.IListTopicSubscriptionsRequest} request ListTopicSubscriptionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.pubsub.v1.Publisher|listTopicSnapshots}. + * @memberof google.pubsub.v1.Publisher + * @typedef ListTopicSnapshotsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.pubsub.v1.ListTopicSnapshotsResponse} [response] ListTopicSnapshotsResponse + */ + + /** + * Calls ListTopicSnapshots. + * @function listTopicSnapshots + * @memberof google.pubsub.v1.Publisher + * @instance + * @param {google.pubsub.v1.IListTopicSnapshotsRequest} request ListTopicSnapshotsRequest message or plain object + * @param {google.pubsub.v1.Publisher.ListTopicSnapshotsCallback} callback Node-style callback called with the error, if any, and ListTopicSnapshotsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Publisher.prototype.listTopicSnapshots = function listTopicSnapshots(request, callback) { + return this.rpcCall(listTopicSnapshots, $root.google.pubsub.v1.ListTopicSnapshotsRequest, $root.google.pubsub.v1.ListTopicSnapshotsResponse, request, callback); + }, "name", { value: "ListTopicSnapshots" }); + + /** + * Calls ListTopicSnapshots. + * @function listTopicSnapshots + * @memberof google.pubsub.v1.Publisher + * @instance + * @param {google.pubsub.v1.IListTopicSnapshotsRequest} request ListTopicSnapshotsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.pubsub.v1.Publisher|deleteTopic}. + * @memberof google.pubsub.v1.Publisher + * @typedef DeleteTopicCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteTopic. + * @function deleteTopic + * @memberof google.pubsub.v1.Publisher + * @instance + * @param {google.pubsub.v1.IDeleteTopicRequest} request DeleteTopicRequest message or plain object + * @param {google.pubsub.v1.Publisher.DeleteTopicCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Publisher.prototype.deleteTopic = function deleteTopic(request, callback) { + return this.rpcCall(deleteTopic, $root.google.pubsub.v1.DeleteTopicRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteTopic" }); + + /** + * Calls DeleteTopic. + * @function deleteTopic + * @memberof google.pubsub.v1.Publisher + * @instance + * @param {google.pubsub.v1.IDeleteTopicRequest} request DeleteTopicRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.pubsub.v1.Publisher|detachSubscription}. + * @memberof google.pubsub.v1.Publisher + * @typedef DetachSubscriptionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.pubsub.v1.DetachSubscriptionResponse} [response] DetachSubscriptionResponse + */ + + /** + * Calls DetachSubscription. + * @function detachSubscription + * @memberof google.pubsub.v1.Publisher + * @instance + * @param {google.pubsub.v1.IDetachSubscriptionRequest} request DetachSubscriptionRequest message or plain object + * @param {google.pubsub.v1.Publisher.DetachSubscriptionCallback} callback Node-style callback called with the error, if any, and DetachSubscriptionResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Publisher.prototype.detachSubscription = function detachSubscription(request, callback) { + return this.rpcCall(detachSubscription, $root.google.pubsub.v1.DetachSubscriptionRequest, $root.google.pubsub.v1.DetachSubscriptionResponse, request, callback); + }, "name", { value: "DetachSubscription" }); + + /** + * Calls DetachSubscription. + * @function detachSubscription + * @memberof google.pubsub.v1.Publisher + * @instance + * @param {google.pubsub.v1.IDetachSubscriptionRequest} request DetachSubscriptionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Publisher; + })(); + + v1.MessageStoragePolicy = (function() { + + /** + * Properties of a MessageStoragePolicy. + * @memberof google.pubsub.v1 + * @interface IMessageStoragePolicy + * @property {Array.|null} [allowedPersistenceRegions] MessageStoragePolicy allowedPersistenceRegions + * @property {boolean|null} [enforceInTransit] MessageStoragePolicy enforceInTransit + */ + + /** + * Constructs a new MessageStoragePolicy. + * @memberof google.pubsub.v1 + * @classdesc Represents a MessageStoragePolicy. + * @implements IMessageStoragePolicy + * @constructor + * @param {google.pubsub.v1.IMessageStoragePolicy=} [properties] Properties to set + */ + function MessageStoragePolicy(properties) { + this.allowedPersistenceRegions = []; + 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]]; + } + + /** + * MessageStoragePolicy allowedPersistenceRegions. + * @member {Array.} allowedPersistenceRegions + * @memberof google.pubsub.v1.MessageStoragePolicy + * @instance + */ + MessageStoragePolicy.prototype.allowedPersistenceRegions = $util.emptyArray; + + /** + * MessageStoragePolicy enforceInTransit. + * @member {boolean} enforceInTransit + * @memberof google.pubsub.v1.MessageStoragePolicy + * @instance + */ + MessageStoragePolicy.prototype.enforceInTransit = false; + + /** + * Creates a new MessageStoragePolicy instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.MessageStoragePolicy + * @static + * @param {google.pubsub.v1.IMessageStoragePolicy=} [properties] Properties to set + * @returns {google.pubsub.v1.MessageStoragePolicy} MessageStoragePolicy instance + */ + MessageStoragePolicy.create = function create(properties) { + return new MessageStoragePolicy(properties); + }; + + /** + * Encodes the specified MessageStoragePolicy message. Does not implicitly {@link google.pubsub.v1.MessageStoragePolicy.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.MessageStoragePolicy + * @static + * @param {google.pubsub.v1.IMessageStoragePolicy} message MessageStoragePolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageStoragePolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowedPersistenceRegions != null && message.allowedPersistenceRegions.length) + for (var i = 0; i < message.allowedPersistenceRegions.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.allowedPersistenceRegions[i]); + if (message.enforceInTransit != null && Object.hasOwnProperty.call(message, "enforceInTransit")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.enforceInTransit); + return writer; + }; + + /** + * Encodes the specified MessageStoragePolicy message, length delimited. Does not implicitly {@link google.pubsub.v1.MessageStoragePolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.MessageStoragePolicy + * @static + * @param {google.pubsub.v1.IMessageStoragePolicy} message MessageStoragePolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageStoragePolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MessageStoragePolicy message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.MessageStoragePolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.MessageStoragePolicy} MessageStoragePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageStoragePolicy.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.pubsub.v1.MessageStoragePolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.allowedPersistenceRegions && message.allowedPersistenceRegions.length)) + message.allowedPersistenceRegions = []; + message.allowedPersistenceRegions.push(reader.string()); + break; + } + case 2: { + message.enforceInTransit = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MessageStoragePolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.MessageStoragePolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.MessageStoragePolicy} MessageStoragePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageStoragePolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MessageStoragePolicy message. + * @function verify + * @memberof google.pubsub.v1.MessageStoragePolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MessageStoragePolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.allowedPersistenceRegions != null && message.hasOwnProperty("allowedPersistenceRegions")) { + if (!Array.isArray(message.allowedPersistenceRegions)) + return "allowedPersistenceRegions: array expected"; + for (var i = 0; i < message.allowedPersistenceRegions.length; ++i) + if (!$util.isString(message.allowedPersistenceRegions[i])) + return "allowedPersistenceRegions: string[] expected"; + } + if (message.enforceInTransit != null && message.hasOwnProperty("enforceInTransit")) + if (typeof message.enforceInTransit !== "boolean") + return "enforceInTransit: boolean expected"; + return null; + }; + + /** + * Creates a MessageStoragePolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.MessageStoragePolicy + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.MessageStoragePolicy} MessageStoragePolicy + */ + MessageStoragePolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.MessageStoragePolicy) + return object; + var message = new $root.google.pubsub.v1.MessageStoragePolicy(); + if (object.allowedPersistenceRegions) { + if (!Array.isArray(object.allowedPersistenceRegions)) + throw TypeError(".google.pubsub.v1.MessageStoragePolicy.allowedPersistenceRegions: array expected"); + message.allowedPersistenceRegions = []; + for (var i = 0; i < object.allowedPersistenceRegions.length; ++i) + message.allowedPersistenceRegions[i] = String(object.allowedPersistenceRegions[i]); + } + if (object.enforceInTransit != null) + message.enforceInTransit = Boolean(object.enforceInTransit); + return message; + }; + + /** + * Creates a plain object from a MessageStoragePolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.MessageStoragePolicy + * @static + * @param {google.pubsub.v1.MessageStoragePolicy} message MessageStoragePolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MessageStoragePolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.allowedPersistenceRegions = []; + if (options.defaults) + object.enforceInTransit = false; + if (message.allowedPersistenceRegions && message.allowedPersistenceRegions.length) { + object.allowedPersistenceRegions = []; + for (var j = 0; j < message.allowedPersistenceRegions.length; ++j) + object.allowedPersistenceRegions[j] = message.allowedPersistenceRegions[j]; + } + if (message.enforceInTransit != null && message.hasOwnProperty("enforceInTransit")) + object.enforceInTransit = message.enforceInTransit; + return object; + }; + + /** + * Converts this MessageStoragePolicy to JSON. + * @function toJSON + * @memberof google.pubsub.v1.MessageStoragePolicy + * @instance + * @returns {Object.} JSON object + */ + MessageStoragePolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MessageStoragePolicy + * @function getTypeUrl + * @memberof google.pubsub.v1.MessageStoragePolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MessageStoragePolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.MessageStoragePolicy"; + }; + + return MessageStoragePolicy; + })(); + + v1.SchemaSettings = (function() { + + /** + * Properties of a SchemaSettings. + * @memberof google.pubsub.v1 + * @interface ISchemaSettings + * @property {string|null} [schema] SchemaSettings schema + * @property {google.pubsub.v1.Encoding|null} [encoding] SchemaSettings encoding + * @property {string|null} [firstRevisionId] SchemaSettings firstRevisionId + * @property {string|null} [lastRevisionId] SchemaSettings lastRevisionId + */ + + /** + * Constructs a new SchemaSettings. + * @memberof google.pubsub.v1 + * @classdesc Represents a SchemaSettings. + * @implements ISchemaSettings + * @constructor + * @param {google.pubsub.v1.ISchemaSettings=} [properties] Properties to set + */ + function SchemaSettings(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]]; + } + + /** + * SchemaSettings schema. + * @member {string} schema + * @memberof google.pubsub.v1.SchemaSettings + * @instance + */ + SchemaSettings.prototype.schema = ""; + + /** + * SchemaSettings encoding. + * @member {google.pubsub.v1.Encoding} encoding + * @memberof google.pubsub.v1.SchemaSettings + * @instance + */ + SchemaSettings.prototype.encoding = 0; + + /** + * SchemaSettings firstRevisionId. + * @member {string} firstRevisionId + * @memberof google.pubsub.v1.SchemaSettings + * @instance + */ + SchemaSettings.prototype.firstRevisionId = ""; + + /** + * SchemaSettings lastRevisionId. + * @member {string} lastRevisionId + * @memberof google.pubsub.v1.SchemaSettings + * @instance + */ + SchemaSettings.prototype.lastRevisionId = ""; + + /** + * Creates a new SchemaSettings instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.SchemaSettings + * @static + * @param {google.pubsub.v1.ISchemaSettings=} [properties] Properties to set + * @returns {google.pubsub.v1.SchemaSettings} SchemaSettings instance + */ + SchemaSettings.create = function create(properties) { + return new SchemaSettings(properties); + }; + + /** + * Encodes the specified SchemaSettings message. Does not implicitly {@link google.pubsub.v1.SchemaSettings.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.SchemaSettings + * @static + * @param {google.pubsub.v1.ISchemaSettings} message SchemaSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SchemaSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.schema != null && Object.hasOwnProperty.call(message, "schema")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.schema); + if (message.encoding != null && Object.hasOwnProperty.call(message, "encoding")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.encoding); + if (message.firstRevisionId != null && Object.hasOwnProperty.call(message, "firstRevisionId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.firstRevisionId); + if (message.lastRevisionId != null && Object.hasOwnProperty.call(message, "lastRevisionId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.lastRevisionId); + return writer; + }; + + /** + * Encodes the specified SchemaSettings message, length delimited. Does not implicitly {@link google.pubsub.v1.SchemaSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.SchemaSettings + * @static + * @param {google.pubsub.v1.ISchemaSettings} message SchemaSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SchemaSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SchemaSettings message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.SchemaSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.SchemaSettings} SchemaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SchemaSettings.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.pubsub.v1.SchemaSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.schema = reader.string(); + break; + } + case 2: { + message.encoding = reader.int32(); + break; + } + case 3: { + message.firstRevisionId = reader.string(); + break; + } + case 4: { + message.lastRevisionId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SchemaSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.SchemaSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.SchemaSettings} SchemaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SchemaSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SchemaSettings message. + * @function verify + * @memberof google.pubsub.v1.SchemaSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SchemaSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.schema != null && message.hasOwnProperty("schema")) + if (!$util.isString(message.schema)) + return "schema: string expected"; + if (message.encoding != null && message.hasOwnProperty("encoding")) + switch (message.encoding) { + default: + return "encoding: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.firstRevisionId != null && message.hasOwnProperty("firstRevisionId")) + if (!$util.isString(message.firstRevisionId)) + return "firstRevisionId: string expected"; + if (message.lastRevisionId != null && message.hasOwnProperty("lastRevisionId")) + if (!$util.isString(message.lastRevisionId)) + return "lastRevisionId: string expected"; + return null; + }; + + /** + * Creates a SchemaSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.SchemaSettings + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.SchemaSettings} SchemaSettings + */ + SchemaSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.SchemaSettings) + return object; + var message = new $root.google.pubsub.v1.SchemaSettings(); + if (object.schema != null) + message.schema = String(object.schema); + switch (object.encoding) { + default: + if (typeof object.encoding === "number") { + message.encoding = object.encoding; + break; + } + break; + case "ENCODING_UNSPECIFIED": + case 0: + message.encoding = 0; + break; + case "JSON": + case 1: + message.encoding = 1; + break; + case "BINARY": + case 2: + message.encoding = 2; + break; + } + if (object.firstRevisionId != null) + message.firstRevisionId = String(object.firstRevisionId); + if (object.lastRevisionId != null) + message.lastRevisionId = String(object.lastRevisionId); + return message; + }; + + /** + * Creates a plain object from a SchemaSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.SchemaSettings + * @static + * @param {google.pubsub.v1.SchemaSettings} message SchemaSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SchemaSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.schema = ""; + object.encoding = options.enums === String ? "ENCODING_UNSPECIFIED" : 0; + object.firstRevisionId = ""; + object.lastRevisionId = ""; + } + if (message.schema != null && message.hasOwnProperty("schema")) + object.schema = message.schema; + if (message.encoding != null && message.hasOwnProperty("encoding")) + object.encoding = options.enums === String ? $root.google.pubsub.v1.Encoding[message.encoding] === undefined ? message.encoding : $root.google.pubsub.v1.Encoding[message.encoding] : message.encoding; + if (message.firstRevisionId != null && message.hasOwnProperty("firstRevisionId")) + object.firstRevisionId = message.firstRevisionId; + if (message.lastRevisionId != null && message.hasOwnProperty("lastRevisionId")) + object.lastRevisionId = message.lastRevisionId; + return object; + }; + + /** + * Converts this SchemaSettings to JSON. + * @function toJSON + * @memberof google.pubsub.v1.SchemaSettings + * @instance + * @returns {Object.} JSON object + */ + SchemaSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SchemaSettings + * @function getTypeUrl + * @memberof google.pubsub.v1.SchemaSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SchemaSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.SchemaSettings"; + }; + + return SchemaSettings; + })(); + + v1.IngestionDataSourceSettings = (function() { + + /** + * Properties of an IngestionDataSourceSettings. + * @memberof google.pubsub.v1 + * @interface IIngestionDataSourceSettings + * @property {google.pubsub.v1.IngestionDataSourceSettings.IAwsKinesis|null} [awsKinesis] IngestionDataSourceSettings awsKinesis + */ + + /** + * Constructs a new IngestionDataSourceSettings. + * @memberof google.pubsub.v1 + * @classdesc Represents an IngestionDataSourceSettings. + * @implements IIngestionDataSourceSettings + * @constructor + * @param {google.pubsub.v1.IIngestionDataSourceSettings=} [properties] Properties to set + */ + function IngestionDataSourceSettings(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]]; + } + + /** + * IngestionDataSourceSettings awsKinesis. + * @member {google.pubsub.v1.IngestionDataSourceSettings.IAwsKinesis|null|undefined} awsKinesis + * @memberof google.pubsub.v1.IngestionDataSourceSettings + * @instance + */ + IngestionDataSourceSettings.prototype.awsKinesis = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * IngestionDataSourceSettings source. + * @member {"awsKinesis"|undefined} source + * @memberof google.pubsub.v1.IngestionDataSourceSettings + * @instance + */ + Object.defineProperty(IngestionDataSourceSettings.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["awsKinesis"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new IngestionDataSourceSettings instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.IngestionDataSourceSettings + * @static + * @param {google.pubsub.v1.IIngestionDataSourceSettings=} [properties] Properties to set + * @returns {google.pubsub.v1.IngestionDataSourceSettings} IngestionDataSourceSettings instance + */ + IngestionDataSourceSettings.create = function create(properties) { + return new IngestionDataSourceSettings(properties); + }; + + /** + * Encodes the specified IngestionDataSourceSettings message. Does not implicitly {@link google.pubsub.v1.IngestionDataSourceSettings.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.IngestionDataSourceSettings + * @static + * @param {google.pubsub.v1.IIngestionDataSourceSettings} message IngestionDataSourceSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IngestionDataSourceSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.awsKinesis != null && Object.hasOwnProperty.call(message, "awsKinesis")) + $root.google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis.encode(message.awsKinesis, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified IngestionDataSourceSettings message, length delimited. Does not implicitly {@link google.pubsub.v1.IngestionDataSourceSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.IngestionDataSourceSettings + * @static + * @param {google.pubsub.v1.IIngestionDataSourceSettings} message IngestionDataSourceSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IngestionDataSourceSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IngestionDataSourceSettings message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.IngestionDataSourceSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.IngestionDataSourceSettings} IngestionDataSourceSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IngestionDataSourceSettings.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.pubsub.v1.IngestionDataSourceSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.awsKinesis = $root.google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IngestionDataSourceSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.IngestionDataSourceSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.IngestionDataSourceSettings} IngestionDataSourceSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IngestionDataSourceSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IngestionDataSourceSettings message. + * @function verify + * @memberof google.pubsub.v1.IngestionDataSourceSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IngestionDataSourceSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.awsKinesis != null && message.hasOwnProperty("awsKinesis")) { + properties.source = 1; + { + var error = $root.google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis.verify(message.awsKinesis); + if (error) + return "awsKinesis." + error; + } + } + return null; + }; + + /** + * Creates an IngestionDataSourceSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.IngestionDataSourceSettings + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.IngestionDataSourceSettings} IngestionDataSourceSettings + */ + IngestionDataSourceSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.IngestionDataSourceSettings) + return object; + var message = new $root.google.pubsub.v1.IngestionDataSourceSettings(); + if (object.awsKinesis != null) { + if (typeof object.awsKinesis !== "object") + throw TypeError(".google.pubsub.v1.IngestionDataSourceSettings.awsKinesis: object expected"); + message.awsKinesis = $root.google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis.fromObject(object.awsKinesis); + } + return message; + }; + + /** + * Creates a plain object from an IngestionDataSourceSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.IngestionDataSourceSettings + * @static + * @param {google.pubsub.v1.IngestionDataSourceSettings} message IngestionDataSourceSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IngestionDataSourceSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.awsKinesis != null && message.hasOwnProperty("awsKinesis")) { + object.awsKinesis = $root.google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis.toObject(message.awsKinesis, options); + if (options.oneofs) + object.source = "awsKinesis"; + } + return object; + }; + + /** + * Converts this IngestionDataSourceSettings to JSON. + * @function toJSON + * @memberof google.pubsub.v1.IngestionDataSourceSettings + * @instance + * @returns {Object.} JSON object + */ + IngestionDataSourceSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IngestionDataSourceSettings + * @function getTypeUrl + * @memberof google.pubsub.v1.IngestionDataSourceSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IngestionDataSourceSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.IngestionDataSourceSettings"; + }; + + IngestionDataSourceSettings.AwsKinesis = (function() { + + /** + * Properties of an AwsKinesis. + * @memberof google.pubsub.v1.IngestionDataSourceSettings + * @interface IAwsKinesis + * @property {google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis.State|null} [state] AwsKinesis state + * @property {string|null} [streamArn] AwsKinesis streamArn + * @property {string|null} [consumerArn] AwsKinesis consumerArn + * @property {string|null} [awsRoleArn] AwsKinesis awsRoleArn + * @property {string|null} [gcpServiceAccount] AwsKinesis gcpServiceAccount + */ + + /** + * Constructs a new AwsKinesis. + * @memberof google.pubsub.v1.IngestionDataSourceSettings + * @classdesc Represents an AwsKinesis. + * @implements IAwsKinesis + * @constructor + * @param {google.pubsub.v1.IngestionDataSourceSettings.IAwsKinesis=} [properties] Properties to set + */ + function AwsKinesis(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]]; + } + + /** + * AwsKinesis state. + * @member {google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis.State} state + * @memberof google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis + * @instance + */ + AwsKinesis.prototype.state = 0; + + /** + * AwsKinesis streamArn. + * @member {string} streamArn + * @memberof google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis + * @instance + */ + AwsKinesis.prototype.streamArn = ""; + + /** + * AwsKinesis consumerArn. + * @member {string} consumerArn + * @memberof google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis + * @instance + */ + AwsKinesis.prototype.consumerArn = ""; + + /** + * AwsKinesis awsRoleArn. + * @member {string} awsRoleArn + * @memberof google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis + * @instance + */ + AwsKinesis.prototype.awsRoleArn = ""; + + /** + * AwsKinesis gcpServiceAccount. + * @member {string} gcpServiceAccount + * @memberof google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis + * @instance + */ + AwsKinesis.prototype.gcpServiceAccount = ""; + + /** + * Creates a new AwsKinesis instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis + * @static + * @param {google.pubsub.v1.IngestionDataSourceSettings.IAwsKinesis=} [properties] Properties to set + * @returns {google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis} AwsKinesis instance + */ + AwsKinesis.create = function create(properties) { + return new AwsKinesis(properties); + }; + + /** + * Encodes the specified AwsKinesis message. Does not implicitly {@link google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis + * @static + * @param {google.pubsub.v1.IngestionDataSourceSettings.IAwsKinesis} message AwsKinesis message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AwsKinesis.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); + if (message.streamArn != null && Object.hasOwnProperty.call(message, "streamArn")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.streamArn); + if (message.consumerArn != null && Object.hasOwnProperty.call(message, "consumerArn")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.consumerArn); + if (message.awsRoleArn != null && Object.hasOwnProperty.call(message, "awsRoleArn")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.awsRoleArn); + if (message.gcpServiceAccount != null && Object.hasOwnProperty.call(message, "gcpServiceAccount")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.gcpServiceAccount); + return writer; + }; + + /** + * Encodes the specified AwsKinesis message, length delimited. Does not implicitly {@link google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis + * @static + * @param {google.pubsub.v1.IngestionDataSourceSettings.IAwsKinesis} message AwsKinesis message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AwsKinesis.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AwsKinesis message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis} AwsKinesis + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AwsKinesis.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.pubsub.v1.IngestionDataSourceSettings.AwsKinesis(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.state = reader.int32(); + break; + } + case 2: { + message.streamArn = reader.string(); + break; + } + case 3: { + message.consumerArn = reader.string(); + break; + } + case 4: { + message.awsRoleArn = reader.string(); + break; + } + case 5: { + message.gcpServiceAccount = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AwsKinesis message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis} AwsKinesis + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AwsKinesis.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AwsKinesis message. + * @function verify + * @memberof google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AwsKinesis.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.streamArn != null && message.hasOwnProperty("streamArn")) + if (!$util.isString(message.streamArn)) + return "streamArn: string expected"; + if (message.consumerArn != null && message.hasOwnProperty("consumerArn")) + if (!$util.isString(message.consumerArn)) + return "consumerArn: string expected"; + if (message.awsRoleArn != null && message.hasOwnProperty("awsRoleArn")) + if (!$util.isString(message.awsRoleArn)) + return "awsRoleArn: string expected"; + if (message.gcpServiceAccount != null && message.hasOwnProperty("gcpServiceAccount")) + if (!$util.isString(message.gcpServiceAccount)) + return "gcpServiceAccount: string expected"; + return null; + }; + + /** + * Creates an AwsKinesis message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis} AwsKinesis + */ + AwsKinesis.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis) + return object; + var message = new $root.google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis(); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "ACTIVE": + case 1: + message.state = 1; + break; + case "KINESIS_PERMISSION_DENIED": + case 2: + message.state = 2; + break; + case "PUBLISH_PERMISSION_DENIED": + case 3: + message.state = 3; + break; + case "STREAM_NOT_FOUND": + case 4: + message.state = 4; + break; + case "CONSUMER_NOT_FOUND": + case 5: + message.state = 5; + break; + } + if (object.streamArn != null) + message.streamArn = String(object.streamArn); + if (object.consumerArn != null) + message.consumerArn = String(object.consumerArn); + if (object.awsRoleArn != null) + message.awsRoleArn = String(object.awsRoleArn); + if (object.gcpServiceAccount != null) + message.gcpServiceAccount = String(object.gcpServiceAccount); + return message; + }; + + /** + * Creates a plain object from an AwsKinesis message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis + * @static + * @param {google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis} message AwsKinesis + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AwsKinesis.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.streamArn = ""; + object.consumerArn = ""; + object.awsRoleArn = ""; + object.gcpServiceAccount = ""; + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis.State[message.state] === undefined ? message.state : $root.google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis.State[message.state] : message.state; + if (message.streamArn != null && message.hasOwnProperty("streamArn")) + object.streamArn = message.streamArn; + if (message.consumerArn != null && message.hasOwnProperty("consumerArn")) + object.consumerArn = message.consumerArn; + if (message.awsRoleArn != null && message.hasOwnProperty("awsRoleArn")) + object.awsRoleArn = message.awsRoleArn; + if (message.gcpServiceAccount != null && message.hasOwnProperty("gcpServiceAccount")) + object.gcpServiceAccount = message.gcpServiceAccount; + return object; + }; + + /** + * Converts this AwsKinesis to JSON. + * @function toJSON + * @memberof google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis + * @instance + * @returns {Object.} JSON object + */ + AwsKinesis.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AwsKinesis + * @function getTypeUrl + * @memberof google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AwsKinesis.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis"; + }; + + /** + * State enum. + * @name google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} ACTIVE=1 ACTIVE value + * @property {number} KINESIS_PERMISSION_DENIED=2 KINESIS_PERMISSION_DENIED value + * @property {number} PUBLISH_PERMISSION_DENIED=3 PUBLISH_PERMISSION_DENIED value + * @property {number} STREAM_NOT_FOUND=4 STREAM_NOT_FOUND value + * @property {number} CONSUMER_NOT_FOUND=5 CONSUMER_NOT_FOUND value + */ + AwsKinesis.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ACTIVE"] = 1; + values[valuesById[2] = "KINESIS_PERMISSION_DENIED"] = 2; + values[valuesById[3] = "PUBLISH_PERMISSION_DENIED"] = 3; + values[valuesById[4] = "STREAM_NOT_FOUND"] = 4; + values[valuesById[5] = "CONSUMER_NOT_FOUND"] = 5; + return values; + })(); + + return AwsKinesis; + })(); + + return IngestionDataSourceSettings; + })(); + + v1.Topic = (function() { + + /** + * Properties of a Topic. + * @memberof google.pubsub.v1 + * @interface ITopic + * @property {string|null} [name] Topic name + * @property {Object.|null} [labels] Topic labels + * @property {google.pubsub.v1.IMessageStoragePolicy|null} [messageStoragePolicy] Topic messageStoragePolicy + * @property {string|null} [kmsKeyName] Topic kmsKeyName + * @property {google.pubsub.v1.ISchemaSettings|null} [schemaSettings] Topic schemaSettings + * @property {boolean|null} [satisfiesPzs] Topic satisfiesPzs + * @property {google.protobuf.IDuration|null} [messageRetentionDuration] Topic messageRetentionDuration + * @property {google.pubsub.v1.Topic.State|null} [state] Topic state + * @property {google.pubsub.v1.IIngestionDataSourceSettings|null} [ingestionDataSourceSettings] Topic ingestionDataSourceSettings + */ + + /** + * Constructs a new Topic. + * @memberof google.pubsub.v1 + * @classdesc Represents a Topic. + * @implements ITopic + * @constructor + * @param {google.pubsub.v1.ITopic=} [properties] Properties to set + */ + function Topic(properties) { + this.labels = {}; + 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]]; + } + + /** + * Topic name. + * @member {string} name + * @memberof google.pubsub.v1.Topic + * @instance + */ + Topic.prototype.name = ""; + + /** + * Topic labels. + * @member {Object.} labels + * @memberof google.pubsub.v1.Topic + * @instance + */ + Topic.prototype.labels = $util.emptyObject; + + /** + * Topic messageStoragePolicy. + * @member {google.pubsub.v1.IMessageStoragePolicy|null|undefined} messageStoragePolicy + * @memberof google.pubsub.v1.Topic + * @instance + */ + Topic.prototype.messageStoragePolicy = null; + + /** + * Topic kmsKeyName. + * @member {string} kmsKeyName + * @memberof google.pubsub.v1.Topic + * @instance + */ + Topic.prototype.kmsKeyName = ""; + + /** + * Topic schemaSettings. + * @member {google.pubsub.v1.ISchemaSettings|null|undefined} schemaSettings + * @memberof google.pubsub.v1.Topic + * @instance + */ + Topic.prototype.schemaSettings = null; + + /** + * Topic satisfiesPzs. + * @member {boolean} satisfiesPzs + * @memberof google.pubsub.v1.Topic + * @instance + */ + Topic.prototype.satisfiesPzs = false; + + /** + * Topic messageRetentionDuration. + * @member {google.protobuf.IDuration|null|undefined} messageRetentionDuration + * @memberof google.pubsub.v1.Topic + * @instance + */ + Topic.prototype.messageRetentionDuration = null; + + /** + * Topic state. + * @member {google.pubsub.v1.Topic.State} state + * @memberof google.pubsub.v1.Topic + * @instance + */ + Topic.prototype.state = 0; + + /** + * Topic ingestionDataSourceSettings. + * @member {google.pubsub.v1.IIngestionDataSourceSettings|null|undefined} ingestionDataSourceSettings + * @memberof google.pubsub.v1.Topic + * @instance + */ + Topic.prototype.ingestionDataSourceSettings = null; + + /** + * Creates a new Topic instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.Topic + * @static + * @param {google.pubsub.v1.ITopic=} [properties] Properties to set + * @returns {google.pubsub.v1.Topic} Topic instance + */ + Topic.create = function create(properties) { + return new Topic(properties); + }; + + /** + * Encodes the specified Topic message. Does not implicitly {@link google.pubsub.v1.Topic.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.Topic + * @static + * @param {google.pubsub.v1.ITopic} message Topic message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Topic.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.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), 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.labels[keys[i]]).ldelim(); + if (message.messageStoragePolicy != null && Object.hasOwnProperty.call(message, "messageStoragePolicy")) + $root.google.pubsub.v1.MessageStoragePolicy.encode(message.messageStoragePolicy, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.kmsKeyName != null && Object.hasOwnProperty.call(message, "kmsKeyName")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.kmsKeyName); + if (message.schemaSettings != null && Object.hasOwnProperty.call(message, "schemaSettings")) + $root.google.pubsub.v1.SchemaSettings.encode(message.schemaSettings, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.satisfiesPzs != null && Object.hasOwnProperty.call(message, "satisfiesPzs")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.satisfiesPzs); + if (message.messageRetentionDuration != null && Object.hasOwnProperty.call(message, "messageRetentionDuration")) + $root.google.protobuf.Duration.encode(message.messageRetentionDuration, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.state); + if (message.ingestionDataSourceSettings != null && Object.hasOwnProperty.call(message, "ingestionDataSourceSettings")) + $root.google.pubsub.v1.IngestionDataSourceSettings.encode(message.ingestionDataSourceSettings, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Topic message, length delimited. Does not implicitly {@link google.pubsub.v1.Topic.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.Topic + * @static + * @param {google.pubsub.v1.ITopic} message Topic message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Topic.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Topic message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.Topic + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.Topic} Topic + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Topic.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.pubsub.v1.Topic(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + 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; + } + case 3: { + message.messageStoragePolicy = $root.google.pubsub.v1.MessageStoragePolicy.decode(reader, reader.uint32()); + break; + } + case 5: { + message.kmsKeyName = reader.string(); + break; + } + case 6: { + message.schemaSettings = $root.google.pubsub.v1.SchemaSettings.decode(reader, reader.uint32()); + break; + } + case 7: { + message.satisfiesPzs = reader.bool(); + break; + } + case 8: { + message.messageRetentionDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 9: { + message.state = reader.int32(); + break; + } + case 10: { + message.ingestionDataSourceSettings = $root.google.pubsub.v1.IngestionDataSourceSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Topic message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.Topic + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.Topic} Topic + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Topic.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Topic message. + * @function verify + * @memberof google.pubsub.v1.Topic + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Topic.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.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"; + } + if (message.messageStoragePolicy != null && message.hasOwnProperty("messageStoragePolicy")) { + var error = $root.google.pubsub.v1.MessageStoragePolicy.verify(message.messageStoragePolicy); + if (error) + return "messageStoragePolicy." + error; + } + if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) + if (!$util.isString(message.kmsKeyName)) + return "kmsKeyName: string expected"; + if (message.schemaSettings != null && message.hasOwnProperty("schemaSettings")) { + var error = $root.google.pubsub.v1.SchemaSettings.verify(message.schemaSettings); + if (error) + return "schemaSettings." + error; + } + if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) + if (typeof message.satisfiesPzs !== "boolean") + return "satisfiesPzs: boolean expected"; + if (message.messageRetentionDuration != null && message.hasOwnProperty("messageRetentionDuration")) { + var error = $root.google.protobuf.Duration.verify(message.messageRetentionDuration); + if (error) + return "messageRetentionDuration." + error; + } + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.ingestionDataSourceSettings != null && message.hasOwnProperty("ingestionDataSourceSettings")) { + var error = $root.google.pubsub.v1.IngestionDataSourceSettings.verify(message.ingestionDataSourceSettings); + if (error) + return "ingestionDataSourceSettings." + error; + } + return null; + }; + + /** + * Creates a Topic message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.Topic + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.Topic} Topic + */ + Topic.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.Topic) + return object; + var message = new $root.google.pubsub.v1.Topic(); + if (object.name != null) + message.name = String(object.name); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.pubsub.v1.Topic.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + if (object.messageStoragePolicy != null) { + if (typeof object.messageStoragePolicy !== "object") + throw TypeError(".google.pubsub.v1.Topic.messageStoragePolicy: object expected"); + message.messageStoragePolicy = $root.google.pubsub.v1.MessageStoragePolicy.fromObject(object.messageStoragePolicy); + } + if (object.kmsKeyName != null) + message.kmsKeyName = String(object.kmsKeyName); + if (object.schemaSettings != null) { + if (typeof object.schemaSettings !== "object") + throw TypeError(".google.pubsub.v1.Topic.schemaSettings: object expected"); + message.schemaSettings = $root.google.pubsub.v1.SchemaSettings.fromObject(object.schemaSettings); + } + if (object.satisfiesPzs != null) + message.satisfiesPzs = Boolean(object.satisfiesPzs); + if (object.messageRetentionDuration != null) { + if (typeof object.messageRetentionDuration !== "object") + throw TypeError(".google.pubsub.v1.Topic.messageRetentionDuration: object expected"); + message.messageRetentionDuration = $root.google.protobuf.Duration.fromObject(object.messageRetentionDuration); + } + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "ACTIVE": + case 1: + message.state = 1; + break; + case "INGESTION_RESOURCE_ERROR": + case 2: + message.state = 2; + break; + } + if (object.ingestionDataSourceSettings != null) { + if (typeof object.ingestionDataSourceSettings !== "object") + throw TypeError(".google.pubsub.v1.Topic.ingestionDataSourceSettings: object expected"); + message.ingestionDataSourceSettings = $root.google.pubsub.v1.IngestionDataSourceSettings.fromObject(object.ingestionDataSourceSettings); + } + return message; + }; + + /** + * Creates a plain object from a Topic message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.Topic + * @static + * @param {google.pubsub.v1.Topic} message Topic + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Topic.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.messageStoragePolicy = null; + object.kmsKeyName = ""; + object.schemaSettings = null; + object.satisfiesPzs = false; + object.messageRetentionDuration = null; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.ingestionDataSourceSettings = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.messageStoragePolicy != null && message.hasOwnProperty("messageStoragePolicy")) + object.messageStoragePolicy = $root.google.pubsub.v1.MessageStoragePolicy.toObject(message.messageStoragePolicy, options); + if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) + object.kmsKeyName = message.kmsKeyName; + if (message.schemaSettings != null && message.hasOwnProperty("schemaSettings")) + object.schemaSettings = $root.google.pubsub.v1.SchemaSettings.toObject(message.schemaSettings, options); + if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) + object.satisfiesPzs = message.satisfiesPzs; + if (message.messageRetentionDuration != null && message.hasOwnProperty("messageRetentionDuration")) + object.messageRetentionDuration = $root.google.protobuf.Duration.toObject(message.messageRetentionDuration, options); + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.pubsub.v1.Topic.State[message.state] === undefined ? message.state : $root.google.pubsub.v1.Topic.State[message.state] : message.state; + if (message.ingestionDataSourceSettings != null && message.hasOwnProperty("ingestionDataSourceSettings")) + object.ingestionDataSourceSettings = $root.google.pubsub.v1.IngestionDataSourceSettings.toObject(message.ingestionDataSourceSettings, options); + return object; + }; + + /** + * Converts this Topic to JSON. + * @function toJSON + * @memberof google.pubsub.v1.Topic + * @instance + * @returns {Object.} JSON object + */ + Topic.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Topic + * @function getTypeUrl + * @memberof google.pubsub.v1.Topic + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Topic.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.Topic"; + }; + + /** + * State enum. + * @name google.pubsub.v1.Topic.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} ACTIVE=1 ACTIVE value + * @property {number} INGESTION_RESOURCE_ERROR=2 INGESTION_RESOURCE_ERROR value + */ + Topic.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ACTIVE"] = 1; + values[valuesById[2] = "INGESTION_RESOURCE_ERROR"] = 2; + return values; + })(); + + return Topic; + })(); + + v1.PubsubMessage = (function() { + + /** + * Properties of a PubsubMessage. + * @memberof google.pubsub.v1 + * @interface IPubsubMessage + * @property {Uint8Array|null} [data] PubsubMessage data + * @property {Object.|null} [attributes] PubsubMessage attributes + * @property {string|null} [messageId] PubsubMessage messageId + * @property {google.protobuf.ITimestamp|null} [publishTime] PubsubMessage publishTime + * @property {string|null} [orderingKey] PubsubMessage orderingKey + */ + + /** + * Constructs a new PubsubMessage. + * @memberof google.pubsub.v1 + * @classdesc Represents a PubsubMessage. + * @implements IPubsubMessage + * @constructor + * @param {google.pubsub.v1.IPubsubMessage=} [properties] Properties to set + */ + function PubsubMessage(properties) { + this.attributes = {}; + 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]]; + } + + /** + * PubsubMessage data. + * @member {Uint8Array} data + * @memberof google.pubsub.v1.PubsubMessage + * @instance + */ + PubsubMessage.prototype.data = $util.newBuffer([]); + + /** + * PubsubMessage attributes. + * @member {Object.} attributes + * @memberof google.pubsub.v1.PubsubMessage + * @instance + */ + PubsubMessage.prototype.attributes = $util.emptyObject; + + /** + * PubsubMessage messageId. + * @member {string} messageId + * @memberof google.pubsub.v1.PubsubMessage + * @instance + */ + PubsubMessage.prototype.messageId = ""; + + /** + * PubsubMessage publishTime. + * @member {google.protobuf.ITimestamp|null|undefined} publishTime + * @memberof google.pubsub.v1.PubsubMessage + * @instance + */ + PubsubMessage.prototype.publishTime = null; + + /** + * PubsubMessage orderingKey. + * @member {string} orderingKey + * @memberof google.pubsub.v1.PubsubMessage + * @instance + */ + PubsubMessage.prototype.orderingKey = ""; + + /** + * Creates a new PubsubMessage instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.PubsubMessage + * @static + * @param {google.pubsub.v1.IPubsubMessage=} [properties] Properties to set + * @returns {google.pubsub.v1.PubsubMessage} PubsubMessage instance + */ + PubsubMessage.create = function create(properties) { + return new PubsubMessage(properties); + }; + + /** + * Encodes the specified PubsubMessage message. Does not implicitly {@link google.pubsub.v1.PubsubMessage.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.PubsubMessage + * @static + * @param {google.pubsub.v1.IPubsubMessage} message PubsubMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PubsubMessage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.data != null && Object.hasOwnProperty.call(message, "data")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.data); + if (message.attributes != null && Object.hasOwnProperty.call(message, "attributes")) + for (var keys = Object.keys(message.attributes), 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.attributes[keys[i]]).ldelim(); + if (message.messageId != null && Object.hasOwnProperty.call(message, "messageId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.messageId); + if (message.publishTime != null && Object.hasOwnProperty.call(message, "publishTime")) + $root.google.protobuf.Timestamp.encode(message.publishTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.orderingKey != null && Object.hasOwnProperty.call(message, "orderingKey")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderingKey); + return writer; + }; + + /** + * Encodes the specified PubsubMessage message, length delimited. Does not implicitly {@link google.pubsub.v1.PubsubMessage.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.PubsubMessage + * @static + * @param {google.pubsub.v1.IPubsubMessage} message PubsubMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PubsubMessage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PubsubMessage message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.PubsubMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.PubsubMessage} PubsubMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PubsubMessage.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.pubsub.v1.PubsubMessage(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.data = reader.bytes(); + break; + } + case 2: { + if (message.attributes === $util.emptyObject) + message.attributes = {}; + 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.attributes[key] = value; + break; + } + case 3: { + message.messageId = reader.string(); + break; + } + case 4: { + message.publishTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.orderingKey = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PubsubMessage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.PubsubMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.PubsubMessage} PubsubMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PubsubMessage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PubsubMessage message. + * @function verify + * @memberof google.pubsub.v1.PubsubMessage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PubsubMessage.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.data != null && message.hasOwnProperty("data")) + if (!(message.data && typeof message.data.length === "number" || $util.isString(message.data))) + return "data: buffer expected"; + if (message.attributes != null && message.hasOwnProperty("attributes")) { + if (!$util.isObject(message.attributes)) + return "attributes: object expected"; + var key = Object.keys(message.attributes); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.attributes[key[i]])) + return "attributes: string{k:string} expected"; + } + if (message.messageId != null && message.hasOwnProperty("messageId")) + if (!$util.isString(message.messageId)) + return "messageId: string expected"; + if (message.publishTime != null && message.hasOwnProperty("publishTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.publishTime); + if (error) + return "publishTime." + error; + } + if (message.orderingKey != null && message.hasOwnProperty("orderingKey")) + if (!$util.isString(message.orderingKey)) + return "orderingKey: string expected"; + return null; + }; + + /** + * Creates a PubsubMessage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.PubsubMessage + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.PubsubMessage} PubsubMessage + */ + PubsubMessage.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.PubsubMessage) + return object; + var message = new $root.google.pubsub.v1.PubsubMessage(); + if (object.data != null) + if (typeof object.data === "string") + $util.base64.decode(object.data, message.data = $util.newBuffer($util.base64.length(object.data)), 0); + else if (object.data.length >= 0) + message.data = object.data; + if (object.attributes) { + if (typeof object.attributes !== "object") + throw TypeError(".google.pubsub.v1.PubsubMessage.attributes: object expected"); + message.attributes = {}; + for (var keys = Object.keys(object.attributes), i = 0; i < keys.length; ++i) + message.attributes[keys[i]] = String(object.attributes[keys[i]]); + } + if (object.messageId != null) + message.messageId = String(object.messageId); + if (object.publishTime != null) { + if (typeof object.publishTime !== "object") + throw TypeError(".google.pubsub.v1.PubsubMessage.publishTime: object expected"); + message.publishTime = $root.google.protobuf.Timestamp.fromObject(object.publishTime); + } + if (object.orderingKey != null) + message.orderingKey = String(object.orderingKey); + return message; + }; + + /** + * Creates a plain object from a PubsubMessage message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.PubsubMessage + * @static + * @param {google.pubsub.v1.PubsubMessage} message PubsubMessage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PubsubMessage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.attributes = {}; + if (options.defaults) { + if (options.bytes === String) + object.data = ""; + else { + object.data = []; + if (options.bytes !== Array) + object.data = $util.newBuffer(object.data); + } + object.messageId = ""; + object.publishTime = null; + object.orderingKey = ""; + } + if (message.data != null && message.hasOwnProperty("data")) + object.data = options.bytes === String ? $util.base64.encode(message.data, 0, message.data.length) : options.bytes === Array ? Array.prototype.slice.call(message.data) : message.data; + var keys2; + if (message.attributes && (keys2 = Object.keys(message.attributes)).length) { + object.attributes = {}; + for (var j = 0; j < keys2.length; ++j) + object.attributes[keys2[j]] = message.attributes[keys2[j]]; + } + if (message.messageId != null && message.hasOwnProperty("messageId")) + object.messageId = message.messageId; + if (message.publishTime != null && message.hasOwnProperty("publishTime")) + object.publishTime = $root.google.protobuf.Timestamp.toObject(message.publishTime, options); + if (message.orderingKey != null && message.hasOwnProperty("orderingKey")) + object.orderingKey = message.orderingKey; + return object; + }; + + /** + * Converts this PubsubMessage to JSON. + * @function toJSON + * @memberof google.pubsub.v1.PubsubMessage + * @instance + * @returns {Object.} JSON object + */ + PubsubMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PubsubMessage + * @function getTypeUrl + * @memberof google.pubsub.v1.PubsubMessage + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PubsubMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.PubsubMessage"; + }; + + return PubsubMessage; + })(); + + v1.GetTopicRequest = (function() { + + /** + * Properties of a GetTopicRequest. + * @memberof google.pubsub.v1 + * @interface IGetTopicRequest + * @property {string|null} [topic] GetTopicRequest topic + */ + + /** + * Constructs a new GetTopicRequest. + * @memberof google.pubsub.v1 + * @classdesc Represents a GetTopicRequest. + * @implements IGetTopicRequest + * @constructor + * @param {google.pubsub.v1.IGetTopicRequest=} [properties] Properties to set + */ + function GetTopicRequest(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]]; + } + + /** + * GetTopicRequest topic. + * @member {string} topic + * @memberof google.pubsub.v1.GetTopicRequest + * @instance + */ + GetTopicRequest.prototype.topic = ""; + + /** + * Creates a new GetTopicRequest instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.GetTopicRequest + * @static + * @param {google.pubsub.v1.IGetTopicRequest=} [properties] Properties to set + * @returns {google.pubsub.v1.GetTopicRequest} GetTopicRequest instance + */ + GetTopicRequest.create = function create(properties) { + return new GetTopicRequest(properties); + }; + + /** + * Encodes the specified GetTopicRequest message. Does not implicitly {@link google.pubsub.v1.GetTopicRequest.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.GetTopicRequest + * @static + * @param {google.pubsub.v1.IGetTopicRequest} message GetTopicRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTopicRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.topic != null && Object.hasOwnProperty.call(message, "topic")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.topic); + return writer; + }; + + /** + * Encodes the specified GetTopicRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.GetTopicRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.GetTopicRequest + * @static + * @param {google.pubsub.v1.IGetTopicRequest} message GetTopicRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTopicRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetTopicRequest message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.GetTopicRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.GetTopicRequest} GetTopicRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTopicRequest.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.pubsub.v1.GetTopicRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.topic = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetTopicRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.GetTopicRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.GetTopicRequest} GetTopicRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTopicRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetTopicRequest message. + * @function verify + * @memberof google.pubsub.v1.GetTopicRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTopicRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.topic != null && message.hasOwnProperty("topic")) + if (!$util.isString(message.topic)) + return "topic: string expected"; + return null; + }; + + /** + * Creates a GetTopicRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.GetTopicRequest + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.GetTopicRequest} GetTopicRequest + */ + GetTopicRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.GetTopicRequest) + return object; + var message = new $root.google.pubsub.v1.GetTopicRequest(); + if (object.topic != null) + message.topic = String(object.topic); + return message; + }; + + /** + * Creates a plain object from a GetTopicRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.GetTopicRequest + * @static + * @param {google.pubsub.v1.GetTopicRequest} message GetTopicRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTopicRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.topic = ""; + if (message.topic != null && message.hasOwnProperty("topic")) + object.topic = message.topic; + return object; + }; + + /** + * Converts this GetTopicRequest to JSON. + * @function toJSON + * @memberof google.pubsub.v1.GetTopicRequest + * @instance + * @returns {Object.} JSON object + */ + GetTopicRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetTopicRequest + * @function getTypeUrl + * @memberof google.pubsub.v1.GetTopicRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetTopicRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.GetTopicRequest"; + }; + + return GetTopicRequest; + })(); + + v1.UpdateTopicRequest = (function() { + + /** + * Properties of an UpdateTopicRequest. + * @memberof google.pubsub.v1 + * @interface IUpdateTopicRequest + * @property {google.pubsub.v1.ITopic|null} [topic] UpdateTopicRequest topic + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateTopicRequest updateMask + */ + + /** + * Constructs a new UpdateTopicRequest. + * @memberof google.pubsub.v1 + * @classdesc Represents an UpdateTopicRequest. + * @implements IUpdateTopicRequest + * @constructor + * @param {google.pubsub.v1.IUpdateTopicRequest=} [properties] Properties to set + */ + function UpdateTopicRequest(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]]; + } + + /** + * UpdateTopicRequest topic. + * @member {google.pubsub.v1.ITopic|null|undefined} topic + * @memberof google.pubsub.v1.UpdateTopicRequest + * @instance + */ + UpdateTopicRequest.prototype.topic = null; + + /** + * UpdateTopicRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.pubsub.v1.UpdateTopicRequest + * @instance + */ + UpdateTopicRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateTopicRequest instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.UpdateTopicRequest + * @static + * @param {google.pubsub.v1.IUpdateTopicRequest=} [properties] Properties to set + * @returns {google.pubsub.v1.UpdateTopicRequest} UpdateTopicRequest instance + */ + UpdateTopicRequest.create = function create(properties) { + return new UpdateTopicRequest(properties); + }; + + /** + * Encodes the specified UpdateTopicRequest message. Does not implicitly {@link google.pubsub.v1.UpdateTopicRequest.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.UpdateTopicRequest + * @static + * @param {google.pubsub.v1.IUpdateTopicRequest} message UpdateTopicRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateTopicRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.topic != null && Object.hasOwnProperty.call(message, "topic")) + $root.google.pubsub.v1.Topic.encode(message.topic, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateTopicRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.UpdateTopicRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.UpdateTopicRequest + * @static + * @param {google.pubsub.v1.IUpdateTopicRequest} message UpdateTopicRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateTopicRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateTopicRequest message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.UpdateTopicRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.UpdateTopicRequest} UpdateTopicRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateTopicRequest.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.pubsub.v1.UpdateTopicRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.topic = $root.google.pubsub.v1.Topic.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateTopicRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.UpdateTopicRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.UpdateTopicRequest} UpdateTopicRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateTopicRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateTopicRequest message. + * @function verify + * @memberof google.pubsub.v1.UpdateTopicRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateTopicRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.topic != null && message.hasOwnProperty("topic")) { + var error = $root.google.pubsub.v1.Topic.verify(message.topic); + if (error) + return "topic." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateTopicRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.UpdateTopicRequest + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.UpdateTopicRequest} UpdateTopicRequest + */ + UpdateTopicRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.UpdateTopicRequest) + return object; + var message = new $root.google.pubsub.v1.UpdateTopicRequest(); + if (object.topic != null) { + if (typeof object.topic !== "object") + throw TypeError(".google.pubsub.v1.UpdateTopicRequest.topic: object expected"); + message.topic = $root.google.pubsub.v1.Topic.fromObject(object.topic); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.pubsub.v1.UpdateTopicRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateTopicRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.UpdateTopicRequest + * @static + * @param {google.pubsub.v1.UpdateTopicRequest} message UpdateTopicRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateTopicRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.topic = null; + object.updateMask = null; + } + if (message.topic != null && message.hasOwnProperty("topic")) + object.topic = $root.google.pubsub.v1.Topic.toObject(message.topic, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateTopicRequest to JSON. + * @function toJSON + * @memberof google.pubsub.v1.UpdateTopicRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateTopicRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateTopicRequest + * @function getTypeUrl + * @memberof google.pubsub.v1.UpdateTopicRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateTopicRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.UpdateTopicRequest"; + }; + + return UpdateTopicRequest; + })(); + + v1.PublishRequest = (function() { + + /** + * Properties of a PublishRequest. + * @memberof google.pubsub.v1 + * @interface IPublishRequest + * @property {string|null} [topic] PublishRequest topic + * @property {Array.|null} [messages] PublishRequest messages + */ + + /** + * Constructs a new PublishRequest. + * @memberof google.pubsub.v1 + * @classdesc Represents a PublishRequest. + * @implements IPublishRequest + * @constructor + * @param {google.pubsub.v1.IPublishRequest=} [properties] Properties to set + */ + function PublishRequest(properties) { + this.messages = []; + 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]]; + } + + /** + * PublishRequest topic. + * @member {string} topic + * @memberof google.pubsub.v1.PublishRequest + * @instance + */ + PublishRequest.prototype.topic = ""; + + /** + * PublishRequest messages. + * @member {Array.} messages + * @memberof google.pubsub.v1.PublishRequest + * @instance + */ + PublishRequest.prototype.messages = $util.emptyArray; + + /** + * Creates a new PublishRequest instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.PublishRequest + * @static + * @param {google.pubsub.v1.IPublishRequest=} [properties] Properties to set + * @returns {google.pubsub.v1.PublishRequest} PublishRequest instance + */ + PublishRequest.create = function create(properties) { + return new PublishRequest(properties); + }; + + /** + * Encodes the specified PublishRequest message. Does not implicitly {@link google.pubsub.v1.PublishRequest.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.PublishRequest + * @static + * @param {google.pubsub.v1.IPublishRequest} message PublishRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PublishRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.topic != null && Object.hasOwnProperty.call(message, "topic")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.topic); + if (message.messages != null && message.messages.length) + for (var i = 0; i < message.messages.length; ++i) + $root.google.pubsub.v1.PubsubMessage.encode(message.messages[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PublishRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.PublishRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.PublishRequest + * @static + * @param {google.pubsub.v1.IPublishRequest} message PublishRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PublishRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PublishRequest message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.PublishRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.PublishRequest} PublishRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PublishRequest.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.pubsub.v1.PublishRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.topic = reader.string(); + break; + } + case 2: { + if (!(message.messages && message.messages.length)) + message.messages = []; + message.messages.push($root.google.pubsub.v1.PubsubMessage.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PublishRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.PublishRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.PublishRequest} PublishRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PublishRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PublishRequest message. + * @function verify + * @memberof google.pubsub.v1.PublishRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PublishRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.topic != null && message.hasOwnProperty("topic")) + if (!$util.isString(message.topic)) + return "topic: string expected"; + if (message.messages != null && message.hasOwnProperty("messages")) { + if (!Array.isArray(message.messages)) + return "messages: array expected"; + for (var i = 0; i < message.messages.length; ++i) { + var error = $root.google.pubsub.v1.PubsubMessage.verify(message.messages[i]); + if (error) + return "messages." + error; + } + } + return null; + }; + + /** + * Creates a PublishRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.PublishRequest + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.PublishRequest} PublishRequest + */ + PublishRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.PublishRequest) + return object; + var message = new $root.google.pubsub.v1.PublishRequest(); + if (object.topic != null) + message.topic = String(object.topic); + if (object.messages) { + if (!Array.isArray(object.messages)) + throw TypeError(".google.pubsub.v1.PublishRequest.messages: array expected"); + message.messages = []; + for (var i = 0; i < object.messages.length; ++i) { + if (typeof object.messages[i] !== "object") + throw TypeError(".google.pubsub.v1.PublishRequest.messages: object expected"); + message.messages[i] = $root.google.pubsub.v1.PubsubMessage.fromObject(object.messages[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a PublishRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.PublishRequest + * @static + * @param {google.pubsub.v1.PublishRequest} message PublishRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PublishRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.messages = []; + if (options.defaults) + object.topic = ""; + if (message.topic != null && message.hasOwnProperty("topic")) + object.topic = message.topic; + if (message.messages && message.messages.length) { + object.messages = []; + for (var j = 0; j < message.messages.length; ++j) + object.messages[j] = $root.google.pubsub.v1.PubsubMessage.toObject(message.messages[j], options); + } + return object; + }; + + /** + * Converts this PublishRequest to JSON. + * @function toJSON + * @memberof google.pubsub.v1.PublishRequest + * @instance + * @returns {Object.} JSON object + */ + PublishRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PublishRequest + * @function getTypeUrl + * @memberof google.pubsub.v1.PublishRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PublishRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.PublishRequest"; + }; + + return PublishRequest; + })(); + + v1.PublishResponse = (function() { + + /** + * Properties of a PublishResponse. + * @memberof google.pubsub.v1 + * @interface IPublishResponse + * @property {Array.|null} [messageIds] PublishResponse messageIds + */ + + /** + * Constructs a new PublishResponse. + * @memberof google.pubsub.v1 + * @classdesc Represents a PublishResponse. + * @implements IPublishResponse + * @constructor + * @param {google.pubsub.v1.IPublishResponse=} [properties] Properties to set + */ + function PublishResponse(properties) { + this.messageIds = []; + 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]]; + } + + /** + * PublishResponse messageIds. + * @member {Array.} messageIds + * @memberof google.pubsub.v1.PublishResponse + * @instance + */ + PublishResponse.prototype.messageIds = $util.emptyArray; + + /** + * Creates a new PublishResponse instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.PublishResponse + * @static + * @param {google.pubsub.v1.IPublishResponse=} [properties] Properties to set + * @returns {google.pubsub.v1.PublishResponse} PublishResponse instance + */ + PublishResponse.create = function create(properties) { + return new PublishResponse(properties); + }; + + /** + * Encodes the specified PublishResponse message. Does not implicitly {@link google.pubsub.v1.PublishResponse.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.PublishResponse + * @static + * @param {google.pubsub.v1.IPublishResponse} message PublishResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PublishResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.messageIds != null && message.messageIds.length) + for (var i = 0; i < message.messageIds.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.messageIds[i]); + return writer; + }; + + /** + * Encodes the specified PublishResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.PublishResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.PublishResponse + * @static + * @param {google.pubsub.v1.IPublishResponse} message PublishResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PublishResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PublishResponse message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.PublishResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.PublishResponse} PublishResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PublishResponse.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.pubsub.v1.PublishResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.messageIds && message.messageIds.length)) + message.messageIds = []; + message.messageIds.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PublishResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.PublishResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.PublishResponse} PublishResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PublishResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PublishResponse message. + * @function verify + * @memberof google.pubsub.v1.PublishResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PublishResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.messageIds != null && message.hasOwnProperty("messageIds")) { + if (!Array.isArray(message.messageIds)) + return "messageIds: array expected"; + for (var i = 0; i < message.messageIds.length; ++i) + if (!$util.isString(message.messageIds[i])) + return "messageIds: string[] expected"; + } + return null; + }; + + /** + * Creates a PublishResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.PublishResponse + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.PublishResponse} PublishResponse + */ + PublishResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.PublishResponse) + return object; + var message = new $root.google.pubsub.v1.PublishResponse(); + if (object.messageIds) { + if (!Array.isArray(object.messageIds)) + throw TypeError(".google.pubsub.v1.PublishResponse.messageIds: array expected"); + message.messageIds = []; + for (var i = 0; i < object.messageIds.length; ++i) + message.messageIds[i] = String(object.messageIds[i]); + } + return message; + }; + + /** + * Creates a plain object from a PublishResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.PublishResponse + * @static + * @param {google.pubsub.v1.PublishResponse} message PublishResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PublishResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.messageIds = []; + if (message.messageIds && message.messageIds.length) { + object.messageIds = []; + for (var j = 0; j < message.messageIds.length; ++j) + object.messageIds[j] = message.messageIds[j]; + } + return object; + }; + + /** + * Converts this PublishResponse to JSON. + * @function toJSON + * @memberof google.pubsub.v1.PublishResponse + * @instance + * @returns {Object.} JSON object + */ + PublishResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PublishResponse + * @function getTypeUrl + * @memberof google.pubsub.v1.PublishResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PublishResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.PublishResponse"; + }; + + return PublishResponse; + })(); + + v1.ListTopicsRequest = (function() { + + /** + * Properties of a ListTopicsRequest. + * @memberof google.pubsub.v1 + * @interface IListTopicsRequest + * @property {string|null} [project] ListTopicsRequest project + * @property {number|null} [pageSize] ListTopicsRequest pageSize + * @property {string|null} [pageToken] ListTopicsRequest pageToken + */ + + /** + * Constructs a new ListTopicsRequest. + * @memberof google.pubsub.v1 + * @classdesc Represents a ListTopicsRequest. + * @implements IListTopicsRequest + * @constructor + * @param {google.pubsub.v1.IListTopicsRequest=} [properties] Properties to set + */ + function ListTopicsRequest(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]]; + } + + /** + * ListTopicsRequest project. + * @member {string} project + * @memberof google.pubsub.v1.ListTopicsRequest + * @instance + */ + ListTopicsRequest.prototype.project = ""; + + /** + * ListTopicsRequest pageSize. + * @member {number} pageSize + * @memberof google.pubsub.v1.ListTopicsRequest + * @instance + */ + ListTopicsRequest.prototype.pageSize = 0; + + /** + * ListTopicsRequest pageToken. + * @member {string} pageToken + * @memberof google.pubsub.v1.ListTopicsRequest + * @instance + */ + ListTopicsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListTopicsRequest instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.ListTopicsRequest + * @static + * @param {google.pubsub.v1.IListTopicsRequest=} [properties] Properties to set + * @returns {google.pubsub.v1.ListTopicsRequest} ListTopicsRequest instance + */ + ListTopicsRequest.create = function create(properties) { + return new ListTopicsRequest(properties); + }; + + /** + * Encodes the specified ListTopicsRequest message. Does not implicitly {@link google.pubsub.v1.ListTopicsRequest.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.ListTopicsRequest + * @static + * @param {google.pubsub.v1.IListTopicsRequest} message ListTopicsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTopicsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.project); + 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); + return writer; + }; + + /** + * Encodes the specified ListTopicsRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.ListTopicsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.ListTopicsRequest + * @static + * @param {google.pubsub.v1.IListTopicsRequest} message ListTopicsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTopicsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListTopicsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.ListTopicsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.ListTopicsRequest} ListTopicsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTopicsRequest.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.pubsub.v1.ListTopicsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.project = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListTopicsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.ListTopicsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.ListTopicsRequest} ListTopicsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTopicsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListTopicsRequest message. + * @function verify + * @memberof google.pubsub.v1.ListTopicsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListTopicsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: 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"; + return null; + }; + + /** + * Creates a ListTopicsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.ListTopicsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.ListTopicsRequest} ListTopicsRequest + */ + ListTopicsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.ListTopicsRequest) + return object; + var message = new $root.google.pubsub.v1.ListTopicsRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListTopicsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.ListTopicsRequest + * @static + * @param {google.pubsub.v1.ListTopicsRequest} message ListTopicsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListTopicsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.project = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListTopicsRequest to JSON. + * @function toJSON + * @memberof google.pubsub.v1.ListTopicsRequest + * @instance + * @returns {Object.} JSON object + */ + ListTopicsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListTopicsRequest + * @function getTypeUrl + * @memberof google.pubsub.v1.ListTopicsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListTopicsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.ListTopicsRequest"; + }; + + return ListTopicsRequest; + })(); + + v1.ListTopicsResponse = (function() { + + /** + * Properties of a ListTopicsResponse. + * @memberof google.pubsub.v1 + * @interface IListTopicsResponse + * @property {Array.|null} [topics] ListTopicsResponse topics + * @property {string|null} [nextPageToken] ListTopicsResponse nextPageToken + */ + + /** + * Constructs a new ListTopicsResponse. + * @memberof google.pubsub.v1 + * @classdesc Represents a ListTopicsResponse. + * @implements IListTopicsResponse + * @constructor + * @param {google.pubsub.v1.IListTopicsResponse=} [properties] Properties to set + */ + function ListTopicsResponse(properties) { + this.topics = []; + 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]]; + } + + /** + * ListTopicsResponse topics. + * @member {Array.} topics + * @memberof google.pubsub.v1.ListTopicsResponse + * @instance + */ + ListTopicsResponse.prototype.topics = $util.emptyArray; + + /** + * ListTopicsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.pubsub.v1.ListTopicsResponse + * @instance + */ + ListTopicsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListTopicsResponse instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.ListTopicsResponse + * @static + * @param {google.pubsub.v1.IListTopicsResponse=} [properties] Properties to set + * @returns {google.pubsub.v1.ListTopicsResponse} ListTopicsResponse instance + */ + ListTopicsResponse.create = function create(properties) { + return new ListTopicsResponse(properties); + }; + + /** + * Encodes the specified ListTopicsResponse message. Does not implicitly {@link google.pubsub.v1.ListTopicsResponse.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.ListTopicsResponse + * @static + * @param {google.pubsub.v1.IListTopicsResponse} message ListTopicsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTopicsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.topics != null && message.topics.length) + for (var i = 0; i < message.topics.length; ++i) + $root.google.pubsub.v1.Topic.encode(message.topics[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 ListTopicsResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.ListTopicsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.ListTopicsResponse + * @static + * @param {google.pubsub.v1.IListTopicsResponse} message ListTopicsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTopicsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListTopicsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.ListTopicsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.ListTopicsResponse} ListTopicsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTopicsResponse.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.pubsub.v1.ListTopicsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.topics && message.topics.length)) + message.topics = []; + message.topics.push($root.google.pubsub.v1.Topic.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListTopicsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.ListTopicsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.ListTopicsResponse} ListTopicsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTopicsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListTopicsResponse message. + * @function verify + * @memberof google.pubsub.v1.ListTopicsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListTopicsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.topics != null && message.hasOwnProperty("topics")) { + if (!Array.isArray(message.topics)) + return "topics: array expected"; + for (var i = 0; i < message.topics.length; ++i) { + var error = $root.google.pubsub.v1.Topic.verify(message.topics[i]); + if (error) + return "topics." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListTopicsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.ListTopicsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.ListTopicsResponse} ListTopicsResponse + */ + ListTopicsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.ListTopicsResponse) + return object; + var message = new $root.google.pubsub.v1.ListTopicsResponse(); + if (object.topics) { + if (!Array.isArray(object.topics)) + throw TypeError(".google.pubsub.v1.ListTopicsResponse.topics: array expected"); + message.topics = []; + for (var i = 0; i < object.topics.length; ++i) { + if (typeof object.topics[i] !== "object") + throw TypeError(".google.pubsub.v1.ListTopicsResponse.topics: object expected"); + message.topics[i] = $root.google.pubsub.v1.Topic.fromObject(object.topics[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListTopicsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.ListTopicsResponse + * @static + * @param {google.pubsub.v1.ListTopicsResponse} message ListTopicsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListTopicsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.topics = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.topics && message.topics.length) { + object.topics = []; + for (var j = 0; j < message.topics.length; ++j) + object.topics[j] = $root.google.pubsub.v1.Topic.toObject(message.topics[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListTopicsResponse to JSON. + * @function toJSON + * @memberof google.pubsub.v1.ListTopicsResponse + * @instance + * @returns {Object.} JSON object + */ + ListTopicsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListTopicsResponse + * @function getTypeUrl + * @memberof google.pubsub.v1.ListTopicsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListTopicsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.ListTopicsResponse"; + }; + + return ListTopicsResponse; + })(); + + v1.ListTopicSubscriptionsRequest = (function() { + + /** + * Properties of a ListTopicSubscriptionsRequest. + * @memberof google.pubsub.v1 + * @interface IListTopicSubscriptionsRequest + * @property {string|null} [topic] ListTopicSubscriptionsRequest topic + * @property {number|null} [pageSize] ListTopicSubscriptionsRequest pageSize + * @property {string|null} [pageToken] ListTopicSubscriptionsRequest pageToken + */ + + /** + * Constructs a new ListTopicSubscriptionsRequest. + * @memberof google.pubsub.v1 + * @classdesc Represents a ListTopicSubscriptionsRequest. + * @implements IListTopicSubscriptionsRequest + * @constructor + * @param {google.pubsub.v1.IListTopicSubscriptionsRequest=} [properties] Properties to set + */ + function ListTopicSubscriptionsRequest(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]]; + } + + /** + * ListTopicSubscriptionsRequest topic. + * @member {string} topic + * @memberof google.pubsub.v1.ListTopicSubscriptionsRequest + * @instance + */ + ListTopicSubscriptionsRequest.prototype.topic = ""; + + /** + * ListTopicSubscriptionsRequest pageSize. + * @member {number} pageSize + * @memberof google.pubsub.v1.ListTopicSubscriptionsRequest + * @instance + */ + ListTopicSubscriptionsRequest.prototype.pageSize = 0; + + /** + * ListTopicSubscriptionsRequest pageToken. + * @member {string} pageToken + * @memberof google.pubsub.v1.ListTopicSubscriptionsRequest + * @instance + */ + ListTopicSubscriptionsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListTopicSubscriptionsRequest instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.ListTopicSubscriptionsRequest + * @static + * @param {google.pubsub.v1.IListTopicSubscriptionsRequest=} [properties] Properties to set + * @returns {google.pubsub.v1.ListTopicSubscriptionsRequest} ListTopicSubscriptionsRequest instance + */ + ListTopicSubscriptionsRequest.create = function create(properties) { + return new ListTopicSubscriptionsRequest(properties); + }; + + /** + * Encodes the specified ListTopicSubscriptionsRequest message. Does not implicitly {@link google.pubsub.v1.ListTopicSubscriptionsRequest.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.ListTopicSubscriptionsRequest + * @static + * @param {google.pubsub.v1.IListTopicSubscriptionsRequest} message ListTopicSubscriptionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTopicSubscriptionsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.topic != null && Object.hasOwnProperty.call(message, "topic")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.topic); + 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); + return writer; + }; + + /** + * Encodes the specified ListTopicSubscriptionsRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.ListTopicSubscriptionsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.ListTopicSubscriptionsRequest + * @static + * @param {google.pubsub.v1.IListTopicSubscriptionsRequest} message ListTopicSubscriptionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTopicSubscriptionsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListTopicSubscriptionsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.ListTopicSubscriptionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.ListTopicSubscriptionsRequest} ListTopicSubscriptionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTopicSubscriptionsRequest.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.pubsub.v1.ListTopicSubscriptionsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.topic = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListTopicSubscriptionsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.ListTopicSubscriptionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.ListTopicSubscriptionsRequest} ListTopicSubscriptionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTopicSubscriptionsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListTopicSubscriptionsRequest message. + * @function verify + * @memberof google.pubsub.v1.ListTopicSubscriptionsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListTopicSubscriptionsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.topic != null && message.hasOwnProperty("topic")) + if (!$util.isString(message.topic)) + return "topic: 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"; + return null; + }; + + /** + * Creates a ListTopicSubscriptionsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.ListTopicSubscriptionsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.ListTopicSubscriptionsRequest} ListTopicSubscriptionsRequest + */ + ListTopicSubscriptionsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.ListTopicSubscriptionsRequest) + return object; + var message = new $root.google.pubsub.v1.ListTopicSubscriptionsRequest(); + if (object.topic != null) + message.topic = String(object.topic); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListTopicSubscriptionsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.ListTopicSubscriptionsRequest + * @static + * @param {google.pubsub.v1.ListTopicSubscriptionsRequest} message ListTopicSubscriptionsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListTopicSubscriptionsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.topic = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.topic != null && message.hasOwnProperty("topic")) + object.topic = message.topic; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListTopicSubscriptionsRequest to JSON. + * @function toJSON + * @memberof google.pubsub.v1.ListTopicSubscriptionsRequest + * @instance + * @returns {Object.} JSON object + */ + ListTopicSubscriptionsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListTopicSubscriptionsRequest + * @function getTypeUrl + * @memberof google.pubsub.v1.ListTopicSubscriptionsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListTopicSubscriptionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.ListTopicSubscriptionsRequest"; + }; + + return ListTopicSubscriptionsRequest; + })(); + + v1.ListTopicSubscriptionsResponse = (function() { + + /** + * Properties of a ListTopicSubscriptionsResponse. + * @memberof google.pubsub.v1 + * @interface IListTopicSubscriptionsResponse + * @property {Array.|null} [subscriptions] ListTopicSubscriptionsResponse subscriptions + * @property {string|null} [nextPageToken] ListTopicSubscriptionsResponse nextPageToken + */ + + /** + * Constructs a new ListTopicSubscriptionsResponse. + * @memberof google.pubsub.v1 + * @classdesc Represents a ListTopicSubscriptionsResponse. + * @implements IListTopicSubscriptionsResponse + * @constructor + * @param {google.pubsub.v1.IListTopicSubscriptionsResponse=} [properties] Properties to set + */ + function ListTopicSubscriptionsResponse(properties) { + this.subscriptions = []; + 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]]; + } + + /** + * ListTopicSubscriptionsResponse subscriptions. + * @member {Array.} subscriptions + * @memberof google.pubsub.v1.ListTopicSubscriptionsResponse + * @instance + */ + ListTopicSubscriptionsResponse.prototype.subscriptions = $util.emptyArray; + + /** + * ListTopicSubscriptionsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.pubsub.v1.ListTopicSubscriptionsResponse + * @instance + */ + ListTopicSubscriptionsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListTopicSubscriptionsResponse instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.ListTopicSubscriptionsResponse + * @static + * @param {google.pubsub.v1.IListTopicSubscriptionsResponse=} [properties] Properties to set + * @returns {google.pubsub.v1.ListTopicSubscriptionsResponse} ListTopicSubscriptionsResponse instance + */ + ListTopicSubscriptionsResponse.create = function create(properties) { + return new ListTopicSubscriptionsResponse(properties); + }; + + /** + * Encodes the specified ListTopicSubscriptionsResponse message. Does not implicitly {@link google.pubsub.v1.ListTopicSubscriptionsResponse.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.ListTopicSubscriptionsResponse + * @static + * @param {google.pubsub.v1.IListTopicSubscriptionsResponse} message ListTopicSubscriptionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTopicSubscriptionsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.subscriptions != null && message.subscriptions.length) + for (var i = 0; i < message.subscriptions.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.subscriptions[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 ListTopicSubscriptionsResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.ListTopicSubscriptionsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.ListTopicSubscriptionsResponse + * @static + * @param {google.pubsub.v1.IListTopicSubscriptionsResponse} message ListTopicSubscriptionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTopicSubscriptionsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListTopicSubscriptionsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.ListTopicSubscriptionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.ListTopicSubscriptionsResponse} ListTopicSubscriptionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTopicSubscriptionsResponse.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.pubsub.v1.ListTopicSubscriptionsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.subscriptions && message.subscriptions.length)) + message.subscriptions = []; + message.subscriptions.push(reader.string()); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListTopicSubscriptionsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.ListTopicSubscriptionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.ListTopicSubscriptionsResponse} ListTopicSubscriptionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTopicSubscriptionsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListTopicSubscriptionsResponse message. + * @function verify + * @memberof google.pubsub.v1.ListTopicSubscriptionsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListTopicSubscriptionsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.subscriptions != null && message.hasOwnProperty("subscriptions")) { + if (!Array.isArray(message.subscriptions)) + return "subscriptions: array expected"; + for (var i = 0; i < message.subscriptions.length; ++i) + if (!$util.isString(message.subscriptions[i])) + return "subscriptions: string[] expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListTopicSubscriptionsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.ListTopicSubscriptionsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.ListTopicSubscriptionsResponse} ListTopicSubscriptionsResponse + */ + ListTopicSubscriptionsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.ListTopicSubscriptionsResponse) + return object; + var message = new $root.google.pubsub.v1.ListTopicSubscriptionsResponse(); + if (object.subscriptions) { + if (!Array.isArray(object.subscriptions)) + throw TypeError(".google.pubsub.v1.ListTopicSubscriptionsResponse.subscriptions: array expected"); + message.subscriptions = []; + for (var i = 0; i < object.subscriptions.length; ++i) + message.subscriptions[i] = String(object.subscriptions[i]); + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListTopicSubscriptionsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.ListTopicSubscriptionsResponse + * @static + * @param {google.pubsub.v1.ListTopicSubscriptionsResponse} message ListTopicSubscriptionsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListTopicSubscriptionsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.subscriptions = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.subscriptions && message.subscriptions.length) { + object.subscriptions = []; + for (var j = 0; j < message.subscriptions.length; ++j) + object.subscriptions[j] = message.subscriptions[j]; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListTopicSubscriptionsResponse to JSON. + * @function toJSON + * @memberof google.pubsub.v1.ListTopicSubscriptionsResponse + * @instance + * @returns {Object.} JSON object + */ + ListTopicSubscriptionsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListTopicSubscriptionsResponse + * @function getTypeUrl + * @memberof google.pubsub.v1.ListTopicSubscriptionsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListTopicSubscriptionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.ListTopicSubscriptionsResponse"; + }; + + return ListTopicSubscriptionsResponse; + })(); + + v1.ListTopicSnapshotsRequest = (function() { + + /** + * Properties of a ListTopicSnapshotsRequest. + * @memberof google.pubsub.v1 + * @interface IListTopicSnapshotsRequest + * @property {string|null} [topic] ListTopicSnapshotsRequest topic + * @property {number|null} [pageSize] ListTopicSnapshotsRequest pageSize + * @property {string|null} [pageToken] ListTopicSnapshotsRequest pageToken + */ + + /** + * Constructs a new ListTopicSnapshotsRequest. + * @memberof google.pubsub.v1 + * @classdesc Represents a ListTopicSnapshotsRequest. + * @implements IListTopicSnapshotsRequest + * @constructor + * @param {google.pubsub.v1.IListTopicSnapshotsRequest=} [properties] Properties to set + */ + function ListTopicSnapshotsRequest(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]]; + } + + /** + * ListTopicSnapshotsRequest topic. + * @member {string} topic + * @memberof google.pubsub.v1.ListTopicSnapshotsRequest + * @instance + */ + ListTopicSnapshotsRequest.prototype.topic = ""; + + /** + * ListTopicSnapshotsRequest pageSize. + * @member {number} pageSize + * @memberof google.pubsub.v1.ListTopicSnapshotsRequest + * @instance + */ + ListTopicSnapshotsRequest.prototype.pageSize = 0; + + /** + * ListTopicSnapshotsRequest pageToken. + * @member {string} pageToken + * @memberof google.pubsub.v1.ListTopicSnapshotsRequest + * @instance + */ + ListTopicSnapshotsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListTopicSnapshotsRequest instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.ListTopicSnapshotsRequest + * @static + * @param {google.pubsub.v1.IListTopicSnapshotsRequest=} [properties] Properties to set + * @returns {google.pubsub.v1.ListTopicSnapshotsRequest} ListTopicSnapshotsRequest instance + */ + ListTopicSnapshotsRequest.create = function create(properties) { + return new ListTopicSnapshotsRequest(properties); + }; + + /** + * Encodes the specified ListTopicSnapshotsRequest message. Does not implicitly {@link google.pubsub.v1.ListTopicSnapshotsRequest.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.ListTopicSnapshotsRequest + * @static + * @param {google.pubsub.v1.IListTopicSnapshotsRequest} message ListTopicSnapshotsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTopicSnapshotsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.topic != null && Object.hasOwnProperty.call(message, "topic")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.topic); + 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); + return writer; + }; + + /** + * Encodes the specified ListTopicSnapshotsRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.ListTopicSnapshotsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.ListTopicSnapshotsRequest + * @static + * @param {google.pubsub.v1.IListTopicSnapshotsRequest} message ListTopicSnapshotsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTopicSnapshotsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListTopicSnapshotsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.ListTopicSnapshotsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.ListTopicSnapshotsRequest} ListTopicSnapshotsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTopicSnapshotsRequest.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.pubsub.v1.ListTopicSnapshotsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.topic = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListTopicSnapshotsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.ListTopicSnapshotsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.ListTopicSnapshotsRequest} ListTopicSnapshotsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTopicSnapshotsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListTopicSnapshotsRequest message. + * @function verify + * @memberof google.pubsub.v1.ListTopicSnapshotsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListTopicSnapshotsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.topic != null && message.hasOwnProperty("topic")) + if (!$util.isString(message.topic)) + return "topic: 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"; + return null; + }; + + /** + * Creates a ListTopicSnapshotsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.ListTopicSnapshotsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.ListTopicSnapshotsRequest} ListTopicSnapshotsRequest + */ + ListTopicSnapshotsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.ListTopicSnapshotsRequest) + return object; + var message = new $root.google.pubsub.v1.ListTopicSnapshotsRequest(); + if (object.topic != null) + message.topic = String(object.topic); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListTopicSnapshotsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.ListTopicSnapshotsRequest + * @static + * @param {google.pubsub.v1.ListTopicSnapshotsRequest} message ListTopicSnapshotsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListTopicSnapshotsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.topic = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.topic != null && message.hasOwnProperty("topic")) + object.topic = message.topic; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListTopicSnapshotsRequest to JSON. + * @function toJSON + * @memberof google.pubsub.v1.ListTopicSnapshotsRequest + * @instance + * @returns {Object.} JSON object + */ + ListTopicSnapshotsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListTopicSnapshotsRequest + * @function getTypeUrl + * @memberof google.pubsub.v1.ListTopicSnapshotsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListTopicSnapshotsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.ListTopicSnapshotsRequest"; + }; + + return ListTopicSnapshotsRequest; + })(); + + v1.ListTopicSnapshotsResponse = (function() { + + /** + * Properties of a ListTopicSnapshotsResponse. + * @memberof google.pubsub.v1 + * @interface IListTopicSnapshotsResponse + * @property {Array.|null} [snapshots] ListTopicSnapshotsResponse snapshots + * @property {string|null} [nextPageToken] ListTopicSnapshotsResponse nextPageToken + */ + + /** + * Constructs a new ListTopicSnapshotsResponse. + * @memberof google.pubsub.v1 + * @classdesc Represents a ListTopicSnapshotsResponse. + * @implements IListTopicSnapshotsResponse + * @constructor + * @param {google.pubsub.v1.IListTopicSnapshotsResponse=} [properties] Properties to set + */ + function ListTopicSnapshotsResponse(properties) { + this.snapshots = []; + 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]]; + } + + /** + * ListTopicSnapshotsResponse snapshots. + * @member {Array.} snapshots + * @memberof google.pubsub.v1.ListTopicSnapshotsResponse + * @instance + */ + ListTopicSnapshotsResponse.prototype.snapshots = $util.emptyArray; + + /** + * ListTopicSnapshotsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.pubsub.v1.ListTopicSnapshotsResponse + * @instance + */ + ListTopicSnapshotsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListTopicSnapshotsResponse instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.ListTopicSnapshotsResponse + * @static + * @param {google.pubsub.v1.IListTopicSnapshotsResponse=} [properties] Properties to set + * @returns {google.pubsub.v1.ListTopicSnapshotsResponse} ListTopicSnapshotsResponse instance + */ + ListTopicSnapshotsResponse.create = function create(properties) { + return new ListTopicSnapshotsResponse(properties); + }; + + /** + * Encodes the specified ListTopicSnapshotsResponse message. Does not implicitly {@link google.pubsub.v1.ListTopicSnapshotsResponse.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.ListTopicSnapshotsResponse + * @static + * @param {google.pubsub.v1.IListTopicSnapshotsResponse} message ListTopicSnapshotsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTopicSnapshotsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.snapshots != null && message.snapshots.length) + for (var i = 0; i < message.snapshots.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.snapshots[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 ListTopicSnapshotsResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.ListTopicSnapshotsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.ListTopicSnapshotsResponse + * @static + * @param {google.pubsub.v1.IListTopicSnapshotsResponse} message ListTopicSnapshotsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTopicSnapshotsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListTopicSnapshotsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.ListTopicSnapshotsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.ListTopicSnapshotsResponse} ListTopicSnapshotsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTopicSnapshotsResponse.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.pubsub.v1.ListTopicSnapshotsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.snapshots && message.snapshots.length)) + message.snapshots = []; + message.snapshots.push(reader.string()); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListTopicSnapshotsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.ListTopicSnapshotsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.ListTopicSnapshotsResponse} ListTopicSnapshotsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTopicSnapshotsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListTopicSnapshotsResponse message. + * @function verify + * @memberof google.pubsub.v1.ListTopicSnapshotsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListTopicSnapshotsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.snapshots != null && message.hasOwnProperty("snapshots")) { + if (!Array.isArray(message.snapshots)) + return "snapshots: array expected"; + for (var i = 0; i < message.snapshots.length; ++i) + if (!$util.isString(message.snapshots[i])) + return "snapshots: string[] expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListTopicSnapshotsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.ListTopicSnapshotsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.ListTopicSnapshotsResponse} ListTopicSnapshotsResponse + */ + ListTopicSnapshotsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.ListTopicSnapshotsResponse) + return object; + var message = new $root.google.pubsub.v1.ListTopicSnapshotsResponse(); + if (object.snapshots) { + if (!Array.isArray(object.snapshots)) + throw TypeError(".google.pubsub.v1.ListTopicSnapshotsResponse.snapshots: array expected"); + message.snapshots = []; + for (var i = 0; i < object.snapshots.length; ++i) + message.snapshots[i] = String(object.snapshots[i]); + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListTopicSnapshotsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.ListTopicSnapshotsResponse + * @static + * @param {google.pubsub.v1.ListTopicSnapshotsResponse} message ListTopicSnapshotsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListTopicSnapshotsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.snapshots = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.snapshots && message.snapshots.length) { + object.snapshots = []; + for (var j = 0; j < message.snapshots.length; ++j) + object.snapshots[j] = message.snapshots[j]; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListTopicSnapshotsResponse to JSON. + * @function toJSON + * @memberof google.pubsub.v1.ListTopicSnapshotsResponse + * @instance + * @returns {Object.} JSON object + */ + ListTopicSnapshotsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListTopicSnapshotsResponse + * @function getTypeUrl + * @memberof google.pubsub.v1.ListTopicSnapshotsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListTopicSnapshotsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.ListTopicSnapshotsResponse"; + }; + + return ListTopicSnapshotsResponse; + })(); + + v1.DeleteTopicRequest = (function() { + + /** + * Properties of a DeleteTopicRequest. + * @memberof google.pubsub.v1 + * @interface IDeleteTopicRequest + * @property {string|null} [topic] DeleteTopicRequest topic + */ + + /** + * Constructs a new DeleteTopicRequest. + * @memberof google.pubsub.v1 + * @classdesc Represents a DeleteTopicRequest. + * @implements IDeleteTopicRequest + * @constructor + * @param {google.pubsub.v1.IDeleteTopicRequest=} [properties] Properties to set + */ + function DeleteTopicRequest(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]]; + } + + /** + * DeleteTopicRequest topic. + * @member {string} topic + * @memberof google.pubsub.v1.DeleteTopicRequest + * @instance + */ + DeleteTopicRequest.prototype.topic = ""; + + /** + * Creates a new DeleteTopicRequest instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.DeleteTopicRequest + * @static + * @param {google.pubsub.v1.IDeleteTopicRequest=} [properties] Properties to set + * @returns {google.pubsub.v1.DeleteTopicRequest} DeleteTopicRequest instance + */ + DeleteTopicRequest.create = function create(properties) { + return new DeleteTopicRequest(properties); + }; + + /** + * Encodes the specified DeleteTopicRequest message. Does not implicitly {@link google.pubsub.v1.DeleteTopicRequest.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.DeleteTopicRequest + * @static + * @param {google.pubsub.v1.IDeleteTopicRequest} message DeleteTopicRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteTopicRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.topic != null && Object.hasOwnProperty.call(message, "topic")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.topic); + return writer; + }; + + /** + * Encodes the specified DeleteTopicRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.DeleteTopicRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.DeleteTopicRequest + * @static + * @param {google.pubsub.v1.IDeleteTopicRequest} message DeleteTopicRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteTopicRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteTopicRequest message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.DeleteTopicRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.DeleteTopicRequest} DeleteTopicRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteTopicRequest.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.pubsub.v1.DeleteTopicRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.topic = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteTopicRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.DeleteTopicRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.DeleteTopicRequest} DeleteTopicRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteTopicRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteTopicRequest message. + * @function verify + * @memberof google.pubsub.v1.DeleteTopicRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteTopicRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.topic != null && message.hasOwnProperty("topic")) + if (!$util.isString(message.topic)) + return "topic: string expected"; + return null; + }; + + /** + * Creates a DeleteTopicRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.DeleteTopicRequest + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.DeleteTopicRequest} DeleteTopicRequest + */ + DeleteTopicRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.DeleteTopicRequest) + return object; + var message = new $root.google.pubsub.v1.DeleteTopicRequest(); + if (object.topic != null) + message.topic = String(object.topic); + return message; + }; + + /** + * Creates a plain object from a DeleteTopicRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.DeleteTopicRequest + * @static + * @param {google.pubsub.v1.DeleteTopicRequest} message DeleteTopicRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteTopicRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.topic = ""; + if (message.topic != null && message.hasOwnProperty("topic")) + object.topic = message.topic; + return object; + }; + + /** + * Converts this DeleteTopicRequest to JSON. + * @function toJSON + * @memberof google.pubsub.v1.DeleteTopicRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteTopicRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteTopicRequest + * @function getTypeUrl + * @memberof google.pubsub.v1.DeleteTopicRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteTopicRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.DeleteTopicRequest"; + }; + + return DeleteTopicRequest; + })(); + + v1.DetachSubscriptionRequest = (function() { + + /** + * Properties of a DetachSubscriptionRequest. + * @memberof google.pubsub.v1 + * @interface IDetachSubscriptionRequest + * @property {string|null} [subscription] DetachSubscriptionRequest subscription + */ + + /** + * Constructs a new DetachSubscriptionRequest. + * @memberof google.pubsub.v1 + * @classdesc Represents a DetachSubscriptionRequest. + * @implements IDetachSubscriptionRequest + * @constructor + * @param {google.pubsub.v1.IDetachSubscriptionRequest=} [properties] Properties to set + */ + function DetachSubscriptionRequest(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]]; + } + + /** + * DetachSubscriptionRequest subscription. + * @member {string} subscription + * @memberof google.pubsub.v1.DetachSubscriptionRequest + * @instance + */ + DetachSubscriptionRequest.prototype.subscription = ""; + + /** + * Creates a new DetachSubscriptionRequest instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.DetachSubscriptionRequest + * @static + * @param {google.pubsub.v1.IDetachSubscriptionRequest=} [properties] Properties to set + * @returns {google.pubsub.v1.DetachSubscriptionRequest} DetachSubscriptionRequest instance + */ + DetachSubscriptionRequest.create = function create(properties) { + return new DetachSubscriptionRequest(properties); + }; + + /** + * Encodes the specified DetachSubscriptionRequest message. Does not implicitly {@link google.pubsub.v1.DetachSubscriptionRequest.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.DetachSubscriptionRequest + * @static + * @param {google.pubsub.v1.IDetachSubscriptionRequest} message DetachSubscriptionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DetachSubscriptionRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.subscription != null && Object.hasOwnProperty.call(message, "subscription")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.subscription); + return writer; + }; + + /** + * Encodes the specified DetachSubscriptionRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.DetachSubscriptionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.DetachSubscriptionRequest + * @static + * @param {google.pubsub.v1.IDetachSubscriptionRequest} message DetachSubscriptionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DetachSubscriptionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DetachSubscriptionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.DetachSubscriptionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.DetachSubscriptionRequest} DetachSubscriptionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DetachSubscriptionRequest.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.pubsub.v1.DetachSubscriptionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.subscription = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DetachSubscriptionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.DetachSubscriptionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.DetachSubscriptionRequest} DetachSubscriptionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DetachSubscriptionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DetachSubscriptionRequest message. + * @function verify + * @memberof google.pubsub.v1.DetachSubscriptionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DetachSubscriptionRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.subscription != null && message.hasOwnProperty("subscription")) + if (!$util.isString(message.subscription)) + return "subscription: string expected"; + return null; + }; + + /** + * Creates a DetachSubscriptionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.DetachSubscriptionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.DetachSubscriptionRequest} DetachSubscriptionRequest + */ + DetachSubscriptionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.DetachSubscriptionRequest) + return object; + var message = new $root.google.pubsub.v1.DetachSubscriptionRequest(); + if (object.subscription != null) + message.subscription = String(object.subscription); + return message; + }; + + /** + * Creates a plain object from a DetachSubscriptionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.DetachSubscriptionRequest + * @static + * @param {google.pubsub.v1.DetachSubscriptionRequest} message DetachSubscriptionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DetachSubscriptionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.subscription = ""; + if (message.subscription != null && message.hasOwnProperty("subscription")) + object.subscription = message.subscription; + return object; + }; + + /** + * Converts this DetachSubscriptionRequest to JSON. + * @function toJSON + * @memberof google.pubsub.v1.DetachSubscriptionRequest + * @instance + * @returns {Object.} JSON object + */ + DetachSubscriptionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DetachSubscriptionRequest + * @function getTypeUrl + * @memberof google.pubsub.v1.DetachSubscriptionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DetachSubscriptionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.DetachSubscriptionRequest"; + }; + + return DetachSubscriptionRequest; + })(); + + v1.DetachSubscriptionResponse = (function() { + + /** + * Properties of a DetachSubscriptionResponse. + * @memberof google.pubsub.v1 + * @interface IDetachSubscriptionResponse + */ + + /** + * Constructs a new DetachSubscriptionResponse. + * @memberof google.pubsub.v1 + * @classdesc Represents a DetachSubscriptionResponse. + * @implements IDetachSubscriptionResponse + * @constructor + * @param {google.pubsub.v1.IDetachSubscriptionResponse=} [properties] Properties to set + */ + function DetachSubscriptionResponse(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 DetachSubscriptionResponse instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.DetachSubscriptionResponse + * @static + * @param {google.pubsub.v1.IDetachSubscriptionResponse=} [properties] Properties to set + * @returns {google.pubsub.v1.DetachSubscriptionResponse} DetachSubscriptionResponse instance + */ + DetachSubscriptionResponse.create = function create(properties) { + return new DetachSubscriptionResponse(properties); + }; + + /** + * Encodes the specified DetachSubscriptionResponse message. Does not implicitly {@link google.pubsub.v1.DetachSubscriptionResponse.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.DetachSubscriptionResponse + * @static + * @param {google.pubsub.v1.IDetachSubscriptionResponse} message DetachSubscriptionResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DetachSubscriptionResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified DetachSubscriptionResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.DetachSubscriptionResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.DetachSubscriptionResponse + * @static + * @param {google.pubsub.v1.IDetachSubscriptionResponse} message DetachSubscriptionResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DetachSubscriptionResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DetachSubscriptionResponse message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.DetachSubscriptionResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.DetachSubscriptionResponse} DetachSubscriptionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DetachSubscriptionResponse.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.pubsub.v1.DetachSubscriptionResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DetachSubscriptionResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.DetachSubscriptionResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.DetachSubscriptionResponse} DetachSubscriptionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DetachSubscriptionResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DetachSubscriptionResponse message. + * @function verify + * @memberof google.pubsub.v1.DetachSubscriptionResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DetachSubscriptionResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a DetachSubscriptionResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.DetachSubscriptionResponse + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.DetachSubscriptionResponse} DetachSubscriptionResponse + */ + DetachSubscriptionResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.DetachSubscriptionResponse) + return object; + return new $root.google.pubsub.v1.DetachSubscriptionResponse(); + }; + + /** + * Creates a plain object from a DetachSubscriptionResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.DetachSubscriptionResponse + * @static + * @param {google.pubsub.v1.DetachSubscriptionResponse} message DetachSubscriptionResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DetachSubscriptionResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this DetachSubscriptionResponse to JSON. + * @function toJSON + * @memberof google.pubsub.v1.DetachSubscriptionResponse + * @instance + * @returns {Object.} JSON object + */ + DetachSubscriptionResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DetachSubscriptionResponse + * @function getTypeUrl + * @memberof google.pubsub.v1.DetachSubscriptionResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DetachSubscriptionResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.DetachSubscriptionResponse"; + }; + + return DetachSubscriptionResponse; + })(); + + v1.Subscriber = (function() { + + /** + * Constructs a new Subscriber service. + * @memberof google.pubsub.v1 + * @classdesc Represents a Subscriber + * @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 Subscriber(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Subscriber.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Subscriber; + + /** + * Creates new Subscriber service using the specified rpc implementation. + * @function create + * @memberof google.pubsub.v1.Subscriber + * @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 {Subscriber} RPC service. Useful where requests and/or responses are streamed. + */ + Subscriber.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.pubsub.v1.Subscriber|createSubscription}. + * @memberof google.pubsub.v1.Subscriber + * @typedef CreateSubscriptionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.pubsub.v1.Subscription} [response] Subscription + */ + + /** + * Calls CreateSubscription. + * @function createSubscription + * @memberof google.pubsub.v1.Subscriber + * @instance + * @param {google.pubsub.v1.ISubscription} request Subscription message or plain object + * @param {google.pubsub.v1.Subscriber.CreateSubscriptionCallback} callback Node-style callback called with the error, if any, and Subscription + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Subscriber.prototype.createSubscription = function createSubscription(request, callback) { + return this.rpcCall(createSubscription, $root.google.pubsub.v1.Subscription, $root.google.pubsub.v1.Subscription, request, callback); + }, "name", { value: "CreateSubscription" }); + + /** + * Calls CreateSubscription. + * @function createSubscription + * @memberof google.pubsub.v1.Subscriber + * @instance + * @param {google.pubsub.v1.ISubscription} request Subscription message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.pubsub.v1.Subscriber|getSubscription}. + * @memberof google.pubsub.v1.Subscriber + * @typedef GetSubscriptionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.pubsub.v1.Subscription} [response] Subscription + */ + + /** + * Calls GetSubscription. + * @function getSubscription + * @memberof google.pubsub.v1.Subscriber + * @instance + * @param {google.pubsub.v1.IGetSubscriptionRequest} request GetSubscriptionRequest message or plain object + * @param {google.pubsub.v1.Subscriber.GetSubscriptionCallback} callback Node-style callback called with the error, if any, and Subscription + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Subscriber.prototype.getSubscription = function getSubscription(request, callback) { + return this.rpcCall(getSubscription, $root.google.pubsub.v1.GetSubscriptionRequest, $root.google.pubsub.v1.Subscription, request, callback); + }, "name", { value: "GetSubscription" }); + + /** + * Calls GetSubscription. + * @function getSubscription + * @memberof google.pubsub.v1.Subscriber + * @instance + * @param {google.pubsub.v1.IGetSubscriptionRequest} request GetSubscriptionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.pubsub.v1.Subscriber|updateSubscription}. + * @memberof google.pubsub.v1.Subscriber + * @typedef UpdateSubscriptionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.pubsub.v1.Subscription} [response] Subscription + */ + + /** + * Calls UpdateSubscription. + * @function updateSubscription + * @memberof google.pubsub.v1.Subscriber + * @instance + * @param {google.pubsub.v1.IUpdateSubscriptionRequest} request UpdateSubscriptionRequest message or plain object + * @param {google.pubsub.v1.Subscriber.UpdateSubscriptionCallback} callback Node-style callback called with the error, if any, and Subscription + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Subscriber.prototype.updateSubscription = function updateSubscription(request, callback) { + return this.rpcCall(updateSubscription, $root.google.pubsub.v1.UpdateSubscriptionRequest, $root.google.pubsub.v1.Subscription, request, callback); + }, "name", { value: "UpdateSubscription" }); + + /** + * Calls UpdateSubscription. + * @function updateSubscription + * @memberof google.pubsub.v1.Subscriber + * @instance + * @param {google.pubsub.v1.IUpdateSubscriptionRequest} request UpdateSubscriptionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.pubsub.v1.Subscriber|listSubscriptions}. + * @memberof google.pubsub.v1.Subscriber + * @typedef ListSubscriptionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.pubsub.v1.ListSubscriptionsResponse} [response] ListSubscriptionsResponse + */ + + /** + * Calls ListSubscriptions. + * @function listSubscriptions + * @memberof google.pubsub.v1.Subscriber + * @instance + * @param {google.pubsub.v1.IListSubscriptionsRequest} request ListSubscriptionsRequest message or plain object + * @param {google.pubsub.v1.Subscriber.ListSubscriptionsCallback} callback Node-style callback called with the error, if any, and ListSubscriptionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Subscriber.prototype.listSubscriptions = function listSubscriptions(request, callback) { + return this.rpcCall(listSubscriptions, $root.google.pubsub.v1.ListSubscriptionsRequest, $root.google.pubsub.v1.ListSubscriptionsResponse, request, callback); + }, "name", { value: "ListSubscriptions" }); + + /** + * Calls ListSubscriptions. + * @function listSubscriptions + * @memberof google.pubsub.v1.Subscriber + * @instance + * @param {google.pubsub.v1.IListSubscriptionsRequest} request ListSubscriptionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.pubsub.v1.Subscriber|deleteSubscription}. + * @memberof google.pubsub.v1.Subscriber + * @typedef DeleteSubscriptionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteSubscription. + * @function deleteSubscription + * @memberof google.pubsub.v1.Subscriber + * @instance + * @param {google.pubsub.v1.IDeleteSubscriptionRequest} request DeleteSubscriptionRequest message or plain object + * @param {google.pubsub.v1.Subscriber.DeleteSubscriptionCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Subscriber.prototype.deleteSubscription = function deleteSubscription(request, callback) { + return this.rpcCall(deleteSubscription, $root.google.pubsub.v1.DeleteSubscriptionRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteSubscription" }); + + /** + * Calls DeleteSubscription. + * @function deleteSubscription + * @memberof google.pubsub.v1.Subscriber + * @instance + * @param {google.pubsub.v1.IDeleteSubscriptionRequest} request DeleteSubscriptionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.pubsub.v1.Subscriber|modifyAckDeadline}. + * @memberof google.pubsub.v1.Subscriber + * @typedef ModifyAckDeadlineCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls ModifyAckDeadline. + * @function modifyAckDeadline + * @memberof google.pubsub.v1.Subscriber + * @instance + * @param {google.pubsub.v1.IModifyAckDeadlineRequest} request ModifyAckDeadlineRequest message or plain object + * @param {google.pubsub.v1.Subscriber.ModifyAckDeadlineCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Subscriber.prototype.modifyAckDeadline = function modifyAckDeadline(request, callback) { + return this.rpcCall(modifyAckDeadline, $root.google.pubsub.v1.ModifyAckDeadlineRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "ModifyAckDeadline" }); + + /** + * Calls ModifyAckDeadline. + * @function modifyAckDeadline + * @memberof google.pubsub.v1.Subscriber + * @instance + * @param {google.pubsub.v1.IModifyAckDeadlineRequest} request ModifyAckDeadlineRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.pubsub.v1.Subscriber|acknowledge}. + * @memberof google.pubsub.v1.Subscriber + * @typedef AcknowledgeCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls Acknowledge. + * @function acknowledge + * @memberof google.pubsub.v1.Subscriber + * @instance + * @param {google.pubsub.v1.IAcknowledgeRequest} request AcknowledgeRequest message or plain object + * @param {google.pubsub.v1.Subscriber.AcknowledgeCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Subscriber.prototype.acknowledge = function acknowledge(request, callback) { + return this.rpcCall(acknowledge, $root.google.pubsub.v1.AcknowledgeRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "Acknowledge" }); + + /** + * Calls Acknowledge. + * @function acknowledge + * @memberof google.pubsub.v1.Subscriber + * @instance + * @param {google.pubsub.v1.IAcknowledgeRequest} request AcknowledgeRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.pubsub.v1.Subscriber|pull}. + * @memberof google.pubsub.v1.Subscriber + * @typedef PullCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.pubsub.v1.PullResponse} [response] PullResponse + */ + + /** + * Calls Pull. + * @function pull + * @memberof google.pubsub.v1.Subscriber + * @instance + * @param {google.pubsub.v1.IPullRequest} request PullRequest message or plain object + * @param {google.pubsub.v1.Subscriber.PullCallback} callback Node-style callback called with the error, if any, and PullResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Subscriber.prototype.pull = function pull(request, callback) { + return this.rpcCall(pull, $root.google.pubsub.v1.PullRequest, $root.google.pubsub.v1.PullResponse, request, callback); + }, "name", { value: "Pull" }); + + /** + * Calls Pull. + * @function pull + * @memberof google.pubsub.v1.Subscriber + * @instance + * @param {google.pubsub.v1.IPullRequest} request PullRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.pubsub.v1.Subscriber|streamingPull}. + * @memberof google.pubsub.v1.Subscriber + * @typedef StreamingPullCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.pubsub.v1.StreamingPullResponse} [response] StreamingPullResponse + */ + + /** + * Calls StreamingPull. + * @function streamingPull + * @memberof google.pubsub.v1.Subscriber + * @instance + * @param {google.pubsub.v1.IStreamingPullRequest} request StreamingPullRequest message or plain object + * @param {google.pubsub.v1.Subscriber.StreamingPullCallback} callback Node-style callback called with the error, if any, and StreamingPullResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Subscriber.prototype.streamingPull = function streamingPull(request, callback) { + return this.rpcCall(streamingPull, $root.google.pubsub.v1.StreamingPullRequest, $root.google.pubsub.v1.StreamingPullResponse, request, callback); + }, "name", { value: "StreamingPull" }); + + /** + * Calls StreamingPull. + * @function streamingPull + * @memberof google.pubsub.v1.Subscriber + * @instance + * @param {google.pubsub.v1.IStreamingPullRequest} request StreamingPullRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.pubsub.v1.Subscriber|modifyPushConfig}. + * @memberof google.pubsub.v1.Subscriber + * @typedef ModifyPushConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls ModifyPushConfig. + * @function modifyPushConfig + * @memberof google.pubsub.v1.Subscriber + * @instance + * @param {google.pubsub.v1.IModifyPushConfigRequest} request ModifyPushConfigRequest message or plain object + * @param {google.pubsub.v1.Subscriber.ModifyPushConfigCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Subscriber.prototype.modifyPushConfig = function modifyPushConfig(request, callback) { + return this.rpcCall(modifyPushConfig, $root.google.pubsub.v1.ModifyPushConfigRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "ModifyPushConfig" }); + + /** + * Calls ModifyPushConfig. + * @function modifyPushConfig + * @memberof google.pubsub.v1.Subscriber + * @instance + * @param {google.pubsub.v1.IModifyPushConfigRequest} request ModifyPushConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.pubsub.v1.Subscriber|getSnapshot}. + * @memberof google.pubsub.v1.Subscriber + * @typedef GetSnapshotCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.pubsub.v1.Snapshot} [response] Snapshot + */ + + /** + * Calls GetSnapshot. + * @function getSnapshot + * @memberof google.pubsub.v1.Subscriber + * @instance + * @param {google.pubsub.v1.IGetSnapshotRequest} request GetSnapshotRequest message or plain object + * @param {google.pubsub.v1.Subscriber.GetSnapshotCallback} callback Node-style callback called with the error, if any, and Snapshot + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Subscriber.prototype.getSnapshot = function getSnapshot(request, callback) { + return this.rpcCall(getSnapshot, $root.google.pubsub.v1.GetSnapshotRequest, $root.google.pubsub.v1.Snapshot, request, callback); + }, "name", { value: "GetSnapshot" }); + + /** + * Calls GetSnapshot. + * @function getSnapshot + * @memberof google.pubsub.v1.Subscriber + * @instance + * @param {google.pubsub.v1.IGetSnapshotRequest} request GetSnapshotRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.pubsub.v1.Subscriber|listSnapshots}. + * @memberof google.pubsub.v1.Subscriber + * @typedef ListSnapshotsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.pubsub.v1.ListSnapshotsResponse} [response] ListSnapshotsResponse + */ + + /** + * Calls ListSnapshots. + * @function listSnapshots + * @memberof google.pubsub.v1.Subscriber + * @instance + * @param {google.pubsub.v1.IListSnapshotsRequest} request ListSnapshotsRequest message or plain object + * @param {google.pubsub.v1.Subscriber.ListSnapshotsCallback} callback Node-style callback called with the error, if any, and ListSnapshotsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Subscriber.prototype.listSnapshots = function listSnapshots(request, callback) { + return this.rpcCall(listSnapshots, $root.google.pubsub.v1.ListSnapshotsRequest, $root.google.pubsub.v1.ListSnapshotsResponse, request, callback); + }, "name", { value: "ListSnapshots" }); + + /** + * Calls ListSnapshots. + * @function listSnapshots + * @memberof google.pubsub.v1.Subscriber + * @instance + * @param {google.pubsub.v1.IListSnapshotsRequest} request ListSnapshotsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.pubsub.v1.Subscriber|createSnapshot}. + * @memberof google.pubsub.v1.Subscriber + * @typedef CreateSnapshotCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.pubsub.v1.Snapshot} [response] Snapshot + */ + + /** + * Calls CreateSnapshot. + * @function createSnapshot + * @memberof google.pubsub.v1.Subscriber + * @instance + * @param {google.pubsub.v1.ICreateSnapshotRequest} request CreateSnapshotRequest message or plain object + * @param {google.pubsub.v1.Subscriber.CreateSnapshotCallback} callback Node-style callback called with the error, if any, and Snapshot + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Subscriber.prototype.createSnapshot = function createSnapshot(request, callback) { + return this.rpcCall(createSnapshot, $root.google.pubsub.v1.CreateSnapshotRequest, $root.google.pubsub.v1.Snapshot, request, callback); + }, "name", { value: "CreateSnapshot" }); + + /** + * Calls CreateSnapshot. + * @function createSnapshot + * @memberof google.pubsub.v1.Subscriber + * @instance + * @param {google.pubsub.v1.ICreateSnapshotRequest} request CreateSnapshotRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.pubsub.v1.Subscriber|updateSnapshot}. + * @memberof google.pubsub.v1.Subscriber + * @typedef UpdateSnapshotCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.pubsub.v1.Snapshot} [response] Snapshot + */ + + /** + * Calls UpdateSnapshot. + * @function updateSnapshot + * @memberof google.pubsub.v1.Subscriber + * @instance + * @param {google.pubsub.v1.IUpdateSnapshotRequest} request UpdateSnapshotRequest message or plain object + * @param {google.pubsub.v1.Subscriber.UpdateSnapshotCallback} callback Node-style callback called with the error, if any, and Snapshot + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Subscriber.prototype.updateSnapshot = function updateSnapshot(request, callback) { + return this.rpcCall(updateSnapshot, $root.google.pubsub.v1.UpdateSnapshotRequest, $root.google.pubsub.v1.Snapshot, request, callback); + }, "name", { value: "UpdateSnapshot" }); + + /** + * Calls UpdateSnapshot. + * @function updateSnapshot + * @memberof google.pubsub.v1.Subscriber + * @instance + * @param {google.pubsub.v1.IUpdateSnapshotRequest} request UpdateSnapshotRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.pubsub.v1.Subscriber|deleteSnapshot}. + * @memberof google.pubsub.v1.Subscriber + * @typedef DeleteSnapshotCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteSnapshot. + * @function deleteSnapshot + * @memberof google.pubsub.v1.Subscriber + * @instance + * @param {google.pubsub.v1.IDeleteSnapshotRequest} request DeleteSnapshotRequest message or plain object + * @param {google.pubsub.v1.Subscriber.DeleteSnapshotCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Subscriber.prototype.deleteSnapshot = function deleteSnapshot(request, callback) { + return this.rpcCall(deleteSnapshot, $root.google.pubsub.v1.DeleteSnapshotRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteSnapshot" }); + + /** + * Calls DeleteSnapshot. + * @function deleteSnapshot + * @memberof google.pubsub.v1.Subscriber + * @instance + * @param {google.pubsub.v1.IDeleteSnapshotRequest} request DeleteSnapshotRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.pubsub.v1.Subscriber|seek}. + * @memberof google.pubsub.v1.Subscriber + * @typedef SeekCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.pubsub.v1.SeekResponse} [response] SeekResponse + */ + + /** + * Calls Seek. + * @function seek + * @memberof google.pubsub.v1.Subscriber + * @instance + * @param {google.pubsub.v1.ISeekRequest} request SeekRequest message or plain object + * @param {google.pubsub.v1.Subscriber.SeekCallback} callback Node-style callback called with the error, if any, and SeekResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Subscriber.prototype.seek = function seek(request, callback) { + return this.rpcCall(seek, $root.google.pubsub.v1.SeekRequest, $root.google.pubsub.v1.SeekResponse, request, callback); + }, "name", { value: "Seek" }); + + /** + * Calls Seek. + * @function seek + * @memberof google.pubsub.v1.Subscriber + * @instance + * @param {google.pubsub.v1.ISeekRequest} request SeekRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Subscriber; + })(); + + v1.Subscription = (function() { + + /** + * Properties of a Subscription. + * @memberof google.pubsub.v1 + * @interface ISubscription + * @property {string|null} [name] Subscription name + * @property {string|null} [topic] Subscription topic + * @property {google.pubsub.v1.IPushConfig|null} [pushConfig] Subscription pushConfig + * @property {google.pubsub.v1.IBigQueryConfig|null} [bigqueryConfig] Subscription bigqueryConfig + * @property {google.pubsub.v1.ICloudStorageConfig|null} [cloudStorageConfig] Subscription cloudStorageConfig + * @property {number|null} [ackDeadlineSeconds] Subscription ackDeadlineSeconds + * @property {boolean|null} [retainAckedMessages] Subscription retainAckedMessages + * @property {google.protobuf.IDuration|null} [messageRetentionDuration] Subscription messageRetentionDuration + * @property {Object.|null} [labels] Subscription labels + * @property {boolean|null} [enableMessageOrdering] Subscription enableMessageOrdering + * @property {google.pubsub.v1.IExpirationPolicy|null} [expirationPolicy] Subscription expirationPolicy + * @property {string|null} [filter] Subscription filter + * @property {google.pubsub.v1.IDeadLetterPolicy|null} [deadLetterPolicy] Subscription deadLetterPolicy + * @property {google.pubsub.v1.IRetryPolicy|null} [retryPolicy] Subscription retryPolicy + * @property {boolean|null} [detached] Subscription detached + * @property {boolean|null} [enableExactlyOnceDelivery] Subscription enableExactlyOnceDelivery + * @property {google.protobuf.IDuration|null} [topicMessageRetentionDuration] Subscription topicMessageRetentionDuration + * @property {google.pubsub.v1.Subscription.State|null} [state] Subscription state + */ + + /** + * Constructs a new Subscription. + * @memberof google.pubsub.v1 + * @classdesc Represents a Subscription. + * @implements ISubscription + * @constructor + * @param {google.pubsub.v1.ISubscription=} [properties] Properties to set + */ + function Subscription(properties) { + this.labels = {}; + 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]]; + } + + /** + * Subscription name. + * @member {string} name + * @memberof google.pubsub.v1.Subscription + * @instance + */ + Subscription.prototype.name = ""; + + /** + * Subscription topic. + * @member {string} topic + * @memberof google.pubsub.v1.Subscription + * @instance + */ + Subscription.prototype.topic = ""; + + /** + * Subscription pushConfig. + * @member {google.pubsub.v1.IPushConfig|null|undefined} pushConfig + * @memberof google.pubsub.v1.Subscription + * @instance + */ + Subscription.prototype.pushConfig = null; + + /** + * Subscription bigqueryConfig. + * @member {google.pubsub.v1.IBigQueryConfig|null|undefined} bigqueryConfig + * @memberof google.pubsub.v1.Subscription + * @instance + */ + Subscription.prototype.bigqueryConfig = null; + + /** + * Subscription cloudStorageConfig. + * @member {google.pubsub.v1.ICloudStorageConfig|null|undefined} cloudStorageConfig + * @memberof google.pubsub.v1.Subscription + * @instance + */ + Subscription.prototype.cloudStorageConfig = null; + + /** + * Subscription ackDeadlineSeconds. + * @member {number} ackDeadlineSeconds + * @memberof google.pubsub.v1.Subscription + * @instance + */ + Subscription.prototype.ackDeadlineSeconds = 0; + + /** + * Subscription retainAckedMessages. + * @member {boolean} retainAckedMessages + * @memberof google.pubsub.v1.Subscription + * @instance + */ + Subscription.prototype.retainAckedMessages = false; + + /** + * Subscription messageRetentionDuration. + * @member {google.protobuf.IDuration|null|undefined} messageRetentionDuration + * @memberof google.pubsub.v1.Subscription + * @instance + */ + Subscription.prototype.messageRetentionDuration = null; + + /** + * Subscription labels. + * @member {Object.} labels + * @memberof google.pubsub.v1.Subscription + * @instance + */ + Subscription.prototype.labels = $util.emptyObject; + + /** + * Subscription enableMessageOrdering. + * @member {boolean} enableMessageOrdering + * @memberof google.pubsub.v1.Subscription + * @instance + */ + Subscription.prototype.enableMessageOrdering = false; + + /** + * Subscription expirationPolicy. + * @member {google.pubsub.v1.IExpirationPolicy|null|undefined} expirationPolicy + * @memberof google.pubsub.v1.Subscription + * @instance + */ + Subscription.prototype.expirationPolicy = null; + + /** + * Subscription filter. + * @member {string} filter + * @memberof google.pubsub.v1.Subscription + * @instance + */ + Subscription.prototype.filter = ""; + + /** + * Subscription deadLetterPolicy. + * @member {google.pubsub.v1.IDeadLetterPolicy|null|undefined} deadLetterPolicy + * @memberof google.pubsub.v1.Subscription + * @instance + */ + Subscription.prototype.deadLetterPolicy = null; + + /** + * Subscription retryPolicy. + * @member {google.pubsub.v1.IRetryPolicy|null|undefined} retryPolicy + * @memberof google.pubsub.v1.Subscription + * @instance + */ + Subscription.prototype.retryPolicy = null; + + /** + * Subscription detached. + * @member {boolean} detached + * @memberof google.pubsub.v1.Subscription + * @instance + */ + Subscription.prototype.detached = false; + + /** + * Subscription enableExactlyOnceDelivery. + * @member {boolean} enableExactlyOnceDelivery + * @memberof google.pubsub.v1.Subscription + * @instance + */ + Subscription.prototype.enableExactlyOnceDelivery = false; + + /** + * Subscription topicMessageRetentionDuration. + * @member {google.protobuf.IDuration|null|undefined} topicMessageRetentionDuration + * @memberof google.pubsub.v1.Subscription + * @instance + */ + Subscription.prototype.topicMessageRetentionDuration = null; + + /** + * Subscription state. + * @member {google.pubsub.v1.Subscription.State} state + * @memberof google.pubsub.v1.Subscription + * @instance + */ + Subscription.prototype.state = 0; + + /** + * Creates a new Subscription instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.Subscription + * @static + * @param {google.pubsub.v1.ISubscription=} [properties] Properties to set + * @returns {google.pubsub.v1.Subscription} Subscription instance + */ + Subscription.create = function create(properties) { + return new Subscription(properties); + }; + + /** + * Encodes the specified Subscription message. Does not implicitly {@link google.pubsub.v1.Subscription.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.Subscription + * @static + * @param {google.pubsub.v1.ISubscription} message Subscription message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Subscription.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.topic != null && Object.hasOwnProperty.call(message, "topic")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.topic); + if (message.pushConfig != null && Object.hasOwnProperty.call(message, "pushConfig")) + $root.google.pubsub.v1.PushConfig.encode(message.pushConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.ackDeadlineSeconds != null && Object.hasOwnProperty.call(message, "ackDeadlineSeconds")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.ackDeadlineSeconds); + if (message.retainAckedMessages != null && Object.hasOwnProperty.call(message, "retainAckedMessages")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.retainAckedMessages); + if (message.messageRetentionDuration != null && Object.hasOwnProperty.call(message, "messageRetentionDuration")) + $root.google.protobuf.Duration.encode(message.messageRetentionDuration, writer.uint32(/* id 8, wireType 2 =*/66).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 9, wireType 2 =*/74).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.enableMessageOrdering != null && Object.hasOwnProperty.call(message, "enableMessageOrdering")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.enableMessageOrdering); + if (message.expirationPolicy != null && Object.hasOwnProperty.call(message, "expirationPolicy")) + $root.google.pubsub.v1.ExpirationPolicy.encode(message.expirationPolicy, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.filter); + if (message.deadLetterPolicy != null && Object.hasOwnProperty.call(message, "deadLetterPolicy")) + $root.google.pubsub.v1.DeadLetterPolicy.encode(message.deadLetterPolicy, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.retryPolicy != null && Object.hasOwnProperty.call(message, "retryPolicy")) + $root.google.pubsub.v1.RetryPolicy.encode(message.retryPolicy, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.detached != null && Object.hasOwnProperty.call(message, "detached")) + writer.uint32(/* id 15, wireType 0 =*/120).bool(message.detached); + if (message.enableExactlyOnceDelivery != null && Object.hasOwnProperty.call(message, "enableExactlyOnceDelivery")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.enableExactlyOnceDelivery); + if (message.topicMessageRetentionDuration != null && Object.hasOwnProperty.call(message, "topicMessageRetentionDuration")) + $root.google.protobuf.Duration.encode(message.topicMessageRetentionDuration, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + if (message.bigqueryConfig != null && Object.hasOwnProperty.call(message, "bigqueryConfig")) + $root.google.pubsub.v1.BigQueryConfig.encode(message.bigqueryConfig, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 19, wireType 0 =*/152).int32(message.state); + if (message.cloudStorageConfig != null && Object.hasOwnProperty.call(message, "cloudStorageConfig")) + $root.google.pubsub.v1.CloudStorageConfig.encode(message.cloudStorageConfig, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Subscription message, length delimited. Does not implicitly {@link google.pubsub.v1.Subscription.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.Subscription + * @static + * @param {google.pubsub.v1.ISubscription} message Subscription message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Subscription.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Subscription message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.Subscription + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.Subscription} Subscription + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Subscription.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.pubsub.v1.Subscription(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.topic = reader.string(); + break; + } + case 4: { + message.pushConfig = $root.google.pubsub.v1.PushConfig.decode(reader, reader.uint32()); + break; + } + case 18: { + message.bigqueryConfig = $root.google.pubsub.v1.BigQueryConfig.decode(reader, reader.uint32()); + break; + } + case 22: { + message.cloudStorageConfig = $root.google.pubsub.v1.CloudStorageConfig.decode(reader, reader.uint32()); + break; + } + case 5: { + message.ackDeadlineSeconds = reader.int32(); + break; + } + case 7: { + message.retainAckedMessages = reader.bool(); + break; + } + case 8: { + message.messageRetentionDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 9: { + 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; + } + case 10: { + message.enableMessageOrdering = reader.bool(); + break; + } + case 11: { + message.expirationPolicy = $root.google.pubsub.v1.ExpirationPolicy.decode(reader, reader.uint32()); + break; + } + case 12: { + message.filter = reader.string(); + break; + } + case 13: { + message.deadLetterPolicy = $root.google.pubsub.v1.DeadLetterPolicy.decode(reader, reader.uint32()); + break; + } + case 14: { + message.retryPolicy = $root.google.pubsub.v1.RetryPolicy.decode(reader, reader.uint32()); + break; + } + case 15: { + message.detached = reader.bool(); + break; + } + case 16: { + message.enableExactlyOnceDelivery = reader.bool(); + break; + } + case 17: { + message.topicMessageRetentionDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 19: { + message.state = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Subscription message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.Subscription + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.Subscription} Subscription + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Subscription.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Subscription message. + * @function verify + * @memberof google.pubsub.v1.Subscription + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Subscription.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.topic != null && message.hasOwnProperty("topic")) + if (!$util.isString(message.topic)) + return "topic: string expected"; + if (message.pushConfig != null && message.hasOwnProperty("pushConfig")) { + var error = $root.google.pubsub.v1.PushConfig.verify(message.pushConfig); + if (error) + return "pushConfig." + error; + } + if (message.bigqueryConfig != null && message.hasOwnProperty("bigqueryConfig")) { + var error = $root.google.pubsub.v1.BigQueryConfig.verify(message.bigqueryConfig); + if (error) + return "bigqueryConfig." + error; + } + if (message.cloudStorageConfig != null && message.hasOwnProperty("cloudStorageConfig")) { + var error = $root.google.pubsub.v1.CloudStorageConfig.verify(message.cloudStorageConfig); + if (error) + return "cloudStorageConfig." + error; + } + if (message.ackDeadlineSeconds != null && message.hasOwnProperty("ackDeadlineSeconds")) + if (!$util.isInteger(message.ackDeadlineSeconds)) + return "ackDeadlineSeconds: integer expected"; + if (message.retainAckedMessages != null && message.hasOwnProperty("retainAckedMessages")) + if (typeof message.retainAckedMessages !== "boolean") + return "retainAckedMessages: boolean expected"; + if (message.messageRetentionDuration != null && message.hasOwnProperty("messageRetentionDuration")) { + var error = $root.google.protobuf.Duration.verify(message.messageRetentionDuration); + if (error) + return "messageRetentionDuration." + 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"; + } + if (message.enableMessageOrdering != null && message.hasOwnProperty("enableMessageOrdering")) + if (typeof message.enableMessageOrdering !== "boolean") + return "enableMessageOrdering: boolean expected"; + if (message.expirationPolicy != null && message.hasOwnProperty("expirationPolicy")) { + var error = $root.google.pubsub.v1.ExpirationPolicy.verify(message.expirationPolicy); + if (error) + return "expirationPolicy." + error; + } + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.deadLetterPolicy != null && message.hasOwnProperty("deadLetterPolicy")) { + var error = $root.google.pubsub.v1.DeadLetterPolicy.verify(message.deadLetterPolicy); + if (error) + return "deadLetterPolicy." + error; + } + if (message.retryPolicy != null && message.hasOwnProperty("retryPolicy")) { + var error = $root.google.pubsub.v1.RetryPolicy.verify(message.retryPolicy); + if (error) + return "retryPolicy." + error; + } + if (message.detached != null && message.hasOwnProperty("detached")) + if (typeof message.detached !== "boolean") + return "detached: boolean expected"; + if (message.enableExactlyOnceDelivery != null && message.hasOwnProperty("enableExactlyOnceDelivery")) + if (typeof message.enableExactlyOnceDelivery !== "boolean") + return "enableExactlyOnceDelivery: boolean expected"; + if (message.topicMessageRetentionDuration != null && message.hasOwnProperty("topicMessageRetentionDuration")) { + var error = $root.google.protobuf.Duration.verify(message.topicMessageRetentionDuration); + if (error) + return "topicMessageRetentionDuration." + error; + } + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a Subscription message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.Subscription + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.Subscription} Subscription + */ + Subscription.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.Subscription) + return object; + var message = new $root.google.pubsub.v1.Subscription(); + if (object.name != null) + message.name = String(object.name); + if (object.topic != null) + message.topic = String(object.topic); + if (object.pushConfig != null) { + if (typeof object.pushConfig !== "object") + throw TypeError(".google.pubsub.v1.Subscription.pushConfig: object expected"); + message.pushConfig = $root.google.pubsub.v1.PushConfig.fromObject(object.pushConfig); + } + if (object.bigqueryConfig != null) { + if (typeof object.bigqueryConfig !== "object") + throw TypeError(".google.pubsub.v1.Subscription.bigqueryConfig: object expected"); + message.bigqueryConfig = $root.google.pubsub.v1.BigQueryConfig.fromObject(object.bigqueryConfig); + } + if (object.cloudStorageConfig != null) { + if (typeof object.cloudStorageConfig !== "object") + throw TypeError(".google.pubsub.v1.Subscription.cloudStorageConfig: object expected"); + message.cloudStorageConfig = $root.google.pubsub.v1.CloudStorageConfig.fromObject(object.cloudStorageConfig); + } + if (object.ackDeadlineSeconds != null) + message.ackDeadlineSeconds = object.ackDeadlineSeconds | 0; + if (object.retainAckedMessages != null) + message.retainAckedMessages = Boolean(object.retainAckedMessages); + if (object.messageRetentionDuration != null) { + if (typeof object.messageRetentionDuration !== "object") + throw TypeError(".google.pubsub.v1.Subscription.messageRetentionDuration: object expected"); + message.messageRetentionDuration = $root.google.protobuf.Duration.fromObject(object.messageRetentionDuration); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.pubsub.v1.Subscription.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + if (object.enableMessageOrdering != null) + message.enableMessageOrdering = Boolean(object.enableMessageOrdering); + if (object.expirationPolicy != null) { + if (typeof object.expirationPolicy !== "object") + throw TypeError(".google.pubsub.v1.Subscription.expirationPolicy: object expected"); + message.expirationPolicy = $root.google.pubsub.v1.ExpirationPolicy.fromObject(object.expirationPolicy); + } + if (object.filter != null) + message.filter = String(object.filter); + if (object.deadLetterPolicy != null) { + if (typeof object.deadLetterPolicy !== "object") + throw TypeError(".google.pubsub.v1.Subscription.deadLetterPolicy: object expected"); + message.deadLetterPolicy = $root.google.pubsub.v1.DeadLetterPolicy.fromObject(object.deadLetterPolicy); + } + if (object.retryPolicy != null) { + if (typeof object.retryPolicy !== "object") + throw TypeError(".google.pubsub.v1.Subscription.retryPolicy: object expected"); + message.retryPolicy = $root.google.pubsub.v1.RetryPolicy.fromObject(object.retryPolicy); + } + if (object.detached != null) + message.detached = Boolean(object.detached); + if (object.enableExactlyOnceDelivery != null) + message.enableExactlyOnceDelivery = Boolean(object.enableExactlyOnceDelivery); + if (object.topicMessageRetentionDuration != null) { + if (typeof object.topicMessageRetentionDuration !== "object") + throw TypeError(".google.pubsub.v1.Subscription.topicMessageRetentionDuration: object expected"); + message.topicMessageRetentionDuration = $root.google.protobuf.Duration.fromObject(object.topicMessageRetentionDuration); + } + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "ACTIVE": + case 1: + message.state = 1; + break; + case "RESOURCE_ERROR": + case 2: + message.state = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a Subscription message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.Subscription + * @static + * @param {google.pubsub.v1.Subscription} message Subscription + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Subscription.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.topic = ""; + object.pushConfig = null; + object.ackDeadlineSeconds = 0; + object.retainAckedMessages = false; + object.messageRetentionDuration = null; + object.enableMessageOrdering = false; + object.expirationPolicy = null; + object.filter = ""; + object.deadLetterPolicy = null; + object.retryPolicy = null; + object.detached = false; + object.enableExactlyOnceDelivery = false; + object.topicMessageRetentionDuration = null; + object.bigqueryConfig = null; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.cloudStorageConfig = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.topic != null && message.hasOwnProperty("topic")) + object.topic = message.topic; + if (message.pushConfig != null && message.hasOwnProperty("pushConfig")) + object.pushConfig = $root.google.pubsub.v1.PushConfig.toObject(message.pushConfig, options); + if (message.ackDeadlineSeconds != null && message.hasOwnProperty("ackDeadlineSeconds")) + object.ackDeadlineSeconds = message.ackDeadlineSeconds; + if (message.retainAckedMessages != null && message.hasOwnProperty("retainAckedMessages")) + object.retainAckedMessages = message.retainAckedMessages; + if (message.messageRetentionDuration != null && message.hasOwnProperty("messageRetentionDuration")) + object.messageRetentionDuration = $root.google.protobuf.Duration.toObject(message.messageRetentionDuration, options); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.enableMessageOrdering != null && message.hasOwnProperty("enableMessageOrdering")) + object.enableMessageOrdering = message.enableMessageOrdering; + if (message.expirationPolicy != null && message.hasOwnProperty("expirationPolicy")) + object.expirationPolicy = $root.google.pubsub.v1.ExpirationPolicy.toObject(message.expirationPolicy, options); + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.deadLetterPolicy != null && message.hasOwnProperty("deadLetterPolicy")) + object.deadLetterPolicy = $root.google.pubsub.v1.DeadLetterPolicy.toObject(message.deadLetterPolicy, options); + if (message.retryPolicy != null && message.hasOwnProperty("retryPolicy")) + object.retryPolicy = $root.google.pubsub.v1.RetryPolicy.toObject(message.retryPolicy, options); + if (message.detached != null && message.hasOwnProperty("detached")) + object.detached = message.detached; + if (message.enableExactlyOnceDelivery != null && message.hasOwnProperty("enableExactlyOnceDelivery")) + object.enableExactlyOnceDelivery = message.enableExactlyOnceDelivery; + if (message.topicMessageRetentionDuration != null && message.hasOwnProperty("topicMessageRetentionDuration")) + object.topicMessageRetentionDuration = $root.google.protobuf.Duration.toObject(message.topicMessageRetentionDuration, options); + if (message.bigqueryConfig != null && message.hasOwnProperty("bigqueryConfig")) + object.bigqueryConfig = $root.google.pubsub.v1.BigQueryConfig.toObject(message.bigqueryConfig, options); + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.pubsub.v1.Subscription.State[message.state] === undefined ? message.state : $root.google.pubsub.v1.Subscription.State[message.state] : message.state; + if (message.cloudStorageConfig != null && message.hasOwnProperty("cloudStorageConfig")) + object.cloudStorageConfig = $root.google.pubsub.v1.CloudStorageConfig.toObject(message.cloudStorageConfig, options); + return object; + }; + + /** + * Converts this Subscription to JSON. + * @function toJSON + * @memberof google.pubsub.v1.Subscription + * @instance + * @returns {Object.} JSON object + */ + Subscription.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Subscription + * @function getTypeUrl + * @memberof google.pubsub.v1.Subscription + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Subscription.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.Subscription"; + }; + + /** + * State enum. + * @name google.pubsub.v1.Subscription.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} ACTIVE=1 ACTIVE value + * @property {number} RESOURCE_ERROR=2 RESOURCE_ERROR value + */ + Subscription.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ACTIVE"] = 1; + values[valuesById[2] = "RESOURCE_ERROR"] = 2; + return values; + })(); + + return Subscription; + })(); + + v1.RetryPolicy = (function() { + + /** + * Properties of a RetryPolicy. + * @memberof google.pubsub.v1 + * @interface IRetryPolicy + * @property {google.protobuf.IDuration|null} [minimumBackoff] RetryPolicy minimumBackoff + * @property {google.protobuf.IDuration|null} [maximumBackoff] RetryPolicy maximumBackoff + */ + + /** + * Constructs a new RetryPolicy. + * @memberof google.pubsub.v1 + * @classdesc Represents a RetryPolicy. + * @implements IRetryPolicy + * @constructor + * @param {google.pubsub.v1.IRetryPolicy=} [properties] Properties to set + */ + function RetryPolicy(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]]; + } + + /** + * RetryPolicy minimumBackoff. + * @member {google.protobuf.IDuration|null|undefined} minimumBackoff + * @memberof google.pubsub.v1.RetryPolicy + * @instance + */ + RetryPolicy.prototype.minimumBackoff = null; + + /** + * RetryPolicy maximumBackoff. + * @member {google.protobuf.IDuration|null|undefined} maximumBackoff + * @memberof google.pubsub.v1.RetryPolicy + * @instance + */ + RetryPolicy.prototype.maximumBackoff = null; + + /** + * Creates a new RetryPolicy instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.RetryPolicy + * @static + * @param {google.pubsub.v1.IRetryPolicy=} [properties] Properties to set + * @returns {google.pubsub.v1.RetryPolicy} RetryPolicy instance + */ + RetryPolicy.create = function create(properties) { + return new RetryPolicy(properties); + }; + + /** + * Encodes the specified RetryPolicy message. Does not implicitly {@link google.pubsub.v1.RetryPolicy.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.RetryPolicy + * @static + * @param {google.pubsub.v1.IRetryPolicy} message RetryPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RetryPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.minimumBackoff != null && Object.hasOwnProperty.call(message, "minimumBackoff")) + $root.google.protobuf.Duration.encode(message.minimumBackoff, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.maximumBackoff != null && Object.hasOwnProperty.call(message, "maximumBackoff")) + $root.google.protobuf.Duration.encode(message.maximumBackoff, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RetryPolicy message, length delimited. Does not implicitly {@link google.pubsub.v1.RetryPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.RetryPolicy + * @static + * @param {google.pubsub.v1.IRetryPolicy} message RetryPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RetryPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RetryPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.RetryPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.RetryPolicy} RetryPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RetryPolicy.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.pubsub.v1.RetryPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.minimumBackoff = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 2: { + message.maximumBackoff = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RetryPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.RetryPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.RetryPolicy} RetryPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RetryPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RetryPolicy message. + * @function verify + * @memberof google.pubsub.v1.RetryPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RetryPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.minimumBackoff != null && message.hasOwnProperty("minimumBackoff")) { + var error = $root.google.protobuf.Duration.verify(message.minimumBackoff); + if (error) + return "minimumBackoff." + error; + } + if (message.maximumBackoff != null && message.hasOwnProperty("maximumBackoff")) { + var error = $root.google.protobuf.Duration.verify(message.maximumBackoff); + if (error) + return "maximumBackoff." + error; + } + return null; + }; + + /** + * Creates a RetryPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.RetryPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.RetryPolicy} RetryPolicy + */ + RetryPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.RetryPolicy) + return object; + var message = new $root.google.pubsub.v1.RetryPolicy(); + if (object.minimumBackoff != null) { + if (typeof object.minimumBackoff !== "object") + throw TypeError(".google.pubsub.v1.RetryPolicy.minimumBackoff: object expected"); + message.minimumBackoff = $root.google.protobuf.Duration.fromObject(object.minimumBackoff); + } + if (object.maximumBackoff != null) { + if (typeof object.maximumBackoff !== "object") + throw TypeError(".google.pubsub.v1.RetryPolicy.maximumBackoff: object expected"); + message.maximumBackoff = $root.google.protobuf.Duration.fromObject(object.maximumBackoff); + } + return message; + }; + + /** + * Creates a plain object from a RetryPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.RetryPolicy + * @static + * @param {google.pubsub.v1.RetryPolicy} message RetryPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RetryPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.minimumBackoff = null; + object.maximumBackoff = null; + } + if (message.minimumBackoff != null && message.hasOwnProperty("minimumBackoff")) + object.minimumBackoff = $root.google.protobuf.Duration.toObject(message.minimumBackoff, options); + if (message.maximumBackoff != null && message.hasOwnProperty("maximumBackoff")) + object.maximumBackoff = $root.google.protobuf.Duration.toObject(message.maximumBackoff, options); + return object; + }; + + /** + * Converts this RetryPolicy to JSON. + * @function toJSON + * @memberof google.pubsub.v1.RetryPolicy + * @instance + * @returns {Object.} JSON object + */ + RetryPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RetryPolicy + * @function getTypeUrl + * @memberof google.pubsub.v1.RetryPolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RetryPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.RetryPolicy"; + }; + + return RetryPolicy; + })(); + + v1.DeadLetterPolicy = (function() { + + /** + * Properties of a DeadLetterPolicy. + * @memberof google.pubsub.v1 + * @interface IDeadLetterPolicy + * @property {string|null} [deadLetterTopic] DeadLetterPolicy deadLetterTopic + * @property {number|null} [maxDeliveryAttempts] DeadLetterPolicy maxDeliveryAttempts + */ + + /** + * Constructs a new DeadLetterPolicy. + * @memberof google.pubsub.v1 + * @classdesc Represents a DeadLetterPolicy. + * @implements IDeadLetterPolicy + * @constructor + * @param {google.pubsub.v1.IDeadLetterPolicy=} [properties] Properties to set + */ + function DeadLetterPolicy(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]]; + } + + /** + * DeadLetterPolicy deadLetterTopic. + * @member {string} deadLetterTopic + * @memberof google.pubsub.v1.DeadLetterPolicy + * @instance + */ + DeadLetterPolicy.prototype.deadLetterTopic = ""; + + /** + * DeadLetterPolicy maxDeliveryAttempts. + * @member {number} maxDeliveryAttempts + * @memberof google.pubsub.v1.DeadLetterPolicy + * @instance + */ + DeadLetterPolicy.prototype.maxDeliveryAttempts = 0; + + /** + * Creates a new DeadLetterPolicy instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.DeadLetterPolicy + * @static + * @param {google.pubsub.v1.IDeadLetterPolicy=} [properties] Properties to set + * @returns {google.pubsub.v1.DeadLetterPolicy} DeadLetterPolicy instance + */ + DeadLetterPolicy.create = function create(properties) { + return new DeadLetterPolicy(properties); + }; + + /** + * Encodes the specified DeadLetterPolicy message. Does not implicitly {@link google.pubsub.v1.DeadLetterPolicy.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.DeadLetterPolicy + * @static + * @param {google.pubsub.v1.IDeadLetterPolicy} message DeadLetterPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeadLetterPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deadLetterTopic != null && Object.hasOwnProperty.call(message, "deadLetterTopic")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.deadLetterTopic); + if (message.maxDeliveryAttempts != null && Object.hasOwnProperty.call(message, "maxDeliveryAttempts")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.maxDeliveryAttempts); + return writer; + }; + + /** + * Encodes the specified DeadLetterPolicy message, length delimited. Does not implicitly {@link google.pubsub.v1.DeadLetterPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.DeadLetterPolicy + * @static + * @param {google.pubsub.v1.IDeadLetterPolicy} message DeadLetterPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeadLetterPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeadLetterPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.DeadLetterPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.DeadLetterPolicy} DeadLetterPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeadLetterPolicy.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.pubsub.v1.DeadLetterPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.deadLetterTopic = reader.string(); + break; + } + case 2: { + message.maxDeliveryAttempts = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeadLetterPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.DeadLetterPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.DeadLetterPolicy} DeadLetterPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeadLetterPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeadLetterPolicy message. + * @function verify + * @memberof google.pubsub.v1.DeadLetterPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeadLetterPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deadLetterTopic != null && message.hasOwnProperty("deadLetterTopic")) + if (!$util.isString(message.deadLetterTopic)) + return "deadLetterTopic: string expected"; + if (message.maxDeliveryAttempts != null && message.hasOwnProperty("maxDeliveryAttempts")) + if (!$util.isInteger(message.maxDeliveryAttempts)) + return "maxDeliveryAttempts: integer expected"; + return null; + }; + + /** + * Creates a DeadLetterPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.DeadLetterPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.DeadLetterPolicy} DeadLetterPolicy + */ + DeadLetterPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.DeadLetterPolicy) + return object; + var message = new $root.google.pubsub.v1.DeadLetterPolicy(); + if (object.deadLetterTopic != null) + message.deadLetterTopic = String(object.deadLetterTopic); + if (object.maxDeliveryAttempts != null) + message.maxDeliveryAttempts = object.maxDeliveryAttempts | 0; + return message; + }; + + /** + * Creates a plain object from a DeadLetterPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.DeadLetterPolicy + * @static + * @param {google.pubsub.v1.DeadLetterPolicy} message DeadLetterPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeadLetterPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.deadLetterTopic = ""; + object.maxDeliveryAttempts = 0; + } + if (message.deadLetterTopic != null && message.hasOwnProperty("deadLetterTopic")) + object.deadLetterTopic = message.deadLetterTopic; + if (message.maxDeliveryAttempts != null && message.hasOwnProperty("maxDeliveryAttempts")) + object.maxDeliveryAttempts = message.maxDeliveryAttempts; + return object; + }; + + /** + * Converts this DeadLetterPolicy to JSON. + * @function toJSON + * @memberof google.pubsub.v1.DeadLetterPolicy + * @instance + * @returns {Object.} JSON object + */ + DeadLetterPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeadLetterPolicy + * @function getTypeUrl + * @memberof google.pubsub.v1.DeadLetterPolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeadLetterPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.DeadLetterPolicy"; + }; + + return DeadLetterPolicy; + })(); + + v1.ExpirationPolicy = (function() { + + /** + * Properties of an ExpirationPolicy. + * @memberof google.pubsub.v1 + * @interface IExpirationPolicy + * @property {google.protobuf.IDuration|null} [ttl] ExpirationPolicy ttl + */ + + /** + * Constructs a new ExpirationPolicy. + * @memberof google.pubsub.v1 + * @classdesc Represents an ExpirationPolicy. + * @implements IExpirationPolicy + * @constructor + * @param {google.pubsub.v1.IExpirationPolicy=} [properties] Properties to set + */ + function ExpirationPolicy(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]]; + } + + /** + * ExpirationPolicy ttl. + * @member {google.protobuf.IDuration|null|undefined} ttl + * @memberof google.pubsub.v1.ExpirationPolicy + * @instance + */ + ExpirationPolicy.prototype.ttl = null; + + /** + * Creates a new ExpirationPolicy instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.ExpirationPolicy + * @static + * @param {google.pubsub.v1.IExpirationPolicy=} [properties] Properties to set + * @returns {google.pubsub.v1.ExpirationPolicy} ExpirationPolicy instance + */ + ExpirationPolicy.create = function create(properties) { + return new ExpirationPolicy(properties); + }; + + /** + * Encodes the specified ExpirationPolicy message. Does not implicitly {@link google.pubsub.v1.ExpirationPolicy.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.ExpirationPolicy + * @static + * @param {google.pubsub.v1.IExpirationPolicy} message ExpirationPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExpirationPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ttl != null && Object.hasOwnProperty.call(message, "ttl")) + $root.google.protobuf.Duration.encode(message.ttl, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExpirationPolicy message, length delimited. Does not implicitly {@link google.pubsub.v1.ExpirationPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.ExpirationPolicy + * @static + * @param {google.pubsub.v1.IExpirationPolicy} message ExpirationPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExpirationPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExpirationPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.ExpirationPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.ExpirationPolicy} ExpirationPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExpirationPolicy.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.pubsub.v1.ExpirationPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.ttl = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExpirationPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.ExpirationPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.ExpirationPolicy} ExpirationPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExpirationPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExpirationPolicy message. + * @function verify + * @memberof google.pubsub.v1.ExpirationPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExpirationPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ttl != null && message.hasOwnProperty("ttl")) { + var error = $root.google.protobuf.Duration.verify(message.ttl); + if (error) + return "ttl." + error; + } + return null; + }; + + /** + * Creates an ExpirationPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.ExpirationPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.ExpirationPolicy} ExpirationPolicy + */ + ExpirationPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.ExpirationPolicy) + return object; + var message = new $root.google.pubsub.v1.ExpirationPolicy(); + if (object.ttl != null) { + if (typeof object.ttl !== "object") + throw TypeError(".google.pubsub.v1.ExpirationPolicy.ttl: object expected"); + message.ttl = $root.google.protobuf.Duration.fromObject(object.ttl); + } + return message; + }; + + /** + * Creates a plain object from an ExpirationPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.ExpirationPolicy + * @static + * @param {google.pubsub.v1.ExpirationPolicy} message ExpirationPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExpirationPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.ttl = null; + if (message.ttl != null && message.hasOwnProperty("ttl")) + object.ttl = $root.google.protobuf.Duration.toObject(message.ttl, options); + return object; + }; + + /** + * Converts this ExpirationPolicy to JSON. + * @function toJSON + * @memberof google.pubsub.v1.ExpirationPolicy + * @instance + * @returns {Object.} JSON object + */ + ExpirationPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExpirationPolicy + * @function getTypeUrl + * @memberof google.pubsub.v1.ExpirationPolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExpirationPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.ExpirationPolicy"; + }; + + return ExpirationPolicy; + })(); + + v1.PushConfig = (function() { + + /** + * Properties of a PushConfig. + * @memberof google.pubsub.v1 + * @interface IPushConfig + * @property {string|null} [pushEndpoint] PushConfig pushEndpoint + * @property {Object.|null} [attributes] PushConfig attributes + * @property {google.pubsub.v1.PushConfig.IOidcToken|null} [oidcToken] PushConfig oidcToken + * @property {google.pubsub.v1.PushConfig.IPubsubWrapper|null} [pubsubWrapper] PushConfig pubsubWrapper + * @property {google.pubsub.v1.PushConfig.INoWrapper|null} [noWrapper] PushConfig noWrapper + */ + + /** + * Constructs a new PushConfig. + * @memberof google.pubsub.v1 + * @classdesc Represents a PushConfig. + * @implements IPushConfig + * @constructor + * @param {google.pubsub.v1.IPushConfig=} [properties] Properties to set + */ + function PushConfig(properties) { + this.attributes = {}; + 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]]; + } + + /** + * PushConfig pushEndpoint. + * @member {string} pushEndpoint + * @memberof google.pubsub.v1.PushConfig + * @instance + */ + PushConfig.prototype.pushEndpoint = ""; + + /** + * PushConfig attributes. + * @member {Object.} attributes + * @memberof google.pubsub.v1.PushConfig + * @instance + */ + PushConfig.prototype.attributes = $util.emptyObject; + + /** + * PushConfig oidcToken. + * @member {google.pubsub.v1.PushConfig.IOidcToken|null|undefined} oidcToken + * @memberof google.pubsub.v1.PushConfig + * @instance + */ + PushConfig.prototype.oidcToken = null; + + /** + * PushConfig pubsubWrapper. + * @member {google.pubsub.v1.PushConfig.IPubsubWrapper|null|undefined} pubsubWrapper + * @memberof google.pubsub.v1.PushConfig + * @instance + */ + PushConfig.prototype.pubsubWrapper = null; + + /** + * PushConfig noWrapper. + * @member {google.pubsub.v1.PushConfig.INoWrapper|null|undefined} noWrapper + * @memberof google.pubsub.v1.PushConfig + * @instance + */ + PushConfig.prototype.noWrapper = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * PushConfig authenticationMethod. + * @member {"oidcToken"|undefined} authenticationMethod + * @memberof google.pubsub.v1.PushConfig + * @instance + */ + Object.defineProperty(PushConfig.prototype, "authenticationMethod", { + get: $util.oneOfGetter($oneOfFields = ["oidcToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * PushConfig wrapper. + * @member {"pubsubWrapper"|"noWrapper"|undefined} wrapper + * @memberof google.pubsub.v1.PushConfig + * @instance + */ + Object.defineProperty(PushConfig.prototype, "wrapper", { + get: $util.oneOfGetter($oneOfFields = ["pubsubWrapper", "noWrapper"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PushConfig instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.PushConfig + * @static + * @param {google.pubsub.v1.IPushConfig=} [properties] Properties to set + * @returns {google.pubsub.v1.PushConfig} PushConfig instance + */ + PushConfig.create = function create(properties) { + return new PushConfig(properties); + }; + + /** + * Encodes the specified PushConfig message. Does not implicitly {@link google.pubsub.v1.PushConfig.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.PushConfig + * @static + * @param {google.pubsub.v1.IPushConfig} message PushConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PushConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pushEndpoint != null && Object.hasOwnProperty.call(message, "pushEndpoint")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.pushEndpoint); + if (message.attributes != null && Object.hasOwnProperty.call(message, "attributes")) + for (var keys = Object.keys(message.attributes), 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.attributes[keys[i]]).ldelim(); + if (message.oidcToken != null && Object.hasOwnProperty.call(message, "oidcToken")) + $root.google.pubsub.v1.PushConfig.OidcToken.encode(message.oidcToken, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.pubsubWrapper != null && Object.hasOwnProperty.call(message, "pubsubWrapper")) + $root.google.pubsub.v1.PushConfig.PubsubWrapper.encode(message.pubsubWrapper, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.noWrapper != null && Object.hasOwnProperty.call(message, "noWrapper")) + $root.google.pubsub.v1.PushConfig.NoWrapper.encode(message.noWrapper, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PushConfig message, length delimited. Does not implicitly {@link google.pubsub.v1.PushConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.PushConfig + * @static + * @param {google.pubsub.v1.IPushConfig} message PushConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PushConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PushConfig message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.PushConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.PushConfig} PushConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PushConfig.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.pubsub.v1.PushConfig(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.pushEndpoint = reader.string(); + break; + } + case 2: { + if (message.attributes === $util.emptyObject) + message.attributes = {}; + 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.attributes[key] = value; + break; + } + case 3: { + message.oidcToken = $root.google.pubsub.v1.PushConfig.OidcToken.decode(reader, reader.uint32()); + break; + } + case 4: { + message.pubsubWrapper = $root.google.pubsub.v1.PushConfig.PubsubWrapper.decode(reader, reader.uint32()); + break; + } + case 5: { + message.noWrapper = $root.google.pubsub.v1.PushConfig.NoWrapper.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PushConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.PushConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.PushConfig} PushConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PushConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PushConfig message. + * @function verify + * @memberof google.pubsub.v1.PushConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PushConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.pushEndpoint != null && message.hasOwnProperty("pushEndpoint")) + if (!$util.isString(message.pushEndpoint)) + return "pushEndpoint: string expected"; + if (message.attributes != null && message.hasOwnProperty("attributes")) { + if (!$util.isObject(message.attributes)) + return "attributes: object expected"; + var key = Object.keys(message.attributes); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.attributes[key[i]])) + return "attributes: string{k:string} expected"; + } + if (message.oidcToken != null && message.hasOwnProperty("oidcToken")) { + properties.authenticationMethod = 1; + { + var error = $root.google.pubsub.v1.PushConfig.OidcToken.verify(message.oidcToken); + if (error) + return "oidcToken." + error; + } + } + if (message.pubsubWrapper != null && message.hasOwnProperty("pubsubWrapper")) { + properties.wrapper = 1; + { + var error = $root.google.pubsub.v1.PushConfig.PubsubWrapper.verify(message.pubsubWrapper); + if (error) + return "pubsubWrapper." + error; + } + } + if (message.noWrapper != null && message.hasOwnProperty("noWrapper")) { + if (properties.wrapper === 1) + return "wrapper: multiple values"; + properties.wrapper = 1; + { + var error = $root.google.pubsub.v1.PushConfig.NoWrapper.verify(message.noWrapper); + if (error) + return "noWrapper." + error; + } + } + return null; + }; + + /** + * Creates a PushConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.PushConfig + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.PushConfig} PushConfig + */ + PushConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.PushConfig) + return object; + var message = new $root.google.pubsub.v1.PushConfig(); + if (object.pushEndpoint != null) + message.pushEndpoint = String(object.pushEndpoint); + if (object.attributes) { + if (typeof object.attributes !== "object") + throw TypeError(".google.pubsub.v1.PushConfig.attributes: object expected"); + message.attributes = {}; + for (var keys = Object.keys(object.attributes), i = 0; i < keys.length; ++i) + message.attributes[keys[i]] = String(object.attributes[keys[i]]); + } + if (object.oidcToken != null) { + if (typeof object.oidcToken !== "object") + throw TypeError(".google.pubsub.v1.PushConfig.oidcToken: object expected"); + message.oidcToken = $root.google.pubsub.v1.PushConfig.OidcToken.fromObject(object.oidcToken); + } + if (object.pubsubWrapper != null) { + if (typeof object.pubsubWrapper !== "object") + throw TypeError(".google.pubsub.v1.PushConfig.pubsubWrapper: object expected"); + message.pubsubWrapper = $root.google.pubsub.v1.PushConfig.PubsubWrapper.fromObject(object.pubsubWrapper); + } + if (object.noWrapper != null) { + if (typeof object.noWrapper !== "object") + throw TypeError(".google.pubsub.v1.PushConfig.noWrapper: object expected"); + message.noWrapper = $root.google.pubsub.v1.PushConfig.NoWrapper.fromObject(object.noWrapper); + } + return message; + }; + + /** + * Creates a plain object from a PushConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.PushConfig + * @static + * @param {google.pubsub.v1.PushConfig} message PushConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PushConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.attributes = {}; + if (options.defaults) + object.pushEndpoint = ""; + if (message.pushEndpoint != null && message.hasOwnProperty("pushEndpoint")) + object.pushEndpoint = message.pushEndpoint; + var keys2; + if (message.attributes && (keys2 = Object.keys(message.attributes)).length) { + object.attributes = {}; + for (var j = 0; j < keys2.length; ++j) + object.attributes[keys2[j]] = message.attributes[keys2[j]]; + } + if (message.oidcToken != null && message.hasOwnProperty("oidcToken")) { + object.oidcToken = $root.google.pubsub.v1.PushConfig.OidcToken.toObject(message.oidcToken, options); + if (options.oneofs) + object.authenticationMethod = "oidcToken"; + } + if (message.pubsubWrapper != null && message.hasOwnProperty("pubsubWrapper")) { + object.pubsubWrapper = $root.google.pubsub.v1.PushConfig.PubsubWrapper.toObject(message.pubsubWrapper, options); + if (options.oneofs) + object.wrapper = "pubsubWrapper"; + } + if (message.noWrapper != null && message.hasOwnProperty("noWrapper")) { + object.noWrapper = $root.google.pubsub.v1.PushConfig.NoWrapper.toObject(message.noWrapper, options); + if (options.oneofs) + object.wrapper = "noWrapper"; + } + return object; + }; + + /** + * Converts this PushConfig to JSON. + * @function toJSON + * @memberof google.pubsub.v1.PushConfig + * @instance + * @returns {Object.} JSON object + */ + PushConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PushConfig + * @function getTypeUrl + * @memberof google.pubsub.v1.PushConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PushConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.PushConfig"; + }; + + PushConfig.OidcToken = (function() { + + /** + * Properties of an OidcToken. + * @memberof google.pubsub.v1.PushConfig + * @interface IOidcToken + * @property {string|null} [serviceAccountEmail] OidcToken serviceAccountEmail + * @property {string|null} [audience] OidcToken audience + */ + + /** + * Constructs a new OidcToken. + * @memberof google.pubsub.v1.PushConfig + * @classdesc Represents an OidcToken. + * @implements IOidcToken + * @constructor + * @param {google.pubsub.v1.PushConfig.IOidcToken=} [properties] Properties to set + */ + function OidcToken(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]]; + } + + /** + * OidcToken serviceAccountEmail. + * @member {string} serviceAccountEmail + * @memberof google.pubsub.v1.PushConfig.OidcToken + * @instance + */ + OidcToken.prototype.serviceAccountEmail = ""; + + /** + * OidcToken audience. + * @member {string} audience + * @memberof google.pubsub.v1.PushConfig.OidcToken + * @instance + */ + OidcToken.prototype.audience = ""; + + /** + * Creates a new OidcToken instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.PushConfig.OidcToken + * @static + * @param {google.pubsub.v1.PushConfig.IOidcToken=} [properties] Properties to set + * @returns {google.pubsub.v1.PushConfig.OidcToken} OidcToken instance + */ + OidcToken.create = function create(properties) { + return new OidcToken(properties); + }; + + /** + * Encodes the specified OidcToken message. Does not implicitly {@link google.pubsub.v1.PushConfig.OidcToken.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.PushConfig.OidcToken + * @static + * @param {google.pubsub.v1.PushConfig.IOidcToken} message OidcToken message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OidcToken.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.serviceAccountEmail != null && Object.hasOwnProperty.call(message, "serviceAccountEmail")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.serviceAccountEmail); + if (message.audience != null && Object.hasOwnProperty.call(message, "audience")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.audience); + return writer; + }; + + /** + * Encodes the specified OidcToken message, length delimited. Does not implicitly {@link google.pubsub.v1.PushConfig.OidcToken.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.PushConfig.OidcToken + * @static + * @param {google.pubsub.v1.PushConfig.IOidcToken} message OidcToken message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OidcToken.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OidcToken message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.PushConfig.OidcToken + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.PushConfig.OidcToken} OidcToken + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OidcToken.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.pubsub.v1.PushConfig.OidcToken(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.serviceAccountEmail = reader.string(); + break; + } + case 2: { + message.audience = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OidcToken message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.PushConfig.OidcToken + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.PushConfig.OidcToken} OidcToken + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OidcToken.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OidcToken message. + * @function verify + * @memberof google.pubsub.v1.PushConfig.OidcToken + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OidcToken.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.serviceAccountEmail != null && message.hasOwnProperty("serviceAccountEmail")) + if (!$util.isString(message.serviceAccountEmail)) + return "serviceAccountEmail: string expected"; + if (message.audience != null && message.hasOwnProperty("audience")) + if (!$util.isString(message.audience)) + return "audience: string expected"; + return null; + }; + + /** + * Creates an OidcToken message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.PushConfig.OidcToken + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.PushConfig.OidcToken} OidcToken + */ + OidcToken.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.PushConfig.OidcToken) + return object; + var message = new $root.google.pubsub.v1.PushConfig.OidcToken(); + if (object.serviceAccountEmail != null) + message.serviceAccountEmail = String(object.serviceAccountEmail); + if (object.audience != null) + message.audience = String(object.audience); + return message; + }; + + /** + * Creates a plain object from an OidcToken message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.PushConfig.OidcToken + * @static + * @param {google.pubsub.v1.PushConfig.OidcToken} message OidcToken + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OidcToken.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.serviceAccountEmail = ""; + object.audience = ""; + } + if (message.serviceAccountEmail != null && message.hasOwnProperty("serviceAccountEmail")) + object.serviceAccountEmail = message.serviceAccountEmail; + if (message.audience != null && message.hasOwnProperty("audience")) + object.audience = message.audience; + return object; + }; + + /** + * Converts this OidcToken to JSON. + * @function toJSON + * @memberof google.pubsub.v1.PushConfig.OidcToken + * @instance + * @returns {Object.} JSON object + */ + OidcToken.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OidcToken + * @function getTypeUrl + * @memberof google.pubsub.v1.PushConfig.OidcToken + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OidcToken.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.PushConfig.OidcToken"; + }; + + return OidcToken; + })(); + + PushConfig.PubsubWrapper = (function() { + + /** + * Properties of a PubsubWrapper. + * @memberof google.pubsub.v1.PushConfig + * @interface IPubsubWrapper + */ + + /** + * Constructs a new PubsubWrapper. + * @memberof google.pubsub.v1.PushConfig + * @classdesc Represents a PubsubWrapper. + * @implements IPubsubWrapper + * @constructor + * @param {google.pubsub.v1.PushConfig.IPubsubWrapper=} [properties] Properties to set + */ + function PubsubWrapper(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 PubsubWrapper instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.PushConfig.PubsubWrapper + * @static + * @param {google.pubsub.v1.PushConfig.IPubsubWrapper=} [properties] Properties to set + * @returns {google.pubsub.v1.PushConfig.PubsubWrapper} PubsubWrapper instance + */ + PubsubWrapper.create = function create(properties) { + return new PubsubWrapper(properties); + }; + + /** + * Encodes the specified PubsubWrapper message. Does not implicitly {@link google.pubsub.v1.PushConfig.PubsubWrapper.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.PushConfig.PubsubWrapper + * @static + * @param {google.pubsub.v1.PushConfig.IPubsubWrapper} message PubsubWrapper message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PubsubWrapper.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified PubsubWrapper message, length delimited. Does not implicitly {@link google.pubsub.v1.PushConfig.PubsubWrapper.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.PushConfig.PubsubWrapper + * @static + * @param {google.pubsub.v1.PushConfig.IPubsubWrapper} message PubsubWrapper message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PubsubWrapper.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PubsubWrapper message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.PushConfig.PubsubWrapper + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.PushConfig.PubsubWrapper} PubsubWrapper + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PubsubWrapper.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.pubsub.v1.PushConfig.PubsubWrapper(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PubsubWrapper message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.PushConfig.PubsubWrapper + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.PushConfig.PubsubWrapper} PubsubWrapper + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PubsubWrapper.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PubsubWrapper message. + * @function verify + * @memberof google.pubsub.v1.PushConfig.PubsubWrapper + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PubsubWrapper.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a PubsubWrapper message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.PushConfig.PubsubWrapper + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.PushConfig.PubsubWrapper} PubsubWrapper + */ + PubsubWrapper.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.PushConfig.PubsubWrapper) + return object; + return new $root.google.pubsub.v1.PushConfig.PubsubWrapper(); + }; + + /** + * Creates a plain object from a PubsubWrapper message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.PushConfig.PubsubWrapper + * @static + * @param {google.pubsub.v1.PushConfig.PubsubWrapper} message PubsubWrapper + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PubsubWrapper.toObject = function toObject() { + return {}; + }; + + /** + * Converts this PubsubWrapper to JSON. + * @function toJSON + * @memberof google.pubsub.v1.PushConfig.PubsubWrapper + * @instance + * @returns {Object.} JSON object + */ + PubsubWrapper.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PubsubWrapper + * @function getTypeUrl + * @memberof google.pubsub.v1.PushConfig.PubsubWrapper + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PubsubWrapper.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.PushConfig.PubsubWrapper"; + }; + + return PubsubWrapper; + })(); + + PushConfig.NoWrapper = (function() { + + /** + * Properties of a NoWrapper. + * @memberof google.pubsub.v1.PushConfig + * @interface INoWrapper + * @property {boolean|null} [writeMetadata] NoWrapper writeMetadata + */ + + /** + * Constructs a new NoWrapper. + * @memberof google.pubsub.v1.PushConfig + * @classdesc Represents a NoWrapper. + * @implements INoWrapper + * @constructor + * @param {google.pubsub.v1.PushConfig.INoWrapper=} [properties] Properties to set + */ + function NoWrapper(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]]; + } + + /** + * NoWrapper writeMetadata. + * @member {boolean} writeMetadata + * @memberof google.pubsub.v1.PushConfig.NoWrapper + * @instance + */ + NoWrapper.prototype.writeMetadata = false; + + /** + * Creates a new NoWrapper instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.PushConfig.NoWrapper + * @static + * @param {google.pubsub.v1.PushConfig.INoWrapper=} [properties] Properties to set + * @returns {google.pubsub.v1.PushConfig.NoWrapper} NoWrapper instance + */ + NoWrapper.create = function create(properties) { + return new NoWrapper(properties); + }; + + /** + * Encodes the specified NoWrapper message. Does not implicitly {@link google.pubsub.v1.PushConfig.NoWrapper.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.PushConfig.NoWrapper + * @static + * @param {google.pubsub.v1.PushConfig.INoWrapper} message NoWrapper message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NoWrapper.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.writeMetadata != null && Object.hasOwnProperty.call(message, "writeMetadata")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.writeMetadata); + return writer; + }; + + /** + * Encodes the specified NoWrapper message, length delimited. Does not implicitly {@link google.pubsub.v1.PushConfig.NoWrapper.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.PushConfig.NoWrapper + * @static + * @param {google.pubsub.v1.PushConfig.INoWrapper} message NoWrapper message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NoWrapper.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NoWrapper message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.PushConfig.NoWrapper + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.PushConfig.NoWrapper} NoWrapper + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NoWrapper.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.pubsub.v1.PushConfig.NoWrapper(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.writeMetadata = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NoWrapper message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.PushConfig.NoWrapper + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.PushConfig.NoWrapper} NoWrapper + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NoWrapper.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NoWrapper message. + * @function verify + * @memberof google.pubsub.v1.PushConfig.NoWrapper + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NoWrapper.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.writeMetadata != null && message.hasOwnProperty("writeMetadata")) + if (typeof message.writeMetadata !== "boolean") + return "writeMetadata: boolean expected"; + return null; + }; + + /** + * Creates a NoWrapper message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.PushConfig.NoWrapper + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.PushConfig.NoWrapper} NoWrapper + */ + NoWrapper.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.PushConfig.NoWrapper) + return object; + var message = new $root.google.pubsub.v1.PushConfig.NoWrapper(); + if (object.writeMetadata != null) + message.writeMetadata = Boolean(object.writeMetadata); + return message; + }; + + /** + * Creates a plain object from a NoWrapper message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.PushConfig.NoWrapper + * @static + * @param {google.pubsub.v1.PushConfig.NoWrapper} message NoWrapper + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NoWrapper.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.writeMetadata = false; + if (message.writeMetadata != null && message.hasOwnProperty("writeMetadata")) + object.writeMetadata = message.writeMetadata; + return object; + }; + + /** + * Converts this NoWrapper to JSON. + * @function toJSON + * @memberof google.pubsub.v1.PushConfig.NoWrapper + * @instance + * @returns {Object.} JSON object + */ + NoWrapper.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NoWrapper + * @function getTypeUrl + * @memberof google.pubsub.v1.PushConfig.NoWrapper + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NoWrapper.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.PushConfig.NoWrapper"; + }; + + return NoWrapper; + })(); + + return PushConfig; + })(); + + v1.BigQueryConfig = (function() { + + /** + * Properties of a BigQueryConfig. + * @memberof google.pubsub.v1 + * @interface IBigQueryConfig + * @property {string|null} [table] BigQueryConfig table + * @property {boolean|null} [useTopicSchema] BigQueryConfig useTopicSchema + * @property {boolean|null} [writeMetadata] BigQueryConfig writeMetadata + * @property {boolean|null} [dropUnknownFields] BigQueryConfig dropUnknownFields + * @property {google.pubsub.v1.BigQueryConfig.State|null} [state] BigQueryConfig state + * @property {boolean|null} [useTableSchema] BigQueryConfig useTableSchema + * @property {string|null} [serviceAccountEmail] BigQueryConfig serviceAccountEmail + */ + + /** + * Constructs a new BigQueryConfig. + * @memberof google.pubsub.v1 + * @classdesc Represents a BigQueryConfig. + * @implements IBigQueryConfig + * @constructor + * @param {google.pubsub.v1.IBigQueryConfig=} [properties] Properties to set + */ + function BigQueryConfig(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]]; + } + + /** + * BigQueryConfig table. + * @member {string} table + * @memberof google.pubsub.v1.BigQueryConfig + * @instance + */ + BigQueryConfig.prototype.table = ""; + + /** + * BigQueryConfig useTopicSchema. + * @member {boolean} useTopicSchema + * @memberof google.pubsub.v1.BigQueryConfig + * @instance + */ + BigQueryConfig.prototype.useTopicSchema = false; + + /** + * BigQueryConfig writeMetadata. + * @member {boolean} writeMetadata + * @memberof google.pubsub.v1.BigQueryConfig + * @instance + */ + BigQueryConfig.prototype.writeMetadata = false; + + /** + * BigQueryConfig dropUnknownFields. + * @member {boolean} dropUnknownFields + * @memberof google.pubsub.v1.BigQueryConfig + * @instance + */ + BigQueryConfig.prototype.dropUnknownFields = false; + + /** + * BigQueryConfig state. + * @member {google.pubsub.v1.BigQueryConfig.State} state + * @memberof google.pubsub.v1.BigQueryConfig + * @instance + */ + BigQueryConfig.prototype.state = 0; + + /** + * BigQueryConfig useTableSchema. + * @member {boolean} useTableSchema + * @memberof google.pubsub.v1.BigQueryConfig + * @instance + */ + BigQueryConfig.prototype.useTableSchema = false; + + /** + * BigQueryConfig serviceAccountEmail. + * @member {string} serviceAccountEmail + * @memberof google.pubsub.v1.BigQueryConfig + * @instance + */ + BigQueryConfig.prototype.serviceAccountEmail = ""; + + /** + * Creates a new BigQueryConfig instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.BigQueryConfig + * @static + * @param {google.pubsub.v1.IBigQueryConfig=} [properties] Properties to set + * @returns {google.pubsub.v1.BigQueryConfig} BigQueryConfig instance + */ + BigQueryConfig.create = function create(properties) { + return new BigQueryConfig(properties); + }; + + /** + * Encodes the specified BigQueryConfig message. Does not implicitly {@link google.pubsub.v1.BigQueryConfig.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.BigQueryConfig + * @static + * @param {google.pubsub.v1.IBigQueryConfig} message BigQueryConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BigQueryConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.table != null && Object.hasOwnProperty.call(message, "table")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.table); + if (message.useTopicSchema != null && Object.hasOwnProperty.call(message, "useTopicSchema")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.useTopicSchema); + if (message.writeMetadata != null && Object.hasOwnProperty.call(message, "writeMetadata")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.writeMetadata); + if (message.dropUnknownFields != null && Object.hasOwnProperty.call(message, "dropUnknownFields")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.dropUnknownFields); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.state); + if (message.useTableSchema != null && Object.hasOwnProperty.call(message, "useTableSchema")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.useTableSchema); + if (message.serviceAccountEmail != null && Object.hasOwnProperty.call(message, "serviceAccountEmail")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.serviceAccountEmail); + return writer; + }; + + /** + * Encodes the specified BigQueryConfig message, length delimited. Does not implicitly {@link google.pubsub.v1.BigQueryConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.BigQueryConfig + * @static + * @param {google.pubsub.v1.IBigQueryConfig} message BigQueryConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BigQueryConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BigQueryConfig message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.BigQueryConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.BigQueryConfig} BigQueryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BigQueryConfig.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.pubsub.v1.BigQueryConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.table = reader.string(); + break; + } + case 2: { + message.useTopicSchema = reader.bool(); + break; + } + case 3: { + message.writeMetadata = reader.bool(); + break; + } + case 4: { + message.dropUnknownFields = reader.bool(); + break; + } + case 5: { + message.state = reader.int32(); + break; + } + case 6: { + message.useTableSchema = reader.bool(); + break; + } + case 7: { + message.serviceAccountEmail = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BigQueryConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.BigQueryConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.BigQueryConfig} BigQueryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BigQueryConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BigQueryConfig message. + * @function verify + * @memberof google.pubsub.v1.BigQueryConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BigQueryConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.table != null && message.hasOwnProperty("table")) + if (!$util.isString(message.table)) + return "table: string expected"; + if (message.useTopicSchema != null && message.hasOwnProperty("useTopicSchema")) + if (typeof message.useTopicSchema !== "boolean") + return "useTopicSchema: boolean expected"; + if (message.writeMetadata != null && message.hasOwnProperty("writeMetadata")) + if (typeof message.writeMetadata !== "boolean") + return "writeMetadata: boolean expected"; + if (message.dropUnknownFields != null && message.hasOwnProperty("dropUnknownFields")) + if (typeof message.dropUnknownFields !== "boolean") + return "dropUnknownFields: boolean expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.useTableSchema != null && message.hasOwnProperty("useTableSchema")) + if (typeof message.useTableSchema !== "boolean") + return "useTableSchema: boolean expected"; + if (message.serviceAccountEmail != null && message.hasOwnProperty("serviceAccountEmail")) + if (!$util.isString(message.serviceAccountEmail)) + return "serviceAccountEmail: string expected"; + return null; + }; + + /** + * Creates a BigQueryConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.BigQueryConfig + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.BigQueryConfig} BigQueryConfig + */ + BigQueryConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.BigQueryConfig) + return object; + var message = new $root.google.pubsub.v1.BigQueryConfig(); + if (object.table != null) + message.table = String(object.table); + if (object.useTopicSchema != null) + message.useTopicSchema = Boolean(object.useTopicSchema); + if (object.writeMetadata != null) + message.writeMetadata = Boolean(object.writeMetadata); + if (object.dropUnknownFields != null) + message.dropUnknownFields = Boolean(object.dropUnknownFields); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "ACTIVE": + case 1: + message.state = 1; + break; + case "PERMISSION_DENIED": + case 2: + message.state = 2; + break; + case "NOT_FOUND": + case 3: + message.state = 3; + break; + case "SCHEMA_MISMATCH": + case 4: + message.state = 4; + break; + case "IN_TRANSIT_LOCATION_RESTRICTION": + case 5: + message.state = 5; + break; + } + if (object.useTableSchema != null) + message.useTableSchema = Boolean(object.useTableSchema); + if (object.serviceAccountEmail != null) + message.serviceAccountEmail = String(object.serviceAccountEmail); + return message; + }; + + /** + * Creates a plain object from a BigQueryConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.BigQueryConfig + * @static + * @param {google.pubsub.v1.BigQueryConfig} message BigQueryConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BigQueryConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.table = ""; + object.useTopicSchema = false; + object.writeMetadata = false; + object.dropUnknownFields = false; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.useTableSchema = false; + object.serviceAccountEmail = ""; + } + if (message.table != null && message.hasOwnProperty("table")) + object.table = message.table; + if (message.useTopicSchema != null && message.hasOwnProperty("useTopicSchema")) + object.useTopicSchema = message.useTopicSchema; + if (message.writeMetadata != null && message.hasOwnProperty("writeMetadata")) + object.writeMetadata = message.writeMetadata; + if (message.dropUnknownFields != null && message.hasOwnProperty("dropUnknownFields")) + object.dropUnknownFields = message.dropUnknownFields; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.pubsub.v1.BigQueryConfig.State[message.state] === undefined ? message.state : $root.google.pubsub.v1.BigQueryConfig.State[message.state] : message.state; + if (message.useTableSchema != null && message.hasOwnProperty("useTableSchema")) + object.useTableSchema = message.useTableSchema; + if (message.serviceAccountEmail != null && message.hasOwnProperty("serviceAccountEmail")) + object.serviceAccountEmail = message.serviceAccountEmail; + return object; + }; + + /** + * Converts this BigQueryConfig to JSON. + * @function toJSON + * @memberof google.pubsub.v1.BigQueryConfig + * @instance + * @returns {Object.} JSON object + */ + BigQueryConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BigQueryConfig + * @function getTypeUrl + * @memberof google.pubsub.v1.BigQueryConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BigQueryConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.BigQueryConfig"; + }; + + /** + * State enum. + * @name google.pubsub.v1.BigQueryConfig.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} ACTIVE=1 ACTIVE value + * @property {number} PERMISSION_DENIED=2 PERMISSION_DENIED value + * @property {number} NOT_FOUND=3 NOT_FOUND value + * @property {number} SCHEMA_MISMATCH=4 SCHEMA_MISMATCH value + * @property {number} IN_TRANSIT_LOCATION_RESTRICTION=5 IN_TRANSIT_LOCATION_RESTRICTION value + */ + BigQueryConfig.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ACTIVE"] = 1; + values[valuesById[2] = "PERMISSION_DENIED"] = 2; + values[valuesById[3] = "NOT_FOUND"] = 3; + values[valuesById[4] = "SCHEMA_MISMATCH"] = 4; + values[valuesById[5] = "IN_TRANSIT_LOCATION_RESTRICTION"] = 5; + return values; + })(); + + return BigQueryConfig; + })(); + + v1.CloudStorageConfig = (function() { + + /** + * Properties of a CloudStorageConfig. + * @memberof google.pubsub.v1 + * @interface ICloudStorageConfig + * @property {string|null} [bucket] CloudStorageConfig bucket + * @property {string|null} [filenamePrefix] CloudStorageConfig filenamePrefix + * @property {string|null} [filenameSuffix] CloudStorageConfig filenameSuffix + * @property {string|null} [filenameDatetimeFormat] CloudStorageConfig filenameDatetimeFormat + * @property {google.pubsub.v1.CloudStorageConfig.ITextConfig|null} [textConfig] CloudStorageConfig textConfig + * @property {google.pubsub.v1.CloudStorageConfig.IAvroConfig|null} [avroConfig] CloudStorageConfig avroConfig + * @property {google.protobuf.IDuration|null} [maxDuration] CloudStorageConfig maxDuration + * @property {number|Long|null} [maxBytes] CloudStorageConfig maxBytes + * @property {google.pubsub.v1.CloudStorageConfig.State|null} [state] CloudStorageConfig state + * @property {string|null} [serviceAccountEmail] CloudStorageConfig serviceAccountEmail + */ + + /** + * Constructs a new CloudStorageConfig. + * @memberof google.pubsub.v1 + * @classdesc Represents a CloudStorageConfig. + * @implements ICloudStorageConfig + * @constructor + * @param {google.pubsub.v1.ICloudStorageConfig=} [properties] Properties to set + */ + function CloudStorageConfig(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]]; + } + + /** + * CloudStorageConfig bucket. + * @member {string} bucket + * @memberof google.pubsub.v1.CloudStorageConfig + * @instance + */ + CloudStorageConfig.prototype.bucket = ""; + + /** + * CloudStorageConfig filenamePrefix. + * @member {string} filenamePrefix + * @memberof google.pubsub.v1.CloudStorageConfig + * @instance + */ + CloudStorageConfig.prototype.filenamePrefix = ""; + + /** + * CloudStorageConfig filenameSuffix. + * @member {string} filenameSuffix + * @memberof google.pubsub.v1.CloudStorageConfig + * @instance + */ + CloudStorageConfig.prototype.filenameSuffix = ""; + + /** + * CloudStorageConfig filenameDatetimeFormat. + * @member {string} filenameDatetimeFormat + * @memberof google.pubsub.v1.CloudStorageConfig + * @instance + */ + CloudStorageConfig.prototype.filenameDatetimeFormat = ""; + + /** + * CloudStorageConfig textConfig. + * @member {google.pubsub.v1.CloudStorageConfig.ITextConfig|null|undefined} textConfig + * @memberof google.pubsub.v1.CloudStorageConfig + * @instance + */ + CloudStorageConfig.prototype.textConfig = null; + + /** + * CloudStorageConfig avroConfig. + * @member {google.pubsub.v1.CloudStorageConfig.IAvroConfig|null|undefined} avroConfig + * @memberof google.pubsub.v1.CloudStorageConfig + * @instance + */ + CloudStorageConfig.prototype.avroConfig = null; + + /** + * CloudStorageConfig maxDuration. + * @member {google.protobuf.IDuration|null|undefined} maxDuration + * @memberof google.pubsub.v1.CloudStorageConfig + * @instance + */ + CloudStorageConfig.prototype.maxDuration = null; + + /** + * CloudStorageConfig maxBytes. + * @member {number|Long} maxBytes + * @memberof google.pubsub.v1.CloudStorageConfig + * @instance + */ + CloudStorageConfig.prototype.maxBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * CloudStorageConfig state. + * @member {google.pubsub.v1.CloudStorageConfig.State} state + * @memberof google.pubsub.v1.CloudStorageConfig + * @instance + */ + CloudStorageConfig.prototype.state = 0; + + /** + * CloudStorageConfig serviceAccountEmail. + * @member {string} serviceAccountEmail + * @memberof google.pubsub.v1.CloudStorageConfig + * @instance + */ + CloudStorageConfig.prototype.serviceAccountEmail = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * CloudStorageConfig outputFormat. + * @member {"textConfig"|"avroConfig"|undefined} outputFormat + * @memberof google.pubsub.v1.CloudStorageConfig + * @instance + */ + Object.defineProperty(CloudStorageConfig.prototype, "outputFormat", { + get: $util.oneOfGetter($oneOfFields = ["textConfig", "avroConfig"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CloudStorageConfig instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.CloudStorageConfig + * @static + * @param {google.pubsub.v1.ICloudStorageConfig=} [properties] Properties to set + * @returns {google.pubsub.v1.CloudStorageConfig} CloudStorageConfig instance + */ + CloudStorageConfig.create = function create(properties) { + return new CloudStorageConfig(properties); + }; + + /** + * Encodes the specified CloudStorageConfig message. Does not implicitly {@link google.pubsub.v1.CloudStorageConfig.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.CloudStorageConfig + * @static + * @param {google.pubsub.v1.ICloudStorageConfig} message CloudStorageConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudStorageConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bucket != null && Object.hasOwnProperty.call(message, "bucket")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.bucket); + if (message.filenamePrefix != null && Object.hasOwnProperty.call(message, "filenamePrefix")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filenamePrefix); + if (message.filenameSuffix != null && Object.hasOwnProperty.call(message, "filenameSuffix")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.filenameSuffix); + if (message.textConfig != null && Object.hasOwnProperty.call(message, "textConfig")) + $root.google.pubsub.v1.CloudStorageConfig.TextConfig.encode(message.textConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.avroConfig != null && Object.hasOwnProperty.call(message, "avroConfig")) + $root.google.pubsub.v1.CloudStorageConfig.AvroConfig.encode(message.avroConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.maxDuration != null && Object.hasOwnProperty.call(message, "maxDuration")) + $root.google.protobuf.Duration.encode(message.maxDuration, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.maxBytes != null && Object.hasOwnProperty.call(message, "maxBytes")) + writer.uint32(/* id 7, wireType 0 =*/56).int64(message.maxBytes); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.state); + if (message.filenameDatetimeFormat != null && Object.hasOwnProperty.call(message, "filenameDatetimeFormat")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.filenameDatetimeFormat); + if (message.serviceAccountEmail != null && Object.hasOwnProperty.call(message, "serviceAccountEmail")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.serviceAccountEmail); + return writer; + }; + + /** + * Encodes the specified CloudStorageConfig message, length delimited. Does not implicitly {@link google.pubsub.v1.CloudStorageConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.CloudStorageConfig + * @static + * @param {google.pubsub.v1.ICloudStorageConfig} message CloudStorageConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudStorageConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CloudStorageConfig message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.CloudStorageConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.CloudStorageConfig} CloudStorageConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudStorageConfig.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.pubsub.v1.CloudStorageConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.bucket = reader.string(); + break; + } + case 2: { + message.filenamePrefix = reader.string(); + break; + } + case 3: { + message.filenameSuffix = reader.string(); + break; + } + case 10: { + message.filenameDatetimeFormat = reader.string(); + break; + } + case 4: { + message.textConfig = $root.google.pubsub.v1.CloudStorageConfig.TextConfig.decode(reader, reader.uint32()); + break; + } + case 5: { + message.avroConfig = $root.google.pubsub.v1.CloudStorageConfig.AvroConfig.decode(reader, reader.uint32()); + break; + } + case 6: { + message.maxDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 7: { + message.maxBytes = reader.int64(); + break; + } + case 9: { + message.state = reader.int32(); + break; + } + case 11: { + message.serviceAccountEmail = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CloudStorageConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.CloudStorageConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.CloudStorageConfig} CloudStorageConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudStorageConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CloudStorageConfig message. + * @function verify + * @memberof google.pubsub.v1.CloudStorageConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CloudStorageConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.bucket != null && message.hasOwnProperty("bucket")) + if (!$util.isString(message.bucket)) + return "bucket: string expected"; + if (message.filenamePrefix != null && message.hasOwnProperty("filenamePrefix")) + if (!$util.isString(message.filenamePrefix)) + return "filenamePrefix: string expected"; + if (message.filenameSuffix != null && message.hasOwnProperty("filenameSuffix")) + if (!$util.isString(message.filenameSuffix)) + return "filenameSuffix: string expected"; + if (message.filenameDatetimeFormat != null && message.hasOwnProperty("filenameDatetimeFormat")) + if (!$util.isString(message.filenameDatetimeFormat)) + return "filenameDatetimeFormat: string expected"; + if (message.textConfig != null && message.hasOwnProperty("textConfig")) { + properties.outputFormat = 1; + { + var error = $root.google.pubsub.v1.CloudStorageConfig.TextConfig.verify(message.textConfig); + if (error) + return "textConfig." + error; + } + } + if (message.avroConfig != null && message.hasOwnProperty("avroConfig")) { + if (properties.outputFormat === 1) + return "outputFormat: multiple values"; + properties.outputFormat = 1; + { + var error = $root.google.pubsub.v1.CloudStorageConfig.AvroConfig.verify(message.avroConfig); + if (error) + return "avroConfig." + error; + } + } + if (message.maxDuration != null && message.hasOwnProperty("maxDuration")) { + var error = $root.google.protobuf.Duration.verify(message.maxDuration); + if (error) + return "maxDuration." + error; + } + if (message.maxBytes != null && message.hasOwnProperty("maxBytes")) + if (!$util.isInteger(message.maxBytes) && !(message.maxBytes && $util.isInteger(message.maxBytes.low) && $util.isInteger(message.maxBytes.high))) + return "maxBytes: integer|Long expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.serviceAccountEmail != null && message.hasOwnProperty("serviceAccountEmail")) + if (!$util.isString(message.serviceAccountEmail)) + return "serviceAccountEmail: string expected"; + return null; + }; + + /** + * Creates a CloudStorageConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.CloudStorageConfig + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.CloudStorageConfig} CloudStorageConfig + */ + CloudStorageConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.CloudStorageConfig) + return object; + var message = new $root.google.pubsub.v1.CloudStorageConfig(); + if (object.bucket != null) + message.bucket = String(object.bucket); + if (object.filenamePrefix != null) + message.filenamePrefix = String(object.filenamePrefix); + if (object.filenameSuffix != null) + message.filenameSuffix = String(object.filenameSuffix); + if (object.filenameDatetimeFormat != null) + message.filenameDatetimeFormat = String(object.filenameDatetimeFormat); + if (object.textConfig != null) { + if (typeof object.textConfig !== "object") + throw TypeError(".google.pubsub.v1.CloudStorageConfig.textConfig: object expected"); + message.textConfig = $root.google.pubsub.v1.CloudStorageConfig.TextConfig.fromObject(object.textConfig); + } + if (object.avroConfig != null) { + if (typeof object.avroConfig !== "object") + throw TypeError(".google.pubsub.v1.CloudStorageConfig.avroConfig: object expected"); + message.avroConfig = $root.google.pubsub.v1.CloudStorageConfig.AvroConfig.fromObject(object.avroConfig); + } + if (object.maxDuration != null) { + if (typeof object.maxDuration !== "object") + throw TypeError(".google.pubsub.v1.CloudStorageConfig.maxDuration: object expected"); + message.maxDuration = $root.google.protobuf.Duration.fromObject(object.maxDuration); + } + if (object.maxBytes != null) + if ($util.Long) + (message.maxBytes = $util.Long.fromValue(object.maxBytes)).unsigned = false; + else if (typeof object.maxBytes === "string") + message.maxBytes = parseInt(object.maxBytes, 10); + else if (typeof object.maxBytes === "number") + message.maxBytes = object.maxBytes; + else if (typeof object.maxBytes === "object") + message.maxBytes = new $util.LongBits(object.maxBytes.low >>> 0, object.maxBytes.high >>> 0).toNumber(); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "ACTIVE": + case 1: + message.state = 1; + break; + case "PERMISSION_DENIED": + case 2: + message.state = 2; + break; + case "NOT_FOUND": + case 3: + message.state = 3; + break; + case "IN_TRANSIT_LOCATION_RESTRICTION": + case 4: + message.state = 4; + break; + case "SCHEMA_MISMATCH": + case 5: + message.state = 5; + break; + } + if (object.serviceAccountEmail != null) + message.serviceAccountEmail = String(object.serviceAccountEmail); + return message; + }; + + /** + * Creates a plain object from a CloudStorageConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.CloudStorageConfig + * @static + * @param {google.pubsub.v1.CloudStorageConfig} message CloudStorageConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CloudStorageConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.bucket = ""; + object.filenamePrefix = ""; + object.filenameSuffix = ""; + object.maxDuration = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.maxBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.maxBytes = options.longs === String ? "0" : 0; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.filenameDatetimeFormat = ""; + object.serviceAccountEmail = ""; + } + if (message.bucket != null && message.hasOwnProperty("bucket")) + object.bucket = message.bucket; + if (message.filenamePrefix != null && message.hasOwnProperty("filenamePrefix")) + object.filenamePrefix = message.filenamePrefix; + if (message.filenameSuffix != null && message.hasOwnProperty("filenameSuffix")) + object.filenameSuffix = message.filenameSuffix; + if (message.textConfig != null && message.hasOwnProperty("textConfig")) { + object.textConfig = $root.google.pubsub.v1.CloudStorageConfig.TextConfig.toObject(message.textConfig, options); + if (options.oneofs) + object.outputFormat = "textConfig"; + } + if (message.avroConfig != null && message.hasOwnProperty("avroConfig")) { + object.avroConfig = $root.google.pubsub.v1.CloudStorageConfig.AvroConfig.toObject(message.avroConfig, options); + if (options.oneofs) + object.outputFormat = "avroConfig"; + } + if (message.maxDuration != null && message.hasOwnProperty("maxDuration")) + object.maxDuration = $root.google.protobuf.Duration.toObject(message.maxDuration, options); + if (message.maxBytes != null && message.hasOwnProperty("maxBytes")) + if (typeof message.maxBytes === "number") + object.maxBytes = options.longs === String ? String(message.maxBytes) : message.maxBytes; + else + object.maxBytes = options.longs === String ? $util.Long.prototype.toString.call(message.maxBytes) : options.longs === Number ? new $util.LongBits(message.maxBytes.low >>> 0, message.maxBytes.high >>> 0).toNumber() : message.maxBytes; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.pubsub.v1.CloudStorageConfig.State[message.state] === undefined ? message.state : $root.google.pubsub.v1.CloudStorageConfig.State[message.state] : message.state; + if (message.filenameDatetimeFormat != null && message.hasOwnProperty("filenameDatetimeFormat")) + object.filenameDatetimeFormat = message.filenameDatetimeFormat; + if (message.serviceAccountEmail != null && message.hasOwnProperty("serviceAccountEmail")) + object.serviceAccountEmail = message.serviceAccountEmail; + return object; + }; + + /** + * Converts this CloudStorageConfig to JSON. + * @function toJSON + * @memberof google.pubsub.v1.CloudStorageConfig + * @instance + * @returns {Object.} JSON object + */ + CloudStorageConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CloudStorageConfig + * @function getTypeUrl + * @memberof google.pubsub.v1.CloudStorageConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CloudStorageConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.CloudStorageConfig"; + }; + + CloudStorageConfig.TextConfig = (function() { + + /** + * Properties of a TextConfig. + * @memberof google.pubsub.v1.CloudStorageConfig + * @interface ITextConfig + */ + + /** + * Constructs a new TextConfig. + * @memberof google.pubsub.v1.CloudStorageConfig + * @classdesc Represents a TextConfig. + * @implements ITextConfig + * @constructor + * @param {google.pubsub.v1.CloudStorageConfig.ITextConfig=} [properties] Properties to set + */ + function TextConfig(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 TextConfig instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.CloudStorageConfig.TextConfig + * @static + * @param {google.pubsub.v1.CloudStorageConfig.ITextConfig=} [properties] Properties to set + * @returns {google.pubsub.v1.CloudStorageConfig.TextConfig} TextConfig instance + */ + TextConfig.create = function create(properties) { + return new TextConfig(properties); + }; + + /** + * Encodes the specified TextConfig message. Does not implicitly {@link google.pubsub.v1.CloudStorageConfig.TextConfig.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.CloudStorageConfig.TextConfig + * @static + * @param {google.pubsub.v1.CloudStorageConfig.ITextConfig} message TextConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified TextConfig message, length delimited. Does not implicitly {@link google.pubsub.v1.CloudStorageConfig.TextConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.CloudStorageConfig.TextConfig + * @static + * @param {google.pubsub.v1.CloudStorageConfig.ITextConfig} message TextConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextConfig message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.CloudStorageConfig.TextConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.CloudStorageConfig.TextConfig} TextConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextConfig.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.pubsub.v1.CloudStorageConfig.TextConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.CloudStorageConfig.TextConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.CloudStorageConfig.TextConfig} TextConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextConfig message. + * @function verify + * @memberof google.pubsub.v1.CloudStorageConfig.TextConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a TextConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.CloudStorageConfig.TextConfig + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.CloudStorageConfig.TextConfig} TextConfig + */ + TextConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.CloudStorageConfig.TextConfig) + return object; + return new $root.google.pubsub.v1.CloudStorageConfig.TextConfig(); + }; + + /** + * Creates a plain object from a TextConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.CloudStorageConfig.TextConfig + * @static + * @param {google.pubsub.v1.CloudStorageConfig.TextConfig} message TextConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextConfig.toObject = function toObject() { + return {}; + }; + + /** + * Converts this TextConfig to JSON. + * @function toJSON + * @memberof google.pubsub.v1.CloudStorageConfig.TextConfig + * @instance + * @returns {Object.} JSON object + */ + TextConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TextConfig + * @function getTypeUrl + * @memberof google.pubsub.v1.CloudStorageConfig.TextConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TextConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.CloudStorageConfig.TextConfig"; + }; + + return TextConfig; + })(); + + CloudStorageConfig.AvroConfig = (function() { + + /** + * Properties of an AvroConfig. + * @memberof google.pubsub.v1.CloudStorageConfig + * @interface IAvroConfig + * @property {boolean|null} [writeMetadata] AvroConfig writeMetadata + * @property {boolean|null} [useTopicSchema] AvroConfig useTopicSchema + */ + + /** + * Constructs a new AvroConfig. + * @memberof google.pubsub.v1.CloudStorageConfig + * @classdesc Represents an AvroConfig. + * @implements IAvroConfig + * @constructor + * @param {google.pubsub.v1.CloudStorageConfig.IAvroConfig=} [properties] Properties to set + */ + function AvroConfig(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]]; + } + + /** + * AvroConfig writeMetadata. + * @member {boolean} writeMetadata + * @memberof google.pubsub.v1.CloudStorageConfig.AvroConfig + * @instance + */ + AvroConfig.prototype.writeMetadata = false; + + /** + * AvroConfig useTopicSchema. + * @member {boolean} useTopicSchema + * @memberof google.pubsub.v1.CloudStorageConfig.AvroConfig + * @instance + */ + AvroConfig.prototype.useTopicSchema = false; + + /** + * Creates a new AvroConfig instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.CloudStorageConfig.AvroConfig + * @static + * @param {google.pubsub.v1.CloudStorageConfig.IAvroConfig=} [properties] Properties to set + * @returns {google.pubsub.v1.CloudStorageConfig.AvroConfig} AvroConfig instance + */ + AvroConfig.create = function create(properties) { + return new AvroConfig(properties); + }; + + /** + * Encodes the specified AvroConfig message. Does not implicitly {@link google.pubsub.v1.CloudStorageConfig.AvroConfig.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.CloudStorageConfig.AvroConfig + * @static + * @param {google.pubsub.v1.CloudStorageConfig.IAvroConfig} message AvroConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AvroConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.writeMetadata != null && Object.hasOwnProperty.call(message, "writeMetadata")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.writeMetadata); + if (message.useTopicSchema != null && Object.hasOwnProperty.call(message, "useTopicSchema")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.useTopicSchema); + return writer; + }; + + /** + * Encodes the specified AvroConfig message, length delimited. Does not implicitly {@link google.pubsub.v1.CloudStorageConfig.AvroConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.CloudStorageConfig.AvroConfig + * @static + * @param {google.pubsub.v1.CloudStorageConfig.IAvroConfig} message AvroConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AvroConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AvroConfig message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.CloudStorageConfig.AvroConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.CloudStorageConfig.AvroConfig} AvroConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AvroConfig.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.pubsub.v1.CloudStorageConfig.AvroConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.writeMetadata = reader.bool(); + break; + } + case 2: { + message.useTopicSchema = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AvroConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.CloudStorageConfig.AvroConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.CloudStorageConfig.AvroConfig} AvroConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AvroConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AvroConfig message. + * @function verify + * @memberof google.pubsub.v1.CloudStorageConfig.AvroConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AvroConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.writeMetadata != null && message.hasOwnProperty("writeMetadata")) + if (typeof message.writeMetadata !== "boolean") + return "writeMetadata: boolean expected"; + if (message.useTopicSchema != null && message.hasOwnProperty("useTopicSchema")) + if (typeof message.useTopicSchema !== "boolean") + return "useTopicSchema: boolean expected"; + return null; + }; + + /** + * Creates an AvroConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.CloudStorageConfig.AvroConfig + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.CloudStorageConfig.AvroConfig} AvroConfig + */ + AvroConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.CloudStorageConfig.AvroConfig) + return object; + var message = new $root.google.pubsub.v1.CloudStorageConfig.AvroConfig(); + if (object.writeMetadata != null) + message.writeMetadata = Boolean(object.writeMetadata); + if (object.useTopicSchema != null) + message.useTopicSchema = Boolean(object.useTopicSchema); + return message; + }; + + /** + * Creates a plain object from an AvroConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.CloudStorageConfig.AvroConfig + * @static + * @param {google.pubsub.v1.CloudStorageConfig.AvroConfig} message AvroConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AvroConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.writeMetadata = false; + object.useTopicSchema = false; + } + if (message.writeMetadata != null && message.hasOwnProperty("writeMetadata")) + object.writeMetadata = message.writeMetadata; + if (message.useTopicSchema != null && message.hasOwnProperty("useTopicSchema")) + object.useTopicSchema = message.useTopicSchema; + return object; + }; + + /** + * Converts this AvroConfig to JSON. + * @function toJSON + * @memberof google.pubsub.v1.CloudStorageConfig.AvroConfig + * @instance + * @returns {Object.} JSON object + */ + AvroConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AvroConfig + * @function getTypeUrl + * @memberof google.pubsub.v1.CloudStorageConfig.AvroConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AvroConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.CloudStorageConfig.AvroConfig"; + }; + + return AvroConfig; + })(); + + /** + * State enum. + * @name google.pubsub.v1.CloudStorageConfig.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} ACTIVE=1 ACTIVE value + * @property {number} PERMISSION_DENIED=2 PERMISSION_DENIED value + * @property {number} NOT_FOUND=3 NOT_FOUND value + * @property {number} IN_TRANSIT_LOCATION_RESTRICTION=4 IN_TRANSIT_LOCATION_RESTRICTION value + * @property {number} SCHEMA_MISMATCH=5 SCHEMA_MISMATCH value + */ + CloudStorageConfig.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ACTIVE"] = 1; + values[valuesById[2] = "PERMISSION_DENIED"] = 2; + values[valuesById[3] = "NOT_FOUND"] = 3; + values[valuesById[4] = "IN_TRANSIT_LOCATION_RESTRICTION"] = 4; + values[valuesById[5] = "SCHEMA_MISMATCH"] = 5; + return values; + })(); + + return CloudStorageConfig; + })(); + + v1.ReceivedMessage = (function() { + + /** + * Properties of a ReceivedMessage. + * @memberof google.pubsub.v1 + * @interface IReceivedMessage + * @property {string|null} [ackId] ReceivedMessage ackId + * @property {google.pubsub.v1.IPubsubMessage|null} [message] ReceivedMessage message + * @property {number|null} [deliveryAttempt] ReceivedMessage deliveryAttempt + */ + + /** + * Constructs a new ReceivedMessage. + * @memberof google.pubsub.v1 + * @classdesc Represents a ReceivedMessage. + * @implements IReceivedMessage + * @constructor + * @param {google.pubsub.v1.IReceivedMessage=} [properties] Properties to set + */ + function ReceivedMessage(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]]; + } + + /** + * ReceivedMessage ackId. + * @member {string} ackId + * @memberof google.pubsub.v1.ReceivedMessage + * @instance + */ + ReceivedMessage.prototype.ackId = ""; + + /** + * ReceivedMessage message. + * @member {google.pubsub.v1.IPubsubMessage|null|undefined} message + * @memberof google.pubsub.v1.ReceivedMessage + * @instance + */ + ReceivedMessage.prototype.message = null; + + /** + * ReceivedMessage deliveryAttempt. + * @member {number} deliveryAttempt + * @memberof google.pubsub.v1.ReceivedMessage + * @instance + */ + ReceivedMessage.prototype.deliveryAttempt = 0; + + /** + * Creates a new ReceivedMessage instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.ReceivedMessage + * @static + * @param {google.pubsub.v1.IReceivedMessage=} [properties] Properties to set + * @returns {google.pubsub.v1.ReceivedMessage} ReceivedMessage instance + */ + ReceivedMessage.create = function create(properties) { + return new ReceivedMessage(properties); + }; + + /** + * Encodes the specified ReceivedMessage message. Does not implicitly {@link google.pubsub.v1.ReceivedMessage.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.ReceivedMessage + * @static + * @param {google.pubsub.v1.IReceivedMessage} message ReceivedMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReceivedMessage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ackId != null && Object.hasOwnProperty.call(message, "ackId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.ackId); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + $root.google.pubsub.v1.PubsubMessage.encode(message.message, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.deliveryAttempt != null && Object.hasOwnProperty.call(message, "deliveryAttempt")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.deliveryAttempt); + return writer; + }; + + /** + * Encodes the specified ReceivedMessage message, length delimited. Does not implicitly {@link google.pubsub.v1.ReceivedMessage.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.ReceivedMessage + * @static + * @param {google.pubsub.v1.IReceivedMessage} message ReceivedMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReceivedMessage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReceivedMessage message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.ReceivedMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.ReceivedMessage} ReceivedMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReceivedMessage.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.pubsub.v1.ReceivedMessage(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.ackId = reader.string(); + break; + } + case 2: { + message.message = $root.google.pubsub.v1.PubsubMessage.decode(reader, reader.uint32()); + break; + } + case 3: { + message.deliveryAttempt = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReceivedMessage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.ReceivedMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.ReceivedMessage} ReceivedMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReceivedMessage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReceivedMessage message. + * @function verify + * @memberof google.pubsub.v1.ReceivedMessage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReceivedMessage.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ackId != null && message.hasOwnProperty("ackId")) + if (!$util.isString(message.ackId)) + return "ackId: string expected"; + if (message.message != null && message.hasOwnProperty("message")) { + var error = $root.google.pubsub.v1.PubsubMessage.verify(message.message); + if (error) + return "message." + error; + } + if (message.deliveryAttempt != null && message.hasOwnProperty("deliveryAttempt")) + if (!$util.isInteger(message.deliveryAttempt)) + return "deliveryAttempt: integer expected"; + return null; + }; + + /** + * Creates a ReceivedMessage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.ReceivedMessage + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.ReceivedMessage} ReceivedMessage + */ + ReceivedMessage.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.ReceivedMessage) + return object; + var message = new $root.google.pubsub.v1.ReceivedMessage(); + if (object.ackId != null) + message.ackId = String(object.ackId); + if (object.message != null) { + if (typeof object.message !== "object") + throw TypeError(".google.pubsub.v1.ReceivedMessage.message: object expected"); + message.message = $root.google.pubsub.v1.PubsubMessage.fromObject(object.message); + } + if (object.deliveryAttempt != null) + message.deliveryAttempt = object.deliveryAttempt | 0; + return message; + }; + + /** + * Creates a plain object from a ReceivedMessage message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.ReceivedMessage + * @static + * @param {google.pubsub.v1.ReceivedMessage} message ReceivedMessage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReceivedMessage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.ackId = ""; + object.message = null; + object.deliveryAttempt = 0; + } + if (message.ackId != null && message.hasOwnProperty("ackId")) + object.ackId = message.ackId; + if (message.message != null && message.hasOwnProperty("message")) + object.message = $root.google.pubsub.v1.PubsubMessage.toObject(message.message, options); + if (message.deliveryAttempt != null && message.hasOwnProperty("deliveryAttempt")) + object.deliveryAttempt = message.deliveryAttempt; + return object; + }; + + /** + * Converts this ReceivedMessage to JSON. + * @function toJSON + * @memberof google.pubsub.v1.ReceivedMessage + * @instance + * @returns {Object.} JSON object + */ + ReceivedMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReceivedMessage + * @function getTypeUrl + * @memberof google.pubsub.v1.ReceivedMessage + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReceivedMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.ReceivedMessage"; + }; + + return ReceivedMessage; + })(); + + v1.GetSubscriptionRequest = (function() { + + /** + * Properties of a GetSubscriptionRequest. + * @memberof google.pubsub.v1 + * @interface IGetSubscriptionRequest + * @property {string|null} [subscription] GetSubscriptionRequest subscription + */ + + /** + * Constructs a new GetSubscriptionRequest. + * @memberof google.pubsub.v1 + * @classdesc Represents a GetSubscriptionRequest. + * @implements IGetSubscriptionRequest + * @constructor + * @param {google.pubsub.v1.IGetSubscriptionRequest=} [properties] Properties to set + */ + function GetSubscriptionRequest(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]]; + } + + /** + * GetSubscriptionRequest subscription. + * @member {string} subscription + * @memberof google.pubsub.v1.GetSubscriptionRequest + * @instance + */ + GetSubscriptionRequest.prototype.subscription = ""; + + /** + * Creates a new GetSubscriptionRequest instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.GetSubscriptionRequest + * @static + * @param {google.pubsub.v1.IGetSubscriptionRequest=} [properties] Properties to set + * @returns {google.pubsub.v1.GetSubscriptionRequest} GetSubscriptionRequest instance + */ + GetSubscriptionRequest.create = function create(properties) { + return new GetSubscriptionRequest(properties); + }; + + /** + * Encodes the specified GetSubscriptionRequest message. Does not implicitly {@link google.pubsub.v1.GetSubscriptionRequest.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.GetSubscriptionRequest + * @static + * @param {google.pubsub.v1.IGetSubscriptionRequest} message GetSubscriptionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSubscriptionRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.subscription != null && Object.hasOwnProperty.call(message, "subscription")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.subscription); + return writer; + }; + + /** + * Encodes the specified GetSubscriptionRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.GetSubscriptionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.GetSubscriptionRequest + * @static + * @param {google.pubsub.v1.IGetSubscriptionRequest} message GetSubscriptionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSubscriptionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetSubscriptionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.GetSubscriptionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.GetSubscriptionRequest} GetSubscriptionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSubscriptionRequest.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.pubsub.v1.GetSubscriptionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.subscription = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetSubscriptionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.GetSubscriptionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.GetSubscriptionRequest} GetSubscriptionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSubscriptionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetSubscriptionRequest message. + * @function verify + * @memberof google.pubsub.v1.GetSubscriptionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetSubscriptionRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.subscription != null && message.hasOwnProperty("subscription")) + if (!$util.isString(message.subscription)) + return "subscription: string expected"; + return null; + }; + + /** + * Creates a GetSubscriptionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.GetSubscriptionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.GetSubscriptionRequest} GetSubscriptionRequest + */ + GetSubscriptionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.GetSubscriptionRequest) + return object; + var message = new $root.google.pubsub.v1.GetSubscriptionRequest(); + if (object.subscription != null) + message.subscription = String(object.subscription); + return message; + }; + + /** + * Creates a plain object from a GetSubscriptionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.GetSubscriptionRequest + * @static + * @param {google.pubsub.v1.GetSubscriptionRequest} message GetSubscriptionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetSubscriptionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.subscription = ""; + if (message.subscription != null && message.hasOwnProperty("subscription")) + object.subscription = message.subscription; + return object; + }; + + /** + * Converts this GetSubscriptionRequest to JSON. + * @function toJSON + * @memberof google.pubsub.v1.GetSubscriptionRequest + * @instance + * @returns {Object.} JSON object + */ + GetSubscriptionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetSubscriptionRequest + * @function getTypeUrl + * @memberof google.pubsub.v1.GetSubscriptionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetSubscriptionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.GetSubscriptionRequest"; + }; + + return GetSubscriptionRequest; + })(); + + v1.UpdateSubscriptionRequest = (function() { + + /** + * Properties of an UpdateSubscriptionRequest. + * @memberof google.pubsub.v1 + * @interface IUpdateSubscriptionRequest + * @property {google.pubsub.v1.ISubscription|null} [subscription] UpdateSubscriptionRequest subscription + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateSubscriptionRequest updateMask + */ + + /** + * Constructs a new UpdateSubscriptionRequest. + * @memberof google.pubsub.v1 + * @classdesc Represents an UpdateSubscriptionRequest. + * @implements IUpdateSubscriptionRequest + * @constructor + * @param {google.pubsub.v1.IUpdateSubscriptionRequest=} [properties] Properties to set + */ + function UpdateSubscriptionRequest(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]]; + } + + /** + * UpdateSubscriptionRequest subscription. + * @member {google.pubsub.v1.ISubscription|null|undefined} subscription + * @memberof google.pubsub.v1.UpdateSubscriptionRequest + * @instance + */ + UpdateSubscriptionRequest.prototype.subscription = null; + + /** + * UpdateSubscriptionRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.pubsub.v1.UpdateSubscriptionRequest + * @instance + */ + UpdateSubscriptionRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateSubscriptionRequest instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.UpdateSubscriptionRequest + * @static + * @param {google.pubsub.v1.IUpdateSubscriptionRequest=} [properties] Properties to set + * @returns {google.pubsub.v1.UpdateSubscriptionRequest} UpdateSubscriptionRequest instance + */ + UpdateSubscriptionRequest.create = function create(properties) { + return new UpdateSubscriptionRequest(properties); + }; + + /** + * Encodes the specified UpdateSubscriptionRequest message. Does not implicitly {@link google.pubsub.v1.UpdateSubscriptionRequest.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.UpdateSubscriptionRequest + * @static + * @param {google.pubsub.v1.IUpdateSubscriptionRequest} message UpdateSubscriptionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateSubscriptionRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.subscription != null && Object.hasOwnProperty.call(message, "subscription")) + $root.google.pubsub.v1.Subscription.encode(message.subscription, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateSubscriptionRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.UpdateSubscriptionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.UpdateSubscriptionRequest + * @static + * @param {google.pubsub.v1.IUpdateSubscriptionRequest} message UpdateSubscriptionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateSubscriptionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateSubscriptionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.UpdateSubscriptionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.UpdateSubscriptionRequest} UpdateSubscriptionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateSubscriptionRequest.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.pubsub.v1.UpdateSubscriptionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.subscription = $root.google.pubsub.v1.Subscription.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateSubscriptionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.UpdateSubscriptionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.UpdateSubscriptionRequest} UpdateSubscriptionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateSubscriptionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateSubscriptionRequest message. + * @function verify + * @memberof google.pubsub.v1.UpdateSubscriptionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateSubscriptionRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.subscription != null && message.hasOwnProperty("subscription")) { + var error = $root.google.pubsub.v1.Subscription.verify(message.subscription); + if (error) + return "subscription." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateSubscriptionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.UpdateSubscriptionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.UpdateSubscriptionRequest} UpdateSubscriptionRequest + */ + UpdateSubscriptionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.UpdateSubscriptionRequest) + return object; + var message = new $root.google.pubsub.v1.UpdateSubscriptionRequest(); + if (object.subscription != null) { + if (typeof object.subscription !== "object") + throw TypeError(".google.pubsub.v1.UpdateSubscriptionRequest.subscription: object expected"); + message.subscription = $root.google.pubsub.v1.Subscription.fromObject(object.subscription); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.pubsub.v1.UpdateSubscriptionRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateSubscriptionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.UpdateSubscriptionRequest + * @static + * @param {google.pubsub.v1.UpdateSubscriptionRequest} message UpdateSubscriptionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateSubscriptionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.subscription = null; + object.updateMask = null; + } + if (message.subscription != null && message.hasOwnProperty("subscription")) + object.subscription = $root.google.pubsub.v1.Subscription.toObject(message.subscription, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateSubscriptionRequest to JSON. + * @function toJSON + * @memberof google.pubsub.v1.UpdateSubscriptionRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateSubscriptionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateSubscriptionRequest + * @function getTypeUrl + * @memberof google.pubsub.v1.UpdateSubscriptionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateSubscriptionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.UpdateSubscriptionRequest"; + }; + + return UpdateSubscriptionRequest; + })(); + + v1.ListSubscriptionsRequest = (function() { + + /** + * Properties of a ListSubscriptionsRequest. + * @memberof google.pubsub.v1 + * @interface IListSubscriptionsRequest + * @property {string|null} [project] ListSubscriptionsRequest project + * @property {number|null} [pageSize] ListSubscriptionsRequest pageSize + * @property {string|null} [pageToken] ListSubscriptionsRequest pageToken + */ + + /** + * Constructs a new ListSubscriptionsRequest. + * @memberof google.pubsub.v1 + * @classdesc Represents a ListSubscriptionsRequest. + * @implements IListSubscriptionsRequest + * @constructor + * @param {google.pubsub.v1.IListSubscriptionsRequest=} [properties] Properties to set + */ + function ListSubscriptionsRequest(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]]; + } + + /** + * ListSubscriptionsRequest project. + * @member {string} project + * @memberof google.pubsub.v1.ListSubscriptionsRequest + * @instance + */ + ListSubscriptionsRequest.prototype.project = ""; + + /** + * ListSubscriptionsRequest pageSize. + * @member {number} pageSize + * @memberof google.pubsub.v1.ListSubscriptionsRequest + * @instance + */ + ListSubscriptionsRequest.prototype.pageSize = 0; + + /** + * ListSubscriptionsRequest pageToken. + * @member {string} pageToken + * @memberof google.pubsub.v1.ListSubscriptionsRequest + * @instance + */ + ListSubscriptionsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListSubscriptionsRequest instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.ListSubscriptionsRequest + * @static + * @param {google.pubsub.v1.IListSubscriptionsRequest=} [properties] Properties to set + * @returns {google.pubsub.v1.ListSubscriptionsRequest} ListSubscriptionsRequest instance + */ + ListSubscriptionsRequest.create = function create(properties) { + return new ListSubscriptionsRequest(properties); + }; + + /** + * Encodes the specified ListSubscriptionsRequest message. Does not implicitly {@link google.pubsub.v1.ListSubscriptionsRequest.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.ListSubscriptionsRequest + * @static + * @param {google.pubsub.v1.IListSubscriptionsRequest} message ListSubscriptionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSubscriptionsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.project); + 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); + return writer; + }; + + /** + * Encodes the specified ListSubscriptionsRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.ListSubscriptionsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.ListSubscriptionsRequest + * @static + * @param {google.pubsub.v1.IListSubscriptionsRequest} message ListSubscriptionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSubscriptionsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSubscriptionsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.ListSubscriptionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.ListSubscriptionsRequest} ListSubscriptionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSubscriptionsRequest.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.pubsub.v1.ListSubscriptionsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.project = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListSubscriptionsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.ListSubscriptionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.ListSubscriptionsRequest} ListSubscriptionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSubscriptionsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSubscriptionsRequest message. + * @function verify + * @memberof google.pubsub.v1.ListSubscriptionsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSubscriptionsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: 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"; + return null; + }; + + /** + * Creates a ListSubscriptionsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.ListSubscriptionsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.ListSubscriptionsRequest} ListSubscriptionsRequest + */ + ListSubscriptionsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.ListSubscriptionsRequest) + return object; + var message = new $root.google.pubsub.v1.ListSubscriptionsRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListSubscriptionsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.ListSubscriptionsRequest + * @static + * @param {google.pubsub.v1.ListSubscriptionsRequest} message ListSubscriptionsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSubscriptionsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.project = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListSubscriptionsRequest to JSON. + * @function toJSON + * @memberof google.pubsub.v1.ListSubscriptionsRequest + * @instance + * @returns {Object.} JSON object + */ + ListSubscriptionsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListSubscriptionsRequest + * @function getTypeUrl + * @memberof google.pubsub.v1.ListSubscriptionsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListSubscriptionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.ListSubscriptionsRequest"; + }; + + return ListSubscriptionsRequest; + })(); + + v1.ListSubscriptionsResponse = (function() { + + /** + * Properties of a ListSubscriptionsResponse. + * @memberof google.pubsub.v1 + * @interface IListSubscriptionsResponse + * @property {Array.|null} [subscriptions] ListSubscriptionsResponse subscriptions + * @property {string|null} [nextPageToken] ListSubscriptionsResponse nextPageToken + */ + + /** + * Constructs a new ListSubscriptionsResponse. + * @memberof google.pubsub.v1 + * @classdesc Represents a ListSubscriptionsResponse. + * @implements IListSubscriptionsResponse + * @constructor + * @param {google.pubsub.v1.IListSubscriptionsResponse=} [properties] Properties to set + */ + function ListSubscriptionsResponse(properties) { + this.subscriptions = []; + 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]]; + } + + /** + * ListSubscriptionsResponse subscriptions. + * @member {Array.} subscriptions + * @memberof google.pubsub.v1.ListSubscriptionsResponse + * @instance + */ + ListSubscriptionsResponse.prototype.subscriptions = $util.emptyArray; + + /** + * ListSubscriptionsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.pubsub.v1.ListSubscriptionsResponse + * @instance + */ + ListSubscriptionsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListSubscriptionsResponse instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.ListSubscriptionsResponse + * @static + * @param {google.pubsub.v1.IListSubscriptionsResponse=} [properties] Properties to set + * @returns {google.pubsub.v1.ListSubscriptionsResponse} ListSubscriptionsResponse instance + */ + ListSubscriptionsResponse.create = function create(properties) { + return new ListSubscriptionsResponse(properties); + }; + + /** + * Encodes the specified ListSubscriptionsResponse message. Does not implicitly {@link google.pubsub.v1.ListSubscriptionsResponse.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.ListSubscriptionsResponse + * @static + * @param {google.pubsub.v1.IListSubscriptionsResponse} message ListSubscriptionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSubscriptionsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.subscriptions != null && message.subscriptions.length) + for (var i = 0; i < message.subscriptions.length; ++i) + $root.google.pubsub.v1.Subscription.encode(message.subscriptions[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 ListSubscriptionsResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.ListSubscriptionsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.ListSubscriptionsResponse + * @static + * @param {google.pubsub.v1.IListSubscriptionsResponse} message ListSubscriptionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSubscriptionsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSubscriptionsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.ListSubscriptionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.ListSubscriptionsResponse} ListSubscriptionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSubscriptionsResponse.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.pubsub.v1.ListSubscriptionsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.subscriptions && message.subscriptions.length)) + message.subscriptions = []; + message.subscriptions.push($root.google.pubsub.v1.Subscription.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListSubscriptionsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.ListSubscriptionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.ListSubscriptionsResponse} ListSubscriptionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSubscriptionsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSubscriptionsResponse message. + * @function verify + * @memberof google.pubsub.v1.ListSubscriptionsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSubscriptionsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.subscriptions != null && message.hasOwnProperty("subscriptions")) { + if (!Array.isArray(message.subscriptions)) + return "subscriptions: array expected"; + for (var i = 0; i < message.subscriptions.length; ++i) { + var error = $root.google.pubsub.v1.Subscription.verify(message.subscriptions[i]); + if (error) + return "subscriptions." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListSubscriptionsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.ListSubscriptionsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.ListSubscriptionsResponse} ListSubscriptionsResponse + */ + ListSubscriptionsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.ListSubscriptionsResponse) + return object; + var message = new $root.google.pubsub.v1.ListSubscriptionsResponse(); + if (object.subscriptions) { + if (!Array.isArray(object.subscriptions)) + throw TypeError(".google.pubsub.v1.ListSubscriptionsResponse.subscriptions: array expected"); + message.subscriptions = []; + for (var i = 0; i < object.subscriptions.length; ++i) { + if (typeof object.subscriptions[i] !== "object") + throw TypeError(".google.pubsub.v1.ListSubscriptionsResponse.subscriptions: object expected"); + message.subscriptions[i] = $root.google.pubsub.v1.Subscription.fromObject(object.subscriptions[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListSubscriptionsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.ListSubscriptionsResponse + * @static + * @param {google.pubsub.v1.ListSubscriptionsResponse} message ListSubscriptionsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSubscriptionsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.subscriptions = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.subscriptions && message.subscriptions.length) { + object.subscriptions = []; + for (var j = 0; j < message.subscriptions.length; ++j) + object.subscriptions[j] = $root.google.pubsub.v1.Subscription.toObject(message.subscriptions[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListSubscriptionsResponse to JSON. + * @function toJSON + * @memberof google.pubsub.v1.ListSubscriptionsResponse + * @instance + * @returns {Object.} JSON object + */ + ListSubscriptionsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListSubscriptionsResponse + * @function getTypeUrl + * @memberof google.pubsub.v1.ListSubscriptionsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListSubscriptionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.ListSubscriptionsResponse"; + }; + + return ListSubscriptionsResponse; + })(); + + v1.DeleteSubscriptionRequest = (function() { + + /** + * Properties of a DeleteSubscriptionRequest. + * @memberof google.pubsub.v1 + * @interface IDeleteSubscriptionRequest + * @property {string|null} [subscription] DeleteSubscriptionRequest subscription + */ + + /** + * Constructs a new DeleteSubscriptionRequest. + * @memberof google.pubsub.v1 + * @classdesc Represents a DeleteSubscriptionRequest. + * @implements IDeleteSubscriptionRequest + * @constructor + * @param {google.pubsub.v1.IDeleteSubscriptionRequest=} [properties] Properties to set + */ + function DeleteSubscriptionRequest(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]]; + } + + /** + * DeleteSubscriptionRequest subscription. + * @member {string} subscription + * @memberof google.pubsub.v1.DeleteSubscriptionRequest + * @instance + */ + DeleteSubscriptionRequest.prototype.subscription = ""; + + /** + * Creates a new DeleteSubscriptionRequest instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.DeleteSubscriptionRequest + * @static + * @param {google.pubsub.v1.IDeleteSubscriptionRequest=} [properties] Properties to set + * @returns {google.pubsub.v1.DeleteSubscriptionRequest} DeleteSubscriptionRequest instance + */ + DeleteSubscriptionRequest.create = function create(properties) { + return new DeleteSubscriptionRequest(properties); + }; + + /** + * Encodes the specified DeleteSubscriptionRequest message. Does not implicitly {@link google.pubsub.v1.DeleteSubscriptionRequest.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.DeleteSubscriptionRequest + * @static + * @param {google.pubsub.v1.IDeleteSubscriptionRequest} message DeleteSubscriptionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteSubscriptionRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.subscription != null && Object.hasOwnProperty.call(message, "subscription")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.subscription); + return writer; + }; + + /** + * Encodes the specified DeleteSubscriptionRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.DeleteSubscriptionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.DeleteSubscriptionRequest + * @static + * @param {google.pubsub.v1.IDeleteSubscriptionRequest} message DeleteSubscriptionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteSubscriptionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteSubscriptionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.DeleteSubscriptionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.DeleteSubscriptionRequest} DeleteSubscriptionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteSubscriptionRequest.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.pubsub.v1.DeleteSubscriptionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.subscription = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteSubscriptionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.DeleteSubscriptionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.DeleteSubscriptionRequest} DeleteSubscriptionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteSubscriptionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteSubscriptionRequest message. + * @function verify + * @memberof google.pubsub.v1.DeleteSubscriptionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteSubscriptionRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.subscription != null && message.hasOwnProperty("subscription")) + if (!$util.isString(message.subscription)) + return "subscription: string expected"; + return null; + }; + + /** + * Creates a DeleteSubscriptionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.DeleteSubscriptionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.DeleteSubscriptionRequest} DeleteSubscriptionRequest + */ + DeleteSubscriptionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.DeleteSubscriptionRequest) + return object; + var message = new $root.google.pubsub.v1.DeleteSubscriptionRequest(); + if (object.subscription != null) + message.subscription = String(object.subscription); + return message; + }; + + /** + * Creates a plain object from a DeleteSubscriptionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.DeleteSubscriptionRequest + * @static + * @param {google.pubsub.v1.DeleteSubscriptionRequest} message DeleteSubscriptionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteSubscriptionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.subscription = ""; + if (message.subscription != null && message.hasOwnProperty("subscription")) + object.subscription = message.subscription; + return object; + }; + + /** + * Converts this DeleteSubscriptionRequest to JSON. + * @function toJSON + * @memberof google.pubsub.v1.DeleteSubscriptionRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteSubscriptionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteSubscriptionRequest + * @function getTypeUrl + * @memberof google.pubsub.v1.DeleteSubscriptionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteSubscriptionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.DeleteSubscriptionRequest"; + }; + + return DeleteSubscriptionRequest; + })(); + + v1.ModifyPushConfigRequest = (function() { + + /** + * Properties of a ModifyPushConfigRequest. + * @memberof google.pubsub.v1 + * @interface IModifyPushConfigRequest + * @property {string|null} [subscription] ModifyPushConfigRequest subscription + * @property {google.pubsub.v1.IPushConfig|null} [pushConfig] ModifyPushConfigRequest pushConfig + */ + + /** + * Constructs a new ModifyPushConfigRequest. + * @memberof google.pubsub.v1 + * @classdesc Represents a ModifyPushConfigRequest. + * @implements IModifyPushConfigRequest + * @constructor + * @param {google.pubsub.v1.IModifyPushConfigRequest=} [properties] Properties to set + */ + function ModifyPushConfigRequest(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]]; + } + + /** + * ModifyPushConfigRequest subscription. + * @member {string} subscription + * @memberof google.pubsub.v1.ModifyPushConfigRequest + * @instance + */ + ModifyPushConfigRequest.prototype.subscription = ""; + + /** + * ModifyPushConfigRequest pushConfig. + * @member {google.pubsub.v1.IPushConfig|null|undefined} pushConfig + * @memberof google.pubsub.v1.ModifyPushConfigRequest + * @instance + */ + ModifyPushConfigRequest.prototype.pushConfig = null; + + /** + * Creates a new ModifyPushConfigRequest instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.ModifyPushConfigRequest + * @static + * @param {google.pubsub.v1.IModifyPushConfigRequest=} [properties] Properties to set + * @returns {google.pubsub.v1.ModifyPushConfigRequest} ModifyPushConfigRequest instance + */ + ModifyPushConfigRequest.create = function create(properties) { + return new ModifyPushConfigRequest(properties); + }; + + /** + * Encodes the specified ModifyPushConfigRequest message. Does not implicitly {@link google.pubsub.v1.ModifyPushConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.ModifyPushConfigRequest + * @static + * @param {google.pubsub.v1.IModifyPushConfigRequest} message ModifyPushConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ModifyPushConfigRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.subscription != null && Object.hasOwnProperty.call(message, "subscription")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.subscription); + if (message.pushConfig != null && Object.hasOwnProperty.call(message, "pushConfig")) + $root.google.pubsub.v1.PushConfig.encode(message.pushConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ModifyPushConfigRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.ModifyPushConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.ModifyPushConfigRequest + * @static + * @param {google.pubsub.v1.IModifyPushConfigRequest} message ModifyPushConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ModifyPushConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ModifyPushConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.ModifyPushConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.ModifyPushConfigRequest} ModifyPushConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ModifyPushConfigRequest.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.pubsub.v1.ModifyPushConfigRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.subscription = reader.string(); + break; + } + case 2: { + message.pushConfig = $root.google.pubsub.v1.PushConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ModifyPushConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.ModifyPushConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.ModifyPushConfigRequest} ModifyPushConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ModifyPushConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ModifyPushConfigRequest message. + * @function verify + * @memberof google.pubsub.v1.ModifyPushConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ModifyPushConfigRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.subscription != null && message.hasOwnProperty("subscription")) + if (!$util.isString(message.subscription)) + return "subscription: string expected"; + if (message.pushConfig != null && message.hasOwnProperty("pushConfig")) { + var error = $root.google.pubsub.v1.PushConfig.verify(message.pushConfig); + if (error) + return "pushConfig." + error; + } + return null; + }; + + /** + * Creates a ModifyPushConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.ModifyPushConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.ModifyPushConfigRequest} ModifyPushConfigRequest + */ + ModifyPushConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.ModifyPushConfigRequest) + return object; + var message = new $root.google.pubsub.v1.ModifyPushConfigRequest(); + if (object.subscription != null) + message.subscription = String(object.subscription); + if (object.pushConfig != null) { + if (typeof object.pushConfig !== "object") + throw TypeError(".google.pubsub.v1.ModifyPushConfigRequest.pushConfig: object expected"); + message.pushConfig = $root.google.pubsub.v1.PushConfig.fromObject(object.pushConfig); + } + return message; + }; + + /** + * Creates a plain object from a ModifyPushConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.ModifyPushConfigRequest + * @static + * @param {google.pubsub.v1.ModifyPushConfigRequest} message ModifyPushConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ModifyPushConfigRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.subscription = ""; + object.pushConfig = null; + } + if (message.subscription != null && message.hasOwnProperty("subscription")) + object.subscription = message.subscription; + if (message.pushConfig != null && message.hasOwnProperty("pushConfig")) + object.pushConfig = $root.google.pubsub.v1.PushConfig.toObject(message.pushConfig, options); + return object; + }; + + /** + * Converts this ModifyPushConfigRequest to JSON. + * @function toJSON + * @memberof google.pubsub.v1.ModifyPushConfigRequest + * @instance + * @returns {Object.} JSON object + */ + ModifyPushConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ModifyPushConfigRequest + * @function getTypeUrl + * @memberof google.pubsub.v1.ModifyPushConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ModifyPushConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.ModifyPushConfigRequest"; + }; + + return ModifyPushConfigRequest; + })(); + + v1.PullRequest = (function() { + + /** + * Properties of a PullRequest. + * @memberof google.pubsub.v1 + * @interface IPullRequest + * @property {string|null} [subscription] PullRequest subscription + * @property {boolean|null} [returnImmediately] PullRequest returnImmediately + * @property {number|null} [maxMessages] PullRequest maxMessages + */ + + /** + * Constructs a new PullRequest. + * @memberof google.pubsub.v1 + * @classdesc Represents a PullRequest. + * @implements IPullRequest + * @constructor + * @param {google.pubsub.v1.IPullRequest=} [properties] Properties to set + */ + function PullRequest(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]]; + } + + /** + * PullRequest subscription. + * @member {string} subscription + * @memberof google.pubsub.v1.PullRequest + * @instance + */ + PullRequest.prototype.subscription = ""; + + /** + * PullRequest returnImmediately. + * @member {boolean} returnImmediately + * @memberof google.pubsub.v1.PullRequest + * @instance + */ + PullRequest.prototype.returnImmediately = false; + + /** + * PullRequest maxMessages. + * @member {number} maxMessages + * @memberof google.pubsub.v1.PullRequest + * @instance + */ + PullRequest.prototype.maxMessages = 0; + + /** + * Creates a new PullRequest instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.PullRequest + * @static + * @param {google.pubsub.v1.IPullRequest=} [properties] Properties to set + * @returns {google.pubsub.v1.PullRequest} PullRequest instance + */ + PullRequest.create = function create(properties) { + return new PullRequest(properties); + }; + + /** + * Encodes the specified PullRequest message. Does not implicitly {@link google.pubsub.v1.PullRequest.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.PullRequest + * @static + * @param {google.pubsub.v1.IPullRequest} message PullRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PullRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.subscription != null && Object.hasOwnProperty.call(message, "subscription")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.subscription); + if (message.returnImmediately != null && Object.hasOwnProperty.call(message, "returnImmediately")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.returnImmediately); + if (message.maxMessages != null && Object.hasOwnProperty.call(message, "maxMessages")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.maxMessages); + return writer; + }; + + /** + * Encodes the specified PullRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.PullRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.PullRequest + * @static + * @param {google.pubsub.v1.IPullRequest} message PullRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PullRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PullRequest message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.PullRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.PullRequest} PullRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PullRequest.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.pubsub.v1.PullRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.subscription = reader.string(); + break; + } + case 2: { + message.returnImmediately = reader.bool(); + break; + } + case 3: { + message.maxMessages = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PullRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.PullRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.PullRequest} PullRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PullRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PullRequest message. + * @function verify + * @memberof google.pubsub.v1.PullRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PullRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.subscription != null && message.hasOwnProperty("subscription")) + if (!$util.isString(message.subscription)) + return "subscription: string expected"; + if (message.returnImmediately != null && message.hasOwnProperty("returnImmediately")) + if (typeof message.returnImmediately !== "boolean") + return "returnImmediately: boolean expected"; + if (message.maxMessages != null && message.hasOwnProperty("maxMessages")) + if (!$util.isInteger(message.maxMessages)) + return "maxMessages: integer expected"; + return null; + }; + + /** + * Creates a PullRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.PullRequest + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.PullRequest} PullRequest + */ + PullRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.PullRequest) + return object; + var message = new $root.google.pubsub.v1.PullRequest(); + if (object.subscription != null) + message.subscription = String(object.subscription); + if (object.returnImmediately != null) + message.returnImmediately = Boolean(object.returnImmediately); + if (object.maxMessages != null) + message.maxMessages = object.maxMessages | 0; + return message; + }; + + /** + * Creates a plain object from a PullRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.PullRequest + * @static + * @param {google.pubsub.v1.PullRequest} message PullRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PullRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.subscription = ""; + object.returnImmediately = false; + object.maxMessages = 0; + } + if (message.subscription != null && message.hasOwnProperty("subscription")) + object.subscription = message.subscription; + if (message.returnImmediately != null && message.hasOwnProperty("returnImmediately")) + object.returnImmediately = message.returnImmediately; + if (message.maxMessages != null && message.hasOwnProperty("maxMessages")) + object.maxMessages = message.maxMessages; + return object; + }; + + /** + * Converts this PullRequest to JSON. + * @function toJSON + * @memberof google.pubsub.v1.PullRequest + * @instance + * @returns {Object.} JSON object + */ + PullRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PullRequest + * @function getTypeUrl + * @memberof google.pubsub.v1.PullRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PullRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.PullRequest"; + }; + + return PullRequest; + })(); + + v1.PullResponse = (function() { + + /** + * Properties of a PullResponse. + * @memberof google.pubsub.v1 + * @interface IPullResponse + * @property {Array.|null} [receivedMessages] PullResponse receivedMessages + */ + + /** + * Constructs a new PullResponse. + * @memberof google.pubsub.v1 + * @classdesc Represents a PullResponse. + * @implements IPullResponse + * @constructor + * @param {google.pubsub.v1.IPullResponse=} [properties] Properties to set + */ + function PullResponse(properties) { + this.receivedMessages = []; + 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]]; + } + + /** + * PullResponse receivedMessages. + * @member {Array.} receivedMessages + * @memberof google.pubsub.v1.PullResponse + * @instance + */ + PullResponse.prototype.receivedMessages = $util.emptyArray; + + /** + * Creates a new PullResponse instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.PullResponse + * @static + * @param {google.pubsub.v1.IPullResponse=} [properties] Properties to set + * @returns {google.pubsub.v1.PullResponse} PullResponse instance + */ + PullResponse.create = function create(properties) { + return new PullResponse(properties); + }; + + /** + * Encodes the specified PullResponse message. Does not implicitly {@link google.pubsub.v1.PullResponse.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.PullResponse + * @static + * @param {google.pubsub.v1.IPullResponse} message PullResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PullResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.receivedMessages != null && message.receivedMessages.length) + for (var i = 0; i < message.receivedMessages.length; ++i) + $root.google.pubsub.v1.ReceivedMessage.encode(message.receivedMessages[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PullResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.PullResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.PullResponse + * @static + * @param {google.pubsub.v1.IPullResponse} message PullResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PullResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PullResponse message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.PullResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.PullResponse} PullResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PullResponse.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.pubsub.v1.PullResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.receivedMessages && message.receivedMessages.length)) + message.receivedMessages = []; + message.receivedMessages.push($root.google.pubsub.v1.ReceivedMessage.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PullResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.PullResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.PullResponse} PullResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PullResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PullResponse message. + * @function verify + * @memberof google.pubsub.v1.PullResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PullResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.receivedMessages != null && message.hasOwnProperty("receivedMessages")) { + if (!Array.isArray(message.receivedMessages)) + return "receivedMessages: array expected"; + for (var i = 0; i < message.receivedMessages.length; ++i) { + var error = $root.google.pubsub.v1.ReceivedMessage.verify(message.receivedMessages[i]); + if (error) + return "receivedMessages." + error; + } + } + return null; + }; + + /** + * Creates a PullResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.PullResponse + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.PullResponse} PullResponse + */ + PullResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.PullResponse) + return object; + var message = new $root.google.pubsub.v1.PullResponse(); + if (object.receivedMessages) { + if (!Array.isArray(object.receivedMessages)) + throw TypeError(".google.pubsub.v1.PullResponse.receivedMessages: array expected"); + message.receivedMessages = []; + for (var i = 0; i < object.receivedMessages.length; ++i) { + if (typeof object.receivedMessages[i] !== "object") + throw TypeError(".google.pubsub.v1.PullResponse.receivedMessages: object expected"); + message.receivedMessages[i] = $root.google.pubsub.v1.ReceivedMessage.fromObject(object.receivedMessages[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a PullResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.PullResponse + * @static + * @param {google.pubsub.v1.PullResponse} message PullResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PullResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.receivedMessages = []; + if (message.receivedMessages && message.receivedMessages.length) { + object.receivedMessages = []; + for (var j = 0; j < message.receivedMessages.length; ++j) + object.receivedMessages[j] = $root.google.pubsub.v1.ReceivedMessage.toObject(message.receivedMessages[j], options); + } + return object; + }; + + /** + * Converts this PullResponse to JSON. + * @function toJSON + * @memberof google.pubsub.v1.PullResponse + * @instance + * @returns {Object.} JSON object + */ + PullResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PullResponse + * @function getTypeUrl + * @memberof google.pubsub.v1.PullResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PullResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.PullResponse"; + }; + + return PullResponse; + })(); + + v1.ModifyAckDeadlineRequest = (function() { + + /** + * Properties of a ModifyAckDeadlineRequest. + * @memberof google.pubsub.v1 + * @interface IModifyAckDeadlineRequest + * @property {string|null} [subscription] ModifyAckDeadlineRequest subscription + * @property {Array.|null} [ackIds] ModifyAckDeadlineRequest ackIds + * @property {number|null} [ackDeadlineSeconds] ModifyAckDeadlineRequest ackDeadlineSeconds + */ + + /** + * Constructs a new ModifyAckDeadlineRequest. + * @memberof google.pubsub.v1 + * @classdesc Represents a ModifyAckDeadlineRequest. + * @implements IModifyAckDeadlineRequest + * @constructor + * @param {google.pubsub.v1.IModifyAckDeadlineRequest=} [properties] Properties to set + */ + function ModifyAckDeadlineRequest(properties) { + this.ackIds = []; + 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]]; + } + + /** + * ModifyAckDeadlineRequest subscription. + * @member {string} subscription + * @memberof google.pubsub.v1.ModifyAckDeadlineRequest + * @instance + */ + ModifyAckDeadlineRequest.prototype.subscription = ""; + + /** + * ModifyAckDeadlineRequest ackIds. + * @member {Array.} ackIds + * @memberof google.pubsub.v1.ModifyAckDeadlineRequest + * @instance + */ + ModifyAckDeadlineRequest.prototype.ackIds = $util.emptyArray; + + /** + * ModifyAckDeadlineRequest ackDeadlineSeconds. + * @member {number} ackDeadlineSeconds + * @memberof google.pubsub.v1.ModifyAckDeadlineRequest + * @instance + */ + ModifyAckDeadlineRequest.prototype.ackDeadlineSeconds = 0; + + /** + * Creates a new ModifyAckDeadlineRequest instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.ModifyAckDeadlineRequest + * @static + * @param {google.pubsub.v1.IModifyAckDeadlineRequest=} [properties] Properties to set + * @returns {google.pubsub.v1.ModifyAckDeadlineRequest} ModifyAckDeadlineRequest instance + */ + ModifyAckDeadlineRequest.create = function create(properties) { + return new ModifyAckDeadlineRequest(properties); + }; + + /** + * Encodes the specified ModifyAckDeadlineRequest message. Does not implicitly {@link google.pubsub.v1.ModifyAckDeadlineRequest.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.ModifyAckDeadlineRequest + * @static + * @param {google.pubsub.v1.IModifyAckDeadlineRequest} message ModifyAckDeadlineRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ModifyAckDeadlineRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.subscription != null && Object.hasOwnProperty.call(message, "subscription")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.subscription); + if (message.ackDeadlineSeconds != null && Object.hasOwnProperty.call(message, "ackDeadlineSeconds")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.ackDeadlineSeconds); + if (message.ackIds != null && message.ackIds.length) + for (var i = 0; i < message.ackIds.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.ackIds[i]); + return writer; + }; + + /** + * Encodes the specified ModifyAckDeadlineRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.ModifyAckDeadlineRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.ModifyAckDeadlineRequest + * @static + * @param {google.pubsub.v1.IModifyAckDeadlineRequest} message ModifyAckDeadlineRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ModifyAckDeadlineRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ModifyAckDeadlineRequest message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.ModifyAckDeadlineRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.ModifyAckDeadlineRequest} ModifyAckDeadlineRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ModifyAckDeadlineRequest.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.pubsub.v1.ModifyAckDeadlineRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.subscription = reader.string(); + break; + } + case 4: { + if (!(message.ackIds && message.ackIds.length)) + message.ackIds = []; + message.ackIds.push(reader.string()); + break; + } + case 3: { + message.ackDeadlineSeconds = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ModifyAckDeadlineRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.ModifyAckDeadlineRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.ModifyAckDeadlineRequest} ModifyAckDeadlineRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ModifyAckDeadlineRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ModifyAckDeadlineRequest message. + * @function verify + * @memberof google.pubsub.v1.ModifyAckDeadlineRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ModifyAckDeadlineRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.subscription != null && message.hasOwnProperty("subscription")) + if (!$util.isString(message.subscription)) + return "subscription: string expected"; + if (message.ackIds != null && message.hasOwnProperty("ackIds")) { + if (!Array.isArray(message.ackIds)) + return "ackIds: array expected"; + for (var i = 0; i < message.ackIds.length; ++i) + if (!$util.isString(message.ackIds[i])) + return "ackIds: string[] expected"; + } + if (message.ackDeadlineSeconds != null && message.hasOwnProperty("ackDeadlineSeconds")) + if (!$util.isInteger(message.ackDeadlineSeconds)) + return "ackDeadlineSeconds: integer expected"; + return null; + }; + + /** + * Creates a ModifyAckDeadlineRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.ModifyAckDeadlineRequest + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.ModifyAckDeadlineRequest} ModifyAckDeadlineRequest + */ + ModifyAckDeadlineRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.ModifyAckDeadlineRequest) + return object; + var message = new $root.google.pubsub.v1.ModifyAckDeadlineRequest(); + if (object.subscription != null) + message.subscription = String(object.subscription); + if (object.ackIds) { + if (!Array.isArray(object.ackIds)) + throw TypeError(".google.pubsub.v1.ModifyAckDeadlineRequest.ackIds: array expected"); + message.ackIds = []; + for (var i = 0; i < object.ackIds.length; ++i) + message.ackIds[i] = String(object.ackIds[i]); + } + if (object.ackDeadlineSeconds != null) + message.ackDeadlineSeconds = object.ackDeadlineSeconds | 0; + return message; + }; + + /** + * Creates a plain object from a ModifyAckDeadlineRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.ModifyAckDeadlineRequest + * @static + * @param {google.pubsub.v1.ModifyAckDeadlineRequest} message ModifyAckDeadlineRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ModifyAckDeadlineRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.ackIds = []; + if (options.defaults) { + object.subscription = ""; + object.ackDeadlineSeconds = 0; + } + if (message.subscription != null && message.hasOwnProperty("subscription")) + object.subscription = message.subscription; + if (message.ackDeadlineSeconds != null && message.hasOwnProperty("ackDeadlineSeconds")) + object.ackDeadlineSeconds = message.ackDeadlineSeconds; + if (message.ackIds && message.ackIds.length) { + object.ackIds = []; + for (var j = 0; j < message.ackIds.length; ++j) + object.ackIds[j] = message.ackIds[j]; + } + return object; + }; + + /** + * Converts this ModifyAckDeadlineRequest to JSON. + * @function toJSON + * @memberof google.pubsub.v1.ModifyAckDeadlineRequest + * @instance + * @returns {Object.} JSON object + */ + ModifyAckDeadlineRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ModifyAckDeadlineRequest + * @function getTypeUrl + * @memberof google.pubsub.v1.ModifyAckDeadlineRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ModifyAckDeadlineRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.ModifyAckDeadlineRequest"; + }; + + return ModifyAckDeadlineRequest; + })(); + + v1.AcknowledgeRequest = (function() { + + /** + * Properties of an AcknowledgeRequest. + * @memberof google.pubsub.v1 + * @interface IAcknowledgeRequest + * @property {string|null} [subscription] AcknowledgeRequest subscription + * @property {Array.|null} [ackIds] AcknowledgeRequest ackIds + */ + + /** + * Constructs a new AcknowledgeRequest. + * @memberof google.pubsub.v1 + * @classdesc Represents an AcknowledgeRequest. + * @implements IAcknowledgeRequest + * @constructor + * @param {google.pubsub.v1.IAcknowledgeRequest=} [properties] Properties to set + */ + function AcknowledgeRequest(properties) { + this.ackIds = []; + 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]]; + } + + /** + * AcknowledgeRequest subscription. + * @member {string} subscription + * @memberof google.pubsub.v1.AcknowledgeRequest + * @instance + */ + AcknowledgeRequest.prototype.subscription = ""; + + /** + * AcknowledgeRequest ackIds. + * @member {Array.} ackIds + * @memberof google.pubsub.v1.AcknowledgeRequest + * @instance + */ + AcknowledgeRequest.prototype.ackIds = $util.emptyArray; + + /** + * Creates a new AcknowledgeRequest instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.AcknowledgeRequest + * @static + * @param {google.pubsub.v1.IAcknowledgeRequest=} [properties] Properties to set + * @returns {google.pubsub.v1.AcknowledgeRequest} AcknowledgeRequest instance + */ + AcknowledgeRequest.create = function create(properties) { + return new AcknowledgeRequest(properties); + }; + + /** + * Encodes the specified AcknowledgeRequest message. Does not implicitly {@link google.pubsub.v1.AcknowledgeRequest.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.AcknowledgeRequest + * @static + * @param {google.pubsub.v1.IAcknowledgeRequest} message AcknowledgeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AcknowledgeRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.subscription != null && Object.hasOwnProperty.call(message, "subscription")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.subscription); + if (message.ackIds != null && message.ackIds.length) + for (var i = 0; i < message.ackIds.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.ackIds[i]); + return writer; + }; + + /** + * Encodes the specified AcknowledgeRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.AcknowledgeRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.AcknowledgeRequest + * @static + * @param {google.pubsub.v1.IAcknowledgeRequest} message AcknowledgeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AcknowledgeRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AcknowledgeRequest message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.AcknowledgeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.AcknowledgeRequest} AcknowledgeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AcknowledgeRequest.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.pubsub.v1.AcknowledgeRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.subscription = reader.string(); + break; + } + case 2: { + if (!(message.ackIds && message.ackIds.length)) + message.ackIds = []; + message.ackIds.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AcknowledgeRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.AcknowledgeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.AcknowledgeRequest} AcknowledgeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AcknowledgeRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AcknowledgeRequest message. + * @function verify + * @memberof google.pubsub.v1.AcknowledgeRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AcknowledgeRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.subscription != null && message.hasOwnProperty("subscription")) + if (!$util.isString(message.subscription)) + return "subscription: string expected"; + if (message.ackIds != null && message.hasOwnProperty("ackIds")) { + if (!Array.isArray(message.ackIds)) + return "ackIds: array expected"; + for (var i = 0; i < message.ackIds.length; ++i) + if (!$util.isString(message.ackIds[i])) + return "ackIds: string[] expected"; + } + return null; + }; + + /** + * Creates an AcknowledgeRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.AcknowledgeRequest + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.AcknowledgeRequest} AcknowledgeRequest + */ + AcknowledgeRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.AcknowledgeRequest) + return object; + var message = new $root.google.pubsub.v1.AcknowledgeRequest(); + if (object.subscription != null) + message.subscription = String(object.subscription); + if (object.ackIds) { + if (!Array.isArray(object.ackIds)) + throw TypeError(".google.pubsub.v1.AcknowledgeRequest.ackIds: array expected"); + message.ackIds = []; + for (var i = 0; i < object.ackIds.length; ++i) + message.ackIds[i] = String(object.ackIds[i]); + } + return message; + }; + + /** + * Creates a plain object from an AcknowledgeRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.AcknowledgeRequest + * @static + * @param {google.pubsub.v1.AcknowledgeRequest} message AcknowledgeRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AcknowledgeRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.ackIds = []; + if (options.defaults) + object.subscription = ""; + if (message.subscription != null && message.hasOwnProperty("subscription")) + object.subscription = message.subscription; + if (message.ackIds && message.ackIds.length) { + object.ackIds = []; + for (var j = 0; j < message.ackIds.length; ++j) + object.ackIds[j] = message.ackIds[j]; + } + return object; + }; + + /** + * Converts this AcknowledgeRequest to JSON. + * @function toJSON + * @memberof google.pubsub.v1.AcknowledgeRequest + * @instance + * @returns {Object.} JSON object + */ + AcknowledgeRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AcknowledgeRequest + * @function getTypeUrl + * @memberof google.pubsub.v1.AcknowledgeRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AcknowledgeRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.AcknowledgeRequest"; + }; + + return AcknowledgeRequest; + })(); + + v1.StreamingPullRequest = (function() { + + /** + * Properties of a StreamingPullRequest. + * @memberof google.pubsub.v1 + * @interface IStreamingPullRequest + * @property {string|null} [subscription] StreamingPullRequest subscription + * @property {Array.|null} [ackIds] StreamingPullRequest ackIds + * @property {Array.|null} [modifyDeadlineSeconds] StreamingPullRequest modifyDeadlineSeconds + * @property {Array.|null} [modifyDeadlineAckIds] StreamingPullRequest modifyDeadlineAckIds + * @property {number|null} [streamAckDeadlineSeconds] StreamingPullRequest streamAckDeadlineSeconds + * @property {string|null} [clientId] StreamingPullRequest clientId + * @property {number|Long|null} [maxOutstandingMessages] StreamingPullRequest maxOutstandingMessages + * @property {number|Long|null} [maxOutstandingBytes] StreamingPullRequest maxOutstandingBytes + */ + + /** + * Constructs a new StreamingPullRequest. + * @memberof google.pubsub.v1 + * @classdesc Represents a StreamingPullRequest. + * @implements IStreamingPullRequest + * @constructor + * @param {google.pubsub.v1.IStreamingPullRequest=} [properties] Properties to set + */ + function StreamingPullRequest(properties) { + this.ackIds = []; + this.modifyDeadlineSeconds = []; + this.modifyDeadlineAckIds = []; + 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]]; + } + + /** + * StreamingPullRequest subscription. + * @member {string} subscription + * @memberof google.pubsub.v1.StreamingPullRequest + * @instance + */ + StreamingPullRequest.prototype.subscription = ""; + + /** + * StreamingPullRequest ackIds. + * @member {Array.} ackIds + * @memberof google.pubsub.v1.StreamingPullRequest + * @instance + */ + StreamingPullRequest.prototype.ackIds = $util.emptyArray; + + /** + * StreamingPullRequest modifyDeadlineSeconds. + * @member {Array.} modifyDeadlineSeconds + * @memberof google.pubsub.v1.StreamingPullRequest + * @instance + */ + StreamingPullRequest.prototype.modifyDeadlineSeconds = $util.emptyArray; + + /** + * StreamingPullRequest modifyDeadlineAckIds. + * @member {Array.} modifyDeadlineAckIds + * @memberof google.pubsub.v1.StreamingPullRequest + * @instance + */ + StreamingPullRequest.prototype.modifyDeadlineAckIds = $util.emptyArray; + + /** + * StreamingPullRequest streamAckDeadlineSeconds. + * @member {number} streamAckDeadlineSeconds + * @memberof google.pubsub.v1.StreamingPullRequest + * @instance + */ + StreamingPullRequest.prototype.streamAckDeadlineSeconds = 0; + + /** + * StreamingPullRequest clientId. + * @member {string} clientId + * @memberof google.pubsub.v1.StreamingPullRequest + * @instance + */ + StreamingPullRequest.prototype.clientId = ""; + + /** + * StreamingPullRequest maxOutstandingMessages. + * @member {number|Long} maxOutstandingMessages + * @memberof google.pubsub.v1.StreamingPullRequest + * @instance + */ + StreamingPullRequest.prototype.maxOutstandingMessages = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * StreamingPullRequest maxOutstandingBytes. + * @member {number|Long} maxOutstandingBytes + * @memberof google.pubsub.v1.StreamingPullRequest + * @instance + */ + StreamingPullRequest.prototype.maxOutstandingBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new StreamingPullRequest instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.StreamingPullRequest + * @static + * @param {google.pubsub.v1.IStreamingPullRequest=} [properties] Properties to set + * @returns {google.pubsub.v1.StreamingPullRequest} StreamingPullRequest instance + */ + StreamingPullRequest.create = function create(properties) { + return new StreamingPullRequest(properties); + }; + + /** + * Encodes the specified StreamingPullRequest message. Does not implicitly {@link google.pubsub.v1.StreamingPullRequest.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.StreamingPullRequest + * @static + * @param {google.pubsub.v1.IStreamingPullRequest} message StreamingPullRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingPullRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.subscription != null && Object.hasOwnProperty.call(message, "subscription")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.subscription); + if (message.ackIds != null && message.ackIds.length) + for (var i = 0; i < message.ackIds.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.ackIds[i]); + if (message.modifyDeadlineSeconds != null && message.modifyDeadlineSeconds.length) { + writer.uint32(/* id 3, wireType 2 =*/26).fork(); + for (var i = 0; i < message.modifyDeadlineSeconds.length; ++i) + writer.int32(message.modifyDeadlineSeconds[i]); + writer.ldelim(); + } + if (message.modifyDeadlineAckIds != null && message.modifyDeadlineAckIds.length) + for (var i = 0; i < message.modifyDeadlineAckIds.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.modifyDeadlineAckIds[i]); + if (message.streamAckDeadlineSeconds != null && Object.hasOwnProperty.call(message, "streamAckDeadlineSeconds")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.streamAckDeadlineSeconds); + if (message.clientId != null && Object.hasOwnProperty.call(message, "clientId")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.clientId); + if (message.maxOutstandingMessages != null && Object.hasOwnProperty.call(message, "maxOutstandingMessages")) + writer.uint32(/* id 7, wireType 0 =*/56).int64(message.maxOutstandingMessages); + if (message.maxOutstandingBytes != null && Object.hasOwnProperty.call(message, "maxOutstandingBytes")) + writer.uint32(/* id 8, wireType 0 =*/64).int64(message.maxOutstandingBytes); + return writer; + }; + + /** + * Encodes the specified StreamingPullRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.StreamingPullRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.StreamingPullRequest + * @static + * @param {google.pubsub.v1.IStreamingPullRequest} message StreamingPullRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingPullRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StreamingPullRequest message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.StreamingPullRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.StreamingPullRequest} StreamingPullRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingPullRequest.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.pubsub.v1.StreamingPullRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.subscription = reader.string(); + break; + } + case 2: { + if (!(message.ackIds && message.ackIds.length)) + message.ackIds = []; + message.ackIds.push(reader.string()); + break; + } + case 3: { + if (!(message.modifyDeadlineSeconds && message.modifyDeadlineSeconds.length)) + message.modifyDeadlineSeconds = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.modifyDeadlineSeconds.push(reader.int32()); + } else + message.modifyDeadlineSeconds.push(reader.int32()); + break; + } + case 4: { + if (!(message.modifyDeadlineAckIds && message.modifyDeadlineAckIds.length)) + message.modifyDeadlineAckIds = []; + message.modifyDeadlineAckIds.push(reader.string()); + break; + } + case 5: { + message.streamAckDeadlineSeconds = reader.int32(); + break; + } + case 6: { + message.clientId = reader.string(); + break; + } + case 7: { + message.maxOutstandingMessages = reader.int64(); + break; + } + case 8: { + message.maxOutstandingBytes = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StreamingPullRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.StreamingPullRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.StreamingPullRequest} StreamingPullRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingPullRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StreamingPullRequest message. + * @function verify + * @memberof google.pubsub.v1.StreamingPullRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StreamingPullRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.subscription != null && message.hasOwnProperty("subscription")) + if (!$util.isString(message.subscription)) + return "subscription: string expected"; + if (message.ackIds != null && message.hasOwnProperty("ackIds")) { + if (!Array.isArray(message.ackIds)) + return "ackIds: array expected"; + for (var i = 0; i < message.ackIds.length; ++i) + if (!$util.isString(message.ackIds[i])) + return "ackIds: string[] expected"; + } + if (message.modifyDeadlineSeconds != null && message.hasOwnProperty("modifyDeadlineSeconds")) { + if (!Array.isArray(message.modifyDeadlineSeconds)) + return "modifyDeadlineSeconds: array expected"; + for (var i = 0; i < message.modifyDeadlineSeconds.length; ++i) + if (!$util.isInteger(message.modifyDeadlineSeconds[i])) + return "modifyDeadlineSeconds: integer[] expected"; + } + if (message.modifyDeadlineAckIds != null && message.hasOwnProperty("modifyDeadlineAckIds")) { + if (!Array.isArray(message.modifyDeadlineAckIds)) + return "modifyDeadlineAckIds: array expected"; + for (var i = 0; i < message.modifyDeadlineAckIds.length; ++i) + if (!$util.isString(message.modifyDeadlineAckIds[i])) + return "modifyDeadlineAckIds: string[] expected"; + } + if (message.streamAckDeadlineSeconds != null && message.hasOwnProperty("streamAckDeadlineSeconds")) + if (!$util.isInteger(message.streamAckDeadlineSeconds)) + return "streamAckDeadlineSeconds: integer expected"; + if (message.clientId != null && message.hasOwnProperty("clientId")) + if (!$util.isString(message.clientId)) + return "clientId: string expected"; + if (message.maxOutstandingMessages != null && message.hasOwnProperty("maxOutstandingMessages")) + if (!$util.isInteger(message.maxOutstandingMessages) && !(message.maxOutstandingMessages && $util.isInteger(message.maxOutstandingMessages.low) && $util.isInteger(message.maxOutstandingMessages.high))) + return "maxOutstandingMessages: integer|Long expected"; + if (message.maxOutstandingBytes != null && message.hasOwnProperty("maxOutstandingBytes")) + if (!$util.isInteger(message.maxOutstandingBytes) && !(message.maxOutstandingBytes && $util.isInteger(message.maxOutstandingBytes.low) && $util.isInteger(message.maxOutstandingBytes.high))) + return "maxOutstandingBytes: integer|Long expected"; + return null; + }; + + /** + * Creates a StreamingPullRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.StreamingPullRequest + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.StreamingPullRequest} StreamingPullRequest + */ + StreamingPullRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.StreamingPullRequest) + return object; + var message = new $root.google.pubsub.v1.StreamingPullRequest(); + if (object.subscription != null) + message.subscription = String(object.subscription); + if (object.ackIds) { + if (!Array.isArray(object.ackIds)) + throw TypeError(".google.pubsub.v1.StreamingPullRequest.ackIds: array expected"); + message.ackIds = []; + for (var i = 0; i < object.ackIds.length; ++i) + message.ackIds[i] = String(object.ackIds[i]); + } + if (object.modifyDeadlineSeconds) { + if (!Array.isArray(object.modifyDeadlineSeconds)) + throw TypeError(".google.pubsub.v1.StreamingPullRequest.modifyDeadlineSeconds: array expected"); + message.modifyDeadlineSeconds = []; + for (var i = 0; i < object.modifyDeadlineSeconds.length; ++i) + message.modifyDeadlineSeconds[i] = object.modifyDeadlineSeconds[i] | 0; + } + if (object.modifyDeadlineAckIds) { + if (!Array.isArray(object.modifyDeadlineAckIds)) + throw TypeError(".google.pubsub.v1.StreamingPullRequest.modifyDeadlineAckIds: array expected"); + message.modifyDeadlineAckIds = []; + for (var i = 0; i < object.modifyDeadlineAckIds.length; ++i) + message.modifyDeadlineAckIds[i] = String(object.modifyDeadlineAckIds[i]); + } + if (object.streamAckDeadlineSeconds != null) + message.streamAckDeadlineSeconds = object.streamAckDeadlineSeconds | 0; + if (object.clientId != null) + message.clientId = String(object.clientId); + if (object.maxOutstandingMessages != null) + if ($util.Long) + (message.maxOutstandingMessages = $util.Long.fromValue(object.maxOutstandingMessages)).unsigned = false; + else if (typeof object.maxOutstandingMessages === "string") + message.maxOutstandingMessages = parseInt(object.maxOutstandingMessages, 10); + else if (typeof object.maxOutstandingMessages === "number") + message.maxOutstandingMessages = object.maxOutstandingMessages; + else if (typeof object.maxOutstandingMessages === "object") + message.maxOutstandingMessages = new $util.LongBits(object.maxOutstandingMessages.low >>> 0, object.maxOutstandingMessages.high >>> 0).toNumber(); + if (object.maxOutstandingBytes != null) + if ($util.Long) + (message.maxOutstandingBytes = $util.Long.fromValue(object.maxOutstandingBytes)).unsigned = false; + else if (typeof object.maxOutstandingBytes === "string") + message.maxOutstandingBytes = parseInt(object.maxOutstandingBytes, 10); + else if (typeof object.maxOutstandingBytes === "number") + message.maxOutstandingBytes = object.maxOutstandingBytes; + else if (typeof object.maxOutstandingBytes === "object") + message.maxOutstandingBytes = new $util.LongBits(object.maxOutstandingBytes.low >>> 0, object.maxOutstandingBytes.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a StreamingPullRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.StreamingPullRequest + * @static + * @param {google.pubsub.v1.StreamingPullRequest} message StreamingPullRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StreamingPullRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.ackIds = []; + object.modifyDeadlineSeconds = []; + object.modifyDeadlineAckIds = []; + } + if (options.defaults) { + object.subscription = ""; + object.streamAckDeadlineSeconds = 0; + object.clientId = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.maxOutstandingMessages = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.maxOutstandingMessages = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.maxOutstandingBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.maxOutstandingBytes = options.longs === String ? "0" : 0; + } + if (message.subscription != null && message.hasOwnProperty("subscription")) + object.subscription = message.subscription; + if (message.ackIds && message.ackIds.length) { + object.ackIds = []; + for (var j = 0; j < message.ackIds.length; ++j) + object.ackIds[j] = message.ackIds[j]; + } + if (message.modifyDeadlineSeconds && message.modifyDeadlineSeconds.length) { + object.modifyDeadlineSeconds = []; + for (var j = 0; j < message.modifyDeadlineSeconds.length; ++j) + object.modifyDeadlineSeconds[j] = message.modifyDeadlineSeconds[j]; + } + if (message.modifyDeadlineAckIds && message.modifyDeadlineAckIds.length) { + object.modifyDeadlineAckIds = []; + for (var j = 0; j < message.modifyDeadlineAckIds.length; ++j) + object.modifyDeadlineAckIds[j] = message.modifyDeadlineAckIds[j]; + } + if (message.streamAckDeadlineSeconds != null && message.hasOwnProperty("streamAckDeadlineSeconds")) + object.streamAckDeadlineSeconds = message.streamAckDeadlineSeconds; + if (message.clientId != null && message.hasOwnProperty("clientId")) + object.clientId = message.clientId; + if (message.maxOutstandingMessages != null && message.hasOwnProperty("maxOutstandingMessages")) + if (typeof message.maxOutstandingMessages === "number") + object.maxOutstandingMessages = options.longs === String ? String(message.maxOutstandingMessages) : message.maxOutstandingMessages; + else + object.maxOutstandingMessages = options.longs === String ? $util.Long.prototype.toString.call(message.maxOutstandingMessages) : options.longs === Number ? new $util.LongBits(message.maxOutstandingMessages.low >>> 0, message.maxOutstandingMessages.high >>> 0).toNumber() : message.maxOutstandingMessages; + if (message.maxOutstandingBytes != null && message.hasOwnProperty("maxOutstandingBytes")) + if (typeof message.maxOutstandingBytes === "number") + object.maxOutstandingBytes = options.longs === String ? String(message.maxOutstandingBytes) : message.maxOutstandingBytes; + else + object.maxOutstandingBytes = options.longs === String ? $util.Long.prototype.toString.call(message.maxOutstandingBytes) : options.longs === Number ? new $util.LongBits(message.maxOutstandingBytes.low >>> 0, message.maxOutstandingBytes.high >>> 0).toNumber() : message.maxOutstandingBytes; + return object; + }; + + /** + * Converts this StreamingPullRequest to JSON. + * @function toJSON + * @memberof google.pubsub.v1.StreamingPullRequest + * @instance + * @returns {Object.} JSON object + */ + StreamingPullRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StreamingPullRequest + * @function getTypeUrl + * @memberof google.pubsub.v1.StreamingPullRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StreamingPullRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.StreamingPullRequest"; + }; + + return StreamingPullRequest; + })(); + + v1.StreamingPullResponse = (function() { + + /** + * Properties of a StreamingPullResponse. + * @memberof google.pubsub.v1 + * @interface IStreamingPullResponse + * @property {Array.|null} [receivedMessages] StreamingPullResponse receivedMessages + * @property {google.pubsub.v1.StreamingPullResponse.IAcknowledgeConfirmation|null} [acknowledgeConfirmation] StreamingPullResponse acknowledgeConfirmation + * @property {google.pubsub.v1.StreamingPullResponse.IModifyAckDeadlineConfirmation|null} [modifyAckDeadlineConfirmation] StreamingPullResponse modifyAckDeadlineConfirmation + * @property {google.pubsub.v1.StreamingPullResponse.ISubscriptionProperties|null} [subscriptionProperties] StreamingPullResponse subscriptionProperties + */ + + /** + * Constructs a new StreamingPullResponse. + * @memberof google.pubsub.v1 + * @classdesc Represents a StreamingPullResponse. + * @implements IStreamingPullResponse + * @constructor + * @param {google.pubsub.v1.IStreamingPullResponse=} [properties] Properties to set + */ + function StreamingPullResponse(properties) { + this.receivedMessages = []; + 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]]; + } + + /** + * StreamingPullResponse receivedMessages. + * @member {Array.} receivedMessages + * @memberof google.pubsub.v1.StreamingPullResponse + * @instance + */ + StreamingPullResponse.prototype.receivedMessages = $util.emptyArray; + + /** + * StreamingPullResponse acknowledgeConfirmation. + * @member {google.pubsub.v1.StreamingPullResponse.IAcknowledgeConfirmation|null|undefined} acknowledgeConfirmation + * @memberof google.pubsub.v1.StreamingPullResponse + * @instance + */ + StreamingPullResponse.prototype.acknowledgeConfirmation = null; + + /** + * StreamingPullResponse modifyAckDeadlineConfirmation. + * @member {google.pubsub.v1.StreamingPullResponse.IModifyAckDeadlineConfirmation|null|undefined} modifyAckDeadlineConfirmation + * @memberof google.pubsub.v1.StreamingPullResponse + * @instance + */ + StreamingPullResponse.prototype.modifyAckDeadlineConfirmation = null; + + /** + * StreamingPullResponse subscriptionProperties. + * @member {google.pubsub.v1.StreamingPullResponse.ISubscriptionProperties|null|undefined} subscriptionProperties + * @memberof google.pubsub.v1.StreamingPullResponse + * @instance + */ + StreamingPullResponse.prototype.subscriptionProperties = null; + + /** + * Creates a new StreamingPullResponse instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.StreamingPullResponse + * @static + * @param {google.pubsub.v1.IStreamingPullResponse=} [properties] Properties to set + * @returns {google.pubsub.v1.StreamingPullResponse} StreamingPullResponse instance + */ + StreamingPullResponse.create = function create(properties) { + return new StreamingPullResponse(properties); + }; + + /** + * Encodes the specified StreamingPullResponse message. Does not implicitly {@link google.pubsub.v1.StreamingPullResponse.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.StreamingPullResponse + * @static + * @param {google.pubsub.v1.IStreamingPullResponse} message StreamingPullResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingPullResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.receivedMessages != null && message.receivedMessages.length) + for (var i = 0; i < message.receivedMessages.length; ++i) + $root.google.pubsub.v1.ReceivedMessage.encode(message.receivedMessages[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.modifyAckDeadlineConfirmation != null && Object.hasOwnProperty.call(message, "modifyAckDeadlineConfirmation")) + $root.google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation.encode(message.modifyAckDeadlineConfirmation, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.subscriptionProperties != null && Object.hasOwnProperty.call(message, "subscriptionProperties")) + $root.google.pubsub.v1.StreamingPullResponse.SubscriptionProperties.encode(message.subscriptionProperties, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.acknowledgeConfirmation != null && Object.hasOwnProperty.call(message, "acknowledgeConfirmation")) + $root.google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation.encode(message.acknowledgeConfirmation, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified StreamingPullResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.StreamingPullResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.StreamingPullResponse + * @static + * @param {google.pubsub.v1.IStreamingPullResponse} message StreamingPullResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingPullResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StreamingPullResponse message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.StreamingPullResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.StreamingPullResponse} StreamingPullResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingPullResponse.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.pubsub.v1.StreamingPullResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.receivedMessages && message.receivedMessages.length)) + message.receivedMessages = []; + message.receivedMessages.push($root.google.pubsub.v1.ReceivedMessage.decode(reader, reader.uint32())); + break; + } + case 5: { + message.acknowledgeConfirmation = $root.google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation.decode(reader, reader.uint32()); + break; + } + case 3: { + message.modifyAckDeadlineConfirmation = $root.google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation.decode(reader, reader.uint32()); + break; + } + case 4: { + message.subscriptionProperties = $root.google.pubsub.v1.StreamingPullResponse.SubscriptionProperties.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StreamingPullResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.StreamingPullResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.StreamingPullResponse} StreamingPullResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingPullResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StreamingPullResponse message. + * @function verify + * @memberof google.pubsub.v1.StreamingPullResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StreamingPullResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.receivedMessages != null && message.hasOwnProperty("receivedMessages")) { + if (!Array.isArray(message.receivedMessages)) + return "receivedMessages: array expected"; + for (var i = 0; i < message.receivedMessages.length; ++i) { + var error = $root.google.pubsub.v1.ReceivedMessage.verify(message.receivedMessages[i]); + if (error) + return "receivedMessages." + error; + } + } + if (message.acknowledgeConfirmation != null && message.hasOwnProperty("acknowledgeConfirmation")) { + var error = $root.google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation.verify(message.acknowledgeConfirmation); + if (error) + return "acknowledgeConfirmation." + error; + } + if (message.modifyAckDeadlineConfirmation != null && message.hasOwnProperty("modifyAckDeadlineConfirmation")) { + var error = $root.google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation.verify(message.modifyAckDeadlineConfirmation); + if (error) + return "modifyAckDeadlineConfirmation." + error; + } + if (message.subscriptionProperties != null && message.hasOwnProperty("subscriptionProperties")) { + var error = $root.google.pubsub.v1.StreamingPullResponse.SubscriptionProperties.verify(message.subscriptionProperties); + if (error) + return "subscriptionProperties." + error; + } + return null; + }; + + /** + * Creates a StreamingPullResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.StreamingPullResponse + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.StreamingPullResponse} StreamingPullResponse + */ + StreamingPullResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.StreamingPullResponse) + return object; + var message = new $root.google.pubsub.v1.StreamingPullResponse(); + if (object.receivedMessages) { + if (!Array.isArray(object.receivedMessages)) + throw TypeError(".google.pubsub.v1.StreamingPullResponse.receivedMessages: array expected"); + message.receivedMessages = []; + for (var i = 0; i < object.receivedMessages.length; ++i) { + if (typeof object.receivedMessages[i] !== "object") + throw TypeError(".google.pubsub.v1.StreamingPullResponse.receivedMessages: object expected"); + message.receivedMessages[i] = $root.google.pubsub.v1.ReceivedMessage.fromObject(object.receivedMessages[i]); + } + } + if (object.acknowledgeConfirmation != null) { + if (typeof object.acknowledgeConfirmation !== "object") + throw TypeError(".google.pubsub.v1.StreamingPullResponse.acknowledgeConfirmation: object expected"); + message.acknowledgeConfirmation = $root.google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation.fromObject(object.acknowledgeConfirmation); + } + if (object.modifyAckDeadlineConfirmation != null) { + if (typeof object.modifyAckDeadlineConfirmation !== "object") + throw TypeError(".google.pubsub.v1.StreamingPullResponse.modifyAckDeadlineConfirmation: object expected"); + message.modifyAckDeadlineConfirmation = $root.google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation.fromObject(object.modifyAckDeadlineConfirmation); + } + if (object.subscriptionProperties != null) { + if (typeof object.subscriptionProperties !== "object") + throw TypeError(".google.pubsub.v1.StreamingPullResponse.subscriptionProperties: object expected"); + message.subscriptionProperties = $root.google.pubsub.v1.StreamingPullResponse.SubscriptionProperties.fromObject(object.subscriptionProperties); + } + return message; + }; + + /** + * Creates a plain object from a StreamingPullResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.StreamingPullResponse + * @static + * @param {google.pubsub.v1.StreamingPullResponse} message StreamingPullResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StreamingPullResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.receivedMessages = []; + if (options.defaults) { + object.modifyAckDeadlineConfirmation = null; + object.subscriptionProperties = null; + object.acknowledgeConfirmation = null; + } + if (message.receivedMessages && message.receivedMessages.length) { + object.receivedMessages = []; + for (var j = 0; j < message.receivedMessages.length; ++j) + object.receivedMessages[j] = $root.google.pubsub.v1.ReceivedMessage.toObject(message.receivedMessages[j], options); + } + if (message.modifyAckDeadlineConfirmation != null && message.hasOwnProperty("modifyAckDeadlineConfirmation")) + object.modifyAckDeadlineConfirmation = $root.google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation.toObject(message.modifyAckDeadlineConfirmation, options); + if (message.subscriptionProperties != null && message.hasOwnProperty("subscriptionProperties")) + object.subscriptionProperties = $root.google.pubsub.v1.StreamingPullResponse.SubscriptionProperties.toObject(message.subscriptionProperties, options); + if (message.acknowledgeConfirmation != null && message.hasOwnProperty("acknowledgeConfirmation")) + object.acknowledgeConfirmation = $root.google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation.toObject(message.acknowledgeConfirmation, options); + return object; + }; + + /** + * Converts this StreamingPullResponse to JSON. + * @function toJSON + * @memberof google.pubsub.v1.StreamingPullResponse + * @instance + * @returns {Object.} JSON object + */ + StreamingPullResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StreamingPullResponse + * @function getTypeUrl + * @memberof google.pubsub.v1.StreamingPullResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StreamingPullResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.StreamingPullResponse"; + }; + + StreamingPullResponse.AcknowledgeConfirmation = (function() { + + /** + * Properties of an AcknowledgeConfirmation. + * @memberof google.pubsub.v1.StreamingPullResponse + * @interface IAcknowledgeConfirmation + * @property {Array.|null} [ackIds] AcknowledgeConfirmation ackIds + * @property {Array.|null} [invalidAckIds] AcknowledgeConfirmation invalidAckIds + * @property {Array.|null} [unorderedAckIds] AcknowledgeConfirmation unorderedAckIds + * @property {Array.|null} [temporaryFailedAckIds] AcknowledgeConfirmation temporaryFailedAckIds + */ + + /** + * Constructs a new AcknowledgeConfirmation. + * @memberof google.pubsub.v1.StreamingPullResponse + * @classdesc Represents an AcknowledgeConfirmation. + * @implements IAcknowledgeConfirmation + * @constructor + * @param {google.pubsub.v1.StreamingPullResponse.IAcknowledgeConfirmation=} [properties] Properties to set + */ + function AcknowledgeConfirmation(properties) { + this.ackIds = []; + this.invalidAckIds = []; + this.unorderedAckIds = []; + this.temporaryFailedAckIds = []; + 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]]; + } + + /** + * AcknowledgeConfirmation ackIds. + * @member {Array.} ackIds + * @memberof google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation + * @instance + */ + AcknowledgeConfirmation.prototype.ackIds = $util.emptyArray; + + /** + * AcknowledgeConfirmation invalidAckIds. + * @member {Array.} invalidAckIds + * @memberof google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation + * @instance + */ + AcknowledgeConfirmation.prototype.invalidAckIds = $util.emptyArray; + + /** + * AcknowledgeConfirmation unorderedAckIds. + * @member {Array.} unorderedAckIds + * @memberof google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation + * @instance + */ + AcknowledgeConfirmation.prototype.unorderedAckIds = $util.emptyArray; + + /** + * AcknowledgeConfirmation temporaryFailedAckIds. + * @member {Array.} temporaryFailedAckIds + * @memberof google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation + * @instance + */ + AcknowledgeConfirmation.prototype.temporaryFailedAckIds = $util.emptyArray; + + /** + * Creates a new AcknowledgeConfirmation instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation + * @static + * @param {google.pubsub.v1.StreamingPullResponse.IAcknowledgeConfirmation=} [properties] Properties to set + * @returns {google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation} AcknowledgeConfirmation instance + */ + AcknowledgeConfirmation.create = function create(properties) { + return new AcknowledgeConfirmation(properties); + }; + + /** + * Encodes the specified AcknowledgeConfirmation message. Does not implicitly {@link google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation + * @static + * @param {google.pubsub.v1.StreamingPullResponse.IAcknowledgeConfirmation} message AcknowledgeConfirmation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AcknowledgeConfirmation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ackIds != null && message.ackIds.length) + for (var i = 0; i < message.ackIds.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.ackIds[i]); + if (message.invalidAckIds != null && message.invalidAckIds.length) + for (var i = 0; i < message.invalidAckIds.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.invalidAckIds[i]); + if (message.unorderedAckIds != null && message.unorderedAckIds.length) + for (var i = 0; i < message.unorderedAckIds.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unorderedAckIds[i]); + if (message.temporaryFailedAckIds != null && message.temporaryFailedAckIds.length) + for (var i = 0; i < message.temporaryFailedAckIds.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.temporaryFailedAckIds[i]); + return writer; + }; + + /** + * Encodes the specified AcknowledgeConfirmation message, length delimited. Does not implicitly {@link google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation + * @static + * @param {google.pubsub.v1.StreamingPullResponse.IAcknowledgeConfirmation} message AcknowledgeConfirmation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AcknowledgeConfirmation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AcknowledgeConfirmation message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation} AcknowledgeConfirmation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AcknowledgeConfirmation.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.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.ackIds && message.ackIds.length)) + message.ackIds = []; + message.ackIds.push(reader.string()); + break; + } + case 2: { + if (!(message.invalidAckIds && message.invalidAckIds.length)) + message.invalidAckIds = []; + message.invalidAckIds.push(reader.string()); + break; + } + case 3: { + if (!(message.unorderedAckIds && message.unorderedAckIds.length)) + message.unorderedAckIds = []; + message.unorderedAckIds.push(reader.string()); + break; + } + case 4: { + if (!(message.temporaryFailedAckIds && message.temporaryFailedAckIds.length)) + message.temporaryFailedAckIds = []; + message.temporaryFailedAckIds.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AcknowledgeConfirmation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation} AcknowledgeConfirmation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AcknowledgeConfirmation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AcknowledgeConfirmation message. + * @function verify + * @memberof google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AcknowledgeConfirmation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ackIds != null && message.hasOwnProperty("ackIds")) { + if (!Array.isArray(message.ackIds)) + return "ackIds: array expected"; + for (var i = 0; i < message.ackIds.length; ++i) + if (!$util.isString(message.ackIds[i])) + return "ackIds: string[] expected"; + } + if (message.invalidAckIds != null && message.hasOwnProperty("invalidAckIds")) { + if (!Array.isArray(message.invalidAckIds)) + return "invalidAckIds: array expected"; + for (var i = 0; i < message.invalidAckIds.length; ++i) + if (!$util.isString(message.invalidAckIds[i])) + return "invalidAckIds: string[] expected"; + } + if (message.unorderedAckIds != null && message.hasOwnProperty("unorderedAckIds")) { + if (!Array.isArray(message.unorderedAckIds)) + return "unorderedAckIds: array expected"; + for (var i = 0; i < message.unorderedAckIds.length; ++i) + if (!$util.isString(message.unorderedAckIds[i])) + return "unorderedAckIds: string[] expected"; + } + if (message.temporaryFailedAckIds != null && message.hasOwnProperty("temporaryFailedAckIds")) { + if (!Array.isArray(message.temporaryFailedAckIds)) + return "temporaryFailedAckIds: array expected"; + for (var i = 0; i < message.temporaryFailedAckIds.length; ++i) + if (!$util.isString(message.temporaryFailedAckIds[i])) + return "temporaryFailedAckIds: string[] expected"; + } + return null; + }; + + /** + * Creates an AcknowledgeConfirmation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation} AcknowledgeConfirmation + */ + AcknowledgeConfirmation.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation) + return object; + var message = new $root.google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation(); + if (object.ackIds) { + if (!Array.isArray(object.ackIds)) + throw TypeError(".google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation.ackIds: array expected"); + message.ackIds = []; + for (var i = 0; i < object.ackIds.length; ++i) + message.ackIds[i] = String(object.ackIds[i]); + } + if (object.invalidAckIds) { + if (!Array.isArray(object.invalidAckIds)) + throw TypeError(".google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation.invalidAckIds: array expected"); + message.invalidAckIds = []; + for (var i = 0; i < object.invalidAckIds.length; ++i) + message.invalidAckIds[i] = String(object.invalidAckIds[i]); + } + if (object.unorderedAckIds) { + if (!Array.isArray(object.unorderedAckIds)) + throw TypeError(".google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation.unorderedAckIds: array expected"); + message.unorderedAckIds = []; + for (var i = 0; i < object.unorderedAckIds.length; ++i) + message.unorderedAckIds[i] = String(object.unorderedAckIds[i]); + } + if (object.temporaryFailedAckIds) { + if (!Array.isArray(object.temporaryFailedAckIds)) + throw TypeError(".google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation.temporaryFailedAckIds: array expected"); + message.temporaryFailedAckIds = []; + for (var i = 0; i < object.temporaryFailedAckIds.length; ++i) + message.temporaryFailedAckIds[i] = String(object.temporaryFailedAckIds[i]); + } + return message; + }; + + /** + * Creates a plain object from an AcknowledgeConfirmation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation + * @static + * @param {google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation} message AcknowledgeConfirmation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AcknowledgeConfirmation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.ackIds = []; + object.invalidAckIds = []; + object.unorderedAckIds = []; + object.temporaryFailedAckIds = []; + } + if (message.ackIds && message.ackIds.length) { + object.ackIds = []; + for (var j = 0; j < message.ackIds.length; ++j) + object.ackIds[j] = message.ackIds[j]; + } + if (message.invalidAckIds && message.invalidAckIds.length) { + object.invalidAckIds = []; + for (var j = 0; j < message.invalidAckIds.length; ++j) + object.invalidAckIds[j] = message.invalidAckIds[j]; + } + if (message.unorderedAckIds && message.unorderedAckIds.length) { + object.unorderedAckIds = []; + for (var j = 0; j < message.unorderedAckIds.length; ++j) + object.unorderedAckIds[j] = message.unorderedAckIds[j]; + } + if (message.temporaryFailedAckIds && message.temporaryFailedAckIds.length) { + object.temporaryFailedAckIds = []; + for (var j = 0; j < message.temporaryFailedAckIds.length; ++j) + object.temporaryFailedAckIds[j] = message.temporaryFailedAckIds[j]; + } + return object; + }; + + /** + * Converts this AcknowledgeConfirmation to JSON. + * @function toJSON + * @memberof google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation + * @instance + * @returns {Object.} JSON object + */ + AcknowledgeConfirmation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AcknowledgeConfirmation + * @function getTypeUrl + * @memberof google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AcknowledgeConfirmation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation"; + }; + + return AcknowledgeConfirmation; + })(); + + StreamingPullResponse.ModifyAckDeadlineConfirmation = (function() { + + /** + * Properties of a ModifyAckDeadlineConfirmation. + * @memberof google.pubsub.v1.StreamingPullResponse + * @interface IModifyAckDeadlineConfirmation + * @property {Array.|null} [ackIds] ModifyAckDeadlineConfirmation ackIds + * @property {Array.|null} [invalidAckIds] ModifyAckDeadlineConfirmation invalidAckIds + * @property {Array.|null} [temporaryFailedAckIds] ModifyAckDeadlineConfirmation temporaryFailedAckIds + */ + + /** + * Constructs a new ModifyAckDeadlineConfirmation. + * @memberof google.pubsub.v1.StreamingPullResponse + * @classdesc Represents a ModifyAckDeadlineConfirmation. + * @implements IModifyAckDeadlineConfirmation + * @constructor + * @param {google.pubsub.v1.StreamingPullResponse.IModifyAckDeadlineConfirmation=} [properties] Properties to set + */ + function ModifyAckDeadlineConfirmation(properties) { + this.ackIds = []; + this.invalidAckIds = []; + this.temporaryFailedAckIds = []; + 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]]; + } + + /** + * ModifyAckDeadlineConfirmation ackIds. + * @member {Array.} ackIds + * @memberof google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation + * @instance + */ + ModifyAckDeadlineConfirmation.prototype.ackIds = $util.emptyArray; + + /** + * ModifyAckDeadlineConfirmation invalidAckIds. + * @member {Array.} invalidAckIds + * @memberof google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation + * @instance + */ + ModifyAckDeadlineConfirmation.prototype.invalidAckIds = $util.emptyArray; + + /** + * ModifyAckDeadlineConfirmation temporaryFailedAckIds. + * @member {Array.} temporaryFailedAckIds + * @memberof google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation + * @instance + */ + ModifyAckDeadlineConfirmation.prototype.temporaryFailedAckIds = $util.emptyArray; + + /** + * Creates a new ModifyAckDeadlineConfirmation instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation + * @static + * @param {google.pubsub.v1.StreamingPullResponse.IModifyAckDeadlineConfirmation=} [properties] Properties to set + * @returns {google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation} ModifyAckDeadlineConfirmation instance + */ + ModifyAckDeadlineConfirmation.create = function create(properties) { + return new ModifyAckDeadlineConfirmation(properties); + }; + + /** + * Encodes the specified ModifyAckDeadlineConfirmation message. Does not implicitly {@link google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation + * @static + * @param {google.pubsub.v1.StreamingPullResponse.IModifyAckDeadlineConfirmation} message ModifyAckDeadlineConfirmation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ModifyAckDeadlineConfirmation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ackIds != null && message.ackIds.length) + for (var i = 0; i < message.ackIds.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.ackIds[i]); + if (message.invalidAckIds != null && message.invalidAckIds.length) + for (var i = 0; i < message.invalidAckIds.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.invalidAckIds[i]); + if (message.temporaryFailedAckIds != null && message.temporaryFailedAckIds.length) + for (var i = 0; i < message.temporaryFailedAckIds.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.temporaryFailedAckIds[i]); + return writer; + }; + + /** + * Encodes the specified ModifyAckDeadlineConfirmation message, length delimited. Does not implicitly {@link google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation + * @static + * @param {google.pubsub.v1.StreamingPullResponse.IModifyAckDeadlineConfirmation} message ModifyAckDeadlineConfirmation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ModifyAckDeadlineConfirmation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ModifyAckDeadlineConfirmation message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation} ModifyAckDeadlineConfirmation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ModifyAckDeadlineConfirmation.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.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.ackIds && message.ackIds.length)) + message.ackIds = []; + message.ackIds.push(reader.string()); + break; + } + case 2: { + if (!(message.invalidAckIds && message.invalidAckIds.length)) + message.invalidAckIds = []; + message.invalidAckIds.push(reader.string()); + break; + } + case 3: { + if (!(message.temporaryFailedAckIds && message.temporaryFailedAckIds.length)) + message.temporaryFailedAckIds = []; + message.temporaryFailedAckIds.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ModifyAckDeadlineConfirmation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation} ModifyAckDeadlineConfirmation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ModifyAckDeadlineConfirmation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ModifyAckDeadlineConfirmation message. + * @function verify + * @memberof google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ModifyAckDeadlineConfirmation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ackIds != null && message.hasOwnProperty("ackIds")) { + if (!Array.isArray(message.ackIds)) + return "ackIds: array expected"; + for (var i = 0; i < message.ackIds.length; ++i) + if (!$util.isString(message.ackIds[i])) + return "ackIds: string[] expected"; + } + if (message.invalidAckIds != null && message.hasOwnProperty("invalidAckIds")) { + if (!Array.isArray(message.invalidAckIds)) + return "invalidAckIds: array expected"; + for (var i = 0; i < message.invalidAckIds.length; ++i) + if (!$util.isString(message.invalidAckIds[i])) + return "invalidAckIds: string[] expected"; + } + if (message.temporaryFailedAckIds != null && message.hasOwnProperty("temporaryFailedAckIds")) { + if (!Array.isArray(message.temporaryFailedAckIds)) + return "temporaryFailedAckIds: array expected"; + for (var i = 0; i < message.temporaryFailedAckIds.length; ++i) + if (!$util.isString(message.temporaryFailedAckIds[i])) + return "temporaryFailedAckIds: string[] expected"; + } + return null; + }; + + /** + * Creates a ModifyAckDeadlineConfirmation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation} ModifyAckDeadlineConfirmation + */ + ModifyAckDeadlineConfirmation.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation) + return object; + var message = new $root.google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation(); + if (object.ackIds) { + if (!Array.isArray(object.ackIds)) + throw TypeError(".google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation.ackIds: array expected"); + message.ackIds = []; + for (var i = 0; i < object.ackIds.length; ++i) + message.ackIds[i] = String(object.ackIds[i]); + } + if (object.invalidAckIds) { + if (!Array.isArray(object.invalidAckIds)) + throw TypeError(".google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation.invalidAckIds: array expected"); + message.invalidAckIds = []; + for (var i = 0; i < object.invalidAckIds.length; ++i) + message.invalidAckIds[i] = String(object.invalidAckIds[i]); + } + if (object.temporaryFailedAckIds) { + if (!Array.isArray(object.temporaryFailedAckIds)) + throw TypeError(".google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation.temporaryFailedAckIds: array expected"); + message.temporaryFailedAckIds = []; + for (var i = 0; i < object.temporaryFailedAckIds.length; ++i) + message.temporaryFailedAckIds[i] = String(object.temporaryFailedAckIds[i]); + } + return message; + }; + + /** + * Creates a plain object from a ModifyAckDeadlineConfirmation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation + * @static + * @param {google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation} message ModifyAckDeadlineConfirmation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ModifyAckDeadlineConfirmation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.ackIds = []; + object.invalidAckIds = []; + object.temporaryFailedAckIds = []; + } + if (message.ackIds && message.ackIds.length) { + object.ackIds = []; + for (var j = 0; j < message.ackIds.length; ++j) + object.ackIds[j] = message.ackIds[j]; + } + if (message.invalidAckIds && message.invalidAckIds.length) { + object.invalidAckIds = []; + for (var j = 0; j < message.invalidAckIds.length; ++j) + object.invalidAckIds[j] = message.invalidAckIds[j]; + } + if (message.temporaryFailedAckIds && message.temporaryFailedAckIds.length) { + object.temporaryFailedAckIds = []; + for (var j = 0; j < message.temporaryFailedAckIds.length; ++j) + object.temporaryFailedAckIds[j] = message.temporaryFailedAckIds[j]; + } + return object; + }; + + /** + * Converts this ModifyAckDeadlineConfirmation to JSON. + * @function toJSON + * @memberof google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation + * @instance + * @returns {Object.} JSON object + */ + ModifyAckDeadlineConfirmation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ModifyAckDeadlineConfirmation + * @function getTypeUrl + * @memberof google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ModifyAckDeadlineConfirmation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation"; + }; + + return ModifyAckDeadlineConfirmation; + })(); + + StreamingPullResponse.SubscriptionProperties = (function() { + + /** + * Properties of a SubscriptionProperties. + * @memberof google.pubsub.v1.StreamingPullResponse + * @interface ISubscriptionProperties + * @property {boolean|null} [exactlyOnceDeliveryEnabled] SubscriptionProperties exactlyOnceDeliveryEnabled + * @property {boolean|null} [messageOrderingEnabled] SubscriptionProperties messageOrderingEnabled + */ + + /** + * Constructs a new SubscriptionProperties. + * @memberof google.pubsub.v1.StreamingPullResponse + * @classdesc Represents a SubscriptionProperties. + * @implements ISubscriptionProperties + * @constructor + * @param {google.pubsub.v1.StreamingPullResponse.ISubscriptionProperties=} [properties] Properties to set + */ + function SubscriptionProperties(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]]; + } + + /** + * SubscriptionProperties exactlyOnceDeliveryEnabled. + * @member {boolean} exactlyOnceDeliveryEnabled + * @memberof google.pubsub.v1.StreamingPullResponse.SubscriptionProperties + * @instance + */ + SubscriptionProperties.prototype.exactlyOnceDeliveryEnabled = false; + + /** + * SubscriptionProperties messageOrderingEnabled. + * @member {boolean} messageOrderingEnabled + * @memberof google.pubsub.v1.StreamingPullResponse.SubscriptionProperties + * @instance + */ + SubscriptionProperties.prototype.messageOrderingEnabled = false; + + /** + * Creates a new SubscriptionProperties instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.StreamingPullResponse.SubscriptionProperties + * @static + * @param {google.pubsub.v1.StreamingPullResponse.ISubscriptionProperties=} [properties] Properties to set + * @returns {google.pubsub.v1.StreamingPullResponse.SubscriptionProperties} SubscriptionProperties instance + */ + SubscriptionProperties.create = function create(properties) { + return new SubscriptionProperties(properties); + }; + + /** + * Encodes the specified SubscriptionProperties message. Does not implicitly {@link google.pubsub.v1.StreamingPullResponse.SubscriptionProperties.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.StreamingPullResponse.SubscriptionProperties + * @static + * @param {google.pubsub.v1.StreamingPullResponse.ISubscriptionProperties} message SubscriptionProperties message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SubscriptionProperties.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.exactlyOnceDeliveryEnabled != null && Object.hasOwnProperty.call(message, "exactlyOnceDeliveryEnabled")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.exactlyOnceDeliveryEnabled); + if (message.messageOrderingEnabled != null && Object.hasOwnProperty.call(message, "messageOrderingEnabled")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.messageOrderingEnabled); + return writer; + }; + + /** + * Encodes the specified SubscriptionProperties message, length delimited. Does not implicitly {@link google.pubsub.v1.StreamingPullResponse.SubscriptionProperties.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.StreamingPullResponse.SubscriptionProperties + * @static + * @param {google.pubsub.v1.StreamingPullResponse.ISubscriptionProperties} message SubscriptionProperties message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SubscriptionProperties.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SubscriptionProperties message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.StreamingPullResponse.SubscriptionProperties + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.StreamingPullResponse.SubscriptionProperties} SubscriptionProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SubscriptionProperties.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.pubsub.v1.StreamingPullResponse.SubscriptionProperties(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.exactlyOnceDeliveryEnabled = reader.bool(); + break; + } + case 2: { + message.messageOrderingEnabled = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SubscriptionProperties message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.StreamingPullResponse.SubscriptionProperties + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.StreamingPullResponse.SubscriptionProperties} SubscriptionProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SubscriptionProperties.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SubscriptionProperties message. + * @function verify + * @memberof google.pubsub.v1.StreamingPullResponse.SubscriptionProperties + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SubscriptionProperties.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.exactlyOnceDeliveryEnabled != null && message.hasOwnProperty("exactlyOnceDeliveryEnabled")) + if (typeof message.exactlyOnceDeliveryEnabled !== "boolean") + return "exactlyOnceDeliveryEnabled: boolean expected"; + if (message.messageOrderingEnabled != null && message.hasOwnProperty("messageOrderingEnabled")) + if (typeof message.messageOrderingEnabled !== "boolean") + return "messageOrderingEnabled: boolean expected"; + return null; + }; + + /** + * Creates a SubscriptionProperties message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.StreamingPullResponse.SubscriptionProperties + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.StreamingPullResponse.SubscriptionProperties} SubscriptionProperties + */ + SubscriptionProperties.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.StreamingPullResponse.SubscriptionProperties) + return object; + var message = new $root.google.pubsub.v1.StreamingPullResponse.SubscriptionProperties(); + if (object.exactlyOnceDeliveryEnabled != null) + message.exactlyOnceDeliveryEnabled = Boolean(object.exactlyOnceDeliveryEnabled); + if (object.messageOrderingEnabled != null) + message.messageOrderingEnabled = Boolean(object.messageOrderingEnabled); + return message; + }; + + /** + * Creates a plain object from a SubscriptionProperties message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.StreamingPullResponse.SubscriptionProperties + * @static + * @param {google.pubsub.v1.StreamingPullResponse.SubscriptionProperties} message SubscriptionProperties + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SubscriptionProperties.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.exactlyOnceDeliveryEnabled = false; + object.messageOrderingEnabled = false; + } + if (message.exactlyOnceDeliveryEnabled != null && message.hasOwnProperty("exactlyOnceDeliveryEnabled")) + object.exactlyOnceDeliveryEnabled = message.exactlyOnceDeliveryEnabled; + if (message.messageOrderingEnabled != null && message.hasOwnProperty("messageOrderingEnabled")) + object.messageOrderingEnabled = message.messageOrderingEnabled; + return object; + }; + + /** + * Converts this SubscriptionProperties to JSON. + * @function toJSON + * @memberof google.pubsub.v1.StreamingPullResponse.SubscriptionProperties + * @instance + * @returns {Object.} JSON object + */ + SubscriptionProperties.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SubscriptionProperties + * @function getTypeUrl + * @memberof google.pubsub.v1.StreamingPullResponse.SubscriptionProperties + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SubscriptionProperties.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.StreamingPullResponse.SubscriptionProperties"; + }; + + return SubscriptionProperties; + })(); + + return StreamingPullResponse; + })(); + + v1.CreateSnapshotRequest = (function() { + + /** + * Properties of a CreateSnapshotRequest. + * @memberof google.pubsub.v1 + * @interface ICreateSnapshotRequest + * @property {string|null} [name] CreateSnapshotRequest name + * @property {string|null} [subscription] CreateSnapshotRequest subscription + * @property {Object.|null} [labels] CreateSnapshotRequest labels + */ + + /** + * Constructs a new CreateSnapshotRequest. + * @memberof google.pubsub.v1 + * @classdesc Represents a CreateSnapshotRequest. + * @implements ICreateSnapshotRequest + * @constructor + * @param {google.pubsub.v1.ICreateSnapshotRequest=} [properties] Properties to set + */ + function CreateSnapshotRequest(properties) { + this.labels = {}; + 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]]; + } + + /** + * CreateSnapshotRequest name. + * @member {string} name + * @memberof google.pubsub.v1.CreateSnapshotRequest + * @instance + */ + CreateSnapshotRequest.prototype.name = ""; + + /** + * CreateSnapshotRequest subscription. + * @member {string} subscription + * @memberof google.pubsub.v1.CreateSnapshotRequest + * @instance + */ + CreateSnapshotRequest.prototype.subscription = ""; + + /** + * CreateSnapshotRequest labels. + * @member {Object.} labels + * @memberof google.pubsub.v1.CreateSnapshotRequest + * @instance + */ + CreateSnapshotRequest.prototype.labels = $util.emptyObject; + + /** + * Creates a new CreateSnapshotRequest instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.CreateSnapshotRequest + * @static + * @param {google.pubsub.v1.ICreateSnapshotRequest=} [properties] Properties to set + * @returns {google.pubsub.v1.CreateSnapshotRequest} CreateSnapshotRequest instance + */ + CreateSnapshotRequest.create = function create(properties) { + return new CreateSnapshotRequest(properties); + }; + + /** + * Encodes the specified CreateSnapshotRequest message. Does not implicitly {@link google.pubsub.v1.CreateSnapshotRequest.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.CreateSnapshotRequest + * @static + * @param {google.pubsub.v1.ICreateSnapshotRequest} message CreateSnapshotRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateSnapshotRequest.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.subscription != null && Object.hasOwnProperty.call(message, "subscription")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.subscription); + 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 CreateSnapshotRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.CreateSnapshotRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.CreateSnapshotRequest + * @static + * @param {google.pubsub.v1.ICreateSnapshotRequest} message CreateSnapshotRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateSnapshotRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateSnapshotRequest message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.CreateSnapshotRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.CreateSnapshotRequest} CreateSnapshotRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateSnapshotRequest.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.pubsub.v1.CreateSnapshotRequest(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.subscription = reader.string(); + 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 CreateSnapshotRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.CreateSnapshotRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.CreateSnapshotRequest} CreateSnapshotRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateSnapshotRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateSnapshotRequest message. + * @function verify + * @memberof google.pubsub.v1.CreateSnapshotRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateSnapshotRequest.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.subscription != null && message.hasOwnProperty("subscription")) + if (!$util.isString(message.subscription)) + return "subscription: string 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 CreateSnapshotRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.CreateSnapshotRequest + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.CreateSnapshotRequest} CreateSnapshotRequest + */ + CreateSnapshotRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.CreateSnapshotRequest) + return object; + var message = new $root.google.pubsub.v1.CreateSnapshotRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.subscription != null) + message.subscription = String(object.subscription); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.pubsub.v1.CreateSnapshotRequest.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from a CreateSnapshotRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.CreateSnapshotRequest + * @static + * @param {google.pubsub.v1.CreateSnapshotRequest} message CreateSnapshotRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateSnapshotRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.subscription = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.subscription != null && message.hasOwnProperty("subscription")) + object.subscription = message.subscription; + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + return object; + }; + + /** + * Converts this CreateSnapshotRequest to JSON. + * @function toJSON + * @memberof google.pubsub.v1.CreateSnapshotRequest + * @instance + * @returns {Object.} JSON object + */ + CreateSnapshotRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateSnapshotRequest + * @function getTypeUrl + * @memberof google.pubsub.v1.CreateSnapshotRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateSnapshotRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.CreateSnapshotRequest"; + }; + + return CreateSnapshotRequest; + })(); + + v1.UpdateSnapshotRequest = (function() { + + /** + * Properties of an UpdateSnapshotRequest. + * @memberof google.pubsub.v1 + * @interface IUpdateSnapshotRequest + * @property {google.pubsub.v1.ISnapshot|null} [snapshot] UpdateSnapshotRequest snapshot + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateSnapshotRequest updateMask + */ + + /** + * Constructs a new UpdateSnapshotRequest. + * @memberof google.pubsub.v1 + * @classdesc Represents an UpdateSnapshotRequest. + * @implements IUpdateSnapshotRequest + * @constructor + * @param {google.pubsub.v1.IUpdateSnapshotRequest=} [properties] Properties to set + */ + function UpdateSnapshotRequest(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]]; + } + + /** + * UpdateSnapshotRequest snapshot. + * @member {google.pubsub.v1.ISnapshot|null|undefined} snapshot + * @memberof google.pubsub.v1.UpdateSnapshotRequest + * @instance + */ + UpdateSnapshotRequest.prototype.snapshot = null; + + /** + * UpdateSnapshotRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.pubsub.v1.UpdateSnapshotRequest + * @instance + */ + UpdateSnapshotRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateSnapshotRequest instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.UpdateSnapshotRequest + * @static + * @param {google.pubsub.v1.IUpdateSnapshotRequest=} [properties] Properties to set + * @returns {google.pubsub.v1.UpdateSnapshotRequest} UpdateSnapshotRequest instance + */ + UpdateSnapshotRequest.create = function create(properties) { + return new UpdateSnapshotRequest(properties); + }; + + /** + * Encodes the specified UpdateSnapshotRequest message. Does not implicitly {@link google.pubsub.v1.UpdateSnapshotRequest.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.UpdateSnapshotRequest + * @static + * @param {google.pubsub.v1.IUpdateSnapshotRequest} message UpdateSnapshotRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateSnapshotRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.snapshot != null && Object.hasOwnProperty.call(message, "snapshot")) + $root.google.pubsub.v1.Snapshot.encode(message.snapshot, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateSnapshotRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.UpdateSnapshotRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.UpdateSnapshotRequest + * @static + * @param {google.pubsub.v1.IUpdateSnapshotRequest} message UpdateSnapshotRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateSnapshotRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateSnapshotRequest message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.UpdateSnapshotRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.UpdateSnapshotRequest} UpdateSnapshotRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateSnapshotRequest.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.pubsub.v1.UpdateSnapshotRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.snapshot = $root.google.pubsub.v1.Snapshot.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateSnapshotRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.UpdateSnapshotRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.UpdateSnapshotRequest} UpdateSnapshotRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateSnapshotRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateSnapshotRequest message. + * @function verify + * @memberof google.pubsub.v1.UpdateSnapshotRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateSnapshotRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.snapshot != null && message.hasOwnProperty("snapshot")) { + var error = $root.google.pubsub.v1.Snapshot.verify(message.snapshot); + if (error) + return "snapshot." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateSnapshotRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.UpdateSnapshotRequest + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.UpdateSnapshotRequest} UpdateSnapshotRequest + */ + UpdateSnapshotRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.UpdateSnapshotRequest) + return object; + var message = new $root.google.pubsub.v1.UpdateSnapshotRequest(); + if (object.snapshot != null) { + if (typeof object.snapshot !== "object") + throw TypeError(".google.pubsub.v1.UpdateSnapshotRequest.snapshot: object expected"); + message.snapshot = $root.google.pubsub.v1.Snapshot.fromObject(object.snapshot); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.pubsub.v1.UpdateSnapshotRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateSnapshotRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.UpdateSnapshotRequest + * @static + * @param {google.pubsub.v1.UpdateSnapshotRequest} message UpdateSnapshotRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateSnapshotRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.snapshot = null; + object.updateMask = null; + } + if (message.snapshot != null && message.hasOwnProperty("snapshot")) + object.snapshot = $root.google.pubsub.v1.Snapshot.toObject(message.snapshot, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateSnapshotRequest to JSON. + * @function toJSON + * @memberof google.pubsub.v1.UpdateSnapshotRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateSnapshotRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateSnapshotRequest + * @function getTypeUrl + * @memberof google.pubsub.v1.UpdateSnapshotRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateSnapshotRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.UpdateSnapshotRequest"; + }; + + return UpdateSnapshotRequest; + })(); + + v1.Snapshot = (function() { + + /** + * Properties of a Snapshot. + * @memberof google.pubsub.v1 + * @interface ISnapshot + * @property {string|null} [name] Snapshot name + * @property {string|null} [topic] Snapshot topic + * @property {google.protobuf.ITimestamp|null} [expireTime] Snapshot expireTime + * @property {Object.|null} [labels] Snapshot labels + */ + + /** + * Constructs a new Snapshot. + * @memberof google.pubsub.v1 + * @classdesc Represents a Snapshot. + * @implements ISnapshot + * @constructor + * @param {google.pubsub.v1.ISnapshot=} [properties] Properties to set + */ + function Snapshot(properties) { + this.labels = {}; + 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]]; + } + + /** + * Snapshot name. + * @member {string} name + * @memberof google.pubsub.v1.Snapshot + * @instance + */ + Snapshot.prototype.name = ""; + + /** + * Snapshot topic. + * @member {string} topic + * @memberof google.pubsub.v1.Snapshot + * @instance + */ + Snapshot.prototype.topic = ""; + + /** + * Snapshot expireTime. + * @member {google.protobuf.ITimestamp|null|undefined} expireTime + * @memberof google.pubsub.v1.Snapshot + * @instance + */ + Snapshot.prototype.expireTime = null; + + /** + * Snapshot labels. + * @member {Object.} labels + * @memberof google.pubsub.v1.Snapshot + * @instance + */ + Snapshot.prototype.labels = $util.emptyObject; + + /** + * Creates a new Snapshot instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.Snapshot + * @static + * @param {google.pubsub.v1.ISnapshot=} [properties] Properties to set + * @returns {google.pubsub.v1.Snapshot} Snapshot instance + */ + Snapshot.create = function create(properties) { + return new Snapshot(properties); + }; + + /** + * Encodes the specified Snapshot message. Does not implicitly {@link google.pubsub.v1.Snapshot.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.Snapshot + * @static + * @param {google.pubsub.v1.ISnapshot} message Snapshot message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Snapshot.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.topic != null && Object.hasOwnProperty.call(message, "topic")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.topic); + if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) + $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 3, wireType 2 =*/26).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 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 Snapshot message, length delimited. Does not implicitly {@link google.pubsub.v1.Snapshot.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.Snapshot + * @static + * @param {google.pubsub.v1.ISnapshot} message Snapshot message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Snapshot.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Snapshot message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.Snapshot + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.Snapshot} Snapshot + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Snapshot.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.pubsub.v1.Snapshot(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.topic = reader.string(); + break; + } + case 3: { + message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + 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 Snapshot message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.Snapshot + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.Snapshot} Snapshot + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Snapshot.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Snapshot message. + * @function verify + * @memberof google.pubsub.v1.Snapshot + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Snapshot.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.topic != null && message.hasOwnProperty("topic")) + if (!$util.isString(message.topic)) + return "topic: string expected"; + if (message.expireTime != null && message.hasOwnProperty("expireTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.expireTime); + if (error) + return "expireTime." + 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 Snapshot message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.Snapshot + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.Snapshot} Snapshot + */ + Snapshot.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.Snapshot) + return object; + var message = new $root.google.pubsub.v1.Snapshot(); + if (object.name != null) + message.name = String(object.name); + if (object.topic != null) + message.topic = String(object.topic); + if (object.expireTime != null) { + if (typeof object.expireTime !== "object") + throw TypeError(".google.pubsub.v1.Snapshot.expireTime: object expected"); + message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.pubsub.v1.Snapshot.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from a Snapshot message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.Snapshot + * @static + * @param {google.pubsub.v1.Snapshot} message Snapshot + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Snapshot.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.topic = ""; + object.expireTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.topic != null && message.hasOwnProperty("topic")) + object.topic = message.topic; + if (message.expireTime != null && message.hasOwnProperty("expireTime")) + object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + return object; + }; + + /** + * Converts this Snapshot to JSON. + * @function toJSON + * @memberof google.pubsub.v1.Snapshot + * @instance + * @returns {Object.} JSON object + */ + Snapshot.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Snapshot + * @function getTypeUrl + * @memberof google.pubsub.v1.Snapshot + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Snapshot.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.Snapshot"; + }; + + return Snapshot; + })(); + + v1.GetSnapshotRequest = (function() { + + /** + * Properties of a GetSnapshotRequest. + * @memberof google.pubsub.v1 + * @interface IGetSnapshotRequest + * @property {string|null} [snapshot] GetSnapshotRequest snapshot + */ + + /** + * Constructs a new GetSnapshotRequest. + * @memberof google.pubsub.v1 + * @classdesc Represents a GetSnapshotRequest. + * @implements IGetSnapshotRequest + * @constructor + * @param {google.pubsub.v1.IGetSnapshotRequest=} [properties] Properties to set + */ + function GetSnapshotRequest(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]]; + } + + /** + * GetSnapshotRequest snapshot. + * @member {string} snapshot + * @memberof google.pubsub.v1.GetSnapshotRequest + * @instance + */ + GetSnapshotRequest.prototype.snapshot = ""; + + /** + * Creates a new GetSnapshotRequest instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.GetSnapshotRequest + * @static + * @param {google.pubsub.v1.IGetSnapshotRequest=} [properties] Properties to set + * @returns {google.pubsub.v1.GetSnapshotRequest} GetSnapshotRequest instance + */ + GetSnapshotRequest.create = function create(properties) { + return new GetSnapshotRequest(properties); + }; + + /** + * Encodes the specified GetSnapshotRequest message. Does not implicitly {@link google.pubsub.v1.GetSnapshotRequest.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.GetSnapshotRequest + * @static + * @param {google.pubsub.v1.IGetSnapshotRequest} message GetSnapshotRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSnapshotRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.snapshot != null && Object.hasOwnProperty.call(message, "snapshot")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.snapshot); + return writer; + }; + + /** + * Encodes the specified GetSnapshotRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.GetSnapshotRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.GetSnapshotRequest + * @static + * @param {google.pubsub.v1.IGetSnapshotRequest} message GetSnapshotRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSnapshotRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetSnapshotRequest message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.GetSnapshotRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.GetSnapshotRequest} GetSnapshotRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSnapshotRequest.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.pubsub.v1.GetSnapshotRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.snapshot = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetSnapshotRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.GetSnapshotRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.GetSnapshotRequest} GetSnapshotRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSnapshotRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetSnapshotRequest message. + * @function verify + * @memberof google.pubsub.v1.GetSnapshotRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetSnapshotRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.snapshot != null && message.hasOwnProperty("snapshot")) + if (!$util.isString(message.snapshot)) + return "snapshot: string expected"; + return null; + }; + + /** + * Creates a GetSnapshotRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.GetSnapshotRequest + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.GetSnapshotRequest} GetSnapshotRequest + */ + GetSnapshotRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.GetSnapshotRequest) + return object; + var message = new $root.google.pubsub.v1.GetSnapshotRequest(); + if (object.snapshot != null) + message.snapshot = String(object.snapshot); + return message; + }; + + /** + * Creates a plain object from a GetSnapshotRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.GetSnapshotRequest + * @static + * @param {google.pubsub.v1.GetSnapshotRequest} message GetSnapshotRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetSnapshotRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.snapshot = ""; + if (message.snapshot != null && message.hasOwnProperty("snapshot")) + object.snapshot = message.snapshot; + return object; + }; + + /** + * Converts this GetSnapshotRequest to JSON. + * @function toJSON + * @memberof google.pubsub.v1.GetSnapshotRequest + * @instance + * @returns {Object.} JSON object + */ + GetSnapshotRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetSnapshotRequest + * @function getTypeUrl + * @memberof google.pubsub.v1.GetSnapshotRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetSnapshotRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.GetSnapshotRequest"; + }; + + return GetSnapshotRequest; + })(); + + v1.ListSnapshotsRequest = (function() { + + /** + * Properties of a ListSnapshotsRequest. + * @memberof google.pubsub.v1 + * @interface IListSnapshotsRequest + * @property {string|null} [project] ListSnapshotsRequest project + * @property {number|null} [pageSize] ListSnapshotsRequest pageSize + * @property {string|null} [pageToken] ListSnapshotsRequest pageToken + */ + + /** + * Constructs a new ListSnapshotsRequest. + * @memberof google.pubsub.v1 + * @classdesc Represents a ListSnapshotsRequest. + * @implements IListSnapshotsRequest + * @constructor + * @param {google.pubsub.v1.IListSnapshotsRequest=} [properties] Properties to set + */ + function ListSnapshotsRequest(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]]; + } + + /** + * ListSnapshotsRequest project. + * @member {string} project + * @memberof google.pubsub.v1.ListSnapshotsRequest + * @instance + */ + ListSnapshotsRequest.prototype.project = ""; + + /** + * ListSnapshotsRequest pageSize. + * @member {number} pageSize + * @memberof google.pubsub.v1.ListSnapshotsRequest + * @instance + */ + ListSnapshotsRequest.prototype.pageSize = 0; + + /** + * ListSnapshotsRequest pageToken. + * @member {string} pageToken + * @memberof google.pubsub.v1.ListSnapshotsRequest + * @instance + */ + ListSnapshotsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListSnapshotsRequest instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.ListSnapshotsRequest + * @static + * @param {google.pubsub.v1.IListSnapshotsRequest=} [properties] Properties to set + * @returns {google.pubsub.v1.ListSnapshotsRequest} ListSnapshotsRequest instance + */ + ListSnapshotsRequest.create = function create(properties) { + return new ListSnapshotsRequest(properties); + }; + + /** + * Encodes the specified ListSnapshotsRequest message. Does not implicitly {@link google.pubsub.v1.ListSnapshotsRequest.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.ListSnapshotsRequest + * @static + * @param {google.pubsub.v1.IListSnapshotsRequest} message ListSnapshotsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSnapshotsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.project); + 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); + return writer; + }; + + /** + * Encodes the specified ListSnapshotsRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.ListSnapshotsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.ListSnapshotsRequest + * @static + * @param {google.pubsub.v1.IListSnapshotsRequest} message ListSnapshotsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSnapshotsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSnapshotsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.ListSnapshotsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.ListSnapshotsRequest} ListSnapshotsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSnapshotsRequest.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.pubsub.v1.ListSnapshotsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.project = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListSnapshotsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.ListSnapshotsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.ListSnapshotsRequest} ListSnapshotsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSnapshotsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSnapshotsRequest message. + * @function verify + * @memberof google.pubsub.v1.ListSnapshotsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSnapshotsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: 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"; + return null; + }; + + /** + * Creates a ListSnapshotsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.ListSnapshotsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.ListSnapshotsRequest} ListSnapshotsRequest + */ + ListSnapshotsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.ListSnapshotsRequest) + return object; + var message = new $root.google.pubsub.v1.ListSnapshotsRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListSnapshotsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.ListSnapshotsRequest + * @static + * @param {google.pubsub.v1.ListSnapshotsRequest} message ListSnapshotsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSnapshotsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.project = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListSnapshotsRequest to JSON. + * @function toJSON + * @memberof google.pubsub.v1.ListSnapshotsRequest + * @instance + * @returns {Object.} JSON object + */ + ListSnapshotsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListSnapshotsRequest + * @function getTypeUrl + * @memberof google.pubsub.v1.ListSnapshotsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListSnapshotsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.ListSnapshotsRequest"; + }; + + return ListSnapshotsRequest; + })(); + + v1.ListSnapshotsResponse = (function() { + + /** + * Properties of a ListSnapshotsResponse. + * @memberof google.pubsub.v1 + * @interface IListSnapshotsResponse + * @property {Array.|null} [snapshots] ListSnapshotsResponse snapshots + * @property {string|null} [nextPageToken] ListSnapshotsResponse nextPageToken + */ + + /** + * Constructs a new ListSnapshotsResponse. + * @memberof google.pubsub.v1 + * @classdesc Represents a ListSnapshotsResponse. + * @implements IListSnapshotsResponse + * @constructor + * @param {google.pubsub.v1.IListSnapshotsResponse=} [properties] Properties to set + */ + function ListSnapshotsResponse(properties) { + this.snapshots = []; + 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]]; + } + + /** + * ListSnapshotsResponse snapshots. + * @member {Array.} snapshots + * @memberof google.pubsub.v1.ListSnapshotsResponse + * @instance + */ + ListSnapshotsResponse.prototype.snapshots = $util.emptyArray; + + /** + * ListSnapshotsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.pubsub.v1.ListSnapshotsResponse + * @instance + */ + ListSnapshotsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListSnapshotsResponse instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.ListSnapshotsResponse + * @static + * @param {google.pubsub.v1.IListSnapshotsResponse=} [properties] Properties to set + * @returns {google.pubsub.v1.ListSnapshotsResponse} ListSnapshotsResponse instance + */ + ListSnapshotsResponse.create = function create(properties) { + return new ListSnapshotsResponse(properties); + }; + + /** + * Encodes the specified ListSnapshotsResponse message. Does not implicitly {@link google.pubsub.v1.ListSnapshotsResponse.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.ListSnapshotsResponse + * @static + * @param {google.pubsub.v1.IListSnapshotsResponse} message ListSnapshotsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSnapshotsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.snapshots != null && message.snapshots.length) + for (var i = 0; i < message.snapshots.length; ++i) + $root.google.pubsub.v1.Snapshot.encode(message.snapshots[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 ListSnapshotsResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.ListSnapshotsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.ListSnapshotsResponse + * @static + * @param {google.pubsub.v1.IListSnapshotsResponse} message ListSnapshotsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSnapshotsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSnapshotsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.ListSnapshotsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.ListSnapshotsResponse} ListSnapshotsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSnapshotsResponse.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.pubsub.v1.ListSnapshotsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.snapshots && message.snapshots.length)) + message.snapshots = []; + message.snapshots.push($root.google.pubsub.v1.Snapshot.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListSnapshotsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.ListSnapshotsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.ListSnapshotsResponse} ListSnapshotsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSnapshotsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSnapshotsResponse message. + * @function verify + * @memberof google.pubsub.v1.ListSnapshotsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSnapshotsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.snapshots != null && message.hasOwnProperty("snapshots")) { + if (!Array.isArray(message.snapshots)) + return "snapshots: array expected"; + for (var i = 0; i < message.snapshots.length; ++i) { + var error = $root.google.pubsub.v1.Snapshot.verify(message.snapshots[i]); + if (error) + return "snapshots." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListSnapshotsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.ListSnapshotsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.ListSnapshotsResponse} ListSnapshotsResponse + */ + ListSnapshotsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.ListSnapshotsResponse) + return object; + var message = new $root.google.pubsub.v1.ListSnapshotsResponse(); + if (object.snapshots) { + if (!Array.isArray(object.snapshots)) + throw TypeError(".google.pubsub.v1.ListSnapshotsResponse.snapshots: array expected"); + message.snapshots = []; + for (var i = 0; i < object.snapshots.length; ++i) { + if (typeof object.snapshots[i] !== "object") + throw TypeError(".google.pubsub.v1.ListSnapshotsResponse.snapshots: object expected"); + message.snapshots[i] = $root.google.pubsub.v1.Snapshot.fromObject(object.snapshots[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListSnapshotsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.ListSnapshotsResponse + * @static + * @param {google.pubsub.v1.ListSnapshotsResponse} message ListSnapshotsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSnapshotsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.snapshots = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.snapshots && message.snapshots.length) { + object.snapshots = []; + for (var j = 0; j < message.snapshots.length; ++j) + object.snapshots[j] = $root.google.pubsub.v1.Snapshot.toObject(message.snapshots[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListSnapshotsResponse to JSON. + * @function toJSON + * @memberof google.pubsub.v1.ListSnapshotsResponse + * @instance + * @returns {Object.} JSON object + */ + ListSnapshotsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListSnapshotsResponse + * @function getTypeUrl + * @memberof google.pubsub.v1.ListSnapshotsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListSnapshotsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.ListSnapshotsResponse"; + }; + + return ListSnapshotsResponse; + })(); + + v1.DeleteSnapshotRequest = (function() { + + /** + * Properties of a DeleteSnapshotRequest. + * @memberof google.pubsub.v1 + * @interface IDeleteSnapshotRequest + * @property {string|null} [snapshot] DeleteSnapshotRequest snapshot + */ + + /** + * Constructs a new DeleteSnapshotRequest. + * @memberof google.pubsub.v1 + * @classdesc Represents a DeleteSnapshotRequest. + * @implements IDeleteSnapshotRequest + * @constructor + * @param {google.pubsub.v1.IDeleteSnapshotRequest=} [properties] Properties to set + */ + function DeleteSnapshotRequest(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]]; + } + + /** + * DeleteSnapshotRequest snapshot. + * @member {string} snapshot + * @memberof google.pubsub.v1.DeleteSnapshotRequest + * @instance + */ + DeleteSnapshotRequest.prototype.snapshot = ""; + + /** + * Creates a new DeleteSnapshotRequest instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.DeleteSnapshotRequest + * @static + * @param {google.pubsub.v1.IDeleteSnapshotRequest=} [properties] Properties to set + * @returns {google.pubsub.v1.DeleteSnapshotRequest} DeleteSnapshotRequest instance + */ + DeleteSnapshotRequest.create = function create(properties) { + return new DeleteSnapshotRequest(properties); + }; + + /** + * Encodes the specified DeleteSnapshotRequest message. Does not implicitly {@link google.pubsub.v1.DeleteSnapshotRequest.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.DeleteSnapshotRequest + * @static + * @param {google.pubsub.v1.IDeleteSnapshotRequest} message DeleteSnapshotRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteSnapshotRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.snapshot != null && Object.hasOwnProperty.call(message, "snapshot")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.snapshot); + return writer; + }; + + /** + * Encodes the specified DeleteSnapshotRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.DeleteSnapshotRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.DeleteSnapshotRequest + * @static + * @param {google.pubsub.v1.IDeleteSnapshotRequest} message DeleteSnapshotRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteSnapshotRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteSnapshotRequest message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.DeleteSnapshotRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.DeleteSnapshotRequest} DeleteSnapshotRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteSnapshotRequest.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.pubsub.v1.DeleteSnapshotRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.snapshot = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteSnapshotRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.DeleteSnapshotRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.DeleteSnapshotRequest} DeleteSnapshotRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteSnapshotRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteSnapshotRequest message. + * @function verify + * @memberof google.pubsub.v1.DeleteSnapshotRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteSnapshotRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.snapshot != null && message.hasOwnProperty("snapshot")) + if (!$util.isString(message.snapshot)) + return "snapshot: string expected"; + return null; + }; + + /** + * Creates a DeleteSnapshotRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.DeleteSnapshotRequest + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.DeleteSnapshotRequest} DeleteSnapshotRequest + */ + DeleteSnapshotRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.DeleteSnapshotRequest) + return object; + var message = new $root.google.pubsub.v1.DeleteSnapshotRequest(); + if (object.snapshot != null) + message.snapshot = String(object.snapshot); + return message; + }; + + /** + * Creates a plain object from a DeleteSnapshotRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.DeleteSnapshotRequest + * @static + * @param {google.pubsub.v1.DeleteSnapshotRequest} message DeleteSnapshotRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteSnapshotRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.snapshot = ""; + if (message.snapshot != null && message.hasOwnProperty("snapshot")) + object.snapshot = message.snapshot; + return object; + }; + + /** + * Converts this DeleteSnapshotRequest to JSON. + * @function toJSON + * @memberof google.pubsub.v1.DeleteSnapshotRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteSnapshotRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteSnapshotRequest + * @function getTypeUrl + * @memberof google.pubsub.v1.DeleteSnapshotRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteSnapshotRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.DeleteSnapshotRequest"; + }; + + return DeleteSnapshotRequest; + })(); + + v1.SeekRequest = (function() { + + /** + * Properties of a SeekRequest. + * @memberof google.pubsub.v1 + * @interface ISeekRequest + * @property {string|null} [subscription] SeekRequest subscription + * @property {google.protobuf.ITimestamp|null} [time] SeekRequest time + * @property {string|null} [snapshot] SeekRequest snapshot + */ + + /** + * Constructs a new SeekRequest. + * @memberof google.pubsub.v1 + * @classdesc Represents a SeekRequest. + * @implements ISeekRequest + * @constructor + * @param {google.pubsub.v1.ISeekRequest=} [properties] Properties to set + */ + function SeekRequest(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]]; + } + + /** + * SeekRequest subscription. + * @member {string} subscription + * @memberof google.pubsub.v1.SeekRequest + * @instance + */ + SeekRequest.prototype.subscription = ""; + + /** + * SeekRequest time. + * @member {google.protobuf.ITimestamp|null|undefined} time + * @memberof google.pubsub.v1.SeekRequest + * @instance + */ + SeekRequest.prototype.time = null; + + /** + * SeekRequest snapshot. + * @member {string|null|undefined} snapshot + * @memberof google.pubsub.v1.SeekRequest + * @instance + */ + SeekRequest.prototype.snapshot = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SeekRequest target. + * @member {"time"|"snapshot"|undefined} target + * @memberof google.pubsub.v1.SeekRequest + * @instance + */ + Object.defineProperty(SeekRequest.prototype, "target", { + get: $util.oneOfGetter($oneOfFields = ["time", "snapshot"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SeekRequest instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.SeekRequest + * @static + * @param {google.pubsub.v1.ISeekRequest=} [properties] Properties to set + * @returns {google.pubsub.v1.SeekRequest} SeekRequest instance + */ + SeekRequest.create = function create(properties) { + return new SeekRequest(properties); + }; + + /** + * Encodes the specified SeekRequest message. Does not implicitly {@link google.pubsub.v1.SeekRequest.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.SeekRequest + * @static + * @param {google.pubsub.v1.ISeekRequest} message SeekRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SeekRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.subscription != null && Object.hasOwnProperty.call(message, "subscription")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.subscription); + if (message.time != null && Object.hasOwnProperty.call(message, "time")) + $root.google.protobuf.Timestamp.encode(message.time, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.snapshot != null && Object.hasOwnProperty.call(message, "snapshot")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.snapshot); + return writer; + }; + + /** + * Encodes the specified SeekRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.SeekRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.SeekRequest + * @static + * @param {google.pubsub.v1.ISeekRequest} message SeekRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SeekRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SeekRequest message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.SeekRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.SeekRequest} SeekRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SeekRequest.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.pubsub.v1.SeekRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.subscription = reader.string(); + break; + } + case 2: { + message.time = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.snapshot = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SeekRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.SeekRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.SeekRequest} SeekRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SeekRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SeekRequest message. + * @function verify + * @memberof google.pubsub.v1.SeekRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SeekRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.subscription != null && message.hasOwnProperty("subscription")) + if (!$util.isString(message.subscription)) + return "subscription: string expected"; + if (message.time != null && message.hasOwnProperty("time")) { + properties.target = 1; + { + var error = $root.google.protobuf.Timestamp.verify(message.time); + if (error) + return "time." + error; + } + } + if (message.snapshot != null && message.hasOwnProperty("snapshot")) { + if (properties.target === 1) + return "target: multiple values"; + properties.target = 1; + if (!$util.isString(message.snapshot)) + return "snapshot: string expected"; + } + return null; + }; + + /** + * Creates a SeekRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.SeekRequest + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.SeekRequest} SeekRequest + */ + SeekRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.SeekRequest) + return object; + var message = new $root.google.pubsub.v1.SeekRequest(); + if (object.subscription != null) + message.subscription = String(object.subscription); + if (object.time != null) { + if (typeof object.time !== "object") + throw TypeError(".google.pubsub.v1.SeekRequest.time: object expected"); + message.time = $root.google.protobuf.Timestamp.fromObject(object.time); + } + if (object.snapshot != null) + message.snapshot = String(object.snapshot); + return message; + }; + + /** + * Creates a plain object from a SeekRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.SeekRequest + * @static + * @param {google.pubsub.v1.SeekRequest} message SeekRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SeekRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.subscription = ""; + if (message.subscription != null && message.hasOwnProperty("subscription")) + object.subscription = message.subscription; + if (message.time != null && message.hasOwnProperty("time")) { + object.time = $root.google.protobuf.Timestamp.toObject(message.time, options); + if (options.oneofs) + object.target = "time"; + } + if (message.snapshot != null && message.hasOwnProperty("snapshot")) { + object.snapshot = message.snapshot; + if (options.oneofs) + object.target = "snapshot"; + } + return object; + }; + + /** + * Converts this SeekRequest to JSON. + * @function toJSON + * @memberof google.pubsub.v1.SeekRequest + * @instance + * @returns {Object.} JSON object + */ + SeekRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SeekRequest + * @function getTypeUrl + * @memberof google.pubsub.v1.SeekRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SeekRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.SeekRequest"; + }; + + return SeekRequest; + })(); + + v1.SeekResponse = (function() { + + /** + * Properties of a SeekResponse. + * @memberof google.pubsub.v1 + * @interface ISeekResponse + */ + + /** + * Constructs a new SeekResponse. + * @memberof google.pubsub.v1 + * @classdesc Represents a SeekResponse. + * @implements ISeekResponse + * @constructor + * @param {google.pubsub.v1.ISeekResponse=} [properties] Properties to set + */ + function SeekResponse(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 SeekResponse instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.SeekResponse + * @static + * @param {google.pubsub.v1.ISeekResponse=} [properties] Properties to set + * @returns {google.pubsub.v1.SeekResponse} SeekResponse instance + */ + SeekResponse.create = function create(properties) { + return new SeekResponse(properties); + }; + + /** + * Encodes the specified SeekResponse message. Does not implicitly {@link google.pubsub.v1.SeekResponse.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.SeekResponse + * @static + * @param {google.pubsub.v1.ISeekResponse} message SeekResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SeekResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified SeekResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.SeekResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.SeekResponse + * @static + * @param {google.pubsub.v1.ISeekResponse} message SeekResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SeekResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SeekResponse message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.SeekResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.SeekResponse} SeekResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SeekResponse.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.pubsub.v1.SeekResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SeekResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.SeekResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.SeekResponse} SeekResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SeekResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SeekResponse message. + * @function verify + * @memberof google.pubsub.v1.SeekResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SeekResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a SeekResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.SeekResponse + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.SeekResponse} SeekResponse + */ + SeekResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.SeekResponse) + return object; + return new $root.google.pubsub.v1.SeekResponse(); + }; + + /** + * Creates a plain object from a SeekResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.SeekResponse + * @static + * @param {google.pubsub.v1.SeekResponse} message SeekResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SeekResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this SeekResponse to JSON. + * @function toJSON + * @memberof google.pubsub.v1.SeekResponse + * @instance + * @returns {Object.} JSON object + */ + SeekResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SeekResponse + * @function getTypeUrl + * @memberof google.pubsub.v1.SeekResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SeekResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.SeekResponse"; + }; + + return SeekResponse; + })(); + + v1.SchemaService = (function() { + + /** + * Constructs a new SchemaService service. + * @memberof google.pubsub.v1 + * @classdesc Represents a SchemaService + * @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 SchemaService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (SchemaService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = SchemaService; + + /** + * Creates new SchemaService service using the specified rpc implementation. + * @function create + * @memberof google.pubsub.v1.SchemaService + * @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 {SchemaService} RPC service. Useful where requests and/or responses are streamed. + */ + SchemaService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.pubsub.v1.SchemaService|createSchema}. + * @memberof google.pubsub.v1.SchemaService + * @typedef CreateSchemaCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.pubsub.v1.Schema} [response] Schema + */ + + /** + * Calls CreateSchema. + * @function createSchema + * @memberof google.pubsub.v1.SchemaService + * @instance + * @param {google.pubsub.v1.ICreateSchemaRequest} request CreateSchemaRequest message or plain object + * @param {google.pubsub.v1.SchemaService.CreateSchemaCallback} callback Node-style callback called with the error, if any, and Schema + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SchemaService.prototype.createSchema = function createSchema(request, callback) { + return this.rpcCall(createSchema, $root.google.pubsub.v1.CreateSchemaRequest, $root.google.pubsub.v1.Schema, request, callback); + }, "name", { value: "CreateSchema" }); + + /** + * Calls CreateSchema. + * @function createSchema + * @memberof google.pubsub.v1.SchemaService + * @instance + * @param {google.pubsub.v1.ICreateSchemaRequest} request CreateSchemaRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.pubsub.v1.SchemaService|getSchema}. + * @memberof google.pubsub.v1.SchemaService + * @typedef GetSchemaCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.pubsub.v1.Schema} [response] Schema + */ + + /** + * Calls GetSchema. + * @function getSchema + * @memberof google.pubsub.v1.SchemaService + * @instance + * @param {google.pubsub.v1.IGetSchemaRequest} request GetSchemaRequest message or plain object + * @param {google.pubsub.v1.SchemaService.GetSchemaCallback} callback Node-style callback called with the error, if any, and Schema + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SchemaService.prototype.getSchema = function getSchema(request, callback) { + return this.rpcCall(getSchema, $root.google.pubsub.v1.GetSchemaRequest, $root.google.pubsub.v1.Schema, request, callback); + }, "name", { value: "GetSchema" }); + + /** + * Calls GetSchema. + * @function getSchema + * @memberof google.pubsub.v1.SchemaService + * @instance + * @param {google.pubsub.v1.IGetSchemaRequest} request GetSchemaRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.pubsub.v1.SchemaService|listSchemas}. + * @memberof google.pubsub.v1.SchemaService + * @typedef ListSchemasCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.pubsub.v1.ListSchemasResponse} [response] ListSchemasResponse + */ + + /** + * Calls ListSchemas. + * @function listSchemas + * @memberof google.pubsub.v1.SchemaService + * @instance + * @param {google.pubsub.v1.IListSchemasRequest} request ListSchemasRequest message or plain object + * @param {google.pubsub.v1.SchemaService.ListSchemasCallback} callback Node-style callback called with the error, if any, and ListSchemasResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SchemaService.prototype.listSchemas = function listSchemas(request, callback) { + return this.rpcCall(listSchemas, $root.google.pubsub.v1.ListSchemasRequest, $root.google.pubsub.v1.ListSchemasResponse, request, callback); + }, "name", { value: "ListSchemas" }); + + /** + * Calls ListSchemas. + * @function listSchemas + * @memberof google.pubsub.v1.SchemaService + * @instance + * @param {google.pubsub.v1.IListSchemasRequest} request ListSchemasRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.pubsub.v1.SchemaService|listSchemaRevisions}. + * @memberof google.pubsub.v1.SchemaService + * @typedef ListSchemaRevisionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.pubsub.v1.ListSchemaRevisionsResponse} [response] ListSchemaRevisionsResponse + */ + + /** + * Calls ListSchemaRevisions. + * @function listSchemaRevisions + * @memberof google.pubsub.v1.SchemaService + * @instance + * @param {google.pubsub.v1.IListSchemaRevisionsRequest} request ListSchemaRevisionsRequest message or plain object + * @param {google.pubsub.v1.SchemaService.ListSchemaRevisionsCallback} callback Node-style callback called with the error, if any, and ListSchemaRevisionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SchemaService.prototype.listSchemaRevisions = function listSchemaRevisions(request, callback) { + return this.rpcCall(listSchemaRevisions, $root.google.pubsub.v1.ListSchemaRevisionsRequest, $root.google.pubsub.v1.ListSchemaRevisionsResponse, request, callback); + }, "name", { value: "ListSchemaRevisions" }); + + /** + * Calls ListSchemaRevisions. + * @function listSchemaRevisions + * @memberof google.pubsub.v1.SchemaService + * @instance + * @param {google.pubsub.v1.IListSchemaRevisionsRequest} request ListSchemaRevisionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.pubsub.v1.SchemaService|commitSchema}. + * @memberof google.pubsub.v1.SchemaService + * @typedef CommitSchemaCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.pubsub.v1.Schema} [response] Schema + */ + + /** + * Calls CommitSchema. + * @function commitSchema + * @memberof google.pubsub.v1.SchemaService + * @instance + * @param {google.pubsub.v1.ICommitSchemaRequest} request CommitSchemaRequest message or plain object + * @param {google.pubsub.v1.SchemaService.CommitSchemaCallback} callback Node-style callback called with the error, if any, and Schema + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SchemaService.prototype.commitSchema = function commitSchema(request, callback) { + return this.rpcCall(commitSchema, $root.google.pubsub.v1.CommitSchemaRequest, $root.google.pubsub.v1.Schema, request, callback); + }, "name", { value: "CommitSchema" }); + + /** + * Calls CommitSchema. + * @function commitSchema + * @memberof google.pubsub.v1.SchemaService + * @instance + * @param {google.pubsub.v1.ICommitSchemaRequest} request CommitSchemaRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.pubsub.v1.SchemaService|rollbackSchema}. + * @memberof google.pubsub.v1.SchemaService + * @typedef RollbackSchemaCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.pubsub.v1.Schema} [response] Schema + */ + + /** + * Calls RollbackSchema. + * @function rollbackSchema + * @memberof google.pubsub.v1.SchemaService + * @instance + * @param {google.pubsub.v1.IRollbackSchemaRequest} request RollbackSchemaRequest message or plain object + * @param {google.pubsub.v1.SchemaService.RollbackSchemaCallback} callback Node-style callback called with the error, if any, and Schema + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SchemaService.prototype.rollbackSchema = function rollbackSchema(request, callback) { + return this.rpcCall(rollbackSchema, $root.google.pubsub.v1.RollbackSchemaRequest, $root.google.pubsub.v1.Schema, request, callback); + }, "name", { value: "RollbackSchema" }); + + /** + * Calls RollbackSchema. + * @function rollbackSchema + * @memberof google.pubsub.v1.SchemaService + * @instance + * @param {google.pubsub.v1.IRollbackSchemaRequest} request RollbackSchemaRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.pubsub.v1.SchemaService|deleteSchemaRevision}. + * @memberof google.pubsub.v1.SchemaService + * @typedef DeleteSchemaRevisionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.pubsub.v1.Schema} [response] Schema + */ + + /** + * Calls DeleteSchemaRevision. + * @function deleteSchemaRevision + * @memberof google.pubsub.v1.SchemaService + * @instance + * @param {google.pubsub.v1.IDeleteSchemaRevisionRequest} request DeleteSchemaRevisionRequest message or plain object + * @param {google.pubsub.v1.SchemaService.DeleteSchemaRevisionCallback} callback Node-style callback called with the error, if any, and Schema + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SchemaService.prototype.deleteSchemaRevision = function deleteSchemaRevision(request, callback) { + return this.rpcCall(deleteSchemaRevision, $root.google.pubsub.v1.DeleteSchemaRevisionRequest, $root.google.pubsub.v1.Schema, request, callback); + }, "name", { value: "DeleteSchemaRevision" }); + + /** + * Calls DeleteSchemaRevision. + * @function deleteSchemaRevision + * @memberof google.pubsub.v1.SchemaService + * @instance + * @param {google.pubsub.v1.IDeleteSchemaRevisionRequest} request DeleteSchemaRevisionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.pubsub.v1.SchemaService|deleteSchema}. + * @memberof google.pubsub.v1.SchemaService + * @typedef DeleteSchemaCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteSchema. + * @function deleteSchema + * @memberof google.pubsub.v1.SchemaService + * @instance + * @param {google.pubsub.v1.IDeleteSchemaRequest} request DeleteSchemaRequest message or plain object + * @param {google.pubsub.v1.SchemaService.DeleteSchemaCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SchemaService.prototype.deleteSchema = function deleteSchema(request, callback) { + return this.rpcCall(deleteSchema, $root.google.pubsub.v1.DeleteSchemaRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteSchema" }); + + /** + * Calls DeleteSchema. + * @function deleteSchema + * @memberof google.pubsub.v1.SchemaService + * @instance + * @param {google.pubsub.v1.IDeleteSchemaRequest} request DeleteSchemaRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.pubsub.v1.SchemaService|validateSchema}. + * @memberof google.pubsub.v1.SchemaService + * @typedef ValidateSchemaCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.pubsub.v1.ValidateSchemaResponse} [response] ValidateSchemaResponse + */ + + /** + * Calls ValidateSchema. + * @function validateSchema + * @memberof google.pubsub.v1.SchemaService + * @instance + * @param {google.pubsub.v1.IValidateSchemaRequest} request ValidateSchemaRequest message or plain object + * @param {google.pubsub.v1.SchemaService.ValidateSchemaCallback} callback Node-style callback called with the error, if any, and ValidateSchemaResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SchemaService.prototype.validateSchema = function validateSchema(request, callback) { + return this.rpcCall(validateSchema, $root.google.pubsub.v1.ValidateSchemaRequest, $root.google.pubsub.v1.ValidateSchemaResponse, request, callback); + }, "name", { value: "ValidateSchema" }); + + /** + * Calls ValidateSchema. + * @function validateSchema + * @memberof google.pubsub.v1.SchemaService + * @instance + * @param {google.pubsub.v1.IValidateSchemaRequest} request ValidateSchemaRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.pubsub.v1.SchemaService|validateMessage}. + * @memberof google.pubsub.v1.SchemaService + * @typedef ValidateMessageCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.pubsub.v1.ValidateMessageResponse} [response] ValidateMessageResponse + */ + + /** + * Calls ValidateMessage. + * @function validateMessage + * @memberof google.pubsub.v1.SchemaService + * @instance + * @param {google.pubsub.v1.IValidateMessageRequest} request ValidateMessageRequest message or plain object + * @param {google.pubsub.v1.SchemaService.ValidateMessageCallback} callback Node-style callback called with the error, if any, and ValidateMessageResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SchemaService.prototype.validateMessage = function validateMessage(request, callback) { + return this.rpcCall(validateMessage, $root.google.pubsub.v1.ValidateMessageRequest, $root.google.pubsub.v1.ValidateMessageResponse, request, callback); + }, "name", { value: "ValidateMessage" }); + + /** + * Calls ValidateMessage. + * @function validateMessage + * @memberof google.pubsub.v1.SchemaService + * @instance + * @param {google.pubsub.v1.IValidateMessageRequest} request ValidateMessageRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return SchemaService; + })(); + + v1.Schema = (function() { + + /** + * Properties of a Schema. + * @memberof google.pubsub.v1 + * @interface ISchema + * @property {string|null} [name] Schema name + * @property {google.pubsub.v1.Schema.Type|null} [type] Schema type + * @property {string|null} [definition] Schema definition + * @property {string|null} [revisionId] Schema revisionId + * @property {google.protobuf.ITimestamp|null} [revisionCreateTime] Schema revisionCreateTime + */ + + /** + * Constructs a new Schema. + * @memberof google.pubsub.v1 + * @classdesc Represents a Schema. + * @implements ISchema + * @constructor + * @param {google.pubsub.v1.ISchema=} [properties] Properties to set + */ + function Schema(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]]; + } + + /** + * Schema name. + * @member {string} name + * @memberof google.pubsub.v1.Schema + * @instance + */ + Schema.prototype.name = ""; + + /** + * Schema type. + * @member {google.pubsub.v1.Schema.Type} type + * @memberof google.pubsub.v1.Schema + * @instance + */ + Schema.prototype.type = 0; + + /** + * Schema definition. + * @member {string} definition + * @memberof google.pubsub.v1.Schema + * @instance + */ + Schema.prototype.definition = ""; + + /** + * Schema revisionId. + * @member {string} revisionId + * @memberof google.pubsub.v1.Schema + * @instance + */ + Schema.prototype.revisionId = ""; + + /** + * Schema revisionCreateTime. + * @member {google.protobuf.ITimestamp|null|undefined} revisionCreateTime + * @memberof google.pubsub.v1.Schema + * @instance + */ + Schema.prototype.revisionCreateTime = null; + + /** + * Creates a new Schema instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.Schema + * @static + * @param {google.pubsub.v1.ISchema=} [properties] Properties to set + * @returns {google.pubsub.v1.Schema} Schema instance + */ + Schema.create = function create(properties) { + return new Schema(properties); + }; + + /** + * Encodes the specified Schema message. Does not implicitly {@link google.pubsub.v1.Schema.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.Schema + * @static + * @param {google.pubsub.v1.ISchema} message Schema message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Schema.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.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.type); + if (message.definition != null && Object.hasOwnProperty.call(message, "definition")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.definition); + if (message.revisionId != null && Object.hasOwnProperty.call(message, "revisionId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.revisionId); + if (message.revisionCreateTime != null && Object.hasOwnProperty.call(message, "revisionCreateTime")) + $root.google.protobuf.Timestamp.encode(message.revisionCreateTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Schema message, length delimited. Does not implicitly {@link google.pubsub.v1.Schema.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.Schema + * @static + * @param {google.pubsub.v1.ISchema} message Schema message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Schema.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Schema message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.Schema + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.Schema} Schema + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Schema.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.pubsub.v1.Schema(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.type = reader.int32(); + break; + } + case 3: { + message.definition = reader.string(); + break; + } + case 4: { + message.revisionId = reader.string(); + break; + } + case 6: { + message.revisionCreateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Schema message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.Schema + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.Schema} Schema + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Schema.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Schema message. + * @function verify + * @memberof google.pubsub.v1.Schema + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Schema.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.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.definition != null && message.hasOwnProperty("definition")) + if (!$util.isString(message.definition)) + return "definition: string expected"; + if (message.revisionId != null && message.hasOwnProperty("revisionId")) + if (!$util.isString(message.revisionId)) + return "revisionId: string expected"; + if (message.revisionCreateTime != null && message.hasOwnProperty("revisionCreateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.revisionCreateTime); + if (error) + return "revisionCreateTime." + error; + } + return null; + }; + + /** + * Creates a Schema message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.Schema + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.Schema} Schema + */ + Schema.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.Schema) + return object; + var message = new $root.google.pubsub.v1.Schema(); + if (object.name != null) + message.name = String(object.name); + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "PROTOCOL_BUFFER": + case 1: + message.type = 1; + break; + case "AVRO": + case 2: + message.type = 2; + break; + } + if (object.definition != null) + message.definition = String(object.definition); + if (object.revisionId != null) + message.revisionId = String(object.revisionId); + if (object.revisionCreateTime != null) { + if (typeof object.revisionCreateTime !== "object") + throw TypeError(".google.pubsub.v1.Schema.revisionCreateTime: object expected"); + message.revisionCreateTime = $root.google.protobuf.Timestamp.fromObject(object.revisionCreateTime); + } + return message; + }; + + /** + * Creates a plain object from a Schema message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.Schema + * @static + * @param {google.pubsub.v1.Schema} message Schema + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Schema.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + object.definition = ""; + object.revisionId = ""; + object.revisionCreateTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.pubsub.v1.Schema.Type[message.type] === undefined ? message.type : $root.google.pubsub.v1.Schema.Type[message.type] : message.type; + if (message.definition != null && message.hasOwnProperty("definition")) + object.definition = message.definition; + if (message.revisionId != null && message.hasOwnProperty("revisionId")) + object.revisionId = message.revisionId; + if (message.revisionCreateTime != null && message.hasOwnProperty("revisionCreateTime")) + object.revisionCreateTime = $root.google.protobuf.Timestamp.toObject(message.revisionCreateTime, options); + return object; + }; + + /** + * Converts this Schema to JSON. + * @function toJSON + * @memberof google.pubsub.v1.Schema + * @instance + * @returns {Object.} JSON object + */ + Schema.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Schema + * @function getTypeUrl + * @memberof google.pubsub.v1.Schema + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Schema.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.Schema"; + }; + + /** + * Type enum. + * @name google.pubsub.v1.Schema.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} PROTOCOL_BUFFER=1 PROTOCOL_BUFFER value + * @property {number} AVRO=2 AVRO value + */ + Schema.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PROTOCOL_BUFFER"] = 1; + values[valuesById[2] = "AVRO"] = 2; + return values; + })(); + + return Schema; + })(); + + /** + * SchemaView enum. + * @name google.pubsub.v1.SchemaView + * @enum {number} + * @property {number} SCHEMA_VIEW_UNSPECIFIED=0 SCHEMA_VIEW_UNSPECIFIED value + * @property {number} BASIC=1 BASIC value + * @property {number} FULL=2 FULL value + */ + v1.SchemaView = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SCHEMA_VIEW_UNSPECIFIED"] = 0; + values[valuesById[1] = "BASIC"] = 1; + values[valuesById[2] = "FULL"] = 2; + return values; + })(); + + v1.CreateSchemaRequest = (function() { + + /** + * Properties of a CreateSchemaRequest. + * @memberof google.pubsub.v1 + * @interface ICreateSchemaRequest + * @property {string|null} [parent] CreateSchemaRequest parent + * @property {google.pubsub.v1.ISchema|null} [schema] CreateSchemaRequest schema + * @property {string|null} [schemaId] CreateSchemaRequest schemaId + */ + + /** + * Constructs a new CreateSchemaRequest. + * @memberof google.pubsub.v1 + * @classdesc Represents a CreateSchemaRequest. + * @implements ICreateSchemaRequest + * @constructor + * @param {google.pubsub.v1.ICreateSchemaRequest=} [properties] Properties to set + */ + function CreateSchemaRequest(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]]; + } + + /** + * CreateSchemaRequest parent. + * @member {string} parent + * @memberof google.pubsub.v1.CreateSchemaRequest + * @instance + */ + CreateSchemaRequest.prototype.parent = ""; + + /** + * CreateSchemaRequest schema. + * @member {google.pubsub.v1.ISchema|null|undefined} schema + * @memberof google.pubsub.v1.CreateSchemaRequest + * @instance + */ + CreateSchemaRequest.prototype.schema = null; + + /** + * CreateSchemaRequest schemaId. + * @member {string} schemaId + * @memberof google.pubsub.v1.CreateSchemaRequest + * @instance + */ + CreateSchemaRequest.prototype.schemaId = ""; + + /** + * Creates a new CreateSchemaRequest instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.CreateSchemaRequest + * @static + * @param {google.pubsub.v1.ICreateSchemaRequest=} [properties] Properties to set + * @returns {google.pubsub.v1.CreateSchemaRequest} CreateSchemaRequest instance + */ + CreateSchemaRequest.create = function create(properties) { + return new CreateSchemaRequest(properties); + }; + + /** + * Encodes the specified CreateSchemaRequest message. Does not implicitly {@link google.pubsub.v1.CreateSchemaRequest.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.CreateSchemaRequest + * @static + * @param {google.pubsub.v1.ICreateSchemaRequest} message CreateSchemaRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateSchemaRequest.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.schema != null && Object.hasOwnProperty.call(message, "schema")) + $root.google.pubsub.v1.Schema.encode(message.schema, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.schemaId != null && Object.hasOwnProperty.call(message, "schemaId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.schemaId); + return writer; + }; + + /** + * Encodes the specified CreateSchemaRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.CreateSchemaRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.CreateSchemaRequest + * @static + * @param {google.pubsub.v1.ICreateSchemaRequest} message CreateSchemaRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateSchemaRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateSchemaRequest message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.CreateSchemaRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.CreateSchemaRequest} CreateSchemaRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateSchemaRequest.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.pubsub.v1.CreateSchemaRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.schema = $root.google.pubsub.v1.Schema.decode(reader, reader.uint32()); + break; + } + case 3: { + message.schemaId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateSchemaRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.CreateSchemaRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.CreateSchemaRequest} CreateSchemaRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateSchemaRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateSchemaRequest message. + * @function verify + * @memberof google.pubsub.v1.CreateSchemaRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateSchemaRequest.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.schema != null && message.hasOwnProperty("schema")) { + var error = $root.google.pubsub.v1.Schema.verify(message.schema); + if (error) + return "schema." + error; + } + if (message.schemaId != null && message.hasOwnProperty("schemaId")) + if (!$util.isString(message.schemaId)) + return "schemaId: string expected"; + return null; + }; + + /** + * Creates a CreateSchemaRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.CreateSchemaRequest + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.CreateSchemaRequest} CreateSchemaRequest + */ + CreateSchemaRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.CreateSchemaRequest) + return object; + var message = new $root.google.pubsub.v1.CreateSchemaRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.schema != null) { + if (typeof object.schema !== "object") + throw TypeError(".google.pubsub.v1.CreateSchemaRequest.schema: object expected"); + message.schema = $root.google.pubsub.v1.Schema.fromObject(object.schema); + } + if (object.schemaId != null) + message.schemaId = String(object.schemaId); + return message; + }; + + /** + * Creates a plain object from a CreateSchemaRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.CreateSchemaRequest + * @static + * @param {google.pubsub.v1.CreateSchemaRequest} message CreateSchemaRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateSchemaRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.schema = null; + object.schemaId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.schema != null && message.hasOwnProperty("schema")) + object.schema = $root.google.pubsub.v1.Schema.toObject(message.schema, options); + if (message.schemaId != null && message.hasOwnProperty("schemaId")) + object.schemaId = message.schemaId; + return object; + }; + + /** + * Converts this CreateSchemaRequest to JSON. + * @function toJSON + * @memberof google.pubsub.v1.CreateSchemaRequest + * @instance + * @returns {Object.} JSON object + */ + CreateSchemaRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateSchemaRequest + * @function getTypeUrl + * @memberof google.pubsub.v1.CreateSchemaRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateSchemaRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.CreateSchemaRequest"; + }; + + return CreateSchemaRequest; + })(); + + v1.GetSchemaRequest = (function() { + + /** + * Properties of a GetSchemaRequest. + * @memberof google.pubsub.v1 + * @interface IGetSchemaRequest + * @property {string|null} [name] GetSchemaRequest name + * @property {google.pubsub.v1.SchemaView|null} [view] GetSchemaRequest view + */ + + /** + * Constructs a new GetSchemaRequest. + * @memberof google.pubsub.v1 + * @classdesc Represents a GetSchemaRequest. + * @implements IGetSchemaRequest + * @constructor + * @param {google.pubsub.v1.IGetSchemaRequest=} [properties] Properties to set + */ + function GetSchemaRequest(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]]; + } + + /** + * GetSchemaRequest name. + * @member {string} name + * @memberof google.pubsub.v1.GetSchemaRequest + * @instance + */ + GetSchemaRequest.prototype.name = ""; + + /** + * GetSchemaRequest view. + * @member {google.pubsub.v1.SchemaView} view + * @memberof google.pubsub.v1.GetSchemaRequest + * @instance + */ + GetSchemaRequest.prototype.view = 0; + + /** + * Creates a new GetSchemaRequest instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.GetSchemaRequest + * @static + * @param {google.pubsub.v1.IGetSchemaRequest=} [properties] Properties to set + * @returns {google.pubsub.v1.GetSchemaRequest} GetSchemaRequest instance + */ + GetSchemaRequest.create = function create(properties) { + return new GetSchemaRequest(properties); + }; + + /** + * Encodes the specified GetSchemaRequest message. Does not implicitly {@link google.pubsub.v1.GetSchemaRequest.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.GetSchemaRequest + * @static + * @param {google.pubsub.v1.IGetSchemaRequest} message GetSchemaRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSchemaRequest.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.view != null && Object.hasOwnProperty.call(message, "view")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.view); + return writer; + }; + + /** + * Encodes the specified GetSchemaRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.GetSchemaRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.GetSchemaRequest + * @static + * @param {google.pubsub.v1.IGetSchemaRequest} message GetSchemaRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSchemaRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetSchemaRequest message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.GetSchemaRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.GetSchemaRequest} GetSchemaRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSchemaRequest.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.pubsub.v1.GetSchemaRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.view = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetSchemaRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.GetSchemaRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.GetSchemaRequest} GetSchemaRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSchemaRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetSchemaRequest message. + * @function verify + * @memberof google.pubsub.v1.GetSchemaRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetSchemaRequest.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.view != null && message.hasOwnProperty("view")) + switch (message.view) { + default: + return "view: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a GetSchemaRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.GetSchemaRequest + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.GetSchemaRequest} GetSchemaRequest + */ + GetSchemaRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.GetSchemaRequest) + return object; + var message = new $root.google.pubsub.v1.GetSchemaRequest(); + if (object.name != null) + message.name = String(object.name); + switch (object.view) { + default: + if (typeof object.view === "number") { + message.view = object.view; + break; + } + break; + case "SCHEMA_VIEW_UNSPECIFIED": + case 0: + message.view = 0; + break; + case "BASIC": + case 1: + message.view = 1; + break; + case "FULL": + case 2: + message.view = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a GetSchemaRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.GetSchemaRequest + * @static + * @param {google.pubsub.v1.GetSchemaRequest} message GetSchemaRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetSchemaRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.view = options.enums === String ? "SCHEMA_VIEW_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.view != null && message.hasOwnProperty("view")) + object.view = options.enums === String ? $root.google.pubsub.v1.SchemaView[message.view] === undefined ? message.view : $root.google.pubsub.v1.SchemaView[message.view] : message.view; + return object; + }; + + /** + * Converts this GetSchemaRequest to JSON. + * @function toJSON + * @memberof google.pubsub.v1.GetSchemaRequest + * @instance + * @returns {Object.} JSON object + */ + GetSchemaRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetSchemaRequest + * @function getTypeUrl + * @memberof google.pubsub.v1.GetSchemaRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetSchemaRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.GetSchemaRequest"; + }; + + return GetSchemaRequest; + })(); + + v1.ListSchemasRequest = (function() { + + /** + * Properties of a ListSchemasRequest. + * @memberof google.pubsub.v1 + * @interface IListSchemasRequest + * @property {string|null} [parent] ListSchemasRequest parent + * @property {google.pubsub.v1.SchemaView|null} [view] ListSchemasRequest view + * @property {number|null} [pageSize] ListSchemasRequest pageSize + * @property {string|null} [pageToken] ListSchemasRequest pageToken + */ + + /** + * Constructs a new ListSchemasRequest. + * @memberof google.pubsub.v1 + * @classdesc Represents a ListSchemasRequest. + * @implements IListSchemasRequest + * @constructor + * @param {google.pubsub.v1.IListSchemasRequest=} [properties] Properties to set + */ + function ListSchemasRequest(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]]; + } + + /** + * ListSchemasRequest parent. + * @member {string} parent + * @memberof google.pubsub.v1.ListSchemasRequest + * @instance + */ + ListSchemasRequest.prototype.parent = ""; + + /** + * ListSchemasRequest view. + * @member {google.pubsub.v1.SchemaView} view + * @memberof google.pubsub.v1.ListSchemasRequest + * @instance + */ + ListSchemasRequest.prototype.view = 0; + + /** + * ListSchemasRequest pageSize. + * @member {number} pageSize + * @memberof google.pubsub.v1.ListSchemasRequest + * @instance + */ + ListSchemasRequest.prototype.pageSize = 0; + + /** + * ListSchemasRequest pageToken. + * @member {string} pageToken + * @memberof google.pubsub.v1.ListSchemasRequest + * @instance + */ + ListSchemasRequest.prototype.pageToken = ""; + + /** + * Creates a new ListSchemasRequest instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.ListSchemasRequest + * @static + * @param {google.pubsub.v1.IListSchemasRequest=} [properties] Properties to set + * @returns {google.pubsub.v1.ListSchemasRequest} ListSchemasRequest instance + */ + ListSchemasRequest.create = function create(properties) { + return new ListSchemasRequest(properties); + }; + + /** + * Encodes the specified ListSchemasRequest message. Does not implicitly {@link google.pubsub.v1.ListSchemasRequest.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.ListSchemasRequest + * @static + * @param {google.pubsub.v1.IListSchemasRequest} message ListSchemasRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSchemasRequest.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.view != null && Object.hasOwnProperty.call(message, "view")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.view); + 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); + return writer; + }; + + /** + * Encodes the specified ListSchemasRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.ListSchemasRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.ListSchemasRequest + * @static + * @param {google.pubsub.v1.IListSchemasRequest} message ListSchemasRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSchemasRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSchemasRequest message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.ListSchemasRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.ListSchemasRequest} ListSchemasRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSchemasRequest.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.pubsub.v1.ListSchemasRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.view = reader.int32(); + break; + } + case 3: { + message.pageSize = reader.int32(); + break; + } + case 4: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListSchemasRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.ListSchemasRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.ListSchemasRequest} ListSchemasRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSchemasRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSchemasRequest message. + * @function verify + * @memberof google.pubsub.v1.ListSchemasRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSchemasRequest.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.view != null && message.hasOwnProperty("view")) + switch (message.view) { + default: + return "view: enum value expected"; + case 0: + case 1: + case 2: + break; + } + 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"; + return null; + }; + + /** + * Creates a ListSchemasRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.ListSchemasRequest + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.ListSchemasRequest} ListSchemasRequest + */ + ListSchemasRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.ListSchemasRequest) + return object; + var message = new $root.google.pubsub.v1.ListSchemasRequest(); + if (object.parent != null) + message.parent = String(object.parent); + switch (object.view) { + default: + if (typeof object.view === "number") { + message.view = object.view; + break; + } + break; + case "SCHEMA_VIEW_UNSPECIFIED": + case 0: + message.view = 0; + break; + case "BASIC": + case 1: + message.view = 1; + break; + case "FULL": + case 2: + message.view = 2; + break; + } + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListSchemasRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.ListSchemasRequest + * @static + * @param {google.pubsub.v1.ListSchemasRequest} message ListSchemasRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSchemasRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.view = options.enums === String ? "SCHEMA_VIEW_UNSPECIFIED" : 0; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.view != null && message.hasOwnProperty("view")) + object.view = options.enums === String ? $root.google.pubsub.v1.SchemaView[message.view] === undefined ? message.view : $root.google.pubsub.v1.SchemaView[message.view] : message.view; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListSchemasRequest to JSON. + * @function toJSON + * @memberof google.pubsub.v1.ListSchemasRequest + * @instance + * @returns {Object.} JSON object + */ + ListSchemasRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListSchemasRequest + * @function getTypeUrl + * @memberof google.pubsub.v1.ListSchemasRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListSchemasRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.ListSchemasRequest"; + }; + + return ListSchemasRequest; + })(); + + v1.ListSchemasResponse = (function() { + + /** + * Properties of a ListSchemasResponse. + * @memberof google.pubsub.v1 + * @interface IListSchemasResponse + * @property {Array.|null} [schemas] ListSchemasResponse schemas + * @property {string|null} [nextPageToken] ListSchemasResponse nextPageToken + */ + + /** + * Constructs a new ListSchemasResponse. + * @memberof google.pubsub.v1 + * @classdesc Represents a ListSchemasResponse. + * @implements IListSchemasResponse + * @constructor + * @param {google.pubsub.v1.IListSchemasResponse=} [properties] Properties to set + */ + function ListSchemasResponse(properties) { + this.schemas = []; + 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]]; + } + + /** + * ListSchemasResponse schemas. + * @member {Array.} schemas + * @memberof google.pubsub.v1.ListSchemasResponse + * @instance + */ + ListSchemasResponse.prototype.schemas = $util.emptyArray; + + /** + * ListSchemasResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.pubsub.v1.ListSchemasResponse + * @instance + */ + ListSchemasResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListSchemasResponse instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.ListSchemasResponse + * @static + * @param {google.pubsub.v1.IListSchemasResponse=} [properties] Properties to set + * @returns {google.pubsub.v1.ListSchemasResponse} ListSchemasResponse instance + */ + ListSchemasResponse.create = function create(properties) { + return new ListSchemasResponse(properties); + }; + + /** + * Encodes the specified ListSchemasResponse message. Does not implicitly {@link google.pubsub.v1.ListSchemasResponse.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.ListSchemasResponse + * @static + * @param {google.pubsub.v1.IListSchemasResponse} message ListSchemasResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSchemasResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.schemas != null && message.schemas.length) + for (var i = 0; i < message.schemas.length; ++i) + $root.google.pubsub.v1.Schema.encode(message.schemas[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 ListSchemasResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.ListSchemasResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.ListSchemasResponse + * @static + * @param {google.pubsub.v1.IListSchemasResponse} message ListSchemasResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSchemasResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSchemasResponse message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.ListSchemasResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.ListSchemasResponse} ListSchemasResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSchemasResponse.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.pubsub.v1.ListSchemasResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.schemas && message.schemas.length)) + message.schemas = []; + message.schemas.push($root.google.pubsub.v1.Schema.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListSchemasResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.ListSchemasResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.ListSchemasResponse} ListSchemasResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSchemasResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSchemasResponse message. + * @function verify + * @memberof google.pubsub.v1.ListSchemasResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSchemasResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.schemas != null && message.hasOwnProperty("schemas")) { + if (!Array.isArray(message.schemas)) + return "schemas: array expected"; + for (var i = 0; i < message.schemas.length; ++i) { + var error = $root.google.pubsub.v1.Schema.verify(message.schemas[i]); + if (error) + return "schemas." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListSchemasResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.ListSchemasResponse + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.ListSchemasResponse} ListSchemasResponse + */ + ListSchemasResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.ListSchemasResponse) + return object; + var message = new $root.google.pubsub.v1.ListSchemasResponse(); + if (object.schemas) { + if (!Array.isArray(object.schemas)) + throw TypeError(".google.pubsub.v1.ListSchemasResponse.schemas: array expected"); + message.schemas = []; + for (var i = 0; i < object.schemas.length; ++i) { + if (typeof object.schemas[i] !== "object") + throw TypeError(".google.pubsub.v1.ListSchemasResponse.schemas: object expected"); + message.schemas[i] = $root.google.pubsub.v1.Schema.fromObject(object.schemas[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListSchemasResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.ListSchemasResponse + * @static + * @param {google.pubsub.v1.ListSchemasResponse} message ListSchemasResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSchemasResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.schemas = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.schemas && message.schemas.length) { + object.schemas = []; + for (var j = 0; j < message.schemas.length; ++j) + object.schemas[j] = $root.google.pubsub.v1.Schema.toObject(message.schemas[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListSchemasResponse to JSON. + * @function toJSON + * @memberof google.pubsub.v1.ListSchemasResponse + * @instance + * @returns {Object.} JSON object + */ + ListSchemasResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListSchemasResponse + * @function getTypeUrl + * @memberof google.pubsub.v1.ListSchemasResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListSchemasResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.ListSchemasResponse"; + }; + + return ListSchemasResponse; + })(); + + v1.ListSchemaRevisionsRequest = (function() { + + /** + * Properties of a ListSchemaRevisionsRequest. + * @memberof google.pubsub.v1 + * @interface IListSchemaRevisionsRequest + * @property {string|null} [name] ListSchemaRevisionsRequest name + * @property {google.pubsub.v1.SchemaView|null} [view] ListSchemaRevisionsRequest view + * @property {number|null} [pageSize] ListSchemaRevisionsRequest pageSize + * @property {string|null} [pageToken] ListSchemaRevisionsRequest pageToken + */ + + /** + * Constructs a new ListSchemaRevisionsRequest. + * @memberof google.pubsub.v1 + * @classdesc Represents a ListSchemaRevisionsRequest. + * @implements IListSchemaRevisionsRequest + * @constructor + * @param {google.pubsub.v1.IListSchemaRevisionsRequest=} [properties] Properties to set + */ + function ListSchemaRevisionsRequest(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]]; + } + + /** + * ListSchemaRevisionsRequest name. + * @member {string} name + * @memberof google.pubsub.v1.ListSchemaRevisionsRequest + * @instance + */ + ListSchemaRevisionsRequest.prototype.name = ""; + + /** + * ListSchemaRevisionsRequest view. + * @member {google.pubsub.v1.SchemaView} view + * @memberof google.pubsub.v1.ListSchemaRevisionsRequest + * @instance + */ + ListSchemaRevisionsRequest.prototype.view = 0; + + /** + * ListSchemaRevisionsRequest pageSize. + * @member {number} pageSize + * @memberof google.pubsub.v1.ListSchemaRevisionsRequest + * @instance + */ + ListSchemaRevisionsRequest.prototype.pageSize = 0; + + /** + * ListSchemaRevisionsRequest pageToken. + * @member {string} pageToken + * @memberof google.pubsub.v1.ListSchemaRevisionsRequest + * @instance + */ + ListSchemaRevisionsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListSchemaRevisionsRequest instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.ListSchemaRevisionsRequest + * @static + * @param {google.pubsub.v1.IListSchemaRevisionsRequest=} [properties] Properties to set + * @returns {google.pubsub.v1.ListSchemaRevisionsRequest} ListSchemaRevisionsRequest instance + */ + ListSchemaRevisionsRequest.create = function create(properties) { + return new ListSchemaRevisionsRequest(properties); + }; + + /** + * Encodes the specified ListSchemaRevisionsRequest message. Does not implicitly {@link google.pubsub.v1.ListSchemaRevisionsRequest.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.ListSchemaRevisionsRequest + * @static + * @param {google.pubsub.v1.IListSchemaRevisionsRequest} message ListSchemaRevisionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSchemaRevisionsRequest.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.view != null && Object.hasOwnProperty.call(message, "view")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.view); + 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); + return writer; + }; + + /** + * Encodes the specified ListSchemaRevisionsRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.ListSchemaRevisionsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.ListSchemaRevisionsRequest + * @static + * @param {google.pubsub.v1.IListSchemaRevisionsRequest} message ListSchemaRevisionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSchemaRevisionsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSchemaRevisionsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.ListSchemaRevisionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.ListSchemaRevisionsRequest} ListSchemaRevisionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSchemaRevisionsRequest.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.pubsub.v1.ListSchemaRevisionsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.view = reader.int32(); + break; + } + case 3: { + message.pageSize = reader.int32(); + break; + } + case 4: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListSchemaRevisionsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.ListSchemaRevisionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.ListSchemaRevisionsRequest} ListSchemaRevisionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSchemaRevisionsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSchemaRevisionsRequest message. + * @function verify + * @memberof google.pubsub.v1.ListSchemaRevisionsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSchemaRevisionsRequest.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.view != null && message.hasOwnProperty("view")) + switch (message.view) { + default: + return "view: enum value expected"; + case 0: + case 1: + case 2: + break; + } + 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"; + return null; + }; + + /** + * Creates a ListSchemaRevisionsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.ListSchemaRevisionsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.ListSchemaRevisionsRequest} ListSchemaRevisionsRequest + */ + ListSchemaRevisionsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.ListSchemaRevisionsRequest) + return object; + var message = new $root.google.pubsub.v1.ListSchemaRevisionsRequest(); + if (object.name != null) + message.name = String(object.name); + switch (object.view) { + default: + if (typeof object.view === "number") { + message.view = object.view; + break; + } + break; + case "SCHEMA_VIEW_UNSPECIFIED": + case 0: + message.view = 0; + break; + case "BASIC": + case 1: + message.view = 1; + break; + case "FULL": + case 2: + message.view = 2; + break; + } + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListSchemaRevisionsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.ListSchemaRevisionsRequest + * @static + * @param {google.pubsub.v1.ListSchemaRevisionsRequest} message ListSchemaRevisionsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSchemaRevisionsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.view = options.enums === String ? "SCHEMA_VIEW_UNSPECIFIED" : 0; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.view != null && message.hasOwnProperty("view")) + object.view = options.enums === String ? $root.google.pubsub.v1.SchemaView[message.view] === undefined ? message.view : $root.google.pubsub.v1.SchemaView[message.view] : message.view; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListSchemaRevisionsRequest to JSON. + * @function toJSON + * @memberof google.pubsub.v1.ListSchemaRevisionsRequest + * @instance + * @returns {Object.} JSON object + */ + ListSchemaRevisionsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListSchemaRevisionsRequest + * @function getTypeUrl + * @memberof google.pubsub.v1.ListSchemaRevisionsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListSchemaRevisionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.ListSchemaRevisionsRequest"; + }; + + return ListSchemaRevisionsRequest; + })(); + + v1.ListSchemaRevisionsResponse = (function() { + + /** + * Properties of a ListSchemaRevisionsResponse. + * @memberof google.pubsub.v1 + * @interface IListSchemaRevisionsResponse + * @property {Array.|null} [schemas] ListSchemaRevisionsResponse schemas + * @property {string|null} [nextPageToken] ListSchemaRevisionsResponse nextPageToken + */ + + /** + * Constructs a new ListSchemaRevisionsResponse. + * @memberof google.pubsub.v1 + * @classdesc Represents a ListSchemaRevisionsResponse. + * @implements IListSchemaRevisionsResponse + * @constructor + * @param {google.pubsub.v1.IListSchemaRevisionsResponse=} [properties] Properties to set + */ + function ListSchemaRevisionsResponse(properties) { + this.schemas = []; + 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]]; + } + + /** + * ListSchemaRevisionsResponse schemas. + * @member {Array.} schemas + * @memberof google.pubsub.v1.ListSchemaRevisionsResponse + * @instance + */ + ListSchemaRevisionsResponse.prototype.schemas = $util.emptyArray; + + /** + * ListSchemaRevisionsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.pubsub.v1.ListSchemaRevisionsResponse + * @instance + */ + ListSchemaRevisionsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListSchemaRevisionsResponse instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.ListSchemaRevisionsResponse + * @static + * @param {google.pubsub.v1.IListSchemaRevisionsResponse=} [properties] Properties to set + * @returns {google.pubsub.v1.ListSchemaRevisionsResponse} ListSchemaRevisionsResponse instance + */ + ListSchemaRevisionsResponse.create = function create(properties) { + return new ListSchemaRevisionsResponse(properties); + }; + + /** + * Encodes the specified ListSchemaRevisionsResponse message. Does not implicitly {@link google.pubsub.v1.ListSchemaRevisionsResponse.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.ListSchemaRevisionsResponse + * @static + * @param {google.pubsub.v1.IListSchemaRevisionsResponse} message ListSchemaRevisionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSchemaRevisionsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.schemas != null && message.schemas.length) + for (var i = 0; i < message.schemas.length; ++i) + $root.google.pubsub.v1.Schema.encode(message.schemas[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 ListSchemaRevisionsResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.ListSchemaRevisionsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.ListSchemaRevisionsResponse + * @static + * @param {google.pubsub.v1.IListSchemaRevisionsResponse} message ListSchemaRevisionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSchemaRevisionsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSchemaRevisionsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.ListSchemaRevisionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.ListSchemaRevisionsResponse} ListSchemaRevisionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSchemaRevisionsResponse.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.pubsub.v1.ListSchemaRevisionsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.schemas && message.schemas.length)) + message.schemas = []; + message.schemas.push($root.google.pubsub.v1.Schema.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListSchemaRevisionsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.ListSchemaRevisionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.ListSchemaRevisionsResponse} ListSchemaRevisionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSchemaRevisionsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSchemaRevisionsResponse message. + * @function verify + * @memberof google.pubsub.v1.ListSchemaRevisionsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSchemaRevisionsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.schemas != null && message.hasOwnProperty("schemas")) { + if (!Array.isArray(message.schemas)) + return "schemas: array expected"; + for (var i = 0; i < message.schemas.length; ++i) { + var error = $root.google.pubsub.v1.Schema.verify(message.schemas[i]); + if (error) + return "schemas." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListSchemaRevisionsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.ListSchemaRevisionsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.ListSchemaRevisionsResponse} ListSchemaRevisionsResponse + */ + ListSchemaRevisionsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.ListSchemaRevisionsResponse) + return object; + var message = new $root.google.pubsub.v1.ListSchemaRevisionsResponse(); + if (object.schemas) { + if (!Array.isArray(object.schemas)) + throw TypeError(".google.pubsub.v1.ListSchemaRevisionsResponse.schemas: array expected"); + message.schemas = []; + for (var i = 0; i < object.schemas.length; ++i) { + if (typeof object.schemas[i] !== "object") + throw TypeError(".google.pubsub.v1.ListSchemaRevisionsResponse.schemas: object expected"); + message.schemas[i] = $root.google.pubsub.v1.Schema.fromObject(object.schemas[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListSchemaRevisionsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.ListSchemaRevisionsResponse + * @static + * @param {google.pubsub.v1.ListSchemaRevisionsResponse} message ListSchemaRevisionsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSchemaRevisionsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.schemas = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.schemas && message.schemas.length) { + object.schemas = []; + for (var j = 0; j < message.schemas.length; ++j) + object.schemas[j] = $root.google.pubsub.v1.Schema.toObject(message.schemas[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListSchemaRevisionsResponse to JSON. + * @function toJSON + * @memberof google.pubsub.v1.ListSchemaRevisionsResponse + * @instance + * @returns {Object.} JSON object + */ + ListSchemaRevisionsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListSchemaRevisionsResponse + * @function getTypeUrl + * @memberof google.pubsub.v1.ListSchemaRevisionsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListSchemaRevisionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.ListSchemaRevisionsResponse"; + }; + + return ListSchemaRevisionsResponse; + })(); + + v1.CommitSchemaRequest = (function() { + + /** + * Properties of a CommitSchemaRequest. + * @memberof google.pubsub.v1 + * @interface ICommitSchemaRequest + * @property {string|null} [name] CommitSchemaRequest name + * @property {google.pubsub.v1.ISchema|null} [schema] CommitSchemaRequest schema + */ + + /** + * Constructs a new CommitSchemaRequest. + * @memberof google.pubsub.v1 + * @classdesc Represents a CommitSchemaRequest. + * @implements ICommitSchemaRequest + * @constructor + * @param {google.pubsub.v1.ICommitSchemaRequest=} [properties] Properties to set + */ + function CommitSchemaRequest(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]]; + } + + /** + * CommitSchemaRequest name. + * @member {string} name + * @memberof google.pubsub.v1.CommitSchemaRequest + * @instance + */ + CommitSchemaRequest.prototype.name = ""; + + /** + * CommitSchemaRequest schema. + * @member {google.pubsub.v1.ISchema|null|undefined} schema + * @memberof google.pubsub.v1.CommitSchemaRequest + * @instance + */ + CommitSchemaRequest.prototype.schema = null; + + /** + * Creates a new CommitSchemaRequest instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.CommitSchemaRequest + * @static + * @param {google.pubsub.v1.ICommitSchemaRequest=} [properties] Properties to set + * @returns {google.pubsub.v1.CommitSchemaRequest} CommitSchemaRequest instance + */ + CommitSchemaRequest.create = function create(properties) { + return new CommitSchemaRequest(properties); + }; + + /** + * Encodes the specified CommitSchemaRequest message. Does not implicitly {@link google.pubsub.v1.CommitSchemaRequest.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.CommitSchemaRequest + * @static + * @param {google.pubsub.v1.ICommitSchemaRequest} message CommitSchemaRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommitSchemaRequest.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.schema != null && Object.hasOwnProperty.call(message, "schema")) + $root.google.pubsub.v1.Schema.encode(message.schema, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CommitSchemaRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.CommitSchemaRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.CommitSchemaRequest + * @static + * @param {google.pubsub.v1.ICommitSchemaRequest} message CommitSchemaRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommitSchemaRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CommitSchemaRequest message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.CommitSchemaRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.CommitSchemaRequest} CommitSchemaRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommitSchemaRequest.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.pubsub.v1.CommitSchemaRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.schema = $root.google.pubsub.v1.Schema.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CommitSchemaRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.CommitSchemaRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.CommitSchemaRequest} CommitSchemaRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommitSchemaRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CommitSchemaRequest message. + * @function verify + * @memberof google.pubsub.v1.CommitSchemaRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CommitSchemaRequest.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.schema != null && message.hasOwnProperty("schema")) { + var error = $root.google.pubsub.v1.Schema.verify(message.schema); + if (error) + return "schema." + error; + } + return null; + }; + + /** + * Creates a CommitSchemaRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.CommitSchemaRequest + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.CommitSchemaRequest} CommitSchemaRequest + */ + CommitSchemaRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.CommitSchemaRequest) + return object; + var message = new $root.google.pubsub.v1.CommitSchemaRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.schema != null) { + if (typeof object.schema !== "object") + throw TypeError(".google.pubsub.v1.CommitSchemaRequest.schema: object expected"); + message.schema = $root.google.pubsub.v1.Schema.fromObject(object.schema); + } + return message; + }; + + /** + * Creates a plain object from a CommitSchemaRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.CommitSchemaRequest + * @static + * @param {google.pubsub.v1.CommitSchemaRequest} message CommitSchemaRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CommitSchemaRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.schema = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.schema != null && message.hasOwnProperty("schema")) + object.schema = $root.google.pubsub.v1.Schema.toObject(message.schema, options); + return object; + }; + + /** + * Converts this CommitSchemaRequest to JSON. + * @function toJSON + * @memberof google.pubsub.v1.CommitSchemaRequest + * @instance + * @returns {Object.} JSON object + */ + CommitSchemaRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CommitSchemaRequest + * @function getTypeUrl + * @memberof google.pubsub.v1.CommitSchemaRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CommitSchemaRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.CommitSchemaRequest"; + }; + + return CommitSchemaRequest; + })(); + + v1.RollbackSchemaRequest = (function() { + + /** + * Properties of a RollbackSchemaRequest. + * @memberof google.pubsub.v1 + * @interface IRollbackSchemaRequest + * @property {string|null} [name] RollbackSchemaRequest name + * @property {string|null} [revisionId] RollbackSchemaRequest revisionId + */ + + /** + * Constructs a new RollbackSchemaRequest. + * @memberof google.pubsub.v1 + * @classdesc Represents a RollbackSchemaRequest. + * @implements IRollbackSchemaRequest + * @constructor + * @param {google.pubsub.v1.IRollbackSchemaRequest=} [properties] Properties to set + */ + function RollbackSchemaRequest(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]]; + } + + /** + * RollbackSchemaRequest name. + * @member {string} name + * @memberof google.pubsub.v1.RollbackSchemaRequest + * @instance + */ + RollbackSchemaRequest.prototype.name = ""; + + /** + * RollbackSchemaRequest revisionId. + * @member {string} revisionId + * @memberof google.pubsub.v1.RollbackSchemaRequest + * @instance + */ + RollbackSchemaRequest.prototype.revisionId = ""; + + /** + * Creates a new RollbackSchemaRequest instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.RollbackSchemaRequest + * @static + * @param {google.pubsub.v1.IRollbackSchemaRequest=} [properties] Properties to set + * @returns {google.pubsub.v1.RollbackSchemaRequest} RollbackSchemaRequest instance + */ + RollbackSchemaRequest.create = function create(properties) { + return new RollbackSchemaRequest(properties); + }; + + /** + * Encodes the specified RollbackSchemaRequest message. Does not implicitly {@link google.pubsub.v1.RollbackSchemaRequest.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.RollbackSchemaRequest + * @static + * @param {google.pubsub.v1.IRollbackSchemaRequest} message RollbackSchemaRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RollbackSchemaRequest.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.revisionId != null && Object.hasOwnProperty.call(message, "revisionId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.revisionId); + return writer; + }; + + /** + * Encodes the specified RollbackSchemaRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.RollbackSchemaRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.RollbackSchemaRequest + * @static + * @param {google.pubsub.v1.IRollbackSchemaRequest} message RollbackSchemaRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RollbackSchemaRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RollbackSchemaRequest message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.RollbackSchemaRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.RollbackSchemaRequest} RollbackSchemaRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RollbackSchemaRequest.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.pubsub.v1.RollbackSchemaRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.revisionId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RollbackSchemaRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.RollbackSchemaRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.RollbackSchemaRequest} RollbackSchemaRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RollbackSchemaRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RollbackSchemaRequest message. + * @function verify + * @memberof google.pubsub.v1.RollbackSchemaRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RollbackSchemaRequest.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.revisionId != null && message.hasOwnProperty("revisionId")) + if (!$util.isString(message.revisionId)) + return "revisionId: string expected"; + return null; + }; + + /** + * Creates a RollbackSchemaRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.RollbackSchemaRequest + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.RollbackSchemaRequest} RollbackSchemaRequest + */ + RollbackSchemaRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.RollbackSchemaRequest) + return object; + var message = new $root.google.pubsub.v1.RollbackSchemaRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.revisionId != null) + message.revisionId = String(object.revisionId); + return message; + }; + + /** + * Creates a plain object from a RollbackSchemaRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.RollbackSchemaRequest + * @static + * @param {google.pubsub.v1.RollbackSchemaRequest} message RollbackSchemaRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RollbackSchemaRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.revisionId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.revisionId != null && message.hasOwnProperty("revisionId")) + object.revisionId = message.revisionId; + return object; + }; + + /** + * Converts this RollbackSchemaRequest to JSON. + * @function toJSON + * @memberof google.pubsub.v1.RollbackSchemaRequest + * @instance + * @returns {Object.} JSON object + */ + RollbackSchemaRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RollbackSchemaRequest + * @function getTypeUrl + * @memberof google.pubsub.v1.RollbackSchemaRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RollbackSchemaRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.RollbackSchemaRequest"; + }; + + return RollbackSchemaRequest; + })(); + + v1.DeleteSchemaRevisionRequest = (function() { + + /** + * Properties of a DeleteSchemaRevisionRequest. + * @memberof google.pubsub.v1 + * @interface IDeleteSchemaRevisionRequest + * @property {string|null} [name] DeleteSchemaRevisionRequest name + * @property {string|null} [revisionId] DeleteSchemaRevisionRequest revisionId + */ + + /** + * Constructs a new DeleteSchemaRevisionRequest. + * @memberof google.pubsub.v1 + * @classdesc Represents a DeleteSchemaRevisionRequest. + * @implements IDeleteSchemaRevisionRequest + * @constructor + * @param {google.pubsub.v1.IDeleteSchemaRevisionRequest=} [properties] Properties to set + */ + function DeleteSchemaRevisionRequest(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]]; + } + + /** + * DeleteSchemaRevisionRequest name. + * @member {string} name + * @memberof google.pubsub.v1.DeleteSchemaRevisionRequest + * @instance + */ + DeleteSchemaRevisionRequest.prototype.name = ""; + + /** + * DeleteSchemaRevisionRequest revisionId. + * @member {string} revisionId + * @memberof google.pubsub.v1.DeleteSchemaRevisionRequest + * @instance + */ + DeleteSchemaRevisionRequest.prototype.revisionId = ""; + + /** + * Creates a new DeleteSchemaRevisionRequest instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.DeleteSchemaRevisionRequest + * @static + * @param {google.pubsub.v1.IDeleteSchemaRevisionRequest=} [properties] Properties to set + * @returns {google.pubsub.v1.DeleteSchemaRevisionRequest} DeleteSchemaRevisionRequest instance + */ + DeleteSchemaRevisionRequest.create = function create(properties) { + return new DeleteSchemaRevisionRequest(properties); + }; + + /** + * Encodes the specified DeleteSchemaRevisionRequest message. Does not implicitly {@link google.pubsub.v1.DeleteSchemaRevisionRequest.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.DeleteSchemaRevisionRequest + * @static + * @param {google.pubsub.v1.IDeleteSchemaRevisionRequest} message DeleteSchemaRevisionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteSchemaRevisionRequest.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.revisionId != null && Object.hasOwnProperty.call(message, "revisionId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.revisionId); + return writer; + }; + + /** + * Encodes the specified DeleteSchemaRevisionRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.DeleteSchemaRevisionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.DeleteSchemaRevisionRequest + * @static + * @param {google.pubsub.v1.IDeleteSchemaRevisionRequest} message DeleteSchemaRevisionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteSchemaRevisionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteSchemaRevisionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.DeleteSchemaRevisionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.DeleteSchemaRevisionRequest} DeleteSchemaRevisionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteSchemaRevisionRequest.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.pubsub.v1.DeleteSchemaRevisionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.revisionId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteSchemaRevisionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.DeleteSchemaRevisionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.DeleteSchemaRevisionRequest} DeleteSchemaRevisionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteSchemaRevisionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteSchemaRevisionRequest message. + * @function verify + * @memberof google.pubsub.v1.DeleteSchemaRevisionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteSchemaRevisionRequest.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.revisionId != null && message.hasOwnProperty("revisionId")) + if (!$util.isString(message.revisionId)) + return "revisionId: string expected"; + return null; + }; + + /** + * Creates a DeleteSchemaRevisionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.DeleteSchemaRevisionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.DeleteSchemaRevisionRequest} DeleteSchemaRevisionRequest + */ + DeleteSchemaRevisionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.DeleteSchemaRevisionRequest) + return object; + var message = new $root.google.pubsub.v1.DeleteSchemaRevisionRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.revisionId != null) + message.revisionId = String(object.revisionId); + return message; + }; + + /** + * Creates a plain object from a DeleteSchemaRevisionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.DeleteSchemaRevisionRequest + * @static + * @param {google.pubsub.v1.DeleteSchemaRevisionRequest} message DeleteSchemaRevisionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteSchemaRevisionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.revisionId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.revisionId != null && message.hasOwnProperty("revisionId")) + object.revisionId = message.revisionId; + return object; + }; + + /** + * Converts this DeleteSchemaRevisionRequest to JSON. + * @function toJSON + * @memberof google.pubsub.v1.DeleteSchemaRevisionRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteSchemaRevisionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteSchemaRevisionRequest + * @function getTypeUrl + * @memberof google.pubsub.v1.DeleteSchemaRevisionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteSchemaRevisionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.DeleteSchemaRevisionRequest"; + }; + + return DeleteSchemaRevisionRequest; + })(); + + v1.DeleteSchemaRequest = (function() { + + /** + * Properties of a DeleteSchemaRequest. + * @memberof google.pubsub.v1 + * @interface IDeleteSchemaRequest + * @property {string|null} [name] DeleteSchemaRequest name + */ + + /** + * Constructs a new DeleteSchemaRequest. + * @memberof google.pubsub.v1 + * @classdesc Represents a DeleteSchemaRequest. + * @implements IDeleteSchemaRequest + * @constructor + * @param {google.pubsub.v1.IDeleteSchemaRequest=} [properties] Properties to set + */ + function DeleteSchemaRequest(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]]; + } + + /** + * DeleteSchemaRequest name. + * @member {string} name + * @memberof google.pubsub.v1.DeleteSchemaRequest + * @instance + */ + DeleteSchemaRequest.prototype.name = ""; + + /** + * Creates a new DeleteSchemaRequest instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.DeleteSchemaRequest + * @static + * @param {google.pubsub.v1.IDeleteSchemaRequest=} [properties] Properties to set + * @returns {google.pubsub.v1.DeleteSchemaRequest} DeleteSchemaRequest instance + */ + DeleteSchemaRequest.create = function create(properties) { + return new DeleteSchemaRequest(properties); + }; + + /** + * Encodes the specified DeleteSchemaRequest message. Does not implicitly {@link google.pubsub.v1.DeleteSchemaRequest.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.DeleteSchemaRequest + * @static + * @param {google.pubsub.v1.IDeleteSchemaRequest} message DeleteSchemaRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteSchemaRequest.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); + return writer; + }; + + /** + * Encodes the specified DeleteSchemaRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.DeleteSchemaRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.DeleteSchemaRequest + * @static + * @param {google.pubsub.v1.IDeleteSchemaRequest} message DeleteSchemaRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteSchemaRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteSchemaRequest message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.DeleteSchemaRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.DeleteSchemaRequest} DeleteSchemaRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteSchemaRequest.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.pubsub.v1.DeleteSchemaRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteSchemaRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.DeleteSchemaRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.DeleteSchemaRequest} DeleteSchemaRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteSchemaRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteSchemaRequest message. + * @function verify + * @memberof google.pubsub.v1.DeleteSchemaRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteSchemaRequest.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"; + return null; + }; + + /** + * Creates a DeleteSchemaRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.DeleteSchemaRequest + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.DeleteSchemaRequest} DeleteSchemaRequest + */ + DeleteSchemaRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.DeleteSchemaRequest) + return object; + var message = new $root.google.pubsub.v1.DeleteSchemaRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteSchemaRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.DeleteSchemaRequest + * @static + * @param {google.pubsub.v1.DeleteSchemaRequest} message DeleteSchemaRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteSchemaRequest.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 DeleteSchemaRequest to JSON. + * @function toJSON + * @memberof google.pubsub.v1.DeleteSchemaRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteSchemaRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteSchemaRequest + * @function getTypeUrl + * @memberof google.pubsub.v1.DeleteSchemaRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteSchemaRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.DeleteSchemaRequest"; + }; + + return DeleteSchemaRequest; + })(); + + v1.ValidateSchemaRequest = (function() { + + /** + * Properties of a ValidateSchemaRequest. + * @memberof google.pubsub.v1 + * @interface IValidateSchemaRequest + * @property {string|null} [parent] ValidateSchemaRequest parent + * @property {google.pubsub.v1.ISchema|null} [schema] ValidateSchemaRequest schema + */ + + /** + * Constructs a new ValidateSchemaRequest. + * @memberof google.pubsub.v1 + * @classdesc Represents a ValidateSchemaRequest. + * @implements IValidateSchemaRequest + * @constructor + * @param {google.pubsub.v1.IValidateSchemaRequest=} [properties] Properties to set + */ + function ValidateSchemaRequest(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]]; + } + + /** + * ValidateSchemaRequest parent. + * @member {string} parent + * @memberof google.pubsub.v1.ValidateSchemaRequest + * @instance + */ + ValidateSchemaRequest.prototype.parent = ""; + + /** + * ValidateSchemaRequest schema. + * @member {google.pubsub.v1.ISchema|null|undefined} schema + * @memberof google.pubsub.v1.ValidateSchemaRequest + * @instance + */ + ValidateSchemaRequest.prototype.schema = null; + + /** + * Creates a new ValidateSchemaRequest instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.ValidateSchemaRequest + * @static + * @param {google.pubsub.v1.IValidateSchemaRequest=} [properties] Properties to set + * @returns {google.pubsub.v1.ValidateSchemaRequest} ValidateSchemaRequest instance + */ + ValidateSchemaRequest.create = function create(properties) { + return new ValidateSchemaRequest(properties); + }; + + /** + * Encodes the specified ValidateSchemaRequest message. Does not implicitly {@link google.pubsub.v1.ValidateSchemaRequest.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.ValidateSchemaRequest + * @static + * @param {google.pubsub.v1.IValidateSchemaRequest} message ValidateSchemaRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValidateSchemaRequest.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.schema != null && Object.hasOwnProperty.call(message, "schema")) + $root.google.pubsub.v1.Schema.encode(message.schema, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ValidateSchemaRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.ValidateSchemaRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.ValidateSchemaRequest + * @static + * @param {google.pubsub.v1.IValidateSchemaRequest} message ValidateSchemaRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValidateSchemaRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ValidateSchemaRequest message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.ValidateSchemaRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.ValidateSchemaRequest} ValidateSchemaRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValidateSchemaRequest.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.pubsub.v1.ValidateSchemaRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.schema = $root.google.pubsub.v1.Schema.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ValidateSchemaRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.ValidateSchemaRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.ValidateSchemaRequest} ValidateSchemaRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValidateSchemaRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ValidateSchemaRequest message. + * @function verify + * @memberof google.pubsub.v1.ValidateSchemaRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ValidateSchemaRequest.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.schema != null && message.hasOwnProperty("schema")) { + var error = $root.google.pubsub.v1.Schema.verify(message.schema); + if (error) + return "schema." + error; + } + return null; + }; + + /** + * Creates a ValidateSchemaRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.ValidateSchemaRequest + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.ValidateSchemaRequest} ValidateSchemaRequest + */ + ValidateSchemaRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.ValidateSchemaRequest) + return object; + var message = new $root.google.pubsub.v1.ValidateSchemaRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.schema != null) { + if (typeof object.schema !== "object") + throw TypeError(".google.pubsub.v1.ValidateSchemaRequest.schema: object expected"); + message.schema = $root.google.pubsub.v1.Schema.fromObject(object.schema); + } + return message; + }; + + /** + * Creates a plain object from a ValidateSchemaRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.ValidateSchemaRequest + * @static + * @param {google.pubsub.v1.ValidateSchemaRequest} message ValidateSchemaRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ValidateSchemaRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.schema = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.schema != null && message.hasOwnProperty("schema")) + object.schema = $root.google.pubsub.v1.Schema.toObject(message.schema, options); + return object; + }; + + /** + * Converts this ValidateSchemaRequest to JSON. + * @function toJSON + * @memberof google.pubsub.v1.ValidateSchemaRequest + * @instance + * @returns {Object.} JSON object + */ + ValidateSchemaRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ValidateSchemaRequest + * @function getTypeUrl + * @memberof google.pubsub.v1.ValidateSchemaRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ValidateSchemaRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.ValidateSchemaRequest"; + }; + + return ValidateSchemaRequest; + })(); + + v1.ValidateSchemaResponse = (function() { + + /** + * Properties of a ValidateSchemaResponse. + * @memberof google.pubsub.v1 + * @interface IValidateSchemaResponse + */ + + /** + * Constructs a new ValidateSchemaResponse. + * @memberof google.pubsub.v1 + * @classdesc Represents a ValidateSchemaResponse. + * @implements IValidateSchemaResponse + * @constructor + * @param {google.pubsub.v1.IValidateSchemaResponse=} [properties] Properties to set + */ + function ValidateSchemaResponse(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 ValidateSchemaResponse instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.ValidateSchemaResponse + * @static + * @param {google.pubsub.v1.IValidateSchemaResponse=} [properties] Properties to set + * @returns {google.pubsub.v1.ValidateSchemaResponse} ValidateSchemaResponse instance + */ + ValidateSchemaResponse.create = function create(properties) { + return new ValidateSchemaResponse(properties); + }; + + /** + * Encodes the specified ValidateSchemaResponse message. Does not implicitly {@link google.pubsub.v1.ValidateSchemaResponse.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.ValidateSchemaResponse + * @static + * @param {google.pubsub.v1.IValidateSchemaResponse} message ValidateSchemaResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValidateSchemaResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified ValidateSchemaResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.ValidateSchemaResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.ValidateSchemaResponse + * @static + * @param {google.pubsub.v1.IValidateSchemaResponse} message ValidateSchemaResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValidateSchemaResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ValidateSchemaResponse message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.ValidateSchemaResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.ValidateSchemaResponse} ValidateSchemaResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValidateSchemaResponse.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.pubsub.v1.ValidateSchemaResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ValidateSchemaResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.ValidateSchemaResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.ValidateSchemaResponse} ValidateSchemaResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValidateSchemaResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ValidateSchemaResponse message. + * @function verify + * @memberof google.pubsub.v1.ValidateSchemaResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ValidateSchemaResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a ValidateSchemaResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.ValidateSchemaResponse + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.ValidateSchemaResponse} ValidateSchemaResponse + */ + ValidateSchemaResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.ValidateSchemaResponse) + return object; + return new $root.google.pubsub.v1.ValidateSchemaResponse(); + }; + + /** + * Creates a plain object from a ValidateSchemaResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.ValidateSchemaResponse + * @static + * @param {google.pubsub.v1.ValidateSchemaResponse} message ValidateSchemaResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ValidateSchemaResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this ValidateSchemaResponse to JSON. + * @function toJSON + * @memberof google.pubsub.v1.ValidateSchemaResponse + * @instance + * @returns {Object.} JSON object + */ + ValidateSchemaResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ValidateSchemaResponse + * @function getTypeUrl + * @memberof google.pubsub.v1.ValidateSchemaResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ValidateSchemaResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.ValidateSchemaResponse"; + }; + + return ValidateSchemaResponse; + })(); + + v1.ValidateMessageRequest = (function() { + + /** + * Properties of a ValidateMessageRequest. + * @memberof google.pubsub.v1 + * @interface IValidateMessageRequest + * @property {string|null} [parent] ValidateMessageRequest parent + * @property {string|null} [name] ValidateMessageRequest name + * @property {google.pubsub.v1.ISchema|null} [schema] ValidateMessageRequest schema + * @property {Uint8Array|null} [message] ValidateMessageRequest message + * @property {google.pubsub.v1.Encoding|null} [encoding] ValidateMessageRequest encoding + */ + + /** + * Constructs a new ValidateMessageRequest. + * @memberof google.pubsub.v1 + * @classdesc Represents a ValidateMessageRequest. + * @implements IValidateMessageRequest + * @constructor + * @param {google.pubsub.v1.IValidateMessageRequest=} [properties] Properties to set + */ + function ValidateMessageRequest(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]]; + } + + /** + * ValidateMessageRequest parent. + * @member {string} parent + * @memberof google.pubsub.v1.ValidateMessageRequest + * @instance + */ + ValidateMessageRequest.prototype.parent = ""; + + /** + * ValidateMessageRequest name. + * @member {string|null|undefined} name + * @memberof google.pubsub.v1.ValidateMessageRequest + * @instance + */ + ValidateMessageRequest.prototype.name = null; + + /** + * ValidateMessageRequest schema. + * @member {google.pubsub.v1.ISchema|null|undefined} schema + * @memberof google.pubsub.v1.ValidateMessageRequest + * @instance + */ + ValidateMessageRequest.prototype.schema = null; + + /** + * ValidateMessageRequest message. + * @member {Uint8Array} message + * @memberof google.pubsub.v1.ValidateMessageRequest + * @instance + */ + ValidateMessageRequest.prototype.message = $util.newBuffer([]); + + /** + * ValidateMessageRequest encoding. + * @member {google.pubsub.v1.Encoding} encoding + * @memberof google.pubsub.v1.ValidateMessageRequest + * @instance + */ + ValidateMessageRequest.prototype.encoding = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ValidateMessageRequest schemaSpec. + * @member {"name"|"schema"|undefined} schemaSpec + * @memberof google.pubsub.v1.ValidateMessageRequest + * @instance + */ + Object.defineProperty(ValidateMessageRequest.prototype, "schemaSpec", { + get: $util.oneOfGetter($oneOfFields = ["name", "schema"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ValidateMessageRequest instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.ValidateMessageRequest + * @static + * @param {google.pubsub.v1.IValidateMessageRequest=} [properties] Properties to set + * @returns {google.pubsub.v1.ValidateMessageRequest} ValidateMessageRequest instance + */ + ValidateMessageRequest.create = function create(properties) { + return new ValidateMessageRequest(properties); + }; + + /** + * Encodes the specified ValidateMessageRequest message. Does not implicitly {@link google.pubsub.v1.ValidateMessageRequest.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.ValidateMessageRequest + * @static + * @param {google.pubsub.v1.IValidateMessageRequest} message ValidateMessageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValidateMessageRequest.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.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.name); + if (message.schema != null && Object.hasOwnProperty.call(message, "schema")) + $root.google.pubsub.v1.Schema.encode(message.schema, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.message); + if (message.encoding != null && Object.hasOwnProperty.call(message, "encoding")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.encoding); + return writer; + }; + + /** + * Encodes the specified ValidateMessageRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.ValidateMessageRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.ValidateMessageRequest + * @static + * @param {google.pubsub.v1.IValidateMessageRequest} message ValidateMessageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValidateMessageRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ValidateMessageRequest message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.ValidateMessageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.ValidateMessageRequest} ValidateMessageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValidateMessageRequest.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.pubsub.v1.ValidateMessageRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.name = reader.string(); + break; + } + case 3: { + message.schema = $root.google.pubsub.v1.Schema.decode(reader, reader.uint32()); + break; + } + case 4: { + message.message = reader.bytes(); + break; + } + case 5: { + message.encoding = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ValidateMessageRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.ValidateMessageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.ValidateMessageRequest} ValidateMessageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValidateMessageRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ValidateMessageRequest message. + * @function verify + * @memberof google.pubsub.v1.ValidateMessageRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ValidateMessageRequest.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.name != null && message.hasOwnProperty("name")) { + properties.schemaSpec = 1; + if (!$util.isString(message.name)) + return "name: string expected"; + } + if (message.schema != null && message.hasOwnProperty("schema")) { + if (properties.schemaSpec === 1) + return "schemaSpec: multiple values"; + properties.schemaSpec = 1; + { + var error = $root.google.pubsub.v1.Schema.verify(message.schema); + if (error) + return "schema." + error; + } + } + if (message.message != null && message.hasOwnProperty("message")) + if (!(message.message && typeof message.message.length === "number" || $util.isString(message.message))) + return "message: buffer expected"; + if (message.encoding != null && message.hasOwnProperty("encoding")) + switch (message.encoding) { + default: + return "encoding: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a ValidateMessageRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.ValidateMessageRequest + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.ValidateMessageRequest} ValidateMessageRequest + */ + ValidateMessageRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.ValidateMessageRequest) + return object; + var message = new $root.google.pubsub.v1.ValidateMessageRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.name != null) + message.name = String(object.name); + if (object.schema != null) { + if (typeof object.schema !== "object") + throw TypeError(".google.pubsub.v1.ValidateMessageRequest.schema: object expected"); + message.schema = $root.google.pubsub.v1.Schema.fromObject(object.schema); + } + if (object.message != null) + if (typeof object.message === "string") + $util.base64.decode(object.message, message.message = $util.newBuffer($util.base64.length(object.message)), 0); + else if (object.message.length >= 0) + message.message = object.message; + switch (object.encoding) { + default: + if (typeof object.encoding === "number") { + message.encoding = object.encoding; + break; + } + break; + case "ENCODING_UNSPECIFIED": + case 0: + message.encoding = 0; + break; + case "JSON": + case 1: + message.encoding = 1; + break; + case "BINARY": + case 2: + message.encoding = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a ValidateMessageRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.ValidateMessageRequest + * @static + * @param {google.pubsub.v1.ValidateMessageRequest} message ValidateMessageRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ValidateMessageRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + if (options.bytes === String) + object.message = ""; + else { + object.message = []; + if (options.bytes !== Array) + object.message = $util.newBuffer(object.message); + } + object.encoding = options.enums === String ? "ENCODING_UNSPECIFIED" : 0; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.name != null && message.hasOwnProperty("name")) { + object.name = message.name; + if (options.oneofs) + object.schemaSpec = "name"; + } + if (message.schema != null && message.hasOwnProperty("schema")) { + object.schema = $root.google.pubsub.v1.Schema.toObject(message.schema, options); + if (options.oneofs) + object.schemaSpec = "schema"; + } + if (message.message != null && message.hasOwnProperty("message")) + object.message = options.bytes === String ? $util.base64.encode(message.message, 0, message.message.length) : options.bytes === Array ? Array.prototype.slice.call(message.message) : message.message; + if (message.encoding != null && message.hasOwnProperty("encoding")) + object.encoding = options.enums === String ? $root.google.pubsub.v1.Encoding[message.encoding] === undefined ? message.encoding : $root.google.pubsub.v1.Encoding[message.encoding] : message.encoding; + return object; + }; + + /** + * Converts this ValidateMessageRequest to JSON. + * @function toJSON + * @memberof google.pubsub.v1.ValidateMessageRequest + * @instance + * @returns {Object.} JSON object + */ + ValidateMessageRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ValidateMessageRequest + * @function getTypeUrl + * @memberof google.pubsub.v1.ValidateMessageRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ValidateMessageRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.ValidateMessageRequest"; + }; + + return ValidateMessageRequest; + })(); + + v1.ValidateMessageResponse = (function() { + + /** + * Properties of a ValidateMessageResponse. + * @memberof google.pubsub.v1 + * @interface IValidateMessageResponse + */ + + /** + * Constructs a new ValidateMessageResponse. + * @memberof google.pubsub.v1 + * @classdesc Represents a ValidateMessageResponse. + * @implements IValidateMessageResponse + * @constructor + * @param {google.pubsub.v1.IValidateMessageResponse=} [properties] Properties to set + */ + function ValidateMessageResponse(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 ValidateMessageResponse instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.ValidateMessageResponse + * @static + * @param {google.pubsub.v1.IValidateMessageResponse=} [properties] Properties to set + * @returns {google.pubsub.v1.ValidateMessageResponse} ValidateMessageResponse instance + */ + ValidateMessageResponse.create = function create(properties) { + return new ValidateMessageResponse(properties); + }; + + /** + * Encodes the specified ValidateMessageResponse message. Does not implicitly {@link google.pubsub.v1.ValidateMessageResponse.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.ValidateMessageResponse + * @static + * @param {google.pubsub.v1.IValidateMessageResponse} message ValidateMessageResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValidateMessageResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified ValidateMessageResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.ValidateMessageResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.ValidateMessageResponse + * @static + * @param {google.pubsub.v1.IValidateMessageResponse} message ValidateMessageResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValidateMessageResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ValidateMessageResponse message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.ValidateMessageResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.ValidateMessageResponse} ValidateMessageResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValidateMessageResponse.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.pubsub.v1.ValidateMessageResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ValidateMessageResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.ValidateMessageResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.ValidateMessageResponse} ValidateMessageResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValidateMessageResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ValidateMessageResponse message. + * @function verify + * @memberof google.pubsub.v1.ValidateMessageResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ValidateMessageResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a ValidateMessageResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.ValidateMessageResponse + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.ValidateMessageResponse} ValidateMessageResponse + */ + ValidateMessageResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.ValidateMessageResponse) + return object; + return new $root.google.pubsub.v1.ValidateMessageResponse(); + }; + + /** + * Creates a plain object from a ValidateMessageResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.ValidateMessageResponse + * @static + * @param {google.pubsub.v1.ValidateMessageResponse} message ValidateMessageResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ValidateMessageResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this ValidateMessageResponse to JSON. + * @function toJSON + * @memberof google.pubsub.v1.ValidateMessageResponse + * @instance + * @returns {Object.} JSON object + */ + ValidateMessageResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ValidateMessageResponse + * @function getTypeUrl + * @memberof google.pubsub.v1.ValidateMessageResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ValidateMessageResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.ValidateMessageResponse"; + }; + + return ValidateMessageResponse; + })(); + + /** + * Encoding enum. + * @name google.pubsub.v1.Encoding + * @enum {number} + * @property {number} ENCODING_UNSPECIFIED=0 ENCODING_UNSPECIFIED value + * @property {number} JSON=1 JSON value + * @property {number} BINARY=2 BINARY value + */ + v1.Encoding = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ENCODING_UNSPECIFIED"] = 0; + values[valuesById[1] = "JSON"] = 1; + values[valuesById[2] = "BINARY"] = 2; + return values; + })(); + + return v1; + })(); + + return pubsub; + })(); + + 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 + * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion + */ + + /** + * 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; + + /** + * Http fullyDecodeReservedExpansion. + * @member {boolean} fullyDecodeReservedExpansion + * @memberof google.api.Http + * @instance + */ + Http.prototype.fullyDecodeReservedExpansion = false; + + /** + * 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 + */ + Http.create = function create(properties) { + return new Http(properties); + }; + + /** + * 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 + */ + Http.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * 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 + */ + Http.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * 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.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]); + } + } + if (object.fullyDecodeReservedExpansion != null) + message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion); + 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 (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.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; + 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} [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 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 selector. + * @member {string} selector + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.selector = ""; + + /** + * 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 body. + * @member {string} body + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.body = ""; + + /** + * HttpRule responseBody. + * @member {string} responseBody + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.responseBody = ""; + + /** + * 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 new HttpRule instance using the specified properties. + * @function create + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule=} [properties] Properties to set + * @returns {google.api.HttpRule} HttpRule instance + */ + HttpRule.create = function create(properties) { + return new HttpRule(properties); + }; + + /** + * 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.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 + */ + 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; + } + } + return message; + }; + + /** + * 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 + */ + HttpRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HttpRule message. + * @function verify + * @memberof google.api.HttpRule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + 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"; + } + 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; + }; + + /** + * 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) + return object; + 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.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 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 = ""; + object.responseBody = ""; + } + 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); + } + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + object.responseBody = message.responseBody; + 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 new CustomHttpPattern instance using the specified properties. + * @function create + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance + */ + CustomHttpPattern.create = function create(properties) { + return new CustomHttpPattern(properties); + }; + + /** + * 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.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; + }; + + /** + * 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 + */ + CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @function decode + * @memberof google.api.CustomHttpPattern + * @static + * @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 message; + }; + + /** + * 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 + */ + CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * 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 + */ + 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 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 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; + })(); + + api.CommonLanguageSettings = (function() { + + /** + * Properties of a CommonLanguageSettings. + * @memberof google.api + * @interface ICommonLanguageSettings + * @property {string|null} [referenceDocsUri] CommonLanguageSettings referenceDocsUri + * @property {Array.|null} [destinations] CommonLanguageSettings destinations + */ + + /** + * Constructs a new CommonLanguageSettings. + * @memberof google.api + * @classdesc Represents a CommonLanguageSettings. + * @implements ICommonLanguageSettings + * @constructor + * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set + */ + 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]]; + } + + /** + * CommonLanguageSettings referenceDocsUri. + * @member {string} referenceDocsUri + * @memberof google.api.CommonLanguageSettings + * @instance + */ + CommonLanguageSettings.prototype.referenceDocsUri = ""; + + /** + * 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.CommonLanguageSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings + */ + 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; + break; + case "PACKAGE_MANAGER": + case 20: + message.destinations[i] = 20; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a CommonLanguageSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.CommonLanguageSettings} message CommonLanguageSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CommonLanguageSettings.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]; + } + return object; + }; + + /** + * Converts this CommonLanguageSettings to JSON. + * @function toJSON + * @memberof google.api.CommonLanguageSettings + * @instance + * @returns {Object.} JSON object + */ + CommonLanguageSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CommonLanguageSettings + * @function getTypeUrl + * @memberof google.api.CommonLanguageSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CommonLanguageSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CommonLanguageSettings"; + }; + + return CommonLanguageSettings; + })(); + + 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; + + /** + * 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 + */ + ClientLibrarySettings.prototype.phpSettings = null; + + /** + * ClientLibrarySettings pythonSettings. + * @member {google.api.IPythonSettings|null|undefined} pythonSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.pythonSettings = null; + + /** + * ClientLibrarySettings nodeSettings. + * @member {google.api.INodeSettings|null|undefined} nodeSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.nodeSettings = null; + + /** + * ClientLibrarySettings dotnetSettings. + * @member {google.api.IDotnetSettings|null|undefined} dotnetSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.dotnetSettings = null; + + /** + * ClientLibrarySettings rubySettings. + * @member {google.api.IRubySettings|null|undefined} rubySettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.rubySettings = null; + + /** + * ClientLibrarySettings goSettings. + * @member {google.api.IGoSettings|null|undefined} goSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.goSettings = null; + + /** + * Creates a new ClientLibrarySettings instance using the specified properties. + * @function create + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.IClientLibrarySettings=} [properties] Properties to set + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings instance + */ + 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; + }; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ClientLibrarySettings + * @static + * @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 + */ + 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 (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); + } + 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 ClientLibrarySettings to JSON. + * @function toJSON + * @memberof google.api.ClientLibrarySettings + * @instance + * @returns {Object.} JSON object + */ + ClientLibrarySettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ClientLibrarySettings + * @function getTypeUrl + * @memberof google.api.ClientLibrarySettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ClientLibrarySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ClientLibrarySettings"; + }; + + return ClientLibrarySettings; + })(); + + api.Publishing = (function() { + + /** + * Properties of a Publishing. + * @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 + * @property {string|null} [restReferenceDocumentationUri] Publishing restReferenceDocumentationUri + */ + + /** + * Constructs a new Publishing. + * @memberof google.api + * @classdesc Represents a Publishing. + * @implements IPublishing + * @constructor + * @param {google.api.IPublishing=} [properties] Properties to set + */ + 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]]; + } + + /** + * Publishing methodSettings. + * @member {Array.} methodSettings + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.methodSettings = $util.emptyArray; + + /** + * 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 = ""; + + /** + * Publishing restReferenceDocumentationUri. + * @member {string} restReferenceDocumentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.restReferenceDocumentationUri = ""; + + /** + * Creates a new Publishing instance using the specified properties. + * @function create + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing=} [properties] Properties to set + * @returns {google.api.Publishing} Publishing instance + */ + 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); + if (message.restReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "restReferenceDocumentationUri")) + writer.uint32(/* id 111, wireType 2 =*/890).string(message.restReferenceDocumentationUri); + 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; + } + case 111: { + message.restReferenceDocumentationUri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Publishing message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Publishing + * @static + * @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 + */ + Publishing.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Publishing message. + * @function verify + * @memberof google.api.Publishing + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + 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; + } + } + 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"; + if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) + if (!$util.isString(message.restReferenceDocumentationUri)) + return "restReferenceDocumentationUri: string expected"; + return null; + }; + + /** + * Creates a Publishing message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Publishing + * @static + * @param {Object.} object Plain object + * @returns {google.api.Publishing} Publishing + */ + 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); + if (object.restReferenceDocumentationUri != null) + message.restReferenceDocumentationUri = String(object.restReferenceDocumentationUri); + return message; + }; + + /** + * Creates a plain object from a Publishing message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Publishing + * @static + * @param {google.api.Publishing} message Publishing + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + 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 = ""; + object.restReferenceDocumentationUri = ""; + } + 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; + if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) + object.restReferenceDocumentationUri = message.restReferenceDocumentationUri; + return object; + }; + + /** + * Converts this Publishing to JSON. + * @function toJSON + * @memberof google.api.Publishing + * @instance + * @returns {Object.} JSON object + */ + Publishing.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Publishing + * @function getTypeUrl + * @memberof google.api.Publishing + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Publishing.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Publishing"; + }; + + 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 new JavaSettings instance using the specified properties. + * @function create + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings=} [properties] Properties to set + * @returns {google.api.JavaSettings} JavaSettings instance + */ + JavaSettings.create = function create(properties) { + return new JavaSettings(properties); + }; + + /** + * 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.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; + }; + + /** + * 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 {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 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.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 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 + */ + CppSettings.create = function create(properties) { + return new CppSettings(properties); + }; + + /** + * 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 + */ + 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; + }; + + /** + * 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 + */ + CppSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * 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; + }; + + /** + * 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 + */ + CppSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * 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 + */ + 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 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); + } + 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); + return object; + }; + + /** + * Converts this CppSettings to JSON. + * @function toJSON + * @memberof google.api.CppSettings + * @instance + * @returns {Object.} JSON object + */ + CppSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CppSettings + * @function getTypeUrl + * @memberof google.api.CppSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CppSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CppSettings"; + }; + + return CppSettings; + })(); + + api.PhpSettings = (function() { + + /** + * Properties of a PhpSettings. + * @memberof google.api + * @interface IPhpSettings + * @property {google.api.ICommonLanguageSettings|null} [common] PhpSettings common + */ + + /** + * Constructs a new PhpSettings. + * @memberof google.api + * @classdesc Represents a PhpSettings. + * @implements IPhpSettings + * @constructor + * @param {google.api.IPhpSettings=} [properties] Properties to set + */ + 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]]; + } + + /** + * PhpSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.PhpSettings + * @instance + */ + PhpSettings.prototype.common = null; + + /** + * 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 + */ + 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 PhpSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.PhpSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.PhpSettings} PhpSettings + */ + 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; + }; + + /** + * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.PhpSettings + * @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; + }; + + /** + * Converts this PhpSettings to JSON. + * @function toJSON + * @memberof google.api.PhpSettings + * @instance + * @returns {Object.} JSON object + */ + PhpSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PhpSettings + * @function getTypeUrl + * @memberof google.api.PhpSettings + * @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"; + } + return typeUrlPrefix + "/google.api.PhpSettings"; + }; + + 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 + */ + 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]]; + } + + /** + * PythonSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.PythonSettings + * @instance + */ + PythonSettings.prototype.common = null; + + /** + * 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 + */ + PythonSettings.create = function create(properties) { + return new PythonSettings(properties); + }; + + /** + * 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.api.PythonSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.PythonSettings} PythonSettings + */ + PythonSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.PythonSettings) + 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); + } + return message; + }; + + /** + * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.PythonSettings + * @static + * @param {google.api.PythonSettings} message PythonSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PythonSettings.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 PythonSettings to JSON. + * @function toJSON + * @memberof google.api.PythonSettings + * @instance + * @returns {Object.} JSON object + */ + PythonSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PythonSettings + * @function getTypeUrl + * @memberof google.api.PythonSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PythonSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.PythonSettings"; + }; + + return PythonSettings; + })(); + + api.NodeSettings = (function() { + + /** + * Properties of a NodeSettings. + * @memberof google.api + * @interface INodeSettings + * @property {google.api.ICommonLanguageSettings|null} [common] NodeSettings common + */ + + /** + * Constructs a new NodeSettings. + * @memberof google.api + * @classdesc Represents a NodeSettings. + * @implements INodeSettings + * @constructor + * @param {google.api.INodeSettings=} [properties] Properties to set + */ + 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]]; + } + + /** + * NodeSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.NodeSettings + * @instance + */ + NodeSettings.prototype.common = null; + + /** + * 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 + */ + NodeSettings.create = function create(properties) { + return new NodeSettings(properties); + }; + + /** + * 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 + */ + 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; + }; + + /** + * 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.api.NodeSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.NodeSettings} NodeSettings + */ + NodeSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.NodeSettings) + 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); + } + return message; + }; + + /** + * Creates a plain object from a NodeSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.NodeSettings + * @static + * @param {google.api.NodeSettings} message NodeSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NodeSettings.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 NodeSettings to JSON. + * @function toJSON + * @memberof google.api.NodeSettings + * @instance + * @returns {Object.} JSON object + */ + NodeSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NodeSettings + * @function getTypeUrl + * @memberof google.api.NodeSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.NodeSettings"; + }; + + return NodeSettings; + })(); + + api.DotnetSettings = (function() { + + /** + * 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 + */ + + /** + * Constructs a new DotnetSettings. + * @memberof google.api + * @classdesc Represents a DotnetSettings. + * @implements IDotnetSettings + * @constructor + * @param {google.api.IDotnetSettings=} [properties] Properties to set + */ + 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]]; + } + + /** + * 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 + */ + DotnetSettings.prototype.ignoredResources = $util.emptyArray; + + /** + * DotnetSettings forcedNamespaceAliases. + * @member {Array.} forcedNamespaceAliases + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.forcedNamespaceAliases = $util.emptyArray; + + /** + * DotnetSettings handwrittenSignatures. + * @member {Array.} handwrittenSignatures + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.handwrittenSignatures = $util.emptyArray; + + /** + * 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 + */ + DotnetSettings.create = function create(properties) { + return new DotnetSettings(properties); + }; + + /** + * 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 + */ + DotnetSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * 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 + */ + 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 a DotnetSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.DotnetSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.DotnetSettings} DotnetSettings + */ + 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]); + } + return message; + }; + + /** + * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.DotnetSettings} message DotnetSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DotnetSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.ignoredResources = []; + object.forcedNamespaceAliases = []; + object.handwrittenSignatures = []; + } + if (options.objects || options.defaults) { + object.renamedServices = {}; + object.renamedResources = {}; + } + 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 DotnetSettings to JSON. + * @function toJSON + * @memberof google.api.DotnetSettings + * @instance + * @returns {Object.} JSON object + */ + DotnetSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DotnetSettings + * @function getTypeUrl + * @memberof google.api.DotnetSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DotnetSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.DotnetSettings"; + }; + + return DotnetSettings; + })(); + + api.RubySettings = (function() { + + /** + * Properties of a RubySettings. + * @memberof google.api + * @interface IRubySettings + * @property {google.api.ICommonLanguageSettings|null} [common] RubySettings common + */ + + /** + * Constructs a new RubySettings. + * @memberof google.api + * @classdesc Represents a RubySettings. + * @implements IRubySettings + * @constructor + * @param {google.api.IRubySettings=} [properties] Properties to set + */ + 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]]; + } + + /** + * RubySettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.RubySettings + * @instance + */ + 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 RubySettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.RubySettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.RubySettings} RubySettings + */ + 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); + } + return message; + }; + + /** + * Creates a plain object from a RubySettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.RubySettings + * @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 + */ + RubySettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RubySettings + * @function getTypeUrl + * @memberof google.api.RubySettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RubySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.RubySettings"; + }; + + 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 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 + */ + GoSettings.create = function create(properties) { + return new GoSettings(properties); + }; + + /** + * 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 + */ + GoSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * 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 + */ + 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 GoSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.GoSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.GoSettings} GoSettings + */ + GoSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.GoSettings) + 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); + } + return message; + }; + + /** + * Creates a plain object from a GoSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.GoSettings + * @static + * @param {google.api.GoSettings} message GoSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GoSettings.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 GoSettings to JSON. + * @function toJSON + * @memberof google.api.GoSettings + * @instance + * @returns {Object.} JSON object + */ + GoSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GoSettings + * @function getTypeUrl + * @memberof google.api.GoSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GoSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.GoSettings"; + }; + + return GoSettings; + })(); + + 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.api.IMethodSettings=} [properties] Properties to set + */ + 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 = ""; + + /** + * MethodSettings longRunning. + * @member {google.api.MethodSettings.ILongRunning|null|undefined} longRunning + * @memberof google.api.MethodSettings + * @instance + */ + MethodSettings.prototype.longRunning = null; + + /** + * MethodSettings autoPopulatedFields. + * @member {Array.} autoPopulatedFields + * @memberof google.api.MethodSettings + * @instance + */ + 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 MethodSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.MethodSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.MethodSettings} MethodSettings + */ + 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; + }; + + /** + * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.MethodSettings + * @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); + }; + + /** + * Gets the default type url for MethodSettings + * @function getTypeUrl + * @memberof google.api.MethodSettings + * @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 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; + })(); + + api.ResourceDescriptor = (function() { + + /** + * Properties of a ResourceDescriptor. + * @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. + * @memberof google.api + * @classdesc Represents a ResourceDescriptor. + * @implements IResourceDescriptor + * @constructor + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + */ + function ResourceDescriptor(properties) { + this.pattern = []; + this.style = []; + 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 + * @instance + */ + ResourceDescriptor.prototype.type = ""; + + /** + * ResourceDescriptor pattern. + * @member {Array.} pattern + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.pattern = $util.emptyArray; + + /** + * ResourceDescriptor nameField. + * @member {string} nameField + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.nameField = ""; + + /** + * ResourceDescriptor history. + * @member {google.api.ResourceDescriptor.History} history + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.history = 0; + + /** + * ResourceDescriptor plural. + * @member {string} plural + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.plural = ""; + + /** + * ResourceDescriptor singular. + * @member {string} singular + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.singular = ""; + + /** + * ResourceDescriptor style. + * @member {Array.} style + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.style = $util.emptyArray; + + /** + * Creates a new ResourceDescriptor instance using the specified properties. + * @function create + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + * @returns {google.api.ResourceDescriptor} ResourceDescriptor instance + */ + ResourceDescriptor.create = function create(properties) { + return new ResourceDescriptor(properties); + }; + + /** + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceDescriptor.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.pattern != null && message.pattern.length) + for (var i = 0; i < message.pattern.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pattern[i]); + if (message.nameField != null && Object.hasOwnProperty.call(message, "nameField")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); + if (message.history != null && Object.hasOwnProperty.call(message, "history")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); + if (message.plural != null && Object.hasOwnProperty.call(message, "plural")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); + if (message.singular != null && Object.hasOwnProperty.call(message, "singular")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); + if (message.style != null && message.style.length) { + writer.uint32(/* id 10, wireType 2 =*/82).fork(); + for (var i = 0; i < message.style.length; ++i) + writer.int32(message.style[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer. + * @function decode + * @memberof google.api.ResourceDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceDescriptor.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.ResourceDescriptor(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type = reader.string(); + break; + } + case 2: { + if (!(message.pattern && message.pattern.length)) + message.pattern = []; + message.pattern.push(reader.string()); + break; + } + case 3: { + message.nameField = reader.string(); + break; + } + case 4: { + message.history = reader.int32(); + break; + } + case 5: { + message.plural = reader.string(); + break; + } + case 6: { + message.singular = reader.string(); + break; + } + case 10: { + if (!(message.style && message.style.length)) + message.style = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.style.push(reader.int32()); + } else + message.style.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ResourceDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceDescriptor.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceDescriptor message. + * @function verify + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceDescriptor.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.pattern != null && message.hasOwnProperty("pattern")) { + if (!Array.isArray(message.pattern)) + return "pattern: array expected"; + for (var i = 0; i < message.pattern.length; ++i) + if (!$util.isString(message.pattern[i])) + return "pattern: string[] expected"; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + if (!$util.isString(message.nameField)) + return "nameField: string expected"; + if (message.history != null && message.hasOwnProperty("history")) + switch (message.history) { + default: + return "history: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.plural != null && message.hasOwnProperty("plural")) + if (!$util.isString(message.plural)) + return "plural: string expected"; + if (message.singular != null && message.hasOwnProperty("singular")) + if (!$util.isString(message.singular)) + return "singular: string expected"; + if (message.style != null && message.hasOwnProperty("style")) { + if (!Array.isArray(message.style)) + return "style: array expected"; + for (var i = 0; i < message.style.length; ++i) + switch (message.style[i]) { + default: + return "style: enum value[] expected"; + case 0: + case 1: + break; + } + } + return null; + }; + + /** + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + */ + ResourceDescriptor.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceDescriptor) + 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; + } + } + return message; + }; + + /** + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.ResourceDescriptor} message ResourceDescriptor + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceDescriptor.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]; + } + return object; + }; + + /** + * Converts this ResourceDescriptor to JSON. + * @function toJSON + * @memberof google.api.ResourceDescriptor + * @instance + * @returns {Object.} JSON object + */ + ResourceDescriptor.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceDescriptor + * @function getTypeUrl + * @memberof google.api.ResourceDescriptor + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceDescriptor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ResourceDescriptor"; + }; + + /** + * History enum. + * @name google.api.ResourceDescriptor.History + * @enum {number} + * @property {number} HISTORY_UNSPECIFIED=0 HISTORY_UNSPECIFIED value + * @property {number} ORIGINALLY_SINGLE_PATTERN=1 ORIGINALLY_SINGLE_PATTERN value + * @property {number} FUTURE_MULTI_PATTERN=2 FUTURE_MULTI_PATTERN value + */ + ResourceDescriptor.History = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "HISTORY_UNSPECIFIED"] = 0; + values[valuesById[1] = "ORIGINALLY_SINGLE_PATTERN"] = 1; + values[valuesById[2] = "FUTURE_MULTI_PATTERN"] = 2; + return values; + })(); + + /** + * Style enum. + * @name google.api.ResourceDescriptor.Style + * @enum {number} + * @property {number} STYLE_UNSPECIFIED=0 STYLE_UNSPECIFIED value + * @property {number} DECLARATIVE_FRIENDLY=1 DECLARATIVE_FRIENDLY value + */ + ResourceDescriptor.Style = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STYLE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DECLARATIVE_FRIENDLY"] = 1; + return values; + })(); + + return ResourceDescriptor; + })(); + + api.ResourceReference = (function() { + + /** + * Properties of a ResourceReference. + * @memberof google.api + * @interface IResourceReference + * @property {string|null} [type] ResourceReference type + * @property {string|null} [childType] ResourceReference childType + */ + + /** + * Constructs a new ResourceReference. + * @memberof google.api + * @classdesc Represents a ResourceReference. + * @implements IResourceReference + * @constructor + * @param {google.api.IResourceReference=} [properties] Properties to set + */ + function ResourceReference(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 + * @instance + */ + ResourceReference.prototype.type = ""; + + /** + * ResourceReference childType. + * @member {string} childType + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.childType = ""; + + /** + * Creates a new ResourceReference instance using the specified properties. + * @function create + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference=} [properties] Properties to set + * @returns {google.api.ResourceReference} ResourceReference instance + */ + ResourceReference.create = function create(properties) { + return new ResourceReference(properties); + }; + + /** + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.childType != null && Object.hasOwnProperty.call(message, "childType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType); + return writer; + }; + + /** + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer. + * @function decode + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ResourceReference} ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceReference.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.ResourceReference(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type = reader.string(); + break; + } + case 2: { + message.childType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ResourceReference} ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceReference.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceReference message. + * @function verify + * @memberof google.api.ResourceReference + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceReference.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.childType != null && message.hasOwnProperty("childType")) + if (!$util.isString(message.childType)) + return "childType: string expected"; + return null; + }; + + /** + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceReference + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceReference} ResourceReference + */ + ResourceReference.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceReference) + 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); + return message; + }; + + /** + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceReference + * @static + * @param {google.api.ResourceReference} message ResourceReference + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceReference.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; + return object; + }; + + /** + * Converts this ResourceReference to JSON. + * @function toJSON + * @memberof google.api.ResourceReference + * @instance + * @returns {Object.} JSON object + */ + ResourceReference.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceReference + * @function getTypeUrl + * @memberof google.api.ResourceReference + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ResourceReference"; + }; + + return ResourceReference; + })(); + + return api; + })(); + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + var protobuf = {}; + + 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"); + message.file = []; + for (var i = 0; i < object.file.length; ++i) { + if (typeof object.file[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorSet.file: object expected"); + message.file[i] = $root.google.protobuf.FileDescriptorProto.fromObject(object.file[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.FileDescriptorSet} message FileDescriptorSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.file = []; + if (message.file && message.file.length) { + object.file = []; + for (var j = 0; j < message.file.length; ++j) + object.file[j] = $root.google.protobuf.FileDescriptorProto.toObject(message.file[j], options); + } + return object; + }; + + /** + * Converts this FileDescriptorSet to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorSet + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileDescriptorSet + * @function getTypeUrl + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileDescriptorSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileDescriptorSet"; + }; + + return FileDescriptorSet; + })(); + + /** + * Edition enum. + * @name google.protobuf.Edition + * @enum {number} + * @property {number} EDITION_UNKNOWN=0 EDITION_UNKNOWN value + * @property {number} EDITION_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 + * @interface IFileDescriptorProto + * @property {string|null} [name] FileDescriptorProto name + * @property {string|null} ["package"] FileDescriptorProto package + * @property {Array.|null} [dependency] FileDescriptorProto dependency + * @property {Array.|null} [publicDependency] FileDescriptorProto publicDependency + * @property {Array.|null} [weakDependency] FileDescriptorProto weakDependency + * @property {Array.|null} [messageType] FileDescriptorProto messageType + * @property {Array.|null} [enumType] FileDescriptorProto enumType + * @property {Array.|null} [service] FileDescriptorProto service + * @property {Array.|null} [extension] FileDescriptorProto extension + * @property {google.protobuf.IFileOptions|null} [options] FileDescriptorProto options + * @property {google.protobuf.ISourceCodeInfo|null} [sourceCodeInfo] FileDescriptorProto sourceCodeInfo + * @property {string|null} [syntax] FileDescriptorProto syntax + * @property {google.protobuf.Edition|null} [edition] FileDescriptorProto edition + */ + + /** + * Constructs a new FileDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorProto. + * @implements IFileDescriptorProto + * @constructor + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + */ + function FileDescriptorProto(properties) { + this.dependency = []; + this.publicDependency = []; + this.weakDependency = []; + this.messageType = []; + this.enumType = []; + this.service = []; + this.extension = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.name = ""; + + /** + * FileDescriptorProto package. + * @member {string} package + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype["package"] = ""; + + /** + * FileDescriptorProto dependency. + * @member {Array.} dependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.dependency = $util.emptyArray; + + /** + * FileDescriptorProto publicDependency. + * @member {Array.} publicDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.publicDependency = $util.emptyArray; + + /** + * FileDescriptorProto weakDependency. + * @member {Array.} weakDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.weakDependency = $util.emptyArray; + + /** + * FileDescriptorProto messageType. + * @member {Array.} messageType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.messageType = $util.emptyArray; + + /** + * FileDescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.enumType = $util.emptyArray; + + /** + * FileDescriptorProto service. + * @member {Array.} service + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.service = $util.emptyArray; + + /** + * FileDescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.extension = $util.emptyArray; + + /** + * FileDescriptorProto options. + * @member {google.protobuf.IFileOptions|null|undefined} options + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.options = null; + + /** + * FileDescriptorProto sourceCodeInfo. + * @member {google.protobuf.ISourceCodeInfo|null|undefined} sourceCodeInfo + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.sourceCodeInfo = null; + + /** + * FileDescriptorProto syntax. + * @member {string} syntax + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.syntax = ""; + + /** + * FileDescriptorProto edition. + * @member {google.protobuf.Edition} edition + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.edition = 0; + + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto instance + */ + FileDescriptorProto.create = function create(properties) { + return new FileDescriptorProto(properties); + }; + + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message["package"] != null && Object.hasOwnProperty.call(message, "package")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message["package"]); + if (message.dependency != null && message.dependency.length) + for (var i = 0; i < message.dependency.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.dependency[i]); + if (message.messageType != null && message.messageType.length) + for (var i = 0; i < message.messageType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.messageType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.service != null && message.service.length) + for (var i = 0; i < message.service.length; ++i) + $root.google.protobuf.ServiceDescriptorProto.encode(message.service[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.sourceCodeInfo != null && Object.hasOwnProperty.call(message, "sourceCodeInfo")) + $root.google.protobuf.SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.publicDependency != null && message.publicDependency.length) + for (var i = 0; i < message.publicDependency.length; ++i) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.publicDependency[i]); + if (message.weakDependency != null && message.weakDependency.length) + for (var i = 0; i < message.weakDependency.length; ++i) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.weakDependency[i]); + if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 14, wireType 0 =*/112).int32(message.edition); + 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 + */ + FileDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileDescriptorProto) + return object; + var message = new $root.google.protobuf.FileDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object["package"] != null) + message["package"] = String(object["package"]); + if (object.dependency) { + if (!Array.isArray(object.dependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.dependency: array expected"); + message.dependency = []; + for (var i = 0; i < object.dependency.length; ++i) + message.dependency[i] = String(object.dependency[i]); + } + if (object.publicDependency) { + if (!Array.isArray(object.publicDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.publicDependency: array expected"); + message.publicDependency = []; + for (var i = 0; i < object.publicDependency.length; ++i) + message.publicDependency[i] = object.publicDependency[i] | 0; + } + if (object.weakDependency) { + if (!Array.isArray(object.weakDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.weakDependency: array expected"); + message.weakDependency = []; + for (var i = 0; i < object.weakDependency.length; ++i) + message.weakDependency[i] = object.weakDependency[i] | 0; + } + if (object.messageType) { + if (!Array.isArray(object.messageType)) + throw TypeError(".google.protobuf.FileDescriptorProto.messageType: array expected"); + message.messageType = []; + for (var i = 0; i < object.messageType.length; ++i) { + if (typeof object.messageType[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.messageType: object expected"); + message.messageType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.messageType[i]); + } + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.FileDescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (typeof object.enumType[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); + } + } + if (object.service) { + if (!Array.isArray(object.service)) + throw TypeError(".google.protobuf.FileDescriptorProto.service: array expected"); + message.service = []; + for (var i = 0; i < object.service.length; ++i) { + if (typeof object.service[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.service: object expected"); + message.service[i] = $root.google.protobuf.ServiceDescriptorProto.fromObject(object.service[i]); + } + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.FileDescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (typeof object.extension[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FileOptions.fromObject(object.options); + } + if (object.sourceCodeInfo != null) { + if (typeof object.sourceCodeInfo !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.sourceCodeInfo: object expected"); + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.fromObject(object.sourceCodeInfo); + } + if (object.syntax != null) + message.syntax = String(object.syntax); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.edition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + return message; + }; + + /** + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.FileDescriptorProto} message FileDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.dependency = []; + object.messageType = []; + object.enumType = []; + object.service = []; + object.extension = []; + object.publicDependency = []; + object.weakDependency = []; + } + if (options.defaults) { + object.name = ""; + object["package"] = ""; + object.options = null; + object.sourceCodeInfo = null; + object.syntax = ""; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message["package"] != null && message.hasOwnProperty("package")) + object["package"] = message["package"]; + if (message.dependency && message.dependency.length) { + object.dependency = []; + for (var j = 0; j < message.dependency.length; ++j) + object.dependency[j] = message.dependency[j]; + } + if (message.messageType && message.messageType.length) { + object.messageType = []; + for (var j = 0; j < message.messageType.length; ++j) + object.messageType[j] = $root.google.protobuf.DescriptorProto.toObject(message.messageType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.service && message.service.length) { + object.service = []; + for (var j = 0; j < message.service.length; ++j) + object.service[j] = $root.google.protobuf.ServiceDescriptorProto.toObject(message.service[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FileOptions.toObject(message.options, options); + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) + object.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.toObject(message.sourceCodeInfo, options); + if (message.publicDependency && message.publicDependency.length) { + object.publicDependency = []; + for (var j = 0; j < message.publicDependency.length; ++j) + object.publicDependency[j] = message.publicDependency[j]; + } + if (message.weakDependency && message.weakDependency.length) { + object.weakDependency = []; + for (var j = 0; j < message.weakDependency.length; ++j) + object.weakDependency[j] = message.weakDependency[j]; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + object.syntax = message.syntax; + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + return object; + }; + + /** + * Converts this FileDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileDescriptorProto"; + }; + + return FileDescriptorProto; + })(); + + protobuf.DescriptorProto = (function() { + + /** + * Properties of a DescriptorProto. + * @memberof google.protobuf + * @interface IDescriptorProto + * @property {string|null} [name] DescriptorProto name + * @property {Array.|null} [field] DescriptorProto field + * @property {Array.|null} [extension] DescriptorProto extension + * @property {Array.|null} [nestedType] DescriptorProto nestedType + * @property {Array.|null} [enumType] DescriptorProto enumType + * @property {Array.|null} [extensionRange] DescriptorProto extensionRange + * @property {Array.|null} [oneofDecl] DescriptorProto oneofDecl + * @property {google.protobuf.IMessageOptions|null} [options] DescriptorProto options + * @property {Array.|null} [reservedRange] DescriptorProto reservedRange + * @property {Array.|null} [reservedName] DescriptorProto reservedName + */ + + /** + * Constructs a new DescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a DescriptorProto. + * @implements IDescriptorProto + * @constructor + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + */ + function DescriptorProto(properties) { + this.field = []; + this.extension = []; + this.nestedType = []; + this.enumType = []; + this.extensionRange = []; + this.oneofDecl = []; + this.reservedRange = []; + this.reservedName = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DescriptorProto name. + * @member {string} name + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.name = ""; + + /** + * DescriptorProto field. + * @member {Array.} field + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.field = $util.emptyArray; + + /** + * DescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extension = $util.emptyArray; + + /** + * DescriptorProto nestedType. + * @member {Array.} nestedType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.nestedType = $util.emptyArray; + + /** + * DescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.enumType = $util.emptyArray; + + /** + * DescriptorProto extensionRange. + * @member {Array.} extensionRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extensionRange = $util.emptyArray; + + /** + * DescriptorProto oneofDecl. + * @member {Array.} oneofDecl + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.oneofDecl = $util.emptyArray; + + /** + * DescriptorProto options. + * @member {google.protobuf.IMessageOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.options = null; + + /** + * DescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * DescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.DescriptorProto + * @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 + * @memberof google.protobuf.DescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto} DescriptorProto + */ + DescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto) + return object; + var message = new $root.google.protobuf.DescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.field) { + if (!Array.isArray(object.field)) + throw TypeError(".google.protobuf.DescriptorProto.field: array expected"); + message.field = []; + for (var i = 0; i < object.field.length; ++i) { + if (typeof object.field[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.field: object expected"); + message.field[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.field[i]); + } + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.DescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (typeof object.extension[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); + } + } + if (object.nestedType) { + if (!Array.isArray(object.nestedType)) + throw TypeError(".google.protobuf.DescriptorProto.nestedType: array expected"); + message.nestedType = []; + for (var i = 0; i < object.nestedType.length; ++i) { + if (typeof object.nestedType[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.nestedType: object expected"); + message.nestedType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.nestedType[i]); + } + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.DescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (typeof object.enumType[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); + } + } + if (object.extensionRange) { + if (!Array.isArray(object.extensionRange)) + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: array expected"); + message.extensionRange = []; + for (var i = 0; i < object.extensionRange.length; ++i) { + if (typeof object.extensionRange[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: object expected"); + message.extensionRange[i] = $root.google.protobuf.DescriptorProto.ExtensionRange.fromObject(object.extensionRange[i]); + } + } + if (object.oneofDecl) { + if (!Array.isArray(object.oneofDecl)) + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: array expected"); + message.oneofDecl = []; + for (var i = 0; i < object.oneofDecl.length; ++i) { + if (typeof object.oneofDecl[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: object expected"); + message.oneofDecl[i] = $root.google.protobuf.OneofDescriptorProto.fromObject(object.oneofDecl[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.DescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MessageOptions.fromObject(object.options); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (typeof object.reservedRange[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.DescriptorProto.ReservedRange.fromObject(object.reservedRange[i]); + } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.DescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + return message; + }; + + /** + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.DescriptorProto} message DescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.field = []; + object.nestedType = []; + object.enumType = []; + object.extensionRange = []; + object.extension = []; + object.oneofDecl = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.field && message.field.length) { + object.field = []; + for (var j = 0; j < message.field.length; ++j) + object.field[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.field[j], options); + } + if (message.nestedType && message.nestedType.length) { + object.nestedType = []; + for (var j = 0; j < message.nestedType.length; ++j) + object.nestedType[j] = $root.google.protobuf.DescriptorProto.toObject(message.nestedType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.extensionRange && message.extensionRange.length) { + object.extensionRange = []; + for (var j = 0; j < message.extensionRange.length; ++j) + object.extensionRange[j] = $root.google.protobuf.DescriptorProto.ExtensionRange.toObject(message.extensionRange[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.MessageOptions.toObject(message.options, options); + if (message.oneofDecl && message.oneofDecl.length) { + object.oneofDecl = []; + for (var j = 0; j < message.oneofDecl.length; ++j) + object.oneofDecl[j] = $root.google.protobuf.OneofDescriptorProto.toObject(message.oneofDecl[j], options); + } + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.DescriptorProto.ReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + return object; + }; + + /** + * Converts this DescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto + * @instance + * @returns {Object.} JSON object + */ + DescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto"; + }; + + DescriptorProto.ExtensionRange = (function() { + + /** + * Properties of an ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @interface IExtensionRange + * @property {number|null} [start] ExtensionRange start + * @property {number|null} [end] ExtensionRange end + * @property {google.protobuf.IExtensionRangeOptions|null} [options] ExtensionRange options + */ + + /** + * Constructs a new ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents an ExtensionRange. + * @implements IExtensionRange + * @constructor + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + */ + function ExtensionRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExtensionRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.start = 0; + + /** + * ExtensionRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.end = 0; + + /** + * ExtensionRange options. + * @member {google.protobuf.IExtensionRangeOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.options = null; + + /** + * Creates a new ExtensionRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange instance + */ + ExtensionRange.create = function create(properties) { + return new ExtensionRange(properties); + }; + + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.ExtensionRangeOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.decode = function decode(reader, length) { + 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 + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + */ + ExtensionRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ExtensionRange) + return object; + var message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.DescriptorProto.ExtensionRange.options: object expected"); + message.options = $root.google.protobuf.ExtensionRangeOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.ExtensionRange} message ExtensionRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + object.options = null; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ExtensionRangeOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this ExtensionRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + * @returns {Object.} JSON object + */ + ExtensionRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExtensionRange + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExtensionRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto.ExtensionRange"; + }; + + return ExtensionRange; + })(); + + DescriptorProto.ReservedRange = (function() { + + /** + * Properties of a ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @interface IReservedRange + * @property {number|null} [start] ReservedRange start + * @property {number|null} [end] ReservedRange end + */ + + /** + * Constructs a new ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents a ReservedRange. + * @implements IReservedRange + * @constructor + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + */ + function ReservedRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReservedRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.start = 0; + + /** + * ReservedRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.end = 0; + + /** + * Creates a new ReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange instance + */ + ReservedRange.create = function create(properties) { + return new ReservedRange(properties); + }; + + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.decode = function decode(reader, length) { + 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 + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + */ + ReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ReservedRange) + return object; + var message = new $root.google.protobuf.DescriptorProto.ReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.ReservedRange} message ReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReservedRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this ReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + * @returns {Object.} JSON object + */ + ReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReservedRange + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto.ReservedRange"; + }; + + return ReservedRange; + })(); + + return DescriptorProto; + })(); + + protobuf.ExtensionRangeOptions = (function() { + + /** + * Properties of an ExtensionRangeOptions. + * @memberof google.protobuf + * @interface IExtensionRangeOptions + * @property {Array.|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 ExtensionRangeOptions. + * @memberof google.protobuf + * @classdesc Represents an ExtensionRangeOptions. + * @implements IExtensionRangeOptions + * @constructor + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + */ + function ExtensionRangeOptions(properties) { + this.uninterpretedOption = []; + this.declaration = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExtensionRangeOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * ExtensionRangeOptions declaration. + * @member {Array.} declaration + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.declaration = $util.emptyArray; + + /** + * ExtensionRangeOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.features = null; + + /** + * ExtensionRangeOptions verification. + * @member {google.protobuf.ExtensionRangeOptions.VerificationState} verification + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.verification = 1; + + /** + * Creates a new ExtensionRangeOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions instance + */ + ExtensionRangeOptions.create = function create(properties) { + return new ExtensionRangeOptions(properties); + }; + + /** + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.declaration != null && message.declaration.length) + for (var i = 0; i < message.declaration.length; ++i) + $root.google.protobuf.ExtensionRangeOptions.Declaration.encode(message.declaration[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.verification != null && Object.hasOwnProperty.call(message, "verification")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.verification); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.decode = function decode(reader, length) { + 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; + }; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtensionRangeOptions message. + * @function verify + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRangeOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message.declaration != null && message.hasOwnProperty("declaration")) { + if (!Array.isArray(message.declaration)) + return "declaration: array expected"; + for (var i = 0; i < message.declaration.length; ++i) { + var error = $root.google.protobuf.ExtensionRangeOptions.Declaration.verify(message.declaration[i]); + if (error) + return "declaration." + error; + } + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.verification != null && message.hasOwnProperty("verification")) + switch (message.verification) { + default: + return "verification: enum value expected"; + case 0: + case 1: + break; + } + return null; + }; + + /** + * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + */ + ExtensionRangeOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ExtensionRangeOptions) + return object; + var message = new $root.google.protobuf.ExtensionRangeOptions(); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object.declaration) { + if (!Array.isArray(object.declaration)) + throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: array expected"); + message.declaration = []; + for (var i = 0; i < object.declaration.length; ++i) { + if (typeof object.declaration[i] !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: object expected"); + message.declaration[i] = $root.google.protobuf.ExtensionRangeOptions.Declaration.fromObject(object.declaration[i]); + } + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + switch (object.verification) { + case "DECLARATION": + case 0: + message.verification = 0; + break; + default: + if (typeof object.verification === "number") { + message.verification = object.verification; + break; + } + break; + case "UNVERIFIED": + case 1: + message.verification = 1; + break; + } + return message; + }; + + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.ExtensionRangeOptions} message ExtensionRangeOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRangeOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.declaration = []; + object.uninterpretedOption = []; + } + if (options.defaults) { + object.verification = options.enums === String ? "UNVERIFIED" : 1; + object.features = null; + } + if (message.declaration && message.declaration.length) { + object.declaration = []; + for (var j = 0; j < message.declaration.length; ++j) + object.declaration[j] = $root.google.protobuf.ExtensionRangeOptions.Declaration.toObject(message.declaration[j], options); + } + if (message.verification != null && message.hasOwnProperty("verification")) + object.verification = options.enums === String ? $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] === undefined ? message.verification : $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] : message.verification; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this ExtensionRangeOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + * @returns {Object.} JSON object + */ + ExtensionRangeOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExtensionRangeOptions + * @function getTypeUrl + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExtensionRangeOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions"; + }; + + ExtensionRangeOptions.Declaration = (function() { + + /** + * Properties of a Declaration. + * @memberof google.protobuf.ExtensionRangeOptions + * @interface IDeclaration + * @property {number|null} [number] Declaration number + * @property {string|null} [fullName] Declaration fullName + * @property {string|null} [type] Declaration type + * @property {boolean|null} [reserved] Declaration reserved + * @property {boolean|null} [repeated] Declaration repeated + */ + + /** + * Constructs a new Declaration. + * @memberof google.protobuf.ExtensionRangeOptions + * @classdesc Represents a Declaration. + * @implements IDeclaration + * @constructor + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set + */ + function Declaration(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Declaration number. + * @member {number} number + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.number = 0; + + /** + * Declaration fullName. + * @member {string} fullName + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.fullName = ""; + + /** + * Declaration type. + * @member {string} type + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.type = ""; + + /** + * Declaration reserved. + * @member {boolean} reserved + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.reserved = false; + + /** + * Declaration repeated. + * @member {boolean} repeated + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.repeated = false; + + /** + * Creates a new Declaration instance using the specified properties. + * @function create + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration instance + */ + Declaration.create = function create(properties) { + return new Declaration(properties); + }; + + /** + * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Declaration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.number); + if (message.fullName != null && Object.hasOwnProperty.call(message, "fullName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.fullName); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.type); + if (message.reserved != null && Object.hasOwnProperty.call(message, "reserved")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.reserved); + if (message.repeated != null && Object.hasOwnProperty.call(message, "repeated")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.repeated); + return writer; + }; + + /** + * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Declaration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Declaration message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Declaration.decode = function decode(reader, length) { + 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; + })(); + + /** + * VerificationState enum. + * @name google.protobuf.ExtensionRangeOptions.VerificationState + * @enum {number} + * @property {number} DECLARATION=0 DECLARATION value + * @property {number} UNVERIFIED=1 UNVERIFIED value + */ + ExtensionRangeOptions.VerificationState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DECLARATION"] = 0; + values[valuesById[1] = "UNVERIFIED"] = 1; + return values; + })(); + + return ExtensionRangeOptions; + })(); + + protobuf.FieldDescriptorProto = (function() { + + /** + * Properties of a FieldDescriptorProto. + * @memberof google.protobuf + * @interface IFieldDescriptorProto + * @property {string|null} [name] FieldDescriptorProto name + * @property {number|null} [number] FieldDescriptorProto number + * @property {google.protobuf.FieldDescriptorProto.Label|null} [label] FieldDescriptorProto label + * @property {google.protobuf.FieldDescriptorProto.Type|null} [type] FieldDescriptorProto type + * @property {string|null} [typeName] FieldDescriptorProto typeName + * @property {string|null} [extendee] FieldDescriptorProto extendee + * @property {string|null} [defaultValue] FieldDescriptorProto defaultValue + * @property {number|null} [oneofIndex] FieldDescriptorProto oneofIndex + * @property {string|null} [jsonName] FieldDescriptorProto jsonName + * @property {google.protobuf.IFieldOptions|null} [options] FieldDescriptorProto options + * @property {boolean|null} [proto3Optional] FieldDescriptorProto proto3Optional + */ + + /** + * Constructs a new FieldDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FieldDescriptorProto. + * @implements IFieldDescriptorProto + * @constructor + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + */ + function FieldDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.name = ""; + + /** + * FieldDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.number = 0; + + /** + * FieldDescriptorProto label. + * @member {google.protobuf.FieldDescriptorProto.Label} label + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.label = 1; + + /** + * FieldDescriptorProto type. + * @member {google.protobuf.FieldDescriptorProto.Type} type + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.type = 1; + + /** + * FieldDescriptorProto typeName. + * @member {string} typeName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.typeName = ""; + + /** + * FieldDescriptorProto extendee. + * @member {string} extendee + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.extendee = ""; + + /** + * FieldDescriptorProto defaultValue. + * @member {string} defaultValue + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.defaultValue = ""; + + /** + * FieldDescriptorProto oneofIndex. + * @member {number} oneofIndex + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.oneofIndex = 0; + + /** + * FieldDescriptorProto jsonName. + * @member {string} jsonName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.jsonName = ""; + + /** + * FieldDescriptorProto options. + * @member {google.protobuf.IFieldOptions|null|undefined} options + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.options = null; + + /** + * FieldDescriptorProto proto3Optional. + * @member {boolean} proto3Optional + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.proto3Optional = false; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto instance + */ + FieldDescriptorProto.create = function create(properties) { + return new FieldDescriptorProto(properties); + }; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.extendee != null && Object.hasOwnProperty.call(message, "extendee")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); + if (message.label != null && Object.hasOwnProperty.call(message, "label")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); + if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName); + if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.oneofIndex != null && Object.hasOwnProperty.call(message, "oneofIndex")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex); + if (message.jsonName != null && Object.hasOwnProperty.call(message, "jsonName")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); + if (message.proto3Optional != null && Object.hasOwnProperty.call(message, "proto3Optional")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.proto3Optional); + return writer; + }; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decode = function decode(reader, length) { + 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.FieldDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + */ + FieldDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldDescriptorProto) + return object; + var message = new $root.google.protobuf.FieldDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + switch (object.label) { + default: + if (typeof object.label === "number") { + message.label = object.label; + break; + } + break; + case "LABEL_OPTIONAL": + case 1: + message.label = 1; + break; + case "LABEL_REPEATED": + case 3: + message.label = 3; + break; + case "LABEL_REQUIRED": + case 2: + message.label = 2; + break; + } + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "TYPE_DOUBLE": + case 1: + message.type = 1; + break; + case "TYPE_FLOAT": + case 2: + message.type = 2; + break; + case "TYPE_INT64": + case 3: + message.type = 3; + break; + case "TYPE_UINT64": + case 4: + message.type = 4; + break; + case "TYPE_INT32": + case 5: + message.type = 5; + break; + case "TYPE_FIXED64": + case 6: + message.type = 6; + break; + case "TYPE_FIXED32": + case 7: + message.type = 7; + break; + case "TYPE_BOOL": + case 8: + message.type = 8; + break; + case "TYPE_STRING": + case 9: + message.type = 9; + break; + case "TYPE_GROUP": + case 10: + message.type = 10; + break; + case "TYPE_MESSAGE": + case 11: + message.type = 11; + break; + case "TYPE_BYTES": + case 12: + message.type = 12; + break; + case "TYPE_UINT32": + case 13: + message.type = 13; + break; + case "TYPE_ENUM": + case 14: + message.type = 14; + break; + case "TYPE_SFIXED32": + case 15: + message.type = 15; + break; + case "TYPE_SFIXED64": + case 16: + message.type = 16; + break; + case "TYPE_SINT32": + case 17: + message.type = 17; + break; + case "TYPE_SINT64": + case 18: + message.type = 18; + break; + } + if (object.typeName != null) + message.typeName = String(object.typeName); + if (object.extendee != null) + message.extendee = String(object.extendee); + if (object.defaultValue != null) + message.defaultValue = String(object.defaultValue); + if (object.oneofIndex != null) + message.oneofIndex = object.oneofIndex | 0; + if (object.jsonName != null) + message.jsonName = String(object.jsonName); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FieldDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FieldOptions.fromObject(object.options); + } + if (object.proto3Optional != null) + message.proto3Optional = Boolean(object.proto3Optional); + return message; + }; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.FieldDescriptorProto} message FieldDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.extendee = ""; + object.number = 0; + object.label = options.enums === String ? "LABEL_OPTIONAL" : 1; + object.type = options.enums === String ? "TYPE_DOUBLE" : 1; + object.typeName = ""; + object.defaultValue = ""; + object.options = null; + object.oneofIndex = 0; + object.jsonName = ""; + object.proto3Optional = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.extendee != null && message.hasOwnProperty("extendee")) + object.extendee = message.extendee; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.label != null && message.hasOwnProperty("label")) + object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] === undefined ? message.label : $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] === undefined ? message.type : $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type; + if (message.typeName != null && message.hasOwnProperty("typeName")) + object.typeName = message.typeName; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + object.defaultValue = message.defaultValue; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FieldOptions.toObject(message.options, options); + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + object.oneofIndex = message.oneofIndex; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + object.jsonName = message.jsonName; + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + object.proto3Optional = message.proto3Optional; + return object; + }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FieldDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FieldDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldDescriptorProto"; + }; + + /** + * Type enum. + * @name google.protobuf.FieldDescriptorProto.Type + * @enum {number} + * @property {number} TYPE_DOUBLE=1 TYPE_DOUBLE value + * @property {number} TYPE_FLOAT=2 TYPE_FLOAT value + * @property {number} TYPE_INT64=3 TYPE_INT64 value + * @property {number} TYPE_UINT64=4 TYPE_UINT64 value + * @property {number} TYPE_INT32=5 TYPE_INT32 value + * @property {number} TYPE_FIXED64=6 TYPE_FIXED64 value + * @property {number} TYPE_FIXED32=7 TYPE_FIXED32 value + * @property {number} TYPE_BOOL=8 TYPE_BOOL value + * @property {number} TYPE_STRING=9 TYPE_STRING value + * @property {number} TYPE_GROUP=10 TYPE_GROUP value + * @property {number} TYPE_MESSAGE=11 TYPE_MESSAGE value + * @property {number} TYPE_BYTES=12 TYPE_BYTES value + * @property {number} TYPE_UINT32=13 TYPE_UINT32 value + * @property {number} TYPE_ENUM=14 TYPE_ENUM value + * @property {number} TYPE_SFIXED32=15 TYPE_SFIXED32 value + * @property {number} TYPE_SFIXED64=16 TYPE_SFIXED64 value + * @property {number} TYPE_SINT32=17 TYPE_SINT32 value + * @property {number} TYPE_SINT64=18 TYPE_SINT64 value + */ + FieldDescriptorProto.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "TYPE_DOUBLE"] = 1; + values[valuesById[2] = "TYPE_FLOAT"] = 2; + values[valuesById[3] = "TYPE_INT64"] = 3; + values[valuesById[4] = "TYPE_UINT64"] = 4; + values[valuesById[5] = "TYPE_INT32"] = 5; + values[valuesById[6] = "TYPE_FIXED64"] = 6; + values[valuesById[7] = "TYPE_FIXED32"] = 7; + values[valuesById[8] = "TYPE_BOOL"] = 8; + values[valuesById[9] = "TYPE_STRING"] = 9; + values[valuesById[10] = "TYPE_GROUP"] = 10; + values[valuesById[11] = "TYPE_MESSAGE"] = 11; + values[valuesById[12] = "TYPE_BYTES"] = 12; + values[valuesById[13] = "TYPE_UINT32"] = 13; + values[valuesById[14] = "TYPE_ENUM"] = 14; + values[valuesById[15] = "TYPE_SFIXED32"] = 15; + values[valuesById[16] = "TYPE_SFIXED64"] = 16; + values[valuesById[17] = "TYPE_SINT32"] = 17; + values[valuesById[18] = "TYPE_SINT64"] = 18; + return values; + })(); + + /** + * Label enum. + * @name google.protobuf.FieldDescriptorProto.Label + * @enum {number} + * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value + * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value + * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value + */ + FieldDescriptorProto.Label = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "LABEL_OPTIONAL"] = 1; + values[valuesById[3] = "LABEL_REPEATED"] = 3; + values[valuesById[2] = "LABEL_REQUIRED"] = 2; + return values; + })(); + + return FieldDescriptorProto; + })(); + + protobuf.OneofDescriptorProto = (function() { + + /** + * Properties of an OneofDescriptorProto. + * @memberof google.protobuf + * @interface IOneofDescriptorProto + * @property {string|null} [name] OneofDescriptorProto name + * @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options + */ + + /** + * Constructs a new OneofDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an OneofDescriptorProto. + * @implements IOneofDescriptorProto + * @constructor + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + */ + function OneofDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.name = ""; + + /** + * OneofDescriptorProto options. + * @member {google.protobuf.IOneofOptions|null|undefined} options + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.options = null; + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto instance + */ + OneofDescriptorProto.create = function create(properties) { + return new OneofDescriptorProto(properties); + }; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decode = function decode(reader, length) { + 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.OneofDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + */ + OneofDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofDescriptorProto) + return object; + var message = new $root.google.protobuf.OneofDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.OneofDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.OneofOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.OneofDescriptorProto} message OneofDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.OneofOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.OneofDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + OneofDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OneofDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OneofDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.OneofDescriptorProto"; + }; + + return OneofDescriptorProto; + })(); + + protobuf.EnumDescriptorProto = (function() { + + /** + * Properties of an EnumDescriptorProto. + * @memberof google.protobuf + * @interface IEnumDescriptorProto + * @property {string|null} [name] EnumDescriptorProto name + * @property {Array.|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 EnumDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumDescriptorProto. + * @implements IEnumDescriptorProto + * @constructor + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + */ + function EnumDescriptorProto(properties) { + this.value = []; + this.reservedRange = []; + this.reservedName = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.name = ""; + + /** + * EnumDescriptorProto value. + * @member {Array.} value + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.value = $util.emptyArray; + + /** + * EnumDescriptorProto options. + * @member {google.protobuf.IEnumOptions|null|undefined} options + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.options = null; + + /** + * EnumDescriptorProto reservedRange. + * @member {Array.} 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.EnumDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + */ + EnumDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto) + return object; + var message = new $root.google.protobuf.EnumDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.value) { + if (!Array.isArray(object.value)) + throw TypeError(".google.protobuf.EnumDescriptorProto.value: array expected"); + message.value = []; + for (var i = 0; i < object.value.length; ++i) { + if (typeof object.value[i] !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.value: object expected"); + message.value[i] = $root.google.protobuf.EnumValueDescriptorProto.fromObject(object.value[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumOptions.fromObject(object.options); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (typeof object.reservedRange[i] !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.fromObject(object.reservedRange[i]); + } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + return message; + }; + + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.EnumDescriptorProto} message EnumDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.value = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.value && message.value.length) { + object.value = []; + for (var j = 0; j < message.value.length; ++j) + object.value[j] = $root.google.protobuf.EnumValueDescriptorProto.toObject(message.value[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumOptions.toObject(message.options, options); + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + return object; + }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto"; + }; + + EnumDescriptorProto.EnumReservedRange = (function() { + + /** + * Properties of an EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @interface IEnumReservedRange + * @property {number|null} [start] EnumReservedRange start + * @property {number|null} [end] EnumReservedRange end + */ + + /** + * Constructs a new EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @classdesc Represents an EnumReservedRange. + * @implements IEnumReservedRange + * @constructor + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + */ + function EnumReservedRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumReservedRange start. + * @member {number} start + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.start = 0; + + /** + * EnumReservedRange end. + * @member {number} end + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.end = 0; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange instance + */ + EnumReservedRange.create = function create(properties) { + return new EnumReservedRange(properties); + }; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.decode = function decode(reader, length) { + 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.EnumValueDescriptorProto = (function() { + + /** + * Properties of an EnumValueDescriptorProto. + * @memberof google.protobuf + * @interface IEnumValueDescriptorProto + * @property {string|null} [name] EnumValueDescriptorProto name + * @property {number|null} [number] EnumValueDescriptorProto number + * @property {google.protobuf.IEnumValueOptions|null} [options] EnumValueDescriptorProto options + */ + + /** + * Constructs a new EnumValueDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumValueDescriptorProto. + * @implements IEnumValueDescriptorProto + * @constructor + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + */ + function EnumValueDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumValueDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.name = ""; + + /** + * EnumValueDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.number = 0; + + /** + * EnumValueDescriptorProto options. + * @member {google.protobuf.IEnumValueOptions|null|undefined} options + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.options = null; + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto instance + */ + EnumValueDescriptorProto.create = function create(properties) { + return new EnumValueDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decode = function decode(reader, length) { + 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; + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.EnumValueOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + */ + EnumValueDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueDescriptorProto) + return object; + var message = new $root.google.protobuf.EnumValueDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.EnumValueDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumValueOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.EnumValueDescriptorProto} message EnumValueDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.number = 0; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumValueOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this EnumValueDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumValueDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumValueDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumValueDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumValueDescriptorProto"; + }; + + return EnumValueDescriptorProto; + })(); + + protobuf.ServiceDescriptorProto = (function() { + + /** + * Properties of a ServiceDescriptorProto. + * @memberof google.protobuf + * @interface IServiceDescriptorProto + * @property {string|null} [name] ServiceDescriptorProto name + * @property {Array.|null} [method] ServiceDescriptorProto method + * @property {google.protobuf.IServiceOptions|null} [options] ServiceDescriptorProto options + */ + + /** + * Constructs a new ServiceDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a ServiceDescriptorProto. + * @implements IServiceDescriptorProto + * @constructor + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + */ + function ServiceDescriptorProto(properties) { + this.method = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.name = ""; + + /** + * ServiceDescriptorProto method. + * @member {Array.} method + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.method = $util.emptyArray; + + /** + * ServiceDescriptorProto options. + * @member {google.protobuf.IServiceOptions|null|undefined} options + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.options = null; + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto instance + */ + ServiceDescriptorProto.create = function create(properties) { + return new ServiceDescriptorProto(properties); + }; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.method != null && message.method.length) + for (var i = 0; i < message.method.length; ++i) + $root.google.protobuf.MethodDescriptorProto.encode(message.method[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.ServiceOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.decode = function decode(reader, length) { + 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 + */ + ServiceDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceDescriptorProto message. + * @function verify + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.method != null && message.hasOwnProperty("method")) { + if (!Array.isArray(message.method)) + return "method: array expected"; + for (var i = 0; i < message.method.length; ++i) { + var error = $root.google.protobuf.MethodDescriptorProto.verify(message.method[i]); + if (error) + return "method." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.ServiceOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + */ + ServiceDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceDescriptorProto) + return object; + var message = new $root.google.protobuf.ServiceDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.method) { + if (!Array.isArray(object.method)) + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: array expected"); + message.method = []; + for (var i = 0; i < object.method.length; ++i) { + if (typeof object.method[i] !== "object") + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: object expected"); + message.method[i] = $root.google.protobuf.MethodDescriptorProto.fromObject(object.method[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.ServiceDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.ServiceOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.ServiceDescriptorProto} message ServiceDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.method = []; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.method && message.method.length) { + object.method = []; + for (var j = 0; j < message.method.length; ++j) + object.method[j] = $root.google.protobuf.MethodDescriptorProto.toObject(message.method[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ServiceOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + ServiceDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ServiceDescriptorProto"; + }; + + return ServiceDescriptorProto; + })(); + + protobuf.MethodDescriptorProto = (function() { + + /** + * Properties of a MethodDescriptorProto. + * @memberof google.protobuf + * @interface IMethodDescriptorProto + * @property {string|null} [name] MethodDescriptorProto name + * @property {string|null} [inputType] MethodDescriptorProto inputType + * @property {string|null} [outputType] MethodDescriptorProto outputType + * @property {google.protobuf.IMethodOptions|null} [options] MethodDescriptorProto options + * @property {boolean|null} [clientStreaming] MethodDescriptorProto clientStreaming + * @property {boolean|null} [serverStreaming] MethodDescriptorProto serverStreaming + */ + + /** + * Constructs a new MethodDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a MethodDescriptorProto. + * @implements IMethodDescriptorProto + * @constructor + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + */ + function MethodDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.name = ""; + + /** + * MethodDescriptorProto inputType. + * @member {string} inputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.inputType = ""; + + /** + * MethodDescriptorProto outputType. + * @member {string} outputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.outputType = ""; + + /** + * MethodDescriptorProto options. + * @member {google.protobuf.IMethodOptions|null|undefined} options + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.options = null; + + /** + * MethodDescriptorProto clientStreaming. + * @member {boolean} clientStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.clientStreaming = false; + + /** + * MethodDescriptorProto serverStreaming. + * @member {boolean} serverStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.serverStreaming = false; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto instance + */ + MethodDescriptorProto.create = function create(properties) { + return new MethodDescriptorProto(properties); + }; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.inputType != null && Object.hasOwnProperty.call(message, "inputType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputType); + if (message.outputType != null && Object.hasOwnProperty.call(message, "outputType")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputType); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.MethodOptions.encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.clientStreaming != null && Object.hasOwnProperty.call(message, "clientStreaming")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.clientStreaming); + if (message.serverStreaming != null && Object.hasOwnProperty.call(message, "serverStreaming")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.serverStreaming); + return writer; + }; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decode = function decode(reader, length) { + 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 2: { + message.inputType = reader.string(); + break; + } + case 3: { + message.outputType = reader.string(); + break; + } + case 4: { + message.options = $root.google.protobuf.MethodOptions.decode(reader, reader.uint32()); + break; + } + case 5: { + message.clientStreaming = reader.bool(); + break; + } + case 6: { + message.serverStreaming = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodDescriptorProto message. + * @function verify + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.inputType != null && message.hasOwnProperty("inputType")) + if (!$util.isString(message.inputType)) + return "inputType: string expected"; + if (message.outputType != null && message.hasOwnProperty("outputType")) + if (!$util.isString(message.outputType)) + return "outputType: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.MethodOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + if (typeof message.clientStreaming !== "boolean") + return "clientStreaming: boolean expected"; + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + if (typeof message.serverStreaming !== "boolean") + return "serverStreaming: boolean expected"; + return null; + }; + + /** + * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} 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"; + } + return typeUrlPrefix + "/google.protobuf.MethodDescriptorProto"; + }; + + return MethodDescriptorProto; + })(); + + protobuf.FileOptions = (function() { + + /** + * Properties of a FileOptions. + * @memberof google.protobuf + * @interface IFileOptions + * @property {string|null} [javaPackage] FileOptions javaPackage + * @property {string|null} [javaOuterClassname] FileOptions javaOuterClassname + * @property {boolean|null} [javaMultipleFiles] FileOptions javaMultipleFiles + * @property {boolean|null} [javaGenerateEqualsAndHash] FileOptions javaGenerateEqualsAndHash + * @property {boolean|null} [javaStringCheckUtf8] FileOptions javaStringCheckUtf8 + * @property {google.protobuf.FileOptions.OptimizeMode|null} [optimizeFor] FileOptions optimizeFor + * @property {string|null} [goPackage] FileOptions goPackage + * @property {boolean|null} [ccGenericServices] FileOptions ccGenericServices + * @property {boolean|null} [javaGenericServices] FileOptions javaGenericServices + * @property {boolean|null} [pyGenericServices] FileOptions pyGenericServices + * @property {boolean|null} [deprecated] FileOptions deprecated + * @property {boolean|null} [ccEnableArenas] FileOptions ccEnableArenas + * @property {string|null} [objcClassPrefix] FileOptions objcClassPrefix + * @property {string|null} [csharpNamespace] FileOptions csharpNamespace + * @property {string|null} [swiftPrefix] FileOptions swiftPrefix + * @property {string|null} [phpClassPrefix] FileOptions phpClassPrefix + * @property {string|null} [phpNamespace] FileOptions phpNamespace + * @property {string|null} [phpMetadataNamespace] FileOptions phpMetadataNamespace + * @property {string|null} [rubyPackage] FileOptions rubyPackage + * @property {google.protobuf.IFeatureSet|null} [features] FileOptions features + * @property {Array.|null} [uninterpretedOption] FileOptions uninterpretedOption + * @property {Array.|null} [".google.api.resourceDefinition"] FileOptions .google.api.resourceDefinition + */ + + /** + * Constructs a new FileOptions. + * @memberof google.protobuf + * @classdesc Represents a FileOptions. + * @implements IFileOptions + * @constructor + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + */ + function FileOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.resourceDefinition"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileOptions javaPackage. + * @member {string} javaPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaPackage = ""; + + /** + * FileOptions javaOuterClassname. + * @member {string} javaOuterClassname + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaOuterClassname = ""; + + /** + * FileOptions javaMultipleFiles. + * @member {boolean} javaMultipleFiles + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaMultipleFiles = false; + + /** + * FileOptions javaGenerateEqualsAndHash. + * @member {boolean} javaGenerateEqualsAndHash + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenerateEqualsAndHash = false; + + /** + * FileOptions javaStringCheckUtf8. + * @member {boolean} javaStringCheckUtf8 + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaStringCheckUtf8 = false; + + /** + * FileOptions optimizeFor. + * @member {google.protobuf.FileOptions.OptimizeMode} optimizeFor + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.optimizeFor = 1; + + /** + * FileOptions goPackage. + * @member {string} goPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.goPackage = ""; + + /** + * FileOptions ccGenericServices. + * @member {boolean} ccGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccGenericServices = false; + + /** + * FileOptions javaGenericServices. + * @member {boolean} javaGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenericServices = false; + + /** + * FileOptions pyGenericServices. + * @member {boolean} pyGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.pyGenericServices = false; + + /** + * FileOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.deprecated = false; + + /** + * FileOptions ccEnableArenas. + * @member {boolean} ccEnableArenas + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccEnableArenas = true; + + /** + * FileOptions objcClassPrefix. + * @member {string} objcClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.objcClassPrefix = ""; + + /** + * FileOptions csharpNamespace. + * @member {string} csharpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.csharpNamespace = ""; + + /** + * FileOptions swiftPrefix. + * @member {string} swiftPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.swiftPrefix = ""; + + /** + * FileOptions phpClassPrefix. + * @member {string} phpClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpClassPrefix = ""; + + /** + * FileOptions phpNamespace. + * @member {string} phpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpNamespace = ""; + + /** + * FileOptions phpMetadataNamespace. + * @member {string} phpMetadataNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpMetadataNamespace = ""; + + /** + * FileOptions rubyPackage. + * @member {string} rubyPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.rubyPackage = ""; + + /** + * FileOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.features = null; + + /** + * FileOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * FileOptions .google.api.resourceDefinition. + * @member {Array.} .google.api.resourceDefinition + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype[".google.api.resourceDefinition"] = $util.emptyArray; + + /** + * Creates a new FileOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + * @returns {google.protobuf.FileOptions} FileOptions instance + */ + FileOptions.create = function create(properties) { + return new FileOptions(properties); + }; + + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.javaPackage != null && Object.hasOwnProperty.call(message, "javaPackage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.javaPackage); + if (message.javaOuterClassname != null && Object.hasOwnProperty.call(message, "javaOuterClassname")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.javaOuterClassname); + if (message.optimizeFor != null && Object.hasOwnProperty.call(message, "optimizeFor")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimizeFor); + if (message.javaMultipleFiles != null && Object.hasOwnProperty.call(message, "javaMultipleFiles")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.javaMultipleFiles); + if (message.goPackage != null && Object.hasOwnProperty.call(message, "goPackage")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.goPackage); + if (message.ccGenericServices != null && Object.hasOwnProperty.call(message, "ccGenericServices")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.ccGenericServices); + if (message.javaGenericServices != null && Object.hasOwnProperty.call(message, "javaGenericServices")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.javaGenericServices); + if (message.pyGenericServices != null && Object.hasOwnProperty.call(message, "pyGenericServices")) + writer.uint32(/* id 18, wireType 0 =*/144).bool(message.pyGenericServices); + if (message.javaGenerateEqualsAndHash != null && Object.hasOwnProperty.call(message, "javaGenerateEqualsAndHash")) + writer.uint32(/* id 20, wireType 0 =*/160).bool(message.javaGenerateEqualsAndHash); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated); + if (message.javaStringCheckUtf8 != null && Object.hasOwnProperty.call(message, "javaStringCheckUtf8")) + writer.uint32(/* id 27, wireType 0 =*/216).bool(message.javaStringCheckUtf8); + if (message.ccEnableArenas != null && Object.hasOwnProperty.call(message, "ccEnableArenas")) + writer.uint32(/* id 31, wireType 0 =*/248).bool(message.ccEnableArenas); + if (message.objcClassPrefix != null && Object.hasOwnProperty.call(message, "objcClassPrefix")) + writer.uint32(/* id 36, wireType 2 =*/290).string(message.objcClassPrefix); + if (message.csharpNamespace != null && Object.hasOwnProperty.call(message, "csharpNamespace")) + writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharpNamespace); + if (message.swiftPrefix != null && Object.hasOwnProperty.call(message, "swiftPrefix")) + writer.uint32(/* id 39, wireType 2 =*/314).string(message.swiftPrefix); + if (message.phpClassPrefix != null && Object.hasOwnProperty.call(message, "phpClassPrefix")) + writer.uint32(/* id 40, wireType 2 =*/322).string(message.phpClassPrefix); + if (message.phpNamespace != null && Object.hasOwnProperty.call(message, "phpNamespace")) + writer.uint32(/* id 41, wireType 2 =*/330).string(message.phpNamespace); + if (message.phpMetadataNamespace != null && Object.hasOwnProperty.call(message, "phpMetadataNamespace")) + writer.uint32(/* id 44, wireType 2 =*/354).string(message.phpMetadataNamespace); + if (message.rubyPackage != null && Object.hasOwnProperty.call(message, "rubyPackage")) + writer.uint32(/* id 45, wireType 2 =*/362).string(message.rubyPackage); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.resourceDefinition"] != null && message[".google.api.resourceDefinition"].length) + for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resourceDefinition"][i], writer.uint32(/* id 1053, wireType 2 =*/8426).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; + } + case 1053: { + if (!(message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length)) + message[".google.api.resourceDefinition"] = []; + message[".google.api.resourceDefinition"].push($root.google.api.ResourceDescriptor.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; + } + } + if (message[".google.api.resourceDefinition"] != null && message.hasOwnProperty(".google.api.resourceDefinition")) { + if (!Array.isArray(message[".google.api.resourceDefinition"])) + return ".google.api.resourceDefinition: array expected"; + for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) { + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resourceDefinition"][i]); + if (error) + return ".google.api.resourceDefinition." + 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]); + } + } + 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]); + } + } + 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 + */ + FileOptions.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 = 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.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); + } + return object; + }; + + /** + * Converts this FileOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FileOptions + * @instance + * @returns {Object.} JSON object + */ + FileOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileOptions + * @function getTypeUrl + * @memberof google.protobuf.FileOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileOptions"; + }; + + /** + * OptimizeMode enum. + * @name google.protobuf.FileOptions.OptimizeMode + * @enum {number} + * @property {number} SPEED=1 SPEED value + * @property {number} CODE_SIZE=2 CODE_SIZE value + * @property {number} LITE_RUNTIME=3 LITE_RUNTIME value + */ + FileOptions.OptimizeMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "SPEED"] = 1; + values[valuesById[2] = "CODE_SIZE"] = 2; + values[valuesById[3] = "LITE_RUNTIME"] = 3; + return values; + })(); + + return FileOptions; + })(); + + protobuf.MessageOptions = (function() { + + /** + * Properties of a MessageOptions. + * @memberof google.protobuf + * @interface IMessageOptions + * @property {boolean|null} [messageSetWireFormat] MessageOptions messageSetWireFormat + * @property {boolean|null} [noStandardDescriptorAccessor] MessageOptions noStandardDescriptorAccessor + * @property {boolean|null} [deprecated] MessageOptions deprecated + * @property {boolean|null} [mapEntry] MessageOptions mapEntry + * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] MessageOptions deprecatedLegacyJsonFieldConflicts + * @property {google.protobuf.IFeatureSet|null} [features] MessageOptions features + * @property {Array.|null} [uninterpretedOption] MessageOptions uninterpretedOption + * @property {google.api.IResourceDescriptor|null} [".google.api.resource"] MessageOptions .google.api.resource + */ + + /** + * Constructs a new MessageOptions. + * @memberof google.protobuf + * @classdesc Represents a MessageOptions. + * @implements IMessageOptions + * @constructor + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + */ + function MessageOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MessageOptions messageSetWireFormat. + * @member {boolean} messageSetWireFormat + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.messageSetWireFormat = false; + + /** + * MessageOptions noStandardDescriptorAccessor. + * @member {boolean} noStandardDescriptorAccessor + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.noStandardDescriptorAccessor = false; + + /** + * MessageOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.deprecated = false; + + /** + * MessageOptions mapEntry. + * @member {boolean} mapEntry + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.mapEntry = false; + + /** + * MessageOptions deprecatedLegacyJsonFieldConflicts. + * @member {boolean} deprecatedLegacyJsonFieldConflicts + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; + + /** + * MessageOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.features = null; + + /** + * MessageOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * MessageOptions .google.api.resource. + * @member {google.api.IResourceDescriptor|null|undefined} .google.api.resource + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype[".google.api.resource"] = null; + + /** + * 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(); + if (message[".google.api.resource"] != null && Object.hasOwnProperty.call(message, ".google.api.resource")) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resource"], writer.uint32(/* id 1053, wireType 2 =*/8426).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; + } + case 1053: { + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.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; + } + } + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) { + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resource"]); + if (error) + return ".google.api.resource." + error; + } + return null; + }; + + /** + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MessageOptions} MessageOptions + */ + MessageOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MessageOptions) + return object; + var message = new $root.google.protobuf.MessageOptions(); + if (object.messageSetWireFormat != null) + message.messageSetWireFormat = Boolean(object.messageSetWireFormat); + if (object.noStandardDescriptorAccessor != null) + message.noStandardDescriptorAccessor = Boolean(object.noStandardDescriptorAccessor); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.mapEntry != null) + message.mapEntry = Boolean(object.mapEntry); + if (object.deprecatedLegacyJsonFieldConflicts != null) + message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.MessageOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + 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"]); + } + return message; + }; + + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.MessageOptions} message MessageOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MessageOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.messageSetWireFormat = false; + object.noStandardDescriptorAccessor = false; + object.deprecated = false; + object.mapEntry = false; + object.deprecatedLegacyJsonFieldConflicts = false; + object.features = null; + object[".google.api.resource"] = 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.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) + object[".google.api.resource"] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resource"], options); + return object; + }; + + /** + * Converts this MessageOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MessageOptions + * @instance + * @returns {Object.} JSON object + */ + MessageOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MessageOptions + * @function getTypeUrl + * @memberof google.protobuf.MessageOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MessageOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MessageOptions"; + }; + + return MessageOptions; + })(); + + protobuf.FieldOptions = (function() { + + /** + * Properties of a FieldOptions. + * @memberof google.protobuf + * @interface IFieldOptions + * @property {google.protobuf.FieldOptions.CType|null} [ctype] FieldOptions ctype + * @property {boolean|null} [packed] FieldOptions packed + * @property {google.protobuf.FieldOptions.JSType|null} [jstype] FieldOptions jstype + * @property {boolean|null} [lazy] FieldOptions lazy + * @property {boolean|null} [unverifiedLazy] FieldOptions unverifiedLazy + * @property {boolean|null} [deprecated] FieldOptions deprecated + * @property {boolean|null} [weak] FieldOptions weak + * @property {boolean|null} [debugRedact] FieldOptions debugRedact + * @property {google.protobuf.FieldOptions.OptionRetention|null} [retention] FieldOptions retention + * @property {Array.|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 + * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference + */ + + /** + * Constructs a new FieldOptions. + * @memberof google.protobuf + * @classdesc Represents a FieldOptions. + * @implements IFieldOptions + * @constructor + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + */ + function FieldOptions(properties) { + this.targets = []; + this.editionDefaults = []; + this.uninterpretedOption = []; + 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]]; + } + + /** + * FieldOptions ctype. + * @member {google.protobuf.FieldOptions.CType} ctype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.ctype = 0; + + /** + * FieldOptions packed. + * @member {boolean} packed + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.packed = false; + + /** + * FieldOptions jstype. + * @member {google.protobuf.FieldOptions.JSType} jstype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.jstype = 0; + + /** + * FieldOptions lazy. + * @member {boolean} lazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.lazy = false; + + /** + * FieldOptions unverifiedLazy. + * @member {boolean} unverifiedLazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.unverifiedLazy = false; + + /** + * FieldOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.deprecated = false; + + /** + * FieldOptions weak. + * @member {boolean} weak + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.weak = false; + + /** + * FieldOptions debugRedact. + * @member {boolean} debugRedact + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.debugRedact = false; + + /** + * FieldOptions retention. + * @member {google.protobuf.FieldOptions.OptionRetention} retention + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.retention = 0; + + /** + * FieldOptions targets. + * @member {Array.} 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; + + /** + * FieldOptions .google.api.resourceReference. + * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.resourceReference"] = null; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions} FieldOptions instance + */ + FieldOptions.create = function create(properties) { + return new FieldOptions(properties); + }; + + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ctype != null && Object.hasOwnProperty.call(message, "ctype")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype); + if (message.packed != null && Object.hasOwnProperty.call(message, "packed")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.lazy != null && Object.hasOwnProperty.call(message, "lazy")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy); + if (message.jstype != null && Object.hasOwnProperty.call(message, "jstype")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype); + if (message.weak != null && Object.hasOwnProperty.call(message, "weak")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak); + if (message.unverifiedLazy != null && Object.hasOwnProperty.call(message, "unverifiedLazy")) + writer.uint32(/* id 15, wireType 0 =*/120).bool(message.unverifiedLazy); + if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.debugRedact); + if (message.retention != null && Object.hasOwnProperty.call(message, "retention")) + writer.uint32(/* id 17, wireType 0 =*/136).int32(message.retention); + if (message.targets != null && message.targets.length) + for (var i = 0; i < message.targets.length; ++i) + writer.uint32(/* id 19, wireType 0 =*/152).int32(message.targets[i]); + if (message.editionDefaults != null && message.editionDefaults.length) + for (var i = 0; i < message.editionDefaults.length; ++i) + $root.google.protobuf.FieldOptions.EditionDefault.encode(message.editionDefaults[i], writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.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) + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + writer.uint32(/* id 1052, wireType 0 =*/8416).int32(message[".google.api.fieldBehavior"][i]); + if (message[".google.api.resourceReference"] != null && Object.hasOwnProperty.call(message, ".google.api.resourceReference")) + $root.google.api.ResourceReference.encode(message[".google.api.resourceReference"], writer.uint32(/* id 1055, wireType 2 =*/8442).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decode = function decode(reader, length) { + 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; + } + case 1055: { + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldOptions message. + * @function verify + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} 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; + } + } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) { + var error = $root.google.api.ResourceReference.verify(message[".google.api.resourceReference"]); + if (error) + return ".google.api.resourceReference." + error; + } + return null; + }; + + /** + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} 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; + } + } + 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"]); + } + 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; + 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.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]; + } + 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; + }; + + /** + * 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 + */ + FieldOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldOptions"; + }; + + /** + * CType enum. + * @name google.protobuf.FieldOptions.CType + * @enum {number} + * @property {number} STRING=0 STRING value + * @property {number} CORD=1 CORD value + * @property {number} STRING_PIECE=2 STRING_PIECE value + */ + FieldOptions.CType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STRING"] = 0; + values[valuesById[1] = "CORD"] = 1; + values[valuesById[2] = "STRING_PIECE"] = 2; + return values; + })(); + + /** + * JSType enum. + * @name google.protobuf.FieldOptions.JSType + * @enum {number} + * @property {number} JS_NORMAL=0 JS_NORMAL value + * @property {number} JS_STRING=1 JS_STRING value + * @property {number} JS_NUMBER=2 JS_NUMBER value + */ + FieldOptions.JSType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JS_NORMAL"] = 0; + values[valuesById[1] = "JS_STRING"] = 1; + values[valuesById[2] = "JS_NUMBER"] = 2; + return values; + })(); + + /** + * OptionRetention enum. + * @name google.protobuf.FieldOptions.OptionRetention + * @enum {number} + * @property {number} RETENTION_UNKNOWN=0 RETENTION_UNKNOWN value + * @property {number} RETENTION_RUNTIME=1 RETENTION_RUNTIME value + * @property {number} RETENTION_SOURCE=2 RETENTION_SOURCE value + */ + FieldOptions.OptionRetention = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RETENTION_UNKNOWN"] = 0; + values[valuesById[1] = "RETENTION_RUNTIME"] = 1; + values[valuesById[2] = "RETENTION_SOURCE"] = 2; + return values; + })(); + + /** + * OptionTargetType enum. + * @name google.protobuf.FieldOptions.OptionTargetType + * @enum {number} + * @property {number} TARGET_TYPE_UNKNOWN=0 TARGET_TYPE_UNKNOWN value + * @property {number} TARGET_TYPE_FILE=1 TARGET_TYPE_FILE value + * @property {number} TARGET_TYPE_EXTENSION_RANGE=2 TARGET_TYPE_EXTENSION_RANGE value + * @property {number} TARGET_TYPE_MESSAGE=3 TARGET_TYPE_MESSAGE value + * @property {number} TARGET_TYPE_FIELD=4 TARGET_TYPE_FIELD value + * @property {number} TARGET_TYPE_ONEOF=5 TARGET_TYPE_ONEOF value + * @property {number} TARGET_TYPE_ENUM=6 TARGET_TYPE_ENUM value + * @property {number} TARGET_TYPE_ENUM_ENTRY=7 TARGET_TYPE_ENUM_ENTRY value + * @property {number} TARGET_TYPE_SERVICE=8 TARGET_TYPE_SERVICE value + * @property {number} TARGET_TYPE_METHOD=9 TARGET_TYPE_METHOD value + */ + FieldOptions.OptionTargetType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TARGET_TYPE_UNKNOWN"] = 0; + values[valuesById[1] = "TARGET_TYPE_FILE"] = 1; + values[valuesById[2] = "TARGET_TYPE_EXTENSION_RANGE"] = 2; + values[valuesById[3] = "TARGET_TYPE_MESSAGE"] = 3; + values[valuesById[4] = "TARGET_TYPE_FIELD"] = 4; + values[valuesById[5] = "TARGET_TYPE_ONEOF"] = 5; + values[valuesById[6] = "TARGET_TYPE_ENUM"] = 6; + values[valuesById[7] = "TARGET_TYPE_ENUM_ENTRY"] = 7; + values[valuesById[8] = "TARGET_TYPE_SERVICE"] = 8; + values[valuesById[9] = "TARGET_TYPE_METHOD"] = 9; + return values; + })(); + + FieldOptions.EditionDefault = (function() { + + /** + * Properties of an EditionDefault. + * @memberof google.protobuf.FieldOptions + * @interface IEditionDefault + * @property {google.protobuf.Edition|null} [edition] EditionDefault edition + * @property {string|null} [value] EditionDefault value + */ + + /** + * Constructs a new EditionDefault. + * @memberof google.protobuf.FieldOptions + * @classdesc Represents an EditionDefault. + * @implements IEditionDefault + * @constructor + * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set + */ + function EditionDefault(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EditionDefault edition. + * @member {google.protobuf.Edition} edition + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + */ + EditionDefault.prototype.edition = 0; + + /** + * EditionDefault value. + * @member {string} value + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + */ + EditionDefault.prototype.value = ""; + + /** + * Creates a new EditionDefault instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault instance + */ + EditionDefault.create = function create(properties) { + return new EditionDefault(properties); + }; + + /** + * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EditionDefault.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.value); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); + return writer; + }; + + /** + * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EditionDefault.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EditionDefault message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EditionDefault.decode = function decode(reader, length) { + 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.FieldOptions.EditionDefault + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + */ + EditionDefault.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions.EditionDefault) + return object; + var message = new $root.google.protobuf.FieldOptions.EditionDefault(); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.edition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.EditionDefault} message EditionDefault + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EditionDefault.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.value = ""; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + return object; + }; + + /** + * Converts this EditionDefault to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + * @returns {Object.} JSON object + */ + EditionDefault.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EditionDefault + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldOptions.EditionDefault"; + }; + + return EditionDefault; + })(); + + return FieldOptions; + })(); + + protobuf.OneofOptions = (function() { + + /** + * Properties of an OneofOptions. + * @memberof google.protobuf + * @interface IOneofOptions + * @property {google.protobuf.IFeatureSet|null} [features] OneofOptions features + * @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 features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.features = null; + + /** + * 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.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.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.OneofOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.OneofOptions} message OneofOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) + object.features = null; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this OneofOptions to JSON. + * @function toJSON + * @memberof google.protobuf.OneofOptions + * @instance + * @returns {Object.} JSON object + */ + OneofOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OneofOptions + * @function getTypeUrl + * @memberof google.protobuf.OneofOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OneofOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.OneofOptions"; + }; + + return OneofOptions; + })(); + + protobuf.EnumOptions = (function() { + + /** + * Properties of an EnumOptions. + * @memberof google.protobuf + * @interface IEnumOptions + * @property {boolean|null} [allowAlias] EnumOptions allowAlias + * @property {boolean|null} [deprecated] EnumOptions deprecated + * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] EnumOptions deprecatedLegacyJsonFieldConflicts + * @property {google.protobuf.IFeatureSet|null} [features] EnumOptions features + * @property {Array.|null} [uninterpretedOption] EnumOptions uninterpretedOption + */ + + /** + * Constructs a new EnumOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumOptions. + * @implements IEnumOptions + * @constructor + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + */ + function EnumOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumOptions allowAlias. + * @member {boolean} allowAlias + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.allowAlias = false; + + /** + * EnumOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.deprecated = false; + + /** + * EnumOptions deprecatedLegacyJsonFieldConflicts. + * @member {boolean} deprecatedLegacyJsonFieldConflicts + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; + + /** + * EnumOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.features = null; + + /** + * EnumOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumOptions} EnumOptions instance + */ + EnumOptions.create = function create(properties) { + return new EnumOptions(properties); + }; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowAlias != null && Object.hasOwnProperty.call(message, "allowAlias")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.deprecatedLegacyJsonFieldConflicts); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decode = function decode(reader, length) { + 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 message; + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumOptions message. + * @function verify + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + if (typeof message.allowAlias !== "boolean") + return "allowAlias: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") + return "deprecatedLegacyJsonFieldConflicts: boolean expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumOptions} EnumOptions + */ + EnumOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumOptions) + return object; + var message = new $root.google.protobuf.EnumOptions(); + if (object.allowAlias != null) + message.allowAlias = Boolean(object.allowAlias); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.deprecatedLegacyJsonFieldConflicts != null) + message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.EnumOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.EnumOptions} message EnumOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.allowAlias = false; + object.deprecated = false; + object.deprecatedLegacyJsonFieldConflicts = false; + object.features = null; + } + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + object.allowAlias = message.allowAlias; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this EnumOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumOptions + * @instance + * @returns {Object.} JSON object + */ + EnumOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumOptions + * @function getTypeUrl + * @memberof google.protobuf.EnumOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumOptions"; + }; + + return EnumOptions; + })(); + + protobuf.EnumValueOptions = (function() { + + /** + * Properties of an EnumValueOptions. + * @memberof google.protobuf + * @interface IEnumValueOptions + * @property {boolean|null} [deprecated] EnumValueOptions deprecated + * @property {google.protobuf.IFeatureSet|null} [features] EnumValueOptions features + * @property {boolean|null} [debugRedact] EnumValueOptions debugRedact + * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption + */ + + /** + * Constructs a new EnumValueOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumValueOptions. + * @implements IEnumValueOptions + * @constructor + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + */ + function EnumValueOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumValueOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.deprecated = false; + + /** + * EnumValueOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.features = null; + + /** + * EnumValueOptions debugRedact. + * @member {boolean} debugRedact + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.debugRedact = false; + + /** + * EnumValueOptions 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.EnumValueOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + */ + EnumValueOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueOptions) + return object; + var message = new $root.google.protobuf.EnumValueOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.debugRedact != null) + message.debugRedact = Boolean(object.debugRedact); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.EnumValueOptions} message EnumValueOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.deprecated = false; + object.features = null; + object.debugRedact = false; + } + 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 EnumValueOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueOptions + * @instance + * @returns {Object.} JSON object + */ + EnumValueOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumValueOptions + * @function getTypeUrl + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumValueOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumValueOptions"; + }; + + return EnumValueOptions; + })(); + + protobuf.ServiceOptions = (function() { + + /** + * Properties of a ServiceOptions. + * @memberof google.protobuf + * @interface IServiceOptions + * @property {google.protobuf.IFeatureSet|null} [features] ServiceOptions features + * @property {boolean|null} [deprecated] ServiceOptions deprecated + * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption + * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost + * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes + * @property {string|null} [".google.api.apiVersion"] ServiceOptions .google.api.apiVersion + */ + + /** + * Constructs a new ServiceOptions. + * @memberof google.protobuf + * @classdesc Represents a ServiceOptions. + * @implements IServiceOptions + * @constructor + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + */ + function ServiceOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.features = null; + + /** + * ServiceOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.deprecated = false; + + /** + * ServiceOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * ServiceOptions .google.api.defaultHost. + * @member {string} .google.api.defaultHost + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.defaultHost"] = ""; + + /** + * ServiceOptions .google.api.oauthScopes. + * @member {string} .google.api.oauthScopes + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.oauthScopes"] = ""; + + /** + * ServiceOptions .google.api.apiVersion. + * @member {string} .google.api.apiVersion + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.apiVersion"] = ""; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + * @returns {google.protobuf.ServiceOptions} ServiceOptions instance + */ + ServiceOptions.create = function create(properties) { + return new ServiceOptions(properties); + }; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 34, wireType 2 =*/274).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + 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"]); + if (message[".google.api.apiVersion"] != null && Object.hasOwnProperty.call(message, ".google.api.apiVersion")) + writer.uint32(/* id 525000001, wireType 2 =*/4200000010).string(message[".google.api.apiVersion"]); + return writer; + }; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decode = function decode(reader, length) { + 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; + } + case 525000001: { + message[".google.api.apiVersion"] = 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 + */ + ServiceOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceOptions message. + * @function verify + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + 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"; + if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) + if (!$util.isString(message[".google.api.apiVersion"])) + return ".google.api.apiVersion: string expected"; + return null; + }; + + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceOptions} ServiceOptions + */ + ServiceOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceOptions) + return object; + var message = new $root.google.protobuf.ServiceOptions(); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.ServiceOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + 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"]); + if (object[".google.api.apiVersion"] != null) + message[".google.api.apiVersion"] = String(object[".google.api.apiVersion"]); + return message; + }; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.ServiceOptions} message ServiceOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.deprecated = false; + object.features = null; + object[".google.api.defaultHost"] = ""; + object[".google.api.oauthScopes"] = ""; + object[".google.api.apiVersion"] = ""; + } + 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"]; + if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) + object[".google.api.apiVersion"] = message[".google.api.apiVersion"]; + return object; + }; + + /** + * Converts this ServiceOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceOptions + * @instance + * @returns {Object.} JSON object + */ + ServiceOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceOptions + * @function getTypeUrl + * @memberof google.protobuf.ServiceOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ServiceOptions"; + }; + + return ServiceOptions; + })(); + + protobuf.MethodOptions = (function() { + + /** + * Properties of a MethodOptions. + * @memberof google.protobuf + * @interface IMethodOptions + * @property {boolean|null} [deprecated] MethodOptions deprecated + * @property {google.protobuf.MethodOptions.IdempotencyLevel|null} [idempotencyLevel] MethodOptions idempotencyLevel + * @property {google.protobuf.IFeatureSet|null} [features] MethodOptions features + * @property {Array.|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 MethodOptions. + * @memberof google.protobuf + * @classdesc Represents a MethodOptions. + * @implements IMethodOptions + * @constructor + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + */ + 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]]; + } + + /** + * MethodOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.deprecated = false; + + /** + * MethodOptions idempotencyLevel. + * @member {google.protobuf.MethodOptions.IdempotencyLevel} idempotencyLevel + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.idempotencyLevel = 0; + + /** + * MethodOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.features = null; + + /** + * MethodOptions uninterpretedOption. + * @member {Array.} 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.MethodOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodOptions} MethodOptions + */ + MethodOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodOptions) + return object; + var message = new $root.google.protobuf.MethodOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + switch (object.idempotencyLevel) { + default: + if (typeof object.idempotencyLevel === "number") { + message.idempotencyLevel = object.idempotencyLevel; + break; + } + break; + case "IDEMPOTENCY_UNKNOWN": + case 0: + message.idempotencyLevel = 0; + break; + case "NO_SIDE_EFFECTS": + case 1: + message.idempotencyLevel = 1; + break; + case "IDEMPOTENT": + case 2: + message.idempotencyLevel = 2; + break; + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.MethodOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + 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 MethodOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.MethodOptions} message MethodOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + 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 MethodOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MethodOptions + * @instance + * @returns {Object.} JSON object + */ + MethodOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodOptions + * @function getTypeUrl + * @memberof google.protobuf.MethodOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MethodOptions"; + }; + + /** + * IdempotencyLevel enum. + * @name google.protobuf.MethodOptions.IdempotencyLevel + * @enum {number} + * @property {number} IDEMPOTENCY_UNKNOWN=0 IDEMPOTENCY_UNKNOWN value + * @property {number} NO_SIDE_EFFECTS=1 NO_SIDE_EFFECTS value + * @property {number} IDEMPOTENT=2 IDEMPOTENT value + */ + MethodOptions.IdempotencyLevel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "IDEMPOTENCY_UNKNOWN"] = 0; + values[valuesById[1] = "NO_SIDE_EFFECTS"] = 1; + values[valuesById[2] = "IDEMPOTENT"] = 2; + return values; + })(); + + return MethodOptions; + })(); + + protobuf.UninterpretedOption = (function() { + + /** + * Properties of an UninterpretedOption. + * @memberof google.protobuf + * @interface IUninterpretedOption + * @property {Array.|null} [name] UninterpretedOption name + * @property {string|null} [identifierValue] UninterpretedOption identifierValue + * @property {number|Long|null} [positiveIntValue] UninterpretedOption positiveIntValue + * @property {number|Long|null} [negativeIntValue] UninterpretedOption negativeIntValue + * @property {number|null} [doubleValue] UninterpretedOption doubleValue + * @property {Uint8Array|null} [stringValue] UninterpretedOption stringValue + * @property {string|null} [aggregateValue] UninterpretedOption aggregateValue + */ + + /** + * Constructs a new UninterpretedOption. + * @memberof google.protobuf + * @classdesc Represents an UninterpretedOption. + * @implements IUninterpretedOption + * @constructor + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + */ + function UninterpretedOption(properties) { + this.name = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UninterpretedOption name. + * @member {Array.} name + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.name = $util.emptyArray; + + /** + * UninterpretedOption identifierValue. + * @member {string} identifierValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.identifierValue = ""; + + /** + * UninterpretedOption positiveIntValue. + * @member {number|Long} positiveIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * UninterpretedOption negativeIntValue. + * @member {number|Long} negativeIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.negativeIntValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * UninterpretedOption doubleValue. + * @member {number} doubleValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.doubleValue = 0; + + /** + * UninterpretedOption stringValue. + * @member {Uint8Array} stringValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.stringValue = $util.newBuffer([]); + + /** + * UninterpretedOption aggregateValue. + * @member {string} aggregateValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.aggregateValue = ""; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption instance + */ + UninterpretedOption.create = function create(properties) { + return new UninterpretedOption(properties); + }; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.name.length) + for (var i = 0; i < message.name.length; ++i) + $root.google.protobuf.UninterpretedOption.NamePart.encode(message.name[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.identifierValue != null && Object.hasOwnProperty.call(message, "identifierValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue); + if (message.positiveIntValue != null && Object.hasOwnProperty.call(message, "positiveIntValue")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue); + if (message.negativeIntValue != null && Object.hasOwnProperty.call(message, "negativeIntValue")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue); + if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) + writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue); + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue); + if (message.aggregateValue != null && Object.hasOwnProperty.call(message, "aggregateValue")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue); + return writer; + }; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decode = function decode(reader, length) { + 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 message; + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UninterpretedOption message. + * @function verify + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UninterpretedOption.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) { + if (!Array.isArray(message.name)) + return "name: array expected"; + for (var i = 0; i < message.name.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.NamePart.verify(message.name[i]); + if (error) + return "name." + error; + } + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + if (!$util.isString(message.identifierValue)) + return "identifierValue: string expected"; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (!$util.isInteger(message.positiveIntValue) && !(message.positiveIntValue && $util.isInteger(message.positiveIntValue.low) && $util.isInteger(message.positiveIntValue.high))) + return "positiveIntValue: integer|Long expected"; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (!$util.isInteger(message.negativeIntValue) && !(message.negativeIntValue && $util.isInteger(message.negativeIntValue.low) && $util.isInteger(message.negativeIntValue.high))) + return "negativeIntValue: integer|Long expected"; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + if (typeof message.doubleValue !== "number") + return "doubleValue: number expected"; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + if (!(message.stringValue && typeof message.stringValue.length === "number" || $util.isString(message.stringValue))) + return "stringValue: buffer expected"; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + if (!$util.isString(message.aggregateValue)) + return "aggregateValue: string expected"; + return null; + }; + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + */ + UninterpretedOption.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption) + return object; + var message = new $root.google.protobuf.UninterpretedOption(); + if (object.name) { + if (!Array.isArray(object.name)) + throw TypeError(".google.protobuf.UninterpretedOption.name: array expected"); + message.name = []; + for (var i = 0; i < object.name.length; ++i) { + if (typeof object.name[i] !== "object") + throw TypeError(".google.protobuf.UninterpretedOption.name: object expected"); + message.name[i] = $root.google.protobuf.UninterpretedOption.NamePart.fromObject(object.name[i]); + } + } + if (object.identifierValue != null) + message.identifierValue = String(object.identifierValue); + if (object.positiveIntValue != null) + if ($util.Long) + (message.positiveIntValue = $util.Long.fromValue(object.positiveIntValue)).unsigned = true; + else if (typeof object.positiveIntValue === "string") + message.positiveIntValue = parseInt(object.positiveIntValue, 10); + else if (typeof object.positiveIntValue === "number") + message.positiveIntValue = object.positiveIntValue; + else if (typeof object.positiveIntValue === "object") + message.positiveIntValue = new $util.LongBits(object.positiveIntValue.low >>> 0, object.positiveIntValue.high >>> 0).toNumber(true); + if (object.negativeIntValue != null) + if ($util.Long) + (message.negativeIntValue = $util.Long.fromValue(object.negativeIntValue)).unsigned = false; + else if (typeof object.negativeIntValue === "string") + message.negativeIntValue = parseInt(object.negativeIntValue, 10); + else if (typeof object.negativeIntValue === "number") + message.negativeIntValue = object.negativeIntValue; + else if (typeof object.negativeIntValue === "object") + message.negativeIntValue = new $util.LongBits(object.negativeIntValue.low >>> 0, object.negativeIntValue.high >>> 0).toNumber(); + if (object.doubleValue != null) + message.doubleValue = Number(object.doubleValue); + if (object.stringValue != null) + if (typeof object.stringValue === "string") + $util.base64.decode(object.stringValue, message.stringValue = $util.newBuffer($util.base64.length(object.stringValue)), 0); + else if (object.stringValue.length >= 0) + message.stringValue = object.stringValue; + if (object.aggregateValue != null) + message.aggregateValue = String(object.aggregateValue); + return message; + }; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.UninterpretedOption} message UninterpretedOption + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UninterpretedOption.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.name = []; + if (options.defaults) { + object.identifierValue = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.positiveIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.positiveIntValue = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.negativeIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.negativeIntValue = options.longs === String ? "0" : 0; + object.doubleValue = 0; + if (options.bytes === String) + object.stringValue = ""; + else { + object.stringValue = []; + if (options.bytes !== Array) + object.stringValue = $util.newBuffer(object.stringValue); + } + object.aggregateValue = ""; + } + if (message.name && message.name.length) { + object.name = []; + for (var j = 0; j < message.name.length; ++j) + object.name[j] = $root.google.protobuf.UninterpretedOption.NamePart.toObject(message.name[j], options); + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + object.identifierValue = message.identifierValue; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (typeof message.positiveIntValue === "number") + object.positiveIntValue = options.longs === String ? String(message.positiveIntValue) : message.positiveIntValue; + else + object.positiveIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.positiveIntValue) : options.longs === Number ? new $util.LongBits(message.positiveIntValue.low >>> 0, message.positiveIntValue.high >>> 0).toNumber(true) : message.positiveIntValue; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (typeof message.negativeIntValue === "number") + object.negativeIntValue = options.longs === String ? String(message.negativeIntValue) : message.negativeIntValue; + else + object.negativeIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.negativeIntValue) : options.longs === Number ? new $util.LongBits(message.negativeIntValue.low >>> 0, message.negativeIntValue.high >>> 0).toNumber() : message.negativeIntValue; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + object.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + object.stringValue = options.bytes === String ? $util.base64.encode(message.stringValue, 0, message.stringValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.stringValue) : message.stringValue; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + object.aggregateValue = message.aggregateValue; + return object; + }; + + /** + * Converts this UninterpretedOption to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption + * @instance + * @returns {Object.} JSON object + */ + UninterpretedOption.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UninterpretedOption + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UninterpretedOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption"; + }; + + UninterpretedOption.NamePart = (function() { + + /** + * Properties of a NamePart. + * @memberof google.protobuf.UninterpretedOption + * @interface INamePart + * @property {string} namePart NamePart namePart + * @property {boolean} isExtension NamePart isExtension + */ + + /** + * Constructs a new NamePart. + * @memberof google.protobuf.UninterpretedOption + * @classdesc Represents a NamePart. + * @implements INamePart + * @constructor + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + */ + function NamePart(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NamePart namePart. + * @member {string} namePart + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.namePart = ""; + + /** + * NamePart isExtension. + * @member {boolean} isExtension + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.isExtension = false; + + /** + * Creates a new NamePart instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart instance + */ + NamePart.create = function create(properties) { + return new NamePart(properties); + }; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + writer.uint32(/* id 1, wireType 2 =*/10).string(message.namePart); + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isExtension); + return writer; + }; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decode = function decode(reader, length) { + 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.FeatureSet = (function() { + + /** + * Properties of a FeatureSet. + * @memberof google.protobuf + * @interface IFeatureSet + * @property {google.protobuf.FeatureSet.FieldPresence|null} [fieldPresence] FeatureSet fieldPresence + * @property {google.protobuf.FeatureSet.EnumType|null} [enumType] FeatureSet enumType + * @property {google.protobuf.FeatureSet.RepeatedFieldEncoding|null} [repeatedFieldEncoding] FeatureSet repeatedFieldEncoding + * @property {google.protobuf.FeatureSet.Utf8Validation|null} [utf8Validation] FeatureSet utf8Validation + * @property {google.protobuf.FeatureSet.MessageEncoding|null} [messageEncoding] FeatureSet messageEncoding + * @property {google.protobuf.FeatureSet.JsonFormat|null} [jsonFormat] FeatureSet jsonFormat + */ + + /** + * Constructs a new FeatureSet. + * @memberof google.protobuf + * @classdesc Represents a FeatureSet. + * @implements IFeatureSet + * @constructor + * @param {google.protobuf.IFeatureSet=} [properties] Properties to set + */ + function FeatureSet(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FeatureSet fieldPresence. + * @member {google.protobuf.FeatureSet.FieldPresence} fieldPresence + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.fieldPresence = 0; + + /** + * FeatureSet enumType. + * @member {google.protobuf.FeatureSet.EnumType} enumType + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.enumType = 0; + + /** + * FeatureSet repeatedFieldEncoding. + * @member {google.protobuf.FeatureSet.RepeatedFieldEncoding} repeatedFieldEncoding + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.repeatedFieldEncoding = 0; + + /** + * FeatureSet utf8Validation. + * @member {google.protobuf.FeatureSet.Utf8Validation} utf8Validation + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.utf8Validation = 0; + + /** + * FeatureSet messageEncoding. + * @member {google.protobuf.FeatureSet.MessageEncoding} messageEncoding + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.messageEncoding = 0; + + /** + * FeatureSet jsonFormat. + * @member {google.protobuf.FeatureSet.JsonFormat} jsonFormat + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.jsonFormat = 0; + + /** + * Creates a new FeatureSet instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.IFeatureSet=} [properties] Properties to set + * @returns {google.protobuf.FeatureSet} FeatureSet instance + */ + FeatureSet.create = function create(properties) { + return new FeatureSet(properties); + }; + + /** + * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fieldPresence != null && Object.hasOwnProperty.call(message, "fieldPresence")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.fieldPresence); + if (message.enumType != null && Object.hasOwnProperty.call(message, "enumType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.enumType); + if (message.repeatedFieldEncoding != null && Object.hasOwnProperty.call(message, "repeatedFieldEncoding")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.repeatedFieldEncoding); + if (message.utf8Validation != null && Object.hasOwnProperty.call(message, "utf8Validation")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.utf8Validation); + if (message.messageEncoding != null && Object.hasOwnProperty.call(message, "messageEncoding")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.messageEncoding); + if (message.jsonFormat != null && Object.hasOwnProperty.call(message, "jsonFormat")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jsonFormat); + return writer; + }; + + /** + * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSet message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSet} FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSet.decode = function decode(reader, length) { + 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 message; + }; + + /** + * Decodes a FeatureSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSet} FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSet message. + * @function verify + * @memberof google.protobuf.FeatureSet + * @static + * @param {Object.} 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 FeatureSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSet + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSet} FeatureSet + */ + FeatureSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSet) + return object; + var message = new $root.google.protobuf.FeatureSet(); + switch (object.fieldPresence) { + default: + if (typeof object.fieldPresence === "number") { + message.fieldPresence = object.fieldPresence; + break; + } + break; + case "FIELD_PRESENCE_UNKNOWN": + case 0: + message.fieldPresence = 0; + break; + case "EXPLICIT": + case 1: + message.fieldPresence = 1; + break; + case "IMPLICIT": + case 2: + message.fieldPresence = 2; + break; + case "LEGACY_REQUIRED": + case 3: + message.fieldPresence = 3; + break; + } + switch (object.enumType) { + default: + if (typeof object.enumType === "number") { + message.enumType = object.enumType; + break; + } + break; + case "ENUM_TYPE_UNKNOWN": + case 0: + message.enumType = 0; + break; + case "OPEN": + case 1: + message.enumType = 1; + break; + case "CLOSED": + case 2: + message.enumType = 2; + break; + } + switch (object.repeatedFieldEncoding) { + default: + if (typeof object.repeatedFieldEncoding === "number") { + message.repeatedFieldEncoding = object.repeatedFieldEncoding; + break; + } + break; + case "REPEATED_FIELD_ENCODING_UNKNOWN": + case 0: + message.repeatedFieldEncoding = 0; + break; + case "PACKED": + case 1: + message.repeatedFieldEncoding = 1; + break; + case "EXPANDED": + case 2: + message.repeatedFieldEncoding = 2; + break; + } + switch (object.utf8Validation) { + default: + if (typeof object.utf8Validation === "number") { + message.utf8Validation = object.utf8Validation; + break; + } + break; + case "UTF8_VALIDATION_UNKNOWN": + case 0: + message.utf8Validation = 0; + break; + case "VERIFY": + case 2: + message.utf8Validation = 2; + break; + case "NONE": + case 3: + message.utf8Validation = 3; + break; + } + switch (object.messageEncoding) { + default: + if (typeof object.messageEncoding === "number") { + message.messageEncoding = object.messageEncoding; + break; + } + break; + case "MESSAGE_ENCODING_UNKNOWN": + case 0: + message.messageEncoding = 0; + break; + case "LENGTH_PREFIXED": + case 1: + message.messageEncoding = 1; + break; + case "DELIMITED": + case 2: + message.messageEncoding = 2; + break; + } + switch (object.jsonFormat) { + default: + if (typeof object.jsonFormat === "number") { + message.jsonFormat = object.jsonFormat; + break; + } + break; + case "JSON_FORMAT_UNKNOWN": + case 0: + message.jsonFormat = 0; + break; + case "ALLOW": + case 1: + message.jsonFormat = 1; + break; + case "LEGACY_BEST_EFFORT": + case 2: + message.jsonFormat = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.FeatureSet} message FeatureSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.fieldPresence = options.enums === String ? "FIELD_PRESENCE_UNKNOWN" : 0; + object.enumType = options.enums === String ? "ENUM_TYPE_UNKNOWN" : 0; + object.repeatedFieldEncoding = options.enums === String ? "REPEATED_FIELD_ENCODING_UNKNOWN" : 0; + object.utf8Validation = options.enums === String ? "UTF8_VALIDATION_UNKNOWN" : 0; + object.messageEncoding = options.enums === String ? "MESSAGE_ENCODING_UNKNOWN" : 0; + object.jsonFormat = options.enums === String ? "JSON_FORMAT_UNKNOWN" : 0; + } + 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 FeatureSet to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSet + * @instance + * @returns {Object.} JSON object + */ + FeatureSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSet + * @function getTypeUrl + * @memberof google.protobuf.FeatureSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSet"; + }; + + /** + * FieldPresence enum. + * @name google.protobuf.FeatureSet.FieldPresence + * @enum {number} + * @property {number} FIELD_PRESENCE_UNKNOWN=0 FIELD_PRESENCE_UNKNOWN value + * @property {number} EXPLICIT=1 EXPLICIT value + * @property {number} IMPLICIT=2 IMPLICIT value + * @property {number} LEGACY_REQUIRED=3 LEGACY_REQUIRED value + */ + FeatureSet.FieldPresence = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FIELD_PRESENCE_UNKNOWN"] = 0; + values[valuesById[1] = "EXPLICIT"] = 1; + values[valuesById[2] = "IMPLICIT"] = 2; + values[valuesById[3] = "LEGACY_REQUIRED"] = 3; + return values; + })(); + + /** + * EnumType enum. + * @name google.protobuf.FeatureSet.EnumType + * @enum {number} + * @property {number} ENUM_TYPE_UNKNOWN=0 ENUM_TYPE_UNKNOWN value + * @property {number} OPEN=1 OPEN value + * @property {number} CLOSED=2 CLOSED value + */ + FeatureSet.EnumType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ENUM_TYPE_UNKNOWN"] = 0; + values[valuesById[1] = "OPEN"] = 1; + values[valuesById[2] = "CLOSED"] = 2; + return values; + })(); + + /** + * RepeatedFieldEncoding enum. + * @name google.protobuf.FeatureSet.RepeatedFieldEncoding + * @enum {number} + * @property {number} REPEATED_FIELD_ENCODING_UNKNOWN=0 REPEATED_FIELD_ENCODING_UNKNOWN value + * @property {number} PACKED=1 PACKED value + * @property {number} EXPANDED=2 EXPANDED value + */ + FeatureSet.RepeatedFieldEncoding = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "REPEATED_FIELD_ENCODING_UNKNOWN"] = 0; + values[valuesById[1] = "PACKED"] = 1; + values[valuesById[2] = "EXPANDED"] = 2; + return values; + })(); + + /** + * Utf8Validation enum. + * @name google.protobuf.FeatureSet.Utf8Validation + * @enum {number} + * @property {number} UTF8_VALIDATION_UNKNOWN=0 UTF8_VALIDATION_UNKNOWN value + * @property {number} VERIFY=2 VERIFY value + * @property {number} NONE=3 NONE value + */ + FeatureSet.Utf8Validation = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UTF8_VALIDATION_UNKNOWN"] = 0; + values[valuesById[2] = "VERIFY"] = 2; + values[valuesById[3] = "NONE"] = 3; + return values; + })(); + + /** + * MessageEncoding enum. + * @name google.protobuf.FeatureSet.MessageEncoding + * @enum {number} + * @property {number} MESSAGE_ENCODING_UNKNOWN=0 MESSAGE_ENCODING_UNKNOWN value + * @property {number} LENGTH_PREFIXED=1 LENGTH_PREFIXED value + * @property {number} DELIMITED=2 DELIMITED value + */ + FeatureSet.MessageEncoding = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MESSAGE_ENCODING_UNKNOWN"] = 0; + values[valuesById[1] = "LENGTH_PREFIXED"] = 1; + values[valuesById[2] = "DELIMITED"] = 2; + return values; + })(); + + /** + * JsonFormat enum. + * @name google.protobuf.FeatureSet.JsonFormat + * @enum {number} + * @property {number} JSON_FORMAT_UNKNOWN=0 JSON_FORMAT_UNKNOWN value + * @property {number} ALLOW=1 ALLOW value + * @property {number} LEGACY_BEST_EFFORT=2 LEGACY_BEST_EFFORT value + */ + FeatureSet.JsonFormat = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JSON_FORMAT_UNKNOWN"] = 0; + values[valuesById[1] = "ALLOW"] = 1; + values[valuesById[2] = "LEGACY_BEST_EFFORT"] = 2; + return values; + })(); + + return FeatureSet; + })(); + + protobuf.FeatureSetDefaults = (function() { + + /** + * Properties of a FeatureSetDefaults. + * @memberof google.protobuf + * @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 FeatureSetDefaults. + * @memberof google.protobuf + * @classdesc Represents a FeatureSetDefaults. + * @implements IFeatureSetDefaults + * @constructor + * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set + */ + function FeatureSetDefaults(properties) { + this.defaults = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FeatureSetDefaults defaults. + * @member {Array.} defaults + * @memberof google.protobuf.FeatureSetDefaults + * @instance + */ + FeatureSetDefaults.prototype.defaults = $util.emptyArray; + + /** + * FeatureSetDefaults minimumEdition. + * @member {google.protobuf.Edition} minimumEdition + * @memberof google.protobuf.FeatureSetDefaults + * @instance + */ + FeatureSetDefaults.prototype.minimumEdition = 0; + + /** + * FeatureSetDefaults maximumEdition. + * @member {google.protobuf.Edition} maximumEdition + * @memberof google.protobuf.FeatureSetDefaults + * @instance + */ + FeatureSetDefaults.prototype.maximumEdition = 0; + + /** + * Creates a new FeatureSetDefaults instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults instance + */ + FeatureSetDefaults.create = function create(properties) { + return new FeatureSetDefaults(properties); + }; + + /** + * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetDefaults.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.defaults != null && message.defaults.length) + for (var i = 0; i < message.defaults.length; ++i) + $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.encode(message.defaults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.minimumEdition != null && Object.hasOwnProperty.call(message, "minimumEdition")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.minimumEdition); + if (message.maximumEdition != null && Object.hasOwnProperty.call(message, "maximumEdition")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.maximumEdition); + return writer; + }; + + /** + * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetDefaults.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetDefaults.decode = function decode(reader, length) { + 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.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 FeatureSetDefaults message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.FeatureSetDefaults} message FeatureSetDefaults + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSetDefaults.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.defaults = []; + if (options.defaults) { + object.minimumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; + object.maximumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.defaults && message.defaults.length) { + object.defaults = []; + for (var j = 0; j < message.defaults.length; ++j) + object.defaults[j] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.toObject(message.defaults[j], options); + } + if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition")) + object.minimumEdition = options.enums === String ? $root.google.protobuf.Edition[message.minimumEdition] === undefined ? message.minimumEdition : $root.google.protobuf.Edition[message.minimumEdition] : message.minimumEdition; + if (message.maximumEdition != null && message.hasOwnProperty("maximumEdition")) + object.maximumEdition = options.enums === String ? $root.google.protobuf.Edition[message.maximumEdition] === undefined ? message.maximumEdition : $root.google.protobuf.Edition[message.maximumEdition] : message.maximumEdition; + return object; + }; + + /** + * Converts this FeatureSetDefaults to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSetDefaults + * @instance + * @returns {Object.} JSON object + */ + FeatureSetDefaults.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSetDefaults + * @function getTypeUrl + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSetDefaults.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults"; + }; + + FeatureSetDefaults.FeatureSetEditionDefault = (function() { + + /** + * Properties of a FeatureSetEditionDefault. + * @memberof google.protobuf.FeatureSetDefaults + * @interface IFeatureSetEditionDefault + * @property {google.protobuf.Edition|null} [edition] FeatureSetEditionDefault edition + * @property {google.protobuf.IFeatureSet|null} [features] FeatureSetEditionDefault features + */ + + /** + * Constructs a new FeatureSetEditionDefault. + * @memberof google.protobuf.FeatureSetDefaults + * @classdesc Represents a FeatureSetEditionDefault. + * @implements IFeatureSetEditionDefault + * @constructor + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set + */ + function FeatureSetEditionDefault(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FeatureSetEditionDefault edition. + * @member {google.protobuf.Edition} edition + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + */ + FeatureSetEditionDefault.prototype.edition = 0; + + /** + * FeatureSetEditionDefault 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 {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault instance + */ + FeatureSetEditionDefault.create = function create(properties) { + return new FeatureSetEditionDefault(properties); + }; + + /** + * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetEditionDefault.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.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; + }; + + /** + * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetEditionDefault.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetEditionDefault.decode = function decode(reader, length) { + 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 message; + }; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetEditionDefault.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSetEditionDefault message. + * @function verify + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {Object.} 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; + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + return null; + }; + + /** + * Creates a FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault + */ + FeatureSetEditionDefault.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault) + return object; + var message = new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault(); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.edition = 0; + break; + case "EDITION_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); + } + return message; + }; + + /** + * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} message FeatureSetEditionDefault + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSetEditionDefault.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.features = null; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + 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 FeatureSetEditionDefault to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + * @returns {Object.} JSON object + */ + FeatureSetEditionDefault.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSetEditionDefault + * @function getTypeUrl + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSetEditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault"; + }; + + return FeatureSetEditionDefault; + })(); + + return FeatureSetDefaults; + })(); + + protobuf.SourceCodeInfo = (function() { + + /** + * Properties of a SourceCodeInfo. + * @memberof google.protobuf + * @interface ISourceCodeInfo + * @property {Array.|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; + var message = new $root.google.protobuf.SourceCodeInfo(); + if (object.location) { + if (!Array.isArray(object.location)) + throw TypeError(".google.protobuf.SourceCodeInfo.location: array expected"); + message.location = []; + for (var i = 0; i < object.location.length; ++i) { + if (typeof object.location[i] !== "object") + throw TypeError(".google.protobuf.SourceCodeInfo.location: object expected"); + message.location[i] = $root.google.protobuf.SourceCodeInfo.Location.fromObject(object.location[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} 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 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 new Location instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo.Location} Location instance + */ + Location.create = function create(properties) { + return new Location(properties); + }; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.span != null && message.span.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.span.length; ++i) + writer.int32(message.span[i]); + writer.ldelim(); + } + if (message.leadingComments != null && Object.hasOwnProperty.call(message, "leadingComments")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); + if (message.trailingComments != null && Object.hasOwnProperty.call(message, "trailingComments")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailingComments); + if (message.leadingDetachedComments != null && message.leadingDetachedComments.length) + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.leadingDetachedComments[i]); + return writer; + }; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Location message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decode = function decode(reader, length) { + 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; + }; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Location message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Location.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.span != null && message.hasOwnProperty("span")) { + if (!Array.isArray(message.span)) + return "span: array expected"; + for (var i = 0; i < message.span.length; ++i) + if (!$util.isInteger(message.span[i])) + return "span: integer[] expected"; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + if (!$util.isString(message.leadingComments)) + return "leadingComments: string expected"; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + if (!$util.isString(message.trailingComments)) + return "trailingComments: string expected"; + if (message.leadingDetachedComments != null && message.hasOwnProperty("leadingDetachedComments")) { + if (!Array.isArray(message.leadingDetachedComments)) + return "leadingDetachedComments: array expected"; + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + if (!$util.isString(message.leadingDetachedComments[i])) + return "leadingDetachedComments: string[] expected"; + } + return null; + }; + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} 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; + })(); + + 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.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.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 + */ + 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]]; + } + + /** + * FieldMask paths. + * @member {Array.} paths + * @memberof google.protobuf.FieldMask + * @instance + */ + FieldMask.prototype.paths = $util.emptyArray; + + /** + * Creates a new FieldMask instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask=} [properties] Properties to set + * @returns {google.protobuf.FieldMask} FieldMask instance + */ + FieldMask.create = function create(properties) { + return new FieldMask(properties); + }; + + /** + * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldMask.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.paths != null && message.paths.length) + for (var i = 0; i < message.paths.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.paths[i]); + return writer; + }; + + /** + * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldMask.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldMask message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldMask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldMask} FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldMask.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.FieldMask(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.paths && message.paths.length)) + message.paths = []; + message.paths.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldMask message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldMask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldMask} FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldMask.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldMask message. + * @function verify + * @memberof google.protobuf.FieldMask + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldMask.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.paths != null && message.hasOwnProperty("paths")) { + if (!Array.isArray(message.paths)) + return "paths: array expected"; + for (var i = 0; i < message.paths.length; ++i) + if (!$util.isString(message.paths[i])) + return "paths: string[] expected"; + } + return null; + }; + + /** + * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldMask + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldMask} FieldMask + */ + FieldMask.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldMask) + 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]); + } + return message; + }; + + /** + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.FieldMask} message FieldMask + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldMask.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]; + } + return object; + }; + + /** + * Converts this FieldMask to JSON. + * @function toJSON + * @memberof google.protobuf.FieldMask + * @instance + * @returns {Object.} JSON object + */ + FieldMask.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldMask + * @function getTypeUrl + * @memberof google.protobuf.FieldMask + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldMask.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldMask"; + }; + + return FieldMask; + })(); + + protobuf.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof google.protobuf + * @interface ITimestamp + * @property {number|Long|null} [seconds] Timestamp seconds + * @property {number|null} [nanos] Timestamp nanos + */ + + /** + * Constructs a new Timestamp. + * @memberof google.protobuf + * @classdesc Represents a Timestamp. + * @implements ITimestamp + * @constructor + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + */ + 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]]; + } + + /** + * Timestamp seconds. + * @member {number|Long} 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 + * @instance + */ + 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; + })(); + + return protobuf; + })(); + + return google; + })(); + + return $root; +}); diff --git a/owl-bot-staging/v1/protos/protos.json b/owl-bot-staging/v1/protos/protos.json new file mode 100644 index 000000000..6497622c4 --- /dev/null +++ b/owl-bot-staging/v1/protos/protos.json @@ -0,0 +1,4338 @@ +{ + "nested": { + "google": { + "nested": { + "pubsub": { + "nested": { + "v1": { + "options": { + "cc_enable_arenas": true, + "csharp_namespace": "Google.Cloud.PubSub.V1", + "go_package": "cloud.google.com/go/pubsub/apiv1/pubsubpb;pubsubpb", + "java_multiple_files": true, + "java_outer_classname": "SchemaProto", + "java_package": "com.google.pubsub.v1", + "php_namespace": "Google\\Cloud\\PubSub\\V1", + "ruby_package": "Google::Cloud::PubSub::V1" + }, + "nested": { + "Publisher": { + "options": { + "(google.api.default_host)": "pubsub.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/pubsub" + }, + "methods": { + "CreateTopic": { + "requestType": "Topic", + "responseType": "Topic", + "options": { + "(google.api.http).put": "/v1/{name=projects/*/topics/*}", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "put": "/v1/{name=projects/*/topics/*}", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "UpdateTopic": { + "requestType": "UpdateTopicRequest", + "responseType": "Topic", + "options": { + "(google.api.http).patch": "/v1/{topic.name=projects/*/topics/*}", + "(google.api.http).body": "*", + "(google.api.method_signature)": "topic,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{topic.name=projects/*/topics/*}", + "body": "*" + } + }, + { + "(google.api.method_signature)": "topic,update_mask" + } + ] + }, + "Publish": { + "requestType": "PublishRequest", + "responseType": "PublishResponse", + "options": { + "(google.api.http).post": "/v1/{topic=projects/*/topics/*}:publish", + "(google.api.http).body": "*", + "(google.api.method_signature)": "topic,messages" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{topic=projects/*/topics/*}:publish", + "body": "*" + } + }, + { + "(google.api.method_signature)": "topic,messages" + } + ] + }, + "GetTopic": { + "requestType": "GetTopicRequest", + "responseType": "Topic", + "options": { + "(google.api.http).get": "/v1/{topic=projects/*/topics/*}", + "(google.api.method_signature)": "topic" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{topic=projects/*/topics/*}" + } + }, + { + "(google.api.method_signature)": "topic" + } + ] + }, + "ListTopics": { + "requestType": "ListTopicsRequest", + "responseType": "ListTopicsResponse", + "options": { + "(google.api.http).get": "/v1/{project=projects/*}/topics", + "(google.api.method_signature)": "project" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{project=projects/*}/topics" + } + }, + { + "(google.api.method_signature)": "project" + } + ] + }, + "ListTopicSubscriptions": { + "requestType": "ListTopicSubscriptionsRequest", + "responseType": "ListTopicSubscriptionsResponse", + "options": { + "(google.api.http).get": "/v1/{topic=projects/*/topics/*}/subscriptions", + "(google.api.method_signature)": "topic" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{topic=projects/*/topics/*}/subscriptions" + } + }, + { + "(google.api.method_signature)": "topic" + } + ] + }, + "ListTopicSnapshots": { + "requestType": "ListTopicSnapshotsRequest", + "responseType": "ListTopicSnapshotsResponse", + "options": { + "(google.api.http).get": "/v1/{topic=projects/*/topics/*}/snapshots", + "(google.api.method_signature)": "topic" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{topic=projects/*/topics/*}/snapshots" + } + }, + { + "(google.api.method_signature)": "topic" + } + ] + }, + "DeleteTopic": { + "requestType": "DeleteTopicRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{topic=projects/*/topics/*}", + "(google.api.method_signature)": "topic" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{topic=projects/*/topics/*}" + } + }, + { + "(google.api.method_signature)": "topic" + } + ] + }, + "DetachSubscription": { + "requestType": "DetachSubscriptionRequest", + "responseType": "DetachSubscriptionResponse", + "options": { + "(google.api.http).post": "/v1/{subscription=projects/*/subscriptions/*}:detach" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{subscription=projects/*/subscriptions/*}:detach" + } + } + ] + } + } + }, + "MessageStoragePolicy": { + "fields": { + "allowedPersistenceRegions": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "enforceInTransit": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "SchemaSettings": { + "fields": { + "schema": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "pubsub.googleapis.com/Schema" + } + }, + "encoding": { + "type": "Encoding", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "firstRevisionId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "lastRevisionId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "IngestionDataSourceSettings": { + "oneofs": { + "source": { + "oneof": [ + "awsKinesis" + ] + } + }, + "fields": { + "awsKinesis": { + "type": "AwsKinesis", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "AwsKinesis": { + "fields": { + "state": { + "type": "State", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "streamArn": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "consumerArn": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "awsRoleArn": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "gcpServiceAccount": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "ACTIVE": 1, + "KINESIS_PERMISSION_DENIED": 2, + "PUBLISH_PERMISSION_DENIED": 3, + "STREAM_NOT_FOUND": 4, + "CONSUMER_NOT_FOUND": 5 + } + } + } + } + } + }, + "Topic": { + "options": { + "(google.api.resource).type": "pubsub.googleapis.com/Topic", + "(google.api.resource).pattern": "_deleted-topic_" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "messageStoragePolicy": { + "type": "MessageStoragePolicy", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "kmsKeyName": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "schemaSettings": { + "type": "SchemaSettings", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "satisfiesPzs": { + "type": "bool", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "messageRetentionDuration": { + "type": "google.protobuf.Duration", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "state": { + "type": "State", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "ingestionDataSourceSettings": { + "type": "IngestionDataSourceSettings", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "ACTIVE": 1, + "INGESTION_RESOURCE_ERROR": 2 + } + } + } + }, + "PubsubMessage": { + "fields": { + "data": { + "type": "bytes", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "attributes": { + "keyType": "string", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "messageId": { + "type": "string", + "id": 3 + }, + "publishTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + }, + "orderingKey": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "GetTopicRequest": { + "fields": { + "topic": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "pubsub.googleapis.com/Topic" + } + } + } + }, + "UpdateTopicRequest": { + "fields": { + "topic": { + "type": "Topic", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "PublishRequest": { + "fields": { + "topic": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "pubsub.googleapis.com/Topic" + } + }, + "messages": { + "rule": "repeated", + "type": "PubsubMessage", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "PublishResponse": { + "fields": { + "messageIds": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListTopicsRequest": { + "fields": { + "project": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Project" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListTopicsResponse": { + "fields": { + "topics": { + "rule": "repeated", + "type": "Topic", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "nextPageToken": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListTopicSubscriptionsRequest": { + "fields": { + "topic": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "pubsub.googleapis.com/Topic" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListTopicSubscriptionsResponse": { + "fields": { + "subscriptions": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "pubsub.googleapis.com/Subscription" + } + }, + "nextPageToken": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListTopicSnapshotsRequest": { + "fields": { + "topic": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "pubsub.googleapis.com/Topic" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListTopicSnapshotsResponse": { + "fields": { + "snapshots": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "nextPageToken": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteTopicRequest": { + "fields": { + "topic": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "pubsub.googleapis.com/Topic" + } + } + } + }, + "DetachSubscriptionRequest": { + "fields": { + "subscription": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "pubsub.googleapis.com/Subscription" + } + } + } + }, + "DetachSubscriptionResponse": { + "fields": {} + }, + "Subscriber": { + "options": { + "(google.api.default_host)": "pubsub.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/pubsub" + }, + "methods": { + "CreateSubscription": { + "requestType": "Subscription", + "responseType": "Subscription", + "options": { + "(google.api.http).put": "/v1/{name=projects/*/subscriptions/*}", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name,topic,push_config,ack_deadline_seconds" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "put": "/v1/{name=projects/*/subscriptions/*}", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name,topic,push_config,ack_deadline_seconds" + } + ] + }, + "GetSubscription": { + "requestType": "GetSubscriptionRequest", + "responseType": "Subscription", + "options": { + "(google.api.http).get": "/v1/{subscription=projects/*/subscriptions/*}", + "(google.api.method_signature)": "subscription" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{subscription=projects/*/subscriptions/*}" + } + }, + { + "(google.api.method_signature)": "subscription" + } + ] + }, + "UpdateSubscription": { + "requestType": "UpdateSubscriptionRequest", + "responseType": "Subscription", + "options": { + "(google.api.http).patch": "/v1/{subscription.name=projects/*/subscriptions/*}", + "(google.api.http).body": "*", + "(google.api.method_signature)": "subscription,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{subscription.name=projects/*/subscriptions/*}", + "body": "*" + } + }, + { + "(google.api.method_signature)": "subscription,update_mask" + } + ] + }, + "ListSubscriptions": { + "requestType": "ListSubscriptionsRequest", + "responseType": "ListSubscriptionsResponse", + "options": { + "(google.api.http).get": "/v1/{project=projects/*}/subscriptions", + "(google.api.method_signature)": "project" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{project=projects/*}/subscriptions" + } + }, + { + "(google.api.method_signature)": "project" + } + ] + }, + "DeleteSubscription": { + "requestType": "DeleteSubscriptionRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{subscription=projects/*/subscriptions/*}", + "(google.api.method_signature)": "subscription" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{subscription=projects/*/subscriptions/*}" + } + }, + { + "(google.api.method_signature)": "subscription" + } + ] + }, + "ModifyAckDeadline": { + "requestType": "ModifyAckDeadlineRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).post": "/v1/{subscription=projects/*/subscriptions/*}:modifyAckDeadline", + "(google.api.http).body": "*", + "(google.api.method_signature)": "subscription,ack_ids,ack_deadline_seconds" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{subscription=projects/*/subscriptions/*}:modifyAckDeadline", + "body": "*" + } + }, + { + "(google.api.method_signature)": "subscription,ack_ids,ack_deadline_seconds" + } + ] + }, + "Acknowledge": { + "requestType": "AcknowledgeRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).post": "/v1/{subscription=projects/*/subscriptions/*}:acknowledge", + "(google.api.http).body": "*", + "(google.api.method_signature)": "subscription,ack_ids" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{subscription=projects/*/subscriptions/*}:acknowledge", + "body": "*" + } + }, + { + "(google.api.method_signature)": "subscription,ack_ids" + } + ] + }, + "Pull": { + "requestType": "PullRequest", + "responseType": "PullResponse", + "options": { + "(google.api.http).post": "/v1/{subscription=projects/*/subscriptions/*}:pull", + "(google.api.http).body": "*", + "(google.api.method_signature)": "subscription,max_messages" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{subscription=projects/*/subscriptions/*}:pull", + "body": "*" + } + }, + { + "(google.api.method_signature)": "subscription,return_immediately,max_messages" + }, + { + "(google.api.method_signature)": "subscription,max_messages" + } + ] + }, + "StreamingPull": { + "requestType": "StreamingPullRequest", + "requestStream": true, + "responseType": "StreamingPullResponse", + "responseStream": true + }, + "ModifyPushConfig": { + "requestType": "ModifyPushConfigRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).post": "/v1/{subscription=projects/*/subscriptions/*}:modifyPushConfig", + "(google.api.http).body": "*", + "(google.api.method_signature)": "subscription,push_config" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{subscription=projects/*/subscriptions/*}:modifyPushConfig", + "body": "*" + } + }, + { + "(google.api.method_signature)": "subscription,push_config" + } + ] + }, + "GetSnapshot": { + "requestType": "GetSnapshotRequest", + "responseType": "Snapshot", + "options": { + "(google.api.http).get": "/v1/{snapshot=projects/*/snapshots/*}", + "(google.api.method_signature)": "snapshot" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{snapshot=projects/*/snapshots/*}" + } + }, + { + "(google.api.method_signature)": "snapshot" + } + ] + }, + "ListSnapshots": { + "requestType": "ListSnapshotsRequest", + "responseType": "ListSnapshotsResponse", + "options": { + "(google.api.http).get": "/v1/{project=projects/*}/snapshots", + "(google.api.method_signature)": "project" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{project=projects/*}/snapshots" + } + }, + { + "(google.api.method_signature)": "project" + } + ] + }, + "CreateSnapshot": { + "requestType": "CreateSnapshotRequest", + "responseType": "Snapshot", + "options": { + "(google.api.http).put": "/v1/{name=projects/*/snapshots/*}", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name,subscription" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "put": "/v1/{name=projects/*/snapshots/*}", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name,subscription" + } + ] + }, + "UpdateSnapshot": { + "requestType": "UpdateSnapshotRequest", + "responseType": "Snapshot", + "options": { + "(google.api.http).patch": "/v1/{snapshot.name=projects/*/snapshots/*}", + "(google.api.http).body": "*", + "(google.api.method_signature)": "snapshot,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{snapshot.name=projects/*/snapshots/*}", + "body": "*" + } + }, + { + "(google.api.method_signature)": "snapshot,update_mask" + } + ] + }, + "DeleteSnapshot": { + "requestType": "DeleteSnapshotRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{snapshot=projects/*/snapshots/*}", + "(google.api.method_signature)": "snapshot" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{snapshot=projects/*/snapshots/*}" + } + }, + { + "(google.api.method_signature)": "snapshot" + } + ] + }, + "Seek": { + "requestType": "SeekRequest", + "responseType": "SeekResponse", + "options": { + "(google.api.http).post": "/v1/{subscription=projects/*/subscriptions/*}:seek", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{subscription=projects/*/subscriptions/*}:seek", + "body": "*" + } + } + ] + } + } + }, + "Subscription": { + "options": { + "(google.api.resource).type": "pubsub.googleapis.com/Subscription", + "(google.api.resource).pattern": "projects/{project}/subscriptions/{subscription}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "topic": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "pubsub.googleapis.com/Topic" + } + }, + "pushConfig": { + "type": "PushConfig", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "bigqueryConfig": { + "type": "BigQueryConfig", + "id": 18, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "cloudStorageConfig": { + "type": "CloudStorageConfig", + "id": 22, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "ackDeadlineSeconds": { + "type": "int32", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "retainAckedMessages": { + "type": "bool", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "messageRetentionDuration": { + "type": "google.protobuf.Duration", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "enableMessageOrdering": { + "type": "bool", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "expirationPolicy": { + "type": "ExpirationPolicy", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "filter": { + "type": "string", + "id": 12, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "deadLetterPolicy": { + "type": "DeadLetterPolicy", + "id": 13, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "retryPolicy": { + "type": "RetryPolicy", + "id": 14, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "detached": { + "type": "bool", + "id": 15, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "enableExactlyOnceDelivery": { + "type": "bool", + "id": 16, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "topicMessageRetentionDuration": { + "type": "google.protobuf.Duration", + "id": 17, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "state": { + "type": "State", + "id": 19, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "ACTIVE": 1, + "RESOURCE_ERROR": 2 + } + } + } + }, + "RetryPolicy": { + "fields": { + "minimumBackoff": { + "type": "google.protobuf.Duration", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "maximumBackoff": { + "type": "google.protobuf.Duration", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeadLetterPolicy": { + "fields": { + "deadLetterTopic": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "maxDeliveryAttempts": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ExpirationPolicy": { + "fields": { + "ttl": { + "type": "google.protobuf.Duration", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "PushConfig": { + "oneofs": { + "authenticationMethod": { + "oneof": [ + "oidcToken" + ] + }, + "wrapper": { + "oneof": [ + "pubsubWrapper", + "noWrapper" + ] + } + }, + "fields": { + "pushEndpoint": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "attributes": { + "keyType": "string", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "oidcToken": { + "type": "OidcToken", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pubsubWrapper": { + "type": "PubsubWrapper", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "noWrapper": { + "type": "NoWrapper", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "OidcToken": { + "fields": { + "serviceAccountEmail": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "audience": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "PubsubWrapper": { + "fields": {} + }, + "NoWrapper": { + "fields": { + "writeMetadata": { + "type": "bool", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + } + } + }, + "BigQueryConfig": { + "fields": { + "table": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "useTopicSchema": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "writeMetadata": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "dropUnknownFields": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "state": { + "type": "State", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "useTableSchema": { + "type": "bool", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "serviceAccountEmail": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "ACTIVE": 1, + "PERMISSION_DENIED": 2, + "NOT_FOUND": 3, + "SCHEMA_MISMATCH": 4, + "IN_TRANSIT_LOCATION_RESTRICTION": 5 + } + } + } + }, + "CloudStorageConfig": { + "oneofs": { + "outputFormat": { + "oneof": [ + "textConfig", + "avroConfig" + ] + } + }, + "fields": { + "bucket": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "filenamePrefix": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "filenameSuffix": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "filenameDatetimeFormat": { + "type": "string", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "textConfig": { + "type": "TextConfig", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "avroConfig": { + "type": "AvroConfig", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "maxDuration": { + "type": "google.protobuf.Duration", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "maxBytes": { + "type": "int64", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "state": { + "type": "State", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "serviceAccountEmail": { + "type": "string", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "TextConfig": { + "fields": {} + }, + "AvroConfig": { + "fields": { + "writeMetadata": { + "type": "bool", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "useTopicSchema": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "ACTIVE": 1, + "PERMISSION_DENIED": 2, + "NOT_FOUND": 3, + "IN_TRANSIT_LOCATION_RESTRICTION": 4, + "SCHEMA_MISMATCH": 5 + } + } + } + }, + "ReceivedMessage": { + "fields": { + "ackId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "message": { + "type": "PubsubMessage", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "deliveryAttempt": { + "type": "int32", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "GetSubscriptionRequest": { + "fields": { + "subscription": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "pubsub.googleapis.com/Subscription" + } + } + } + }, + "UpdateSubscriptionRequest": { + "fields": { + "subscription": { + "type": "Subscription", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ListSubscriptionsRequest": { + "fields": { + "project": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Project" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListSubscriptionsResponse": { + "fields": { + "subscriptions": { + "rule": "repeated", + "type": "Subscription", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "nextPageToken": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteSubscriptionRequest": { + "fields": { + "subscription": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "pubsub.googleapis.com/Subscription" + } + } + } + }, + "ModifyPushConfigRequest": { + "fields": { + "subscription": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "pubsub.googleapis.com/Subscription" + } + }, + "pushConfig": { + "type": "PushConfig", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "PullRequest": { + "fields": { + "subscription": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "pubsub.googleapis.com/Subscription" + } + }, + "returnImmediately": { + "type": "bool", + "id": 2, + "options": { + "deprecated": true, + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "maxMessages": { + "type": "int32", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "PullResponse": { + "fields": { + "receivedMessages": { + "rule": "repeated", + "type": "ReceivedMessage", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ModifyAckDeadlineRequest": { + "fields": { + "subscription": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "pubsub.googleapis.com/Subscription" + } + }, + "ackIds": { + "rule": "repeated", + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "ackDeadlineSeconds": { + "type": "int32", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "AcknowledgeRequest": { + "fields": { + "subscription": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "pubsub.googleapis.com/Subscription" + } + }, + "ackIds": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "StreamingPullRequest": { + "fields": { + "subscription": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "pubsub.googleapis.com/Subscription" + } + }, + "ackIds": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "modifyDeadlineSeconds": { + "rule": "repeated", + "type": "int32", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "modifyDeadlineAckIds": { + "rule": "repeated", + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "streamAckDeadlineSeconds": { + "type": "int32", + "id": 5, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "clientId": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "maxOutstandingMessages": { + "type": "int64", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "maxOutstandingBytes": { + "type": "int64", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "StreamingPullResponse": { + "fields": { + "receivedMessages": { + "rule": "repeated", + "type": "ReceivedMessage", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "acknowledgeConfirmation": { + "type": "AcknowledgeConfirmation", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "modifyAckDeadlineConfirmation": { + "type": "ModifyAckDeadlineConfirmation", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "subscriptionProperties": { + "type": "SubscriptionProperties", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "AcknowledgeConfirmation": { + "fields": { + "ackIds": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "invalidAckIds": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "unorderedAckIds": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "temporaryFailedAckIds": { + "rule": "repeated", + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ModifyAckDeadlineConfirmation": { + "fields": { + "ackIds": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "invalidAckIds": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "temporaryFailedAckIds": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "SubscriptionProperties": { + "fields": { + "exactlyOnceDeliveryEnabled": { + "type": "bool", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "messageOrderingEnabled": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + } + } + }, + "CreateSnapshotRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "pubsub.googleapis.com/Snapshot" + } + }, + "subscription": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "pubsub.googleapis.com/Subscription" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "UpdateSnapshotRequest": { + "fields": { + "snapshot": { + "type": "Snapshot", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "Snapshot": { + "options": { + "(google.api.resource).type": "pubsub.googleapis.com/Snapshot", + "(google.api.resource).pattern": "projects/{project}/snapshots/{snapshot}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "topic": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "pubsub.googleapis.com/Topic" + } + }, + "expireTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "GetSnapshotRequest": { + "fields": { + "snapshot": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "pubsub.googleapis.com/Snapshot" + } + } + } + }, + "ListSnapshotsRequest": { + "fields": { + "project": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Project" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListSnapshotsResponse": { + "fields": { + "snapshots": { + "rule": "repeated", + "type": "Snapshot", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "nextPageToken": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteSnapshotRequest": { + "fields": { + "snapshot": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "pubsub.googleapis.com/Snapshot" + } + } + } + }, + "SeekRequest": { + "oneofs": { + "target": { + "oneof": [ + "time", + "snapshot" + ] + } + }, + "fields": { + "subscription": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "pubsub.googleapis.com/Subscription" + } + }, + "time": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "snapshot": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "pubsub.googleapis.com/Snapshot" + } + } + } + }, + "SeekResponse": { + "fields": {} + }, + "SchemaService": { + "options": { + "(google.api.default_host)": "pubsub.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/pubsub" + }, + "methods": { + "CreateSchema": { + "requestType": "CreateSchemaRequest", + "responseType": "Schema", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*}/schemas", + "(google.api.http).body": "schema", + "(google.api.method_signature)": "parent,schema,schema_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*}/schemas", + "body": "schema" + } + }, + { + "(google.api.method_signature)": "parent,schema,schema_id" + } + ] + }, + "GetSchema": { + "requestType": "GetSchemaRequest", + "responseType": "Schema", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/schemas/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/schemas/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListSchemas": { + "requestType": "ListSchemasRequest", + "responseType": "ListSchemasResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*}/schemas", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*}/schemas" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "ListSchemaRevisions": { + "requestType": "ListSchemaRevisionsRequest", + "responseType": "ListSchemaRevisionsResponse", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/schemas/*}:listRevisions", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/schemas/*}:listRevisions" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CommitSchema": { + "requestType": "CommitSchemaRequest", + "responseType": "Schema", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/schemas/*}:commit", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name,schema" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/schemas/*}:commit", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name,schema" + } + ] + }, + "RollbackSchema": { + "requestType": "RollbackSchemaRequest", + "responseType": "Schema", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/schemas/*}:rollback", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name,revision_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/schemas/*}:rollback", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name,revision_id" + } + ] + }, + "DeleteSchemaRevision": { + "requestType": "DeleteSchemaRevisionRequest", + "responseType": "Schema", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/schemas/*}:deleteRevision", + "(google.api.method_signature)": "name,revision_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/schemas/*}:deleteRevision" + } + }, + { + "(google.api.method_signature)": "name,revision_id" + } + ] + }, + "DeleteSchema": { + "requestType": "DeleteSchemaRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/schemas/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/schemas/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ValidateSchema": { + "requestType": "ValidateSchemaRequest", + "responseType": "ValidateSchemaResponse", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*}/schemas:validate", + "(google.api.http).body": "*", + "(google.api.method_signature)": "parent,schema" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*}/schemas:validate", + "body": "*" + } + }, + { + "(google.api.method_signature)": "parent,schema" + } + ] + }, + "ValidateMessage": { + "requestType": "ValidateMessageRequest", + "responseType": "ValidateMessageResponse", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*}/schemas:validateMessage", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*}/schemas:validateMessage", + "body": "*" + } + } + ] + } + } + }, + "Schema": { + "options": { + "(google.api.resource).type": "pubsub.googleapis.com/Schema", + "(google.api.resource).pattern": "projects/{project}/schemas/{schema}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "type": { + "type": "Type", + "id": 2 + }, + "definition": { + "type": "string", + "id": 3 + }, + "revisionId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "revisionCreateTime": { + "type": "google.protobuf.Timestamp", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "Type": { + "values": { + "TYPE_UNSPECIFIED": 0, + "PROTOCOL_BUFFER": 1, + "AVRO": 2 + } + } + } + }, + "SchemaView": { + "values": { + "SCHEMA_VIEW_UNSPECIFIED": 0, + "BASIC": 1, + "FULL": 2 + } + }, + "CreateSchemaRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "pubsub.googleapis.com/Schema" + } + }, + "schema": { + "type": "Schema", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "schemaId": { + "type": "string", + "id": 3 + } + } + }, + "GetSchemaRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "pubsub.googleapis.com/Schema" + } + }, + "view": { + "type": "SchemaView", + "id": 2 + } + } + }, + "ListSchemasRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Project" + } + }, + "view": { + "type": "SchemaView", + "id": 2 + }, + "pageSize": { + "type": "int32", + "id": 3 + }, + "pageToken": { + "type": "string", + "id": 4 + } + } + }, + "ListSchemasResponse": { + "fields": { + "schemas": { + "rule": "repeated", + "type": "Schema", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "ListSchemaRevisionsRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "pubsub.googleapis.com/Schema" + } + }, + "view": { + "type": "SchemaView", + "id": 2 + }, + "pageSize": { + "type": "int32", + "id": 3 + }, + "pageToken": { + "type": "string", + "id": 4 + } + } + }, + "ListSchemaRevisionsResponse": { + "fields": { + "schemas": { + "rule": "repeated", + "type": "Schema", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "CommitSchemaRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "pubsub.googleapis.com/Schema" + } + }, + "schema": { + "type": "Schema", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "RollbackSchemaRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "pubsub.googleapis.com/Schema" + } + }, + "revisionId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteSchemaRevisionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "pubsub.googleapis.com/Schema" + } + }, + "revisionId": { + "type": "string", + "id": 2, + "options": { + "deprecated": true, + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteSchemaRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "pubsub.googleapis.com/Schema" + } + } + } + }, + "ValidateSchemaRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Project" + } + }, + "schema": { + "type": "Schema", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ValidateSchemaResponse": { + "fields": {} + }, + "ValidateMessageRequest": { + "oneofs": { + "schemaSpec": { + "oneof": [ + "name", + "schema" + ] + } + }, + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Project" + } + }, + "name": { + "type": "string", + "id": 2, + "options": { + "(google.api.resource_reference).type": "pubsub.googleapis.com/Schema" + } + }, + "schema": { + "type": "Schema", + "id": 3 + }, + "message": { + "type": "bytes", + "id": 4 + }, + "encoding": { + "type": "Encoding", + "id": 5 + } + } + }, + "ValidateMessageResponse": { + "fields": {} + }, + "Encoding": { + "values": { + "ENCODING_UNSPECIFIED": 0, + "JSON": 1, + "BINARY": 2 + } + } + } + } + } + }, + "api": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", + "java_multiple_files": true, + "java_outer_classname": "ResourceProto", + "java_package": "com.google.api", + "objc_class_prefix": "GAPI", + "cc_enable_arenas": true + }, + "nested": { + "http": { + "type": "HttpRule", + "id": 72295728, + "extend": "google.protobuf.MethodOptions" + }, + "Http": { + "fields": { + "rules": { + "rule": "repeated", + "type": "HttpRule", + "id": 1 + }, + "fullyDecodeReservedExpansion": { + "type": "bool", + "id": 2 + } + } + }, + "HttpRule": { + "oneofs": { + "pattern": { + "oneof": [ + "get", + "put", + "post", + "delete", + "patch", + "custom" + ] + } + }, + "fields": { + "selector": { + "type": "string", + "id": 1 + }, + "get": { + "type": "string", + "id": 2 + }, + "put": { + "type": "string", + "id": 3 + }, + "post": { + "type": "string", + "id": 4 + }, + "delete": { + "type": "string", + "id": 5 + }, + "patch": { + "type": "string", + "id": 6 + }, + "custom": { + "type": "CustomHttpPattern", + "id": 8 + }, + "body": { + "type": "string", + "id": 7 + }, + "responseBody": { + "type": "string", + "id": 12 + }, + "additionalBindings": { + "rule": "repeated", + "type": "HttpRule", + "id": 11 + } + } + }, + "CustomHttpPattern": { + "fields": { + "kind": { + "type": "string", + "id": 1 + }, + "path": { + "type": "string", + "id": 2 + } + } + }, + "methodSignature": { + "rule": "repeated", + "type": "string", + "id": 1051, + "extend": "google.protobuf.MethodOptions" + }, + "defaultHost": { + "type": "string", + "id": 1049, + "extend": "google.protobuf.ServiceOptions" + }, + "oauthScopes": { + "type": "string", + "id": 1050, + "extend": "google.protobuf.ServiceOptions" + }, + "apiVersion": { + "type": "string", + "id": 525000001, + "extend": "google.protobuf.ServiceOptions" + }, + "CommonLanguageSettings": { + "fields": { + "referenceDocsUri": { + "type": "string", + "id": 1, + "options": { + "deprecated": true + } + }, + "destinations": { + "rule": "repeated", + "type": "ClientLibraryDestination", + "id": 2 + } + } + }, + "ClientLibrarySettings": { + "fields": { + "version": { + "type": "string", + "id": 1 + }, + "launchStage": { + "type": "LaunchStage", + "id": 2 + }, + "restNumericEnums": { + "type": "bool", + "id": 3 + }, + "javaSettings": { + "type": "JavaSettings", + "id": 21 + }, + "cppSettings": { + "type": "CppSettings", + "id": 22 + }, + "phpSettings": { + "type": "PhpSettings", + "id": 23 + }, + "pythonSettings": { + "type": "PythonSettings", + "id": 24 + }, + "nodeSettings": { + "type": "NodeSettings", + "id": 25 + }, + "dotnetSettings": { + "type": "DotnetSettings", + "id": 26 + }, + "rubySettings": { + "type": "RubySettings", + "id": 27 + }, + "goSettings": { + "type": "GoSettings", + "id": 28 + } + } + }, + "Publishing": { + "fields": { + "methodSettings": { + "rule": "repeated", + "type": "MethodSettings", + "id": 2 + }, + "newIssueUri": { + "type": "string", + "id": 101 + }, + "documentationUri": { + "type": "string", + "id": 102 + }, + "apiShortName": { + "type": "string", + "id": 103 + }, + "githubLabel": { + "type": "string", + "id": 104 + }, + "codeownerGithubTeams": { + "rule": "repeated", + "type": "string", + "id": 105 + }, + "docTagPrefix": { + "type": "string", + "id": 106 + }, + "organization": { + "type": "ClientLibraryOrganization", + "id": 107 + }, + "librarySettings": { + "rule": "repeated", + "type": "ClientLibrarySettings", + "id": 109 + }, + "protoReferenceDocumentationUri": { + "type": "string", + "id": 110 + }, + "restReferenceDocumentationUri": { + "type": "string", + "id": 111 + } + } + }, + "JavaSettings": { + "fields": { + "libraryPackage": { + "type": "string", + "id": 1 + }, + "serviceClassNames": { + "keyType": "string", + "type": "string", + "id": 2 + }, + "common": { + "type": "CommonLanguageSettings", + "id": 3 + } + } + }, + "CppSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "PhpSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "PythonSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "NodeSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "DotnetSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + }, + "renamedServices": { + "keyType": "string", + "type": "string", + "id": 2 + }, + "renamedResources": { + "keyType": "string", + "type": "string", + "id": 3 + }, + "ignoredResources": { + "rule": "repeated", + "type": "string", + "id": 4 + }, + "forcedNamespaceAliases": { + "rule": "repeated", + "type": "string", + "id": 5 + }, + "handwrittenSignatures": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + }, + "RubySettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "GoSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "MethodSettings": { + "fields": { + "selector": { + "type": "string", + "id": 1 + }, + "longRunning": { + "type": "LongRunning", + "id": 2 + }, + "autoPopulatedFields": { + "rule": "repeated", + "type": "string", + "id": 3 + } + }, + "nested": { + "LongRunning": { + "fields": { + "initialPollDelay": { + "type": "google.protobuf.Duration", + "id": 1 + }, + "pollDelayMultiplier": { + "type": "float", + "id": 2 + }, + "maxPollDelay": { + "type": "google.protobuf.Duration", + "id": 3 + }, + "totalPollTimeout": { + "type": "google.protobuf.Duration", + "id": 4 + } + } + } + } + }, + "ClientLibraryOrganization": { + "values": { + "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": 0, + "CLOUD": 1, + "ADS": 2, + "PHOTOS": 3, + "STREET_VIEW": 4, + "SHOPPING": 5, + "GEO": 6, + "GENERATIVE_AI": 7 + } + }, + "ClientLibraryDestination": { + "values": { + "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED": 0, + "GITHUB": 10, + "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", + "id": 1052, + "extend": "google.protobuf.FieldOptions", + "options": { + "packed": false + } + }, + "FieldBehavior": { + "values": { + "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 + } + }, + "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 + } + } + } + } + }, + "protobuf": { + "options": { + "go_package": "google.golang.org/protobuf/types/descriptorpb", + "java_package": "com.google.protobuf", + "java_outer_classname": "DescriptorProtos", + "csharp_namespace": "Google.Protobuf.Reflection", + "objc_class_prefix": "GPB", + "cc_enable_arenas": true, + "optimize_for": "SPEED" + }, + "nested": { + "FileDescriptorSet": { + "fields": { + "file": { + "rule": "repeated", + "type": "FileDescriptorProto", + "id": 1 + } + } + }, + "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": { + "type": "string", + "id": 1 + }, + "package": { + "type": "string", + "id": 2 + }, + "dependency": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "publicDependency": { + "rule": "repeated", + "type": "int32", + "id": 10, + "options": { + "packed": false + } + }, + "weakDependency": { + "rule": "repeated", + "type": "int32", + "id": 11, + "options": { + "packed": false + } + }, + "messageType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 4 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 5 + }, + "service": { + "rule": "repeated", + "type": "ServiceDescriptorProto", + "id": 6 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 7 + }, + "options": { + "type": "FileOptions", + "id": 8 + }, + "sourceCodeInfo": { + "type": "SourceCodeInfo", + "id": 9 + }, + "syntax": { + "type": "string", + "id": 12 + }, + "edition": { + "type": "Edition", + "id": 14 + } + } + }, + "DescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "field": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 2 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 6 + }, + "nestedType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 3 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 4 + }, + "extensionRange": { + "rule": "repeated", + "type": "ExtensionRange", + "id": 5 + }, + "oneofDecl": { + "rule": "repeated", + "type": "OneofDescriptorProto", + "id": 8 + }, + "options": { + "type": "MessageOptions", + "id": 7 + }, + "reservedRange": { + "rule": "repeated", + "type": "ReservedRange", + "id": 9 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 10 + } + }, + "nested": { + "ExtensionRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "ExtensionRangeOptions", + "id": 3 + } + } + }, + "ReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "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": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 3 + }, + "label": { + "type": "Label", + "id": 4 + }, + "type": { + "type": "Type", + "id": 5 + }, + "typeName": { + "type": "string", + "id": 6 + }, + "extendee": { + "type": "string", + "id": 2 + }, + "defaultValue": { + "type": "string", + "id": 7 + }, + "oneofIndex": { + "type": "int32", + "id": 9 + }, + "jsonName": { + "type": "string", + "id": 10 + }, + "options": { + "type": "FieldOptions", + "id": 8 + }, + "proto3Optional": { + "type": "bool", + "id": 17 + } + }, + "nested": { + "Type": { + "values": { + "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": { + "values": { + "LABEL_OPTIONAL": 1, + "LABEL_REPEATED": 3, + "LABEL_REQUIRED": 2 + } + } + } + }, + "OneofDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "options": { + "type": "OneofOptions", + "id": 2 + } + } + }, + "EnumDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "value": { + "rule": "repeated", + "type": "EnumValueDescriptorProto", + "id": 2 + }, + "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 + } + } + } + } + }, + "EnumValueDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "EnumValueOptions", + "id": 3 + } + } + }, + "ServiceDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "method": { + "rule": "repeated", + "type": "MethodDescriptorProto", + "id": 2 + }, + "options": { + "type": "ServiceOptions", + "id": 3 + } + } + }, + "MethodDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "inputType": { + "type": "string", + "id": 2 + }, + "outputType": { + "type": "string", + "id": 3 + }, + "options": { + "type": "MethodOptions", + "id": 4 + }, + "clientStreaming": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "serverStreaming": { + "type": "bool", + "id": 6, + "options": { + "default": false + } + } + } + }, + "FileOptions": { + "fields": { + "javaPackage": { + "type": "string", + "id": 1 + }, + "javaOuterClassname": { + "type": "string", + "id": 8 + }, + "javaMultipleFiles": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "javaGenerateEqualsAndHash": { + "type": "bool", + "id": 20, + "options": { + "deprecated": true + } + }, + "javaStringCheckUtf8": { + "type": "bool", + "id": 27, + "options": { + "default": false + } + }, + "optimizeFor": { + "type": "OptimizeMode", + "id": 9, + "options": { + "default": "SPEED" + } + }, + "goPackage": { + "type": "string", + "id": 11 + }, + "ccGenericServices": { + "type": "bool", + "id": 16, + "options": { + "default": false + } + }, + "javaGenericServices": { + "type": "bool", + "id": 17, + "options": { + "default": false + } + }, + "pyGenericServices": { + "type": "bool", + "id": 18, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 23, + "options": { + "default": false + } + }, + "ccEnableArenas": { + "type": "bool", + "id": 31, + "options": { + "default": true + } + }, + "objcClassPrefix": { + "type": "string", + "id": 36 + }, + "csharpNamespace": { + "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", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 42, + 42 + ], + [ + 38, + 38 + ] + ], + "nested": { + "OptimizeMode": { + "values": { + "SPEED": 1, + "CODE_SIZE": 2, + "LITE_RUNTIME": 3 + } + } + } + }, + "MessageOptions": { + "fields": { + "messageSetWireFormat": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "noStandardDescriptorAccessor": { + "type": "bool", + "id": 2, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "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", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ], + [ + 5, + 5 + ], + [ + 6, + 6 + ], + [ + 8, + 8 + ], + [ + 9, + 9 + ] + ] + }, + "FieldOptions": { + "fields": { + "ctype": { + "type": "CType", + "id": 1, + "options": { + "default": "STRING" + } + }, + "packed": { + "type": "bool", + "id": 2 + }, + "jstype": { + "type": "JSType", + "id": 6, + "options": { + "default": "JS_NORMAL" + } + }, + "lazy": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "unverifiedLazy": { + "type": "bool", + "id": 15, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "weak": { + "type": "bool", + "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", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ], + [ + 18, + 18 + ] + ], + "nested": { + "CType": { + "values": { + "STRING": 0, + "CORD": 1, + "STRING_PIECE": 2 + } + }, + "JSType": { + "values": { + "JS_NORMAL": 0, + "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", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "EnumOptions": { + "fields": { + "allowAlias": { + "type": "bool", + "id": 2 + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "deprecatedLegacyJsonFieldConflicts": { + "type": "bool", + "id": 6, + "options": { + "deprecated": true + } + }, + "features": { + "type": "FeatureSet", + "id": 7 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 5, + 5 + ] + ] + }, + "EnumValueOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "features": { + "type": "FeatureSet", + "id": 2 + }, + "debugRedact": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "ServiceOptions": { + "fields": { + "features": { + "type": "FeatureSet", + "id": 34 + }, + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "MethodOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "idempotencyLevel": { + "type": "IdempotencyLevel", + "id": 34, + "options": { + "default": "IDEMPOTENCY_UNKNOWN" + } + }, + "features": { + "type": "FeatureSet", + "id": 35 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "nested": { + "IdempotencyLevel": { + "values": { + "IDEMPOTENCY_UNKNOWN": 0, + "NO_SIDE_EFFECTS": 1, + "IDEMPOTENT": 2 + } + } + } + }, + "UninterpretedOption": { + "fields": { + "name": { + "rule": "repeated", + "type": "NamePart", + "id": 2 + }, + "identifierValue": { + "type": "string", + "id": 3 + }, + "positiveIntValue": { + "type": "uint64", + "id": 4 + }, + "negativeIntValue": { + "type": "int64", + "id": 5 + }, + "doubleValue": { + "type": "double", + "id": 6 + }, + "stringValue": { + "type": "bytes", + "id": 7 + }, + "aggregateValue": { + "type": "string", + "id": 8 + } + }, + "nested": { + "NamePart": { + "fields": { + "namePart": { + "rule": "required", + "type": "string", + "id": 1 + }, + "isExtension": { + "rule": "required", + "type": "bool", + "id": 2 + } + } + } + } + }, + "FeatureSet": { + "fields": { + "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 + ], + [ + 1002, + 1002 + ], + [ + 9990, + 9990 + ], + [ + 9995, + 9999 + ], + [ + 10000, + 10000 + ] + ], + "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": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "span": { + "rule": "repeated", + "type": "int32", + "id": 2 + }, + "leadingComments": { + "type": "string", + "id": 3 + }, + "trailingComments": { + "type": "string", + "id": 4 + }, + "leadingDetachedComments": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + } + } + }, + "GeneratedCodeInfo": { + "fields": { + "annotation": { + "rule": "repeated", + "type": "Annotation", + "id": 1 + } + }, + "nested": { + "Annotation": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "sourceFile": { + "type": "string", + "id": 2 + }, + "begin": { + "type": "int32", + "id": 3 + }, + "end": { + "type": "int32", + "id": 4 + }, + "semantic": { + "type": "Semantic", + "id": 5 + } + }, + "nested": { + "Semantic": { + "values": { + "NONE": 0, + "SET": 1, + "ALIAS": 2 + } + } + } + } + } + }, + "Duration": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "Empty": { + "fields": {} + }, + "FieldMask": { + "fields": { + "paths": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "Timestamp": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/owl-bot-staging/v1/src/index.ts b/owl-bot-staging/v1/src/index.ts new file mode 100644 index 000000000..fd5e2ff08 --- /dev/null +++ b/owl-bot-staging/v1/src/index.ts @@ -0,0 +1,29 @@ +// 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as v1 from './v1'; +const PublisherClient = v1.PublisherClient; +type PublisherClient = v1.PublisherClient; +const SchemaServiceClient = v1.SchemaServiceClient; +type SchemaServiceClient = v1.SchemaServiceClient; +const SubscriberClient = v1.SubscriberClient; +type SubscriberClient = v1.SubscriberClient; +export {v1, PublisherClient, SchemaServiceClient, SubscriberClient}; +export default {v1, PublisherClient, SchemaServiceClient, SubscriberClient}; +import * as protos from '../protos/protos'; +export {protos} diff --git a/owl-bot-staging/v1/src/v1/index.ts b/owl-bot-staging/v1/src/v1/index.ts new file mode 100644 index 000000000..f12ac87b4 --- /dev/null +++ b/owl-bot-staging/v1/src/v1/index.ts @@ -0,0 +1,21 @@ +// 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +export {PublisherClient} from './publisher_client'; +export {SchemaServiceClient} from './schema_service_client'; +export {SubscriberClient} from './subscriber_client'; diff --git a/owl-bot-staging/v1/src/v1/publisher_client.ts b/owl-bot-staging/v1/src/v1/publisher_client.ts new file mode 100644 index 000000000..1b5b0aede --- /dev/null +++ b/owl-bot-staging/v1/src/v1/publisher_client.ts @@ -0,0 +1,1701 @@ +// 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type {Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback, GaxCall, IamClient, IamProtos} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); + +/** + * Client JSON configuration object, loaded from + * `src/v1/publisher_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './publisher_client_config.json'; +const version = require('../../../package.json').version; + +/** + * The service that an application uses to manipulate topics, and to send + * messages to a topic. + * @class + * @memberof v1 + */ +export class PublisherClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + private _universeDomain: string; + private _servicePath: string; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + iamClient: IamClient; + pathTemplates: {[name: string]: gax.PathTemplate}; + publisherStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of PublisherClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new PublisherClient({fallback: true}, gax); + * ``` + */ + constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof PublisherClient; + if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) { + throw new Error('Please set either universe_domain or universeDomain, but not both.'); + } + const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined; + this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com'; + this._servicePath = 'pubsub.' + this._universeDomain; + const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; + this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== this._servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); + + + // Determine the client header string. + const clientHeader = [ + `gax/${this._gaxModule.version}`, + `gapic/${version}`, + ]; + if (typeof process === 'object' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + projectTopicPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/topics/{topic}' + ), + schemaPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/schemas/{schema}' + ), + snapshotPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/snapshots/{snapshot}' + ), + subscriptionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/subscriptions/{subscription}' + ), + }; + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this.descriptors.page = { + listTopics: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'topics'), + listTopicSubscriptions: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'subscriptions'), + listTopicSnapshots: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'snapshots') + }; + + const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); + // Some methods on this API support automatically batching + // requests; denote this. + + this.descriptors.batching = { + publish: new this._gaxModule.BundleDescriptor( + 'messages', + ['topic'], + 'message_ids', + this._gaxModule.GrpcClient.createByteLengthFunction( + // eslint-disable-next-line @typescript-eslint/no-explicit-any + protoFilesRoot.lookupType('google.pubsub.v1.PubsubMessage') as any + ) + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.pubsub.v1.Publisher', gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = this._gaxModule.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.publisherStub) { + return this.publisherStub; + } + + // Put together the "service stub" for + // google.pubsub.v1.Publisher. + this.publisherStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.pubsub.v1.Publisher') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.pubsub.v1.Publisher, + this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const publisherStubMethods = + ['createTopic', 'updateTopic', 'publish', 'getTopic', 'listTopics', 'listTopicSubscriptions', 'listTopicSnapshots', 'deleteTopic', 'detachSubscription']; + for (const methodName of publisherStubMethods) { + const callPromise = this.publisherStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error|null|undefined) => () => { + throw err; + }); + + const descriptor = + this.descriptors.page[methodName] || + this.descriptors.batching?.[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.publisherStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'pubsub.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'pubsub.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/pubsub' + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId(callback?: Callback): + Promise|void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- +/** + * Creates the given topic with the given name. See the [resource name rules] + * (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the topic. It must have the format + * `"projects/{project}/topics/{topic}"`. `{topic}` must start with a letter, + * and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), + * underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent + * signs (`%`). It must be between 3 and 255 characters in length, and it + * must not start with `"goog"`. + * @param {number[]} [request.labels] + * Optional. See [Creating and managing labels] + * (https://cloud.google.com/pubsub/docs/labels). + * @param {google.pubsub.v1.MessageStoragePolicy} [request.messageStoragePolicy] + * Optional. Policy constraining the set of Google Cloud Platform regions + * where messages published to the topic may be stored. If not present, then + * no constraints are in effect. + * @param {string} [request.kmsKeyName] + * Optional. The resource name of the Cloud KMS CryptoKey to be used to + * protect access to messages published on this topic. + * + * The expected format is `projects/* /locations/* /keyRings/* /cryptoKeys/*`. + * @param {google.pubsub.v1.SchemaSettings} [request.schemaSettings] + * Optional. Settings for validating messages published against a schema. + * @param {boolean} [request.satisfiesPzs] + * Optional. Reserved for future use. This field is set only in responses from + * the server; it is ignored if it is set in any requests. + * @param {google.protobuf.Duration} [request.messageRetentionDuration] + * Optional. Indicates the minimum duration to retain a message after it is + * published to the topic. If this field is set, messages published to the + * topic in the last `message_retention_duration` are always available to + * subscribers. For instance, it allows any attached subscription to [seek to + * a + * timestamp](https://cloud.google.com/pubsub/docs/replay-overview#seek_to_a_time) + * that is up to `message_retention_duration` in the past. If this field is + * not set, message retention is controlled by settings on individual + * subscriptions. Cannot be more than 31 days or less than 10 minutes. + * @param {google.pubsub.v1.Topic.State} request.state + * Output only. An output-only field indicating the state of the topic. + * @param {google.pubsub.v1.IngestionDataSourceSettings} [request.ingestionDataSourceSettings] + * Optional. Settings for ingestion from a data source into this topic. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.pubsub.v1.Topic|Topic}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + */ + createTopic( + request?: protos.google.pubsub.v1.ITopic, + options?: CallOptions): + Promise<[ + protos.google.pubsub.v1.ITopic, + protos.google.pubsub.v1.ITopic|undefined, {}|undefined + ]>; + createTopic( + request: protos.google.pubsub.v1.ITopic, + options: CallOptions, + callback: Callback< + protos.google.pubsub.v1.ITopic, + protos.google.pubsub.v1.ITopic|null|undefined, + {}|null|undefined>): void; + createTopic( + request: protos.google.pubsub.v1.ITopic, + callback: Callback< + protos.google.pubsub.v1.ITopic, + protos.google.pubsub.v1.ITopic|null|undefined, + {}|null|undefined>): void; + createTopic( + request?: protos.google.pubsub.v1.ITopic, + optionsOrCallback?: CallOptions|Callback< + protos.google.pubsub.v1.ITopic, + protos.google.pubsub.v1.ITopic|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.pubsub.v1.ITopic, + protos.google.pubsub.v1.ITopic|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.pubsub.v1.ITopic, + protos.google.pubsub.v1.ITopic|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.createTopic(request, options, callback); + } +/** + * Updates an existing topic by updating the fields specified in the update + * mask. Note that certain properties of a topic are not modifiable. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.pubsub.v1.Topic} request.topic + * Required. The updated topic object. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Indicates which fields in the provided topic to update. Must be + * specified and non-empty. Note that if `update_mask` contains + * "message_storage_policy" but the `message_storage_policy` is not set in + * the `topic` provided above, then the updated value is determined by the + * policy configured at the project or organization level. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.pubsub.v1.Topic|Topic}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + */ + updateTopic( + request?: protos.google.pubsub.v1.IUpdateTopicRequest, + options?: CallOptions): + Promise<[ + protos.google.pubsub.v1.ITopic, + protos.google.pubsub.v1.IUpdateTopicRequest|undefined, {}|undefined + ]>; + updateTopic( + request: protos.google.pubsub.v1.IUpdateTopicRequest, + options: CallOptions, + callback: Callback< + protos.google.pubsub.v1.ITopic, + protos.google.pubsub.v1.IUpdateTopicRequest|null|undefined, + {}|null|undefined>): void; + updateTopic( + request: protos.google.pubsub.v1.IUpdateTopicRequest, + callback: Callback< + protos.google.pubsub.v1.ITopic, + protos.google.pubsub.v1.IUpdateTopicRequest|null|undefined, + {}|null|undefined>): void; + updateTopic( + request?: protos.google.pubsub.v1.IUpdateTopicRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.pubsub.v1.ITopic, + protos.google.pubsub.v1.IUpdateTopicRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.pubsub.v1.ITopic, + protos.google.pubsub.v1.IUpdateTopicRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.pubsub.v1.ITopic, + protos.google.pubsub.v1.IUpdateTopicRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'topic.name': request.topic!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateTopic(request, options, callback); + } +/** + * Adds one or more messages to the topic. Returns `NOT_FOUND` if the topic + * does not exist. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.topic + * Required. The messages in the request will be published on this topic. + * Format is `projects/{project}/topics/{topic}`. + * @param {number[]} request.messages + * Required. The messages to publish. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.pubsub.v1.PublishResponse|PublishResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + */ + publish( + request?: protos.google.pubsub.v1.IPublishRequest, + options?: CallOptions): + Promise<[ + protos.google.pubsub.v1.IPublishResponse, + protos.google.pubsub.v1.IPublishRequest|undefined, {}|undefined + ]>; + publish( + request: protos.google.pubsub.v1.IPublishRequest, + options: CallOptions, + callback: Callback< + protos.google.pubsub.v1.IPublishResponse, + protos.google.pubsub.v1.IPublishRequest|null|undefined, + {}|null|undefined>): void; + publish( + request: protos.google.pubsub.v1.IPublishRequest, + callback: Callback< + protos.google.pubsub.v1.IPublishResponse, + protos.google.pubsub.v1.IPublishRequest|null|undefined, + {}|null|undefined>): void; + publish( + request?: protos.google.pubsub.v1.IPublishRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.pubsub.v1.IPublishResponse, + protos.google.pubsub.v1.IPublishRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.pubsub.v1.IPublishResponse, + protos.google.pubsub.v1.IPublishRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.pubsub.v1.IPublishResponse, + protos.google.pubsub.v1.IPublishRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'topic': request.topic ?? '', + }); + this.initialize(); + return this.innerApiCalls.publish(request, options, callback); + } +/** + * Gets the configuration of a topic. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.topic + * Required. The name of the topic to get. + * Format is `projects/{project}/topics/{topic}`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.pubsub.v1.Topic|Topic}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + */ + getTopic( + request?: protos.google.pubsub.v1.IGetTopicRequest, + options?: CallOptions): + Promise<[ + protos.google.pubsub.v1.ITopic, + protos.google.pubsub.v1.IGetTopicRequest|undefined, {}|undefined + ]>; + getTopic( + request: protos.google.pubsub.v1.IGetTopicRequest, + options: CallOptions, + callback: Callback< + protos.google.pubsub.v1.ITopic, + protos.google.pubsub.v1.IGetTopicRequest|null|undefined, + {}|null|undefined>): void; + getTopic( + request: protos.google.pubsub.v1.IGetTopicRequest, + callback: Callback< + protos.google.pubsub.v1.ITopic, + protos.google.pubsub.v1.IGetTopicRequest|null|undefined, + {}|null|undefined>): void; + getTopic( + request?: protos.google.pubsub.v1.IGetTopicRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.pubsub.v1.ITopic, + protos.google.pubsub.v1.IGetTopicRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.pubsub.v1.ITopic, + protos.google.pubsub.v1.IGetTopicRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.pubsub.v1.ITopic, + protos.google.pubsub.v1.IGetTopicRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'topic': request.topic ?? '', + }); + this.initialize(); + return this.innerApiCalls.getTopic(request, options, callback); + } +/** + * Deletes the topic with the given name. Returns `NOT_FOUND` if the topic + * does not exist. After a topic is deleted, a new topic may be created with + * the same name; this is an entirely new topic with none of the old + * configuration or subscriptions. Existing subscriptions to this topic are + * not deleted, but their `topic` field is set to `_deleted-topic_`. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.topic + * Required. Name of the topic to delete. + * Format is `projects/{project}/topics/{topic}`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + */ + deleteTopic( + request?: protos.google.pubsub.v1.IDeleteTopicRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IDeleteTopicRequest|undefined, {}|undefined + ]>; + deleteTopic( + request: protos.google.pubsub.v1.IDeleteTopicRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IDeleteTopicRequest|null|undefined, + {}|null|undefined>): void; + deleteTopic( + request: protos.google.pubsub.v1.IDeleteTopicRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IDeleteTopicRequest|null|undefined, + {}|null|undefined>): void; + deleteTopic( + request?: protos.google.pubsub.v1.IDeleteTopicRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IDeleteTopicRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IDeleteTopicRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IDeleteTopicRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'topic': request.topic ?? '', + }); + this.initialize(); + return this.innerApiCalls.deleteTopic(request, options, callback); + } +/** + * Detaches a subscription from this topic. All messages retained in the + * subscription are dropped. Subsequent `Pull` and `StreamingPull` requests + * will return FAILED_PRECONDITION. If the subscription is a push + * subscription, pushes to the endpoint will stop. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.subscription + * Required. The subscription to detach. + * Format is `projects/{project}/subscriptions/{subscription}`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.pubsub.v1.DetachSubscriptionResponse|DetachSubscriptionResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + */ + detachSubscription( + request?: protos.google.pubsub.v1.IDetachSubscriptionRequest, + options?: CallOptions): + Promise<[ + protos.google.pubsub.v1.IDetachSubscriptionResponse, + protos.google.pubsub.v1.IDetachSubscriptionRequest|undefined, {}|undefined + ]>; + detachSubscription( + request: protos.google.pubsub.v1.IDetachSubscriptionRequest, + options: CallOptions, + callback: Callback< + protos.google.pubsub.v1.IDetachSubscriptionResponse, + protos.google.pubsub.v1.IDetachSubscriptionRequest|null|undefined, + {}|null|undefined>): void; + detachSubscription( + request: protos.google.pubsub.v1.IDetachSubscriptionRequest, + callback: Callback< + protos.google.pubsub.v1.IDetachSubscriptionResponse, + protos.google.pubsub.v1.IDetachSubscriptionRequest|null|undefined, + {}|null|undefined>): void; + detachSubscription( + request?: protos.google.pubsub.v1.IDetachSubscriptionRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.pubsub.v1.IDetachSubscriptionResponse, + protos.google.pubsub.v1.IDetachSubscriptionRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.pubsub.v1.IDetachSubscriptionResponse, + protos.google.pubsub.v1.IDetachSubscriptionRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.pubsub.v1.IDetachSubscriptionResponse, + protos.google.pubsub.v1.IDetachSubscriptionRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'subscription': request.subscription ?? '', + }); + this.initialize(); + return this.innerApiCalls.detachSubscription(request, options, callback); + } + + /** + * Lists matching topics. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Required. The name of the project in which to list topics. + * Format is `projects/{project-id}`. + * @param {number} [request.pageSize] + * Optional. Maximum number of topics to return. + * @param {string} [request.pageToken] + * Optional. The value returned by the last `ListTopicsResponse`; indicates + * that this is a continuation of a prior `ListTopics` call, and that the + * system should return the next page of data. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.pubsub.v1.Topic|Topic}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listTopicsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listTopics( + request?: protos.google.pubsub.v1.IListTopicsRequest, + options?: CallOptions): + Promise<[ + protos.google.pubsub.v1.ITopic[], + protos.google.pubsub.v1.IListTopicsRequest|null, + protos.google.pubsub.v1.IListTopicsResponse + ]>; + listTopics( + request: protos.google.pubsub.v1.IListTopicsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.pubsub.v1.IListTopicsRequest, + protos.google.pubsub.v1.IListTopicsResponse|null|undefined, + protos.google.pubsub.v1.ITopic>): void; + listTopics( + request: protos.google.pubsub.v1.IListTopicsRequest, + callback: PaginationCallback< + protos.google.pubsub.v1.IListTopicsRequest, + protos.google.pubsub.v1.IListTopicsResponse|null|undefined, + protos.google.pubsub.v1.ITopic>): void; + listTopics( + request?: protos.google.pubsub.v1.IListTopicsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.pubsub.v1.IListTopicsRequest, + protos.google.pubsub.v1.IListTopicsResponse|null|undefined, + protos.google.pubsub.v1.ITopic>, + callback?: PaginationCallback< + protos.google.pubsub.v1.IListTopicsRequest, + protos.google.pubsub.v1.IListTopicsResponse|null|undefined, + protos.google.pubsub.v1.ITopic>): + Promise<[ + protos.google.pubsub.v1.ITopic[], + protos.google.pubsub.v1.IListTopicsRequest|null, + protos.google.pubsub.v1.IListTopicsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'project': request.project ?? '', + }); + this.initialize(); + return this.innerApiCalls.listTopics(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Required. The name of the project in which to list topics. + * Format is `projects/{project-id}`. + * @param {number} [request.pageSize] + * Optional. Maximum number of topics to return. + * @param {string} [request.pageToken] + * Optional. The value returned by the last `ListTopicsResponse`; indicates + * that this is a continuation of a prior `ListTopics` call, and that the + * system should return the next page of data. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.pubsub.v1.Topic|Topic} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listTopicsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listTopicsStream( + request?: protos.google.pubsub.v1.IListTopicsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'project': request.project ?? '', + }); + const defaultCallSettings = this._defaults['listTopics']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listTopics.createStream( + this.innerApiCalls.listTopics as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listTopics`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Required. The name of the project in which to list topics. + * Format is `projects/{project-id}`. + * @param {number} [request.pageSize] + * Optional. Maximum number of topics to return. + * @param {string} [request.pageToken] + * Optional. The value returned by the last `ListTopicsResponse`; indicates + * that this is a continuation of a prior `ListTopics` call, and that the + * system should return the next page of data. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.pubsub.v1.Topic|Topic}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listTopicsAsync( + request?: protos.google.pubsub.v1.IListTopicsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'project': request.project ?? '', + }); + const defaultCallSettings = this._defaults['listTopics']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listTopics.asyncIterate( + this.innerApiCalls['listTopics'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists the names of the attached subscriptions on this topic. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.topic + * Required. The name of the topic that subscriptions are attached to. + * Format is `projects/{project}/topics/{topic}`. + * @param {number} [request.pageSize] + * Optional. Maximum number of subscription names to return. + * @param {string} [request.pageToken] + * Optional. The value returned by the last `ListTopicSubscriptionsResponse`; + * indicates that this is a continuation of a prior `ListTopicSubscriptions` + * call, and that the system should return the next page of data. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of string. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listTopicSubscriptionsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listTopicSubscriptions( + request?: protos.google.pubsub.v1.IListTopicSubscriptionsRequest, + options?: CallOptions): + Promise<[ + string[], + protos.google.pubsub.v1.IListTopicSubscriptionsRequest|null, + protos.google.pubsub.v1.IListTopicSubscriptionsResponse + ]>; + listTopicSubscriptions( + request: protos.google.pubsub.v1.IListTopicSubscriptionsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.pubsub.v1.IListTopicSubscriptionsRequest, + protos.google.pubsub.v1.IListTopicSubscriptionsResponse|null|undefined, + string>): void; + listTopicSubscriptions( + request: protos.google.pubsub.v1.IListTopicSubscriptionsRequest, + callback: PaginationCallback< + protos.google.pubsub.v1.IListTopicSubscriptionsRequest, + protos.google.pubsub.v1.IListTopicSubscriptionsResponse|null|undefined, + string>): void; + listTopicSubscriptions( + request?: protos.google.pubsub.v1.IListTopicSubscriptionsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.pubsub.v1.IListTopicSubscriptionsRequest, + protos.google.pubsub.v1.IListTopicSubscriptionsResponse|null|undefined, + string>, + callback?: PaginationCallback< + protos.google.pubsub.v1.IListTopicSubscriptionsRequest, + protos.google.pubsub.v1.IListTopicSubscriptionsResponse|null|undefined, + string>): + Promise<[ + string[], + protos.google.pubsub.v1.IListTopicSubscriptionsRequest|null, + protos.google.pubsub.v1.IListTopicSubscriptionsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'topic': request.topic ?? '', + }); + this.initialize(); + return this.innerApiCalls.listTopicSubscriptions(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.topic + * Required. The name of the topic that subscriptions are attached to. + * Format is `projects/{project}/topics/{topic}`. + * @param {number} [request.pageSize] + * Optional. Maximum number of subscription names to return. + * @param {string} [request.pageToken] + * Optional. The value returned by the last `ListTopicSubscriptionsResponse`; + * indicates that this is a continuation of a prior `ListTopicSubscriptions` + * call, and that the system should return the next page of data. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing string on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listTopicSubscriptionsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listTopicSubscriptionsStream( + request?: protos.google.pubsub.v1.IListTopicSubscriptionsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'topic': request.topic ?? '', + }); + const defaultCallSettings = this._defaults['listTopicSubscriptions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listTopicSubscriptions.createStream( + this.innerApiCalls.listTopicSubscriptions as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listTopicSubscriptions`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.topic + * Required. The name of the topic that subscriptions are attached to. + * Format is `projects/{project}/topics/{topic}`. + * @param {number} [request.pageSize] + * Optional. Maximum number of subscription names to return. + * @param {string} [request.pageToken] + * Optional. The value returned by the last `ListTopicSubscriptionsResponse`; + * indicates that this is a continuation of a prior `ListTopicSubscriptions` + * call, and that the system should return the next page of data. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * string. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listTopicSubscriptionsAsync( + request?: protos.google.pubsub.v1.IListTopicSubscriptionsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'topic': request.topic ?? '', + }); + const defaultCallSettings = this._defaults['listTopicSubscriptions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listTopicSubscriptions.asyncIterate( + this.innerApiCalls['listTopicSubscriptions'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists the names of the snapshots on this topic. Snapshots are used in + * [Seek](https://cloud.google.com/pubsub/docs/replay-overview) operations, + * which allow you to manage message acknowledgments in bulk. That is, you can + * set the acknowledgment state of messages in an existing subscription to the + * state captured by a snapshot. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.topic + * Required. The name of the topic that snapshots are attached to. + * Format is `projects/{project}/topics/{topic}`. + * @param {number} [request.pageSize] + * Optional. Maximum number of snapshot names to return. + * @param {string} [request.pageToken] + * Optional. The value returned by the last `ListTopicSnapshotsResponse`; + * indicates that this is a continuation of a prior `ListTopicSnapshots` call, + * and that the system should return the next page of data. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of string. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listTopicSnapshotsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listTopicSnapshots( + request?: protos.google.pubsub.v1.IListTopicSnapshotsRequest, + options?: CallOptions): + Promise<[ + string[], + protos.google.pubsub.v1.IListTopicSnapshotsRequest|null, + protos.google.pubsub.v1.IListTopicSnapshotsResponse + ]>; + listTopicSnapshots( + request: protos.google.pubsub.v1.IListTopicSnapshotsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.pubsub.v1.IListTopicSnapshotsRequest, + protos.google.pubsub.v1.IListTopicSnapshotsResponse|null|undefined, + string>): void; + listTopicSnapshots( + request: protos.google.pubsub.v1.IListTopicSnapshotsRequest, + callback: PaginationCallback< + protos.google.pubsub.v1.IListTopicSnapshotsRequest, + protos.google.pubsub.v1.IListTopicSnapshotsResponse|null|undefined, + string>): void; + listTopicSnapshots( + request?: protos.google.pubsub.v1.IListTopicSnapshotsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.pubsub.v1.IListTopicSnapshotsRequest, + protos.google.pubsub.v1.IListTopicSnapshotsResponse|null|undefined, + string>, + callback?: PaginationCallback< + protos.google.pubsub.v1.IListTopicSnapshotsRequest, + protos.google.pubsub.v1.IListTopicSnapshotsResponse|null|undefined, + string>): + Promise<[ + string[], + protos.google.pubsub.v1.IListTopicSnapshotsRequest|null, + protos.google.pubsub.v1.IListTopicSnapshotsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'topic': request.topic ?? '', + }); + this.initialize(); + return this.innerApiCalls.listTopicSnapshots(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.topic + * Required. The name of the topic that snapshots are attached to. + * Format is `projects/{project}/topics/{topic}`. + * @param {number} [request.pageSize] + * Optional. Maximum number of snapshot names to return. + * @param {string} [request.pageToken] + * Optional. The value returned by the last `ListTopicSnapshotsResponse`; + * indicates that this is a continuation of a prior `ListTopicSnapshots` call, + * and that the system should return the next page of data. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing string on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listTopicSnapshotsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listTopicSnapshotsStream( + request?: protos.google.pubsub.v1.IListTopicSnapshotsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'topic': request.topic ?? '', + }); + const defaultCallSettings = this._defaults['listTopicSnapshots']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listTopicSnapshots.createStream( + this.innerApiCalls.listTopicSnapshots as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listTopicSnapshots`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.topic + * Required. The name of the topic that snapshots are attached to. + * Format is `projects/{project}/topics/{topic}`. + * @param {number} [request.pageSize] + * Optional. Maximum number of snapshot names to return. + * @param {string} [request.pageToken] + * Optional. The value returned by the last `ListTopicSnapshotsResponse`; + * indicates that this is a continuation of a prior `ListTopicSnapshots` call, + * and that the system should return the next page of data. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * string. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listTopicSnapshotsAsync( + request?: protos.google.pubsub.v1.IListTopicSnapshotsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'topic': request.topic ?? '', + }); + const defaultCallSettings = this._defaults['listTopicSnapshots']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listTopicSnapshots.asyncIterate( + this.innerApiCalls['listTopicSnapshots'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } +/** + * Gets the access control policy for a resource. Returns an empty policy + * if the resource exists and does not have a policy set. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {Object} [request.options] + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. This field is only used by Cloud IAM. + * + * This object should have the same structure as {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing {@link google.iam.v1.Policy | Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.Policy | Policy}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getIamPolicy( + request: IamProtos.google.iam.v1.GetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ):Promise<[IamProtos.google.iam.v1.Policy]> { + return this.iamClient.getIamPolicy(request, options, callback); + } + +/** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + setIamPolicy( + request: IamProtos.google.iam.v1.SetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ):Promise<[IamProtos.google.iam.v1.Policy]> { + return this.iamClient.setIamPolicy(request, options, callback); + } + +/** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + */ + testIamPermissions( + request: IamProtos.google.iam.v1.TestIamPermissionsRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ):Promise<[IamProtos.google.iam.v1.TestIamPermissionsResponse]> { + return this.iamClient.testIamPermissions(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project:string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified projectTopic resource name string. + * + * @param {string} project + * @param {string} topic + * @returns {string} Resource name string. + */ + projectTopicPath(project:string,topic:string) { + return this.pathTemplates.projectTopicPathTemplate.render({ + project: project, + topic: topic, + }); + } + + /** + * Parse the project from ProjectTopic resource. + * + * @param {string} projectTopicName + * A fully-qualified path representing project_topic resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectTopicName(projectTopicName: string) { + return this.pathTemplates.projectTopicPathTemplate.match(projectTopicName).project; + } + + /** + * Parse the topic from ProjectTopic resource. + * + * @param {string} projectTopicName + * A fully-qualified path representing project_topic resource. + * @returns {string} A string representing the topic. + */ + matchTopicFromProjectTopicName(projectTopicName: string) { + return this.pathTemplates.projectTopicPathTemplate.match(projectTopicName).topic; + } + + /** + * Return a fully-qualified schema resource name string. + * + * @param {string} project + * @param {string} schema + * @returns {string} Resource name string. + */ + schemaPath(project:string,schema:string) { + return this.pathTemplates.schemaPathTemplate.render({ + project: project, + schema: schema, + }); + } + + /** + * Parse the project from Schema resource. + * + * @param {string} schemaName + * A fully-qualified path representing Schema resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSchemaName(schemaName: string) { + return this.pathTemplates.schemaPathTemplate.match(schemaName).project; + } + + /** + * Parse the schema from Schema resource. + * + * @param {string} schemaName + * A fully-qualified path representing Schema resource. + * @returns {string} A string representing the schema. + */ + matchSchemaFromSchemaName(schemaName: string) { + return this.pathTemplates.schemaPathTemplate.match(schemaName).schema; + } + + /** + * Return a fully-qualified snapshot resource name string. + * + * @param {string} project + * @param {string} snapshot + * @returns {string} Resource name string. + */ + snapshotPath(project:string,snapshot:string) { + return this.pathTemplates.snapshotPathTemplate.render({ + project: project, + snapshot: snapshot, + }); + } + + /** + * Parse the project from Snapshot resource. + * + * @param {string} snapshotName + * A fully-qualified path representing Snapshot resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSnapshotName(snapshotName: string) { + return this.pathTemplates.snapshotPathTemplate.match(snapshotName).project; + } + + /** + * Parse the snapshot from Snapshot resource. + * + * @param {string} snapshotName + * A fully-qualified path representing Snapshot resource. + * @returns {string} A string representing the snapshot. + */ + matchSnapshotFromSnapshotName(snapshotName: string) { + return this.pathTemplates.snapshotPathTemplate.match(snapshotName).snapshot; + } + + /** + * Return a fully-qualified subscription resource name string. + * + * @param {string} project + * @param {string} subscription + * @returns {string} Resource name string. + */ + subscriptionPath(project:string,subscription:string) { + return this.pathTemplates.subscriptionPathTemplate.render({ + project: project, + subscription: subscription, + }); + } + + /** + * Parse the project from Subscription resource. + * + * @param {string} subscriptionName + * A fully-qualified path representing Subscription resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSubscriptionName(subscriptionName: string) { + return this.pathTemplates.subscriptionPathTemplate.match(subscriptionName).project; + } + + /** + * Parse the subscription from Subscription resource. + * + * @param {string} subscriptionName + * A fully-qualified path representing Subscription resource. + * @returns {string} A string representing the subscription. + */ + matchSubscriptionFromSubscriptionName(subscriptionName: string) { + return this.pathTemplates.subscriptionPathTemplate.match(subscriptionName).subscription; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.publisherStub && !this._terminated) { + return this.publisherStub.then(stub => { + this._terminated = true; + stub.close(); + this.iamClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/v1/src/v1/publisher_client_config.json b/owl-bot-staging/v1/src/v1/publisher_client_config.json new file mode 100644 index 000000000..187d70936 --- /dev/null +++ b/owl-bot-staging/v1/src/v1/publisher_client_config.json @@ -0,0 +1,103 @@ +{ + "interfaces": { + "google.pubsub.v1.Publisher": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "unavailable": [ + "UNAVAILABLE" + ], + "cancelled_unknown_deadline_exceeded_resource_exhausted_aborted_internal_unavailable": [ + "CANCELLED", + "UNKNOWN", + "DEADLINE_EXCEEDED", + "RESOURCE_EXHAUSTED", + "ABORTED", + "INTERNAL", + "UNAVAILABLE" + ], + "unknown_aborted_unavailable": [ + "UNKNOWN", + "ABORTED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + }, + "693222d32e887d96c8faeadca469f7763ccda85a": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 4, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "CreateTopic": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "UpdateTopic": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "Publish": { + "timeout_millis": 60000, + "retry_codes_name": "cancelled_unknown_deadline_exceeded_resource_exhausted_aborted_internal_unavailable", + "retry_params_name": "693222d32e887d96c8faeadca469f7763ccda85a", + "bundling": { + "element_count_threshold": 100, + "request_byte_threshold": 1048576, + "delay_threshold_millis": 10, + "element_count_limit": 1000 + } + }, + "GetTopic": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_aborted_unavailable", + "retry_params_name": "default" + }, + "ListTopics": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_aborted_unavailable", + "retry_params_name": "default" + }, + "ListTopicSubscriptions": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_aborted_unavailable", + "retry_params_name": "default" + }, + "ListTopicSnapshots": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_aborted_unavailable", + "retry_params_name": "default" + }, + "DeleteTopic": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "DetachSubscription": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/v1/src/v1/publisher_proto_list.json b/owl-bot-staging/v1/src/v1/publisher_proto_list.json new file mode 100644 index 000000000..91011aec1 --- /dev/null +++ b/owl-bot-staging/v1/src/v1/publisher_proto_list.json @@ -0,0 +1,4 @@ +[ + "../../protos/google/pubsub/v1/pubsub.proto", + "../../protos/google/pubsub/v1/schema.proto" +] diff --git a/owl-bot-staging/v1/src/v1/schema_service_client.ts b/owl-bot-staging/v1/src/v1/schema_service_client.ts new file mode 100644 index 000000000..f7f64778e --- /dev/null +++ b/owl-bot-staging/v1/src/v1/schema_service_client.ts @@ -0,0 +1,1643 @@ +// 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type {Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback, GaxCall, IamClient, IamProtos} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); + +/** + * Client JSON configuration object, loaded from + * `src/v1/schema_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './schema_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Service for doing schema-related operations. + * @class + * @memberof v1 + */ +export class SchemaServiceClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + private _universeDomain: string; + private _servicePath: string; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + iamClient: IamClient; + pathTemplates: {[name: string]: gax.PathTemplate}; + schemaServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of SchemaServiceClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new SchemaServiceClient({fallback: true}, gax); + * ``` + */ + constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof SchemaServiceClient; + if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) { + throw new Error('Please set either universe_domain or universeDomain, but not both.'); + } + const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined; + this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com'; + this._servicePath = 'pubsub.' + this._universeDomain; + const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; + this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== this._servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); + + + // Determine the client header string. + const clientHeader = [ + `gax/${this._gaxModule.version}`, + `gapic/${version}`, + ]; + if (typeof process === 'object' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + projectTopicPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/topics/{topic}' + ), + schemaPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/schemas/{schema}' + ), + snapshotPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/snapshots/{snapshot}' + ), + subscriptionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/subscriptions/{subscription}' + ), + }; + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this.descriptors.page = { + listSchemas: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'schemas'), + listSchemaRevisions: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'schemas') + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.pubsub.v1.SchemaService', gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = this._gaxModule.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.schemaServiceStub) { + return this.schemaServiceStub; + } + + // Put together the "service stub" for + // google.pubsub.v1.SchemaService. + this.schemaServiceStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.pubsub.v1.SchemaService') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.pubsub.v1.SchemaService, + this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const schemaServiceStubMethods = + ['createSchema', 'getSchema', 'listSchemas', 'listSchemaRevisions', 'commitSchema', 'rollbackSchema', 'deleteSchemaRevision', 'deleteSchema', 'validateSchema', 'validateMessage']; + for (const methodName of schemaServiceStubMethods) { + const callPromise = this.schemaServiceStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error|null|undefined) => () => { + throw err; + }); + + const descriptor = + this.descriptors.page[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.schemaServiceStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'pubsub.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'pubsub.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/pubsub' + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId(callback?: Callback): + Promise|void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- +/** + * Creates a schema. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the project in which to create the schema. + * Format is `projects/{project-id}`. + * @param {google.pubsub.v1.Schema} request.schema + * Required. The schema object to create. + * + * This schema's `name` parameter is ignored. The schema object returned + * by CreateSchema will have a `name` made using the given `parent` and + * `schema_id`. + * @param {string} request.schemaId + * The ID to use for the schema, which will become the final component of + * the schema's resource name. + * + * See https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names for + * resource name constraints. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.pubsub.v1.Schema|Schema}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + */ + createSchema( + request?: protos.google.pubsub.v1.ICreateSchemaRequest, + options?: CallOptions): + Promise<[ + protos.google.pubsub.v1.ISchema, + protos.google.pubsub.v1.ICreateSchemaRequest|undefined, {}|undefined + ]>; + createSchema( + request: protos.google.pubsub.v1.ICreateSchemaRequest, + options: CallOptions, + callback: Callback< + protos.google.pubsub.v1.ISchema, + protos.google.pubsub.v1.ICreateSchemaRequest|null|undefined, + {}|null|undefined>): void; + createSchema( + request: protos.google.pubsub.v1.ICreateSchemaRequest, + callback: Callback< + protos.google.pubsub.v1.ISchema, + protos.google.pubsub.v1.ICreateSchemaRequest|null|undefined, + {}|null|undefined>): void; + createSchema( + request?: protos.google.pubsub.v1.ICreateSchemaRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.pubsub.v1.ISchema, + protos.google.pubsub.v1.ICreateSchemaRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.pubsub.v1.ISchema, + protos.google.pubsub.v1.ICreateSchemaRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.pubsub.v1.ISchema, + protos.google.pubsub.v1.ICreateSchemaRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.createSchema(request, options, callback); + } +/** + * Gets a schema. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the schema to get. + * Format is `projects/{project}/schemas/{schema}`. + * @param {google.pubsub.v1.SchemaView} request.view + * The set of fields to return in the response. If not set, returns a Schema + * with all fields filled out. Set to `BASIC` to omit the `definition`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.pubsub.v1.Schema|Schema}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + */ + getSchema( + request?: protos.google.pubsub.v1.IGetSchemaRequest, + options?: CallOptions): + Promise<[ + protos.google.pubsub.v1.ISchema, + protos.google.pubsub.v1.IGetSchemaRequest|undefined, {}|undefined + ]>; + getSchema( + request: protos.google.pubsub.v1.IGetSchemaRequest, + options: CallOptions, + callback: Callback< + protos.google.pubsub.v1.ISchema, + protos.google.pubsub.v1.IGetSchemaRequest|null|undefined, + {}|null|undefined>): void; + getSchema( + request: protos.google.pubsub.v1.IGetSchemaRequest, + callback: Callback< + protos.google.pubsub.v1.ISchema, + protos.google.pubsub.v1.IGetSchemaRequest|null|undefined, + {}|null|undefined>): void; + getSchema( + request?: protos.google.pubsub.v1.IGetSchemaRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.pubsub.v1.ISchema, + protos.google.pubsub.v1.IGetSchemaRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.pubsub.v1.ISchema, + protos.google.pubsub.v1.IGetSchemaRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.pubsub.v1.ISchema, + protos.google.pubsub.v1.IGetSchemaRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.getSchema(request, options, callback); + } +/** + * Commits a new schema revision to an existing schema. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the schema we are revising. + * Format is `projects/{project}/schemas/{schema}`. + * @param {google.pubsub.v1.Schema} request.schema + * Required. The schema revision to commit. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.pubsub.v1.Schema|Schema}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + */ + commitSchema( + request?: protos.google.pubsub.v1.ICommitSchemaRequest, + options?: CallOptions): + Promise<[ + protos.google.pubsub.v1.ISchema, + protos.google.pubsub.v1.ICommitSchemaRequest|undefined, {}|undefined + ]>; + commitSchema( + request: protos.google.pubsub.v1.ICommitSchemaRequest, + options: CallOptions, + callback: Callback< + protos.google.pubsub.v1.ISchema, + protos.google.pubsub.v1.ICommitSchemaRequest|null|undefined, + {}|null|undefined>): void; + commitSchema( + request: protos.google.pubsub.v1.ICommitSchemaRequest, + callback: Callback< + protos.google.pubsub.v1.ISchema, + protos.google.pubsub.v1.ICommitSchemaRequest|null|undefined, + {}|null|undefined>): void; + commitSchema( + request?: protos.google.pubsub.v1.ICommitSchemaRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.pubsub.v1.ISchema, + protos.google.pubsub.v1.ICommitSchemaRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.pubsub.v1.ISchema, + protos.google.pubsub.v1.ICommitSchemaRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.pubsub.v1.ISchema, + protos.google.pubsub.v1.ICommitSchemaRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.commitSchema(request, options, callback); + } +/** + * Creates a new schema revision that is a copy of the provided revision_id. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The schema being rolled back with revision id. + * @param {string} request.revisionId + * Required. The revision ID to roll back to. + * It must be a revision of the same schema. + * + * Example: c7cfa2a8 + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.pubsub.v1.Schema|Schema}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + */ + rollbackSchema( + request?: protos.google.pubsub.v1.IRollbackSchemaRequest, + options?: CallOptions): + Promise<[ + protos.google.pubsub.v1.ISchema, + protos.google.pubsub.v1.IRollbackSchemaRequest|undefined, {}|undefined + ]>; + rollbackSchema( + request: protos.google.pubsub.v1.IRollbackSchemaRequest, + options: CallOptions, + callback: Callback< + protos.google.pubsub.v1.ISchema, + protos.google.pubsub.v1.IRollbackSchemaRequest|null|undefined, + {}|null|undefined>): void; + rollbackSchema( + request: protos.google.pubsub.v1.IRollbackSchemaRequest, + callback: Callback< + protos.google.pubsub.v1.ISchema, + protos.google.pubsub.v1.IRollbackSchemaRequest|null|undefined, + {}|null|undefined>): void; + rollbackSchema( + request?: protos.google.pubsub.v1.IRollbackSchemaRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.pubsub.v1.ISchema, + protos.google.pubsub.v1.IRollbackSchemaRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.pubsub.v1.ISchema, + protos.google.pubsub.v1.IRollbackSchemaRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.pubsub.v1.ISchema, + protos.google.pubsub.v1.IRollbackSchemaRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.rollbackSchema(request, options, callback); + } +/** + * Deletes a specific schema revision. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the schema revision to be deleted, with a revision ID + * explicitly included. + * + * Example: `projects/123/schemas/my-schema@c7cfa2a8` + * @param {string} [request.revisionId] + * Optional. This field is deprecated and should not be used for specifying + * the revision ID. The revision ID should be specified via the `name` + * parameter. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.pubsub.v1.Schema|Schema}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + */ + deleteSchemaRevision( + request?: protos.google.pubsub.v1.IDeleteSchemaRevisionRequest, + options?: CallOptions): + Promise<[ + protos.google.pubsub.v1.ISchema, + protos.google.pubsub.v1.IDeleteSchemaRevisionRequest|undefined, {}|undefined + ]>; + deleteSchemaRevision( + request: protos.google.pubsub.v1.IDeleteSchemaRevisionRequest, + options: CallOptions, + callback: Callback< + protos.google.pubsub.v1.ISchema, + protos.google.pubsub.v1.IDeleteSchemaRevisionRequest|null|undefined, + {}|null|undefined>): void; + deleteSchemaRevision( + request: protos.google.pubsub.v1.IDeleteSchemaRevisionRequest, + callback: Callback< + protos.google.pubsub.v1.ISchema, + protos.google.pubsub.v1.IDeleteSchemaRevisionRequest|null|undefined, + {}|null|undefined>): void; + deleteSchemaRevision( + request?: protos.google.pubsub.v1.IDeleteSchemaRevisionRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.pubsub.v1.ISchema, + protos.google.pubsub.v1.IDeleteSchemaRevisionRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.pubsub.v1.ISchema, + protos.google.pubsub.v1.IDeleteSchemaRevisionRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.pubsub.v1.ISchema, + protos.google.pubsub.v1.IDeleteSchemaRevisionRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.deleteSchemaRevision(request, options, callback); + } +/** + * Deletes a schema. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the schema to delete. + * Format is `projects/{project}/schemas/{schema}`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + */ + deleteSchema( + request?: protos.google.pubsub.v1.IDeleteSchemaRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IDeleteSchemaRequest|undefined, {}|undefined + ]>; + deleteSchema( + request: protos.google.pubsub.v1.IDeleteSchemaRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IDeleteSchemaRequest|null|undefined, + {}|null|undefined>): void; + deleteSchema( + request: protos.google.pubsub.v1.IDeleteSchemaRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IDeleteSchemaRequest|null|undefined, + {}|null|undefined>): void; + deleteSchema( + request?: protos.google.pubsub.v1.IDeleteSchemaRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IDeleteSchemaRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IDeleteSchemaRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IDeleteSchemaRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.deleteSchema(request, options, callback); + } +/** + * Validates a schema. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the project in which to validate schemas. + * Format is `projects/{project-id}`. + * @param {google.pubsub.v1.Schema} request.schema + * Required. The schema object to validate. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.pubsub.v1.ValidateSchemaResponse|ValidateSchemaResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + */ + validateSchema( + request?: protos.google.pubsub.v1.IValidateSchemaRequest, + options?: CallOptions): + Promise<[ + protos.google.pubsub.v1.IValidateSchemaResponse, + protos.google.pubsub.v1.IValidateSchemaRequest|undefined, {}|undefined + ]>; + validateSchema( + request: protos.google.pubsub.v1.IValidateSchemaRequest, + options: CallOptions, + callback: Callback< + protos.google.pubsub.v1.IValidateSchemaResponse, + protos.google.pubsub.v1.IValidateSchemaRequest|null|undefined, + {}|null|undefined>): void; + validateSchema( + request: protos.google.pubsub.v1.IValidateSchemaRequest, + callback: Callback< + protos.google.pubsub.v1.IValidateSchemaResponse, + protos.google.pubsub.v1.IValidateSchemaRequest|null|undefined, + {}|null|undefined>): void; + validateSchema( + request?: protos.google.pubsub.v1.IValidateSchemaRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.pubsub.v1.IValidateSchemaResponse, + protos.google.pubsub.v1.IValidateSchemaRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.pubsub.v1.IValidateSchemaResponse, + protos.google.pubsub.v1.IValidateSchemaRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.pubsub.v1.IValidateSchemaResponse, + protos.google.pubsub.v1.IValidateSchemaRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.validateSchema(request, options, callback); + } +/** + * Validates a message against a schema. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the project in which to validate schemas. + * Format is `projects/{project-id}`. + * @param {string} request.name + * Name of the schema against which to validate. + * + * Format is `projects/{project}/schemas/{schema}`. + * @param {google.pubsub.v1.Schema} request.schema + * Ad-hoc schema against which to validate + * @param {Buffer} request.message + * Message to validate against the provided `schema_spec`. + * @param {google.pubsub.v1.Encoding} request.encoding + * The encoding expected for messages + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.pubsub.v1.ValidateMessageResponse|ValidateMessageResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + */ + validateMessage( + request?: protos.google.pubsub.v1.IValidateMessageRequest, + options?: CallOptions): + Promise<[ + protos.google.pubsub.v1.IValidateMessageResponse, + protos.google.pubsub.v1.IValidateMessageRequest|undefined, {}|undefined + ]>; + validateMessage( + request: protos.google.pubsub.v1.IValidateMessageRequest, + options: CallOptions, + callback: Callback< + protos.google.pubsub.v1.IValidateMessageResponse, + protos.google.pubsub.v1.IValidateMessageRequest|null|undefined, + {}|null|undefined>): void; + validateMessage( + request: protos.google.pubsub.v1.IValidateMessageRequest, + callback: Callback< + protos.google.pubsub.v1.IValidateMessageResponse, + protos.google.pubsub.v1.IValidateMessageRequest|null|undefined, + {}|null|undefined>): void; + validateMessage( + request?: protos.google.pubsub.v1.IValidateMessageRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.pubsub.v1.IValidateMessageResponse, + protos.google.pubsub.v1.IValidateMessageRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.pubsub.v1.IValidateMessageResponse, + protos.google.pubsub.v1.IValidateMessageRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.pubsub.v1.IValidateMessageResponse, + protos.google.pubsub.v1.IValidateMessageRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.validateMessage(request, options, callback); + } + + /** + * Lists schemas in a project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the project in which to list schemas. + * Format is `projects/{project-id}`. + * @param {google.pubsub.v1.SchemaView} request.view + * The set of Schema fields to return in the response. If not set, returns + * Schemas with `name` and `type`, but not `definition`. Set to `FULL` to + * retrieve all fields. + * @param {number} request.pageSize + * Maximum number of schemas to return. + * @param {string} request.pageToken + * The value returned by the last `ListSchemasResponse`; indicates that + * this is a continuation of a prior `ListSchemas` call, and that the + * system should return the next page of data. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.pubsub.v1.Schema|Schema}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listSchemasAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listSchemas( + request?: protos.google.pubsub.v1.IListSchemasRequest, + options?: CallOptions): + Promise<[ + protos.google.pubsub.v1.ISchema[], + protos.google.pubsub.v1.IListSchemasRequest|null, + protos.google.pubsub.v1.IListSchemasResponse + ]>; + listSchemas( + request: protos.google.pubsub.v1.IListSchemasRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.pubsub.v1.IListSchemasRequest, + protos.google.pubsub.v1.IListSchemasResponse|null|undefined, + protos.google.pubsub.v1.ISchema>): void; + listSchemas( + request: protos.google.pubsub.v1.IListSchemasRequest, + callback: PaginationCallback< + protos.google.pubsub.v1.IListSchemasRequest, + protos.google.pubsub.v1.IListSchemasResponse|null|undefined, + protos.google.pubsub.v1.ISchema>): void; + listSchemas( + request?: protos.google.pubsub.v1.IListSchemasRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.pubsub.v1.IListSchemasRequest, + protos.google.pubsub.v1.IListSchemasResponse|null|undefined, + protos.google.pubsub.v1.ISchema>, + callback?: PaginationCallback< + protos.google.pubsub.v1.IListSchemasRequest, + protos.google.pubsub.v1.IListSchemasResponse|null|undefined, + protos.google.pubsub.v1.ISchema>): + Promise<[ + protos.google.pubsub.v1.ISchema[], + protos.google.pubsub.v1.IListSchemasRequest|null, + protos.google.pubsub.v1.IListSchemasResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.listSchemas(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the project in which to list schemas. + * Format is `projects/{project-id}`. + * @param {google.pubsub.v1.SchemaView} request.view + * The set of Schema fields to return in the response. If not set, returns + * Schemas with `name` and `type`, but not `definition`. Set to `FULL` to + * retrieve all fields. + * @param {number} request.pageSize + * Maximum number of schemas to return. + * @param {string} request.pageToken + * The value returned by the last `ListSchemasResponse`; indicates that + * this is a continuation of a prior `ListSchemas` call, and that the + * system should return the next page of data. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.pubsub.v1.Schema|Schema} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listSchemasAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listSchemasStream( + request?: protos.google.pubsub.v1.IListSchemasRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listSchemas']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listSchemas.createStream( + this.innerApiCalls.listSchemas as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listSchemas`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the project in which to list schemas. + * Format is `projects/{project-id}`. + * @param {google.pubsub.v1.SchemaView} request.view + * The set of Schema fields to return in the response. If not set, returns + * Schemas with `name` and `type`, but not `definition`. Set to `FULL` to + * retrieve all fields. + * @param {number} request.pageSize + * Maximum number of schemas to return. + * @param {string} request.pageToken + * The value returned by the last `ListSchemasResponse`; indicates that + * this is a continuation of a prior `ListSchemas` call, and that the + * system should return the next page of data. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.pubsub.v1.Schema|Schema}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listSchemasAsync( + request?: protos.google.pubsub.v1.IListSchemasRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listSchemas']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listSchemas.asyncIterate( + this.innerApiCalls['listSchemas'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists all schema revisions for the named schema. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the schema to list revisions for. + * @param {google.pubsub.v1.SchemaView} request.view + * The set of Schema fields to return in the response. If not set, returns + * Schemas with `name` and `type`, but not `definition`. Set to `FULL` to + * retrieve all fields. + * @param {number} request.pageSize + * The maximum number of revisions to return per page. + * @param {string} request.pageToken + * The page token, received from a previous ListSchemaRevisions call. + * Provide this to retrieve the subsequent page. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.pubsub.v1.Schema|Schema}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listSchemaRevisionsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listSchemaRevisions( + request?: protos.google.pubsub.v1.IListSchemaRevisionsRequest, + options?: CallOptions): + Promise<[ + protos.google.pubsub.v1.ISchema[], + protos.google.pubsub.v1.IListSchemaRevisionsRequest|null, + protos.google.pubsub.v1.IListSchemaRevisionsResponse + ]>; + listSchemaRevisions( + request: protos.google.pubsub.v1.IListSchemaRevisionsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.pubsub.v1.IListSchemaRevisionsRequest, + protos.google.pubsub.v1.IListSchemaRevisionsResponse|null|undefined, + protos.google.pubsub.v1.ISchema>): void; + listSchemaRevisions( + request: protos.google.pubsub.v1.IListSchemaRevisionsRequest, + callback: PaginationCallback< + protos.google.pubsub.v1.IListSchemaRevisionsRequest, + protos.google.pubsub.v1.IListSchemaRevisionsResponse|null|undefined, + protos.google.pubsub.v1.ISchema>): void; + listSchemaRevisions( + request?: protos.google.pubsub.v1.IListSchemaRevisionsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.pubsub.v1.IListSchemaRevisionsRequest, + protos.google.pubsub.v1.IListSchemaRevisionsResponse|null|undefined, + protos.google.pubsub.v1.ISchema>, + callback?: PaginationCallback< + protos.google.pubsub.v1.IListSchemaRevisionsRequest, + protos.google.pubsub.v1.IListSchemaRevisionsResponse|null|undefined, + protos.google.pubsub.v1.ISchema>): + Promise<[ + protos.google.pubsub.v1.ISchema[], + protos.google.pubsub.v1.IListSchemaRevisionsRequest|null, + protos.google.pubsub.v1.IListSchemaRevisionsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.listSchemaRevisions(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the schema to list revisions for. + * @param {google.pubsub.v1.SchemaView} request.view + * The set of Schema fields to return in the response. If not set, returns + * Schemas with `name` and `type`, but not `definition`. Set to `FULL` to + * retrieve all fields. + * @param {number} request.pageSize + * The maximum number of revisions to return per page. + * @param {string} request.pageToken + * The page token, received from a previous ListSchemaRevisions call. + * Provide this to retrieve the subsequent page. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.pubsub.v1.Schema|Schema} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listSchemaRevisionsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listSchemaRevisionsStream( + request?: protos.google.pubsub.v1.IListSchemaRevisionsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + const defaultCallSettings = this._defaults['listSchemaRevisions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listSchemaRevisions.createStream( + this.innerApiCalls.listSchemaRevisions as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listSchemaRevisions`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the schema to list revisions for. + * @param {google.pubsub.v1.SchemaView} request.view + * The set of Schema fields to return in the response. If not set, returns + * Schemas with `name` and `type`, but not `definition`. Set to `FULL` to + * retrieve all fields. + * @param {number} request.pageSize + * The maximum number of revisions to return per page. + * @param {string} request.pageToken + * The page token, received from a previous ListSchemaRevisions call. + * Provide this to retrieve the subsequent page. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.pubsub.v1.Schema|Schema}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listSchemaRevisionsAsync( + request?: protos.google.pubsub.v1.IListSchemaRevisionsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + const defaultCallSettings = this._defaults['listSchemaRevisions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listSchemaRevisions.asyncIterate( + this.innerApiCalls['listSchemaRevisions'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } +/** + * Gets the access control policy for a resource. Returns an empty policy + * if the resource exists and does not have a policy set. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {Object} [request.options] + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. This field is only used by Cloud IAM. + * + * This object should have the same structure as {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing {@link google.iam.v1.Policy | Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.Policy | Policy}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getIamPolicy( + request: IamProtos.google.iam.v1.GetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ):Promise<[IamProtos.google.iam.v1.Policy]> { + return this.iamClient.getIamPolicy(request, options, callback); + } + +/** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + setIamPolicy( + request: IamProtos.google.iam.v1.SetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ):Promise<[IamProtos.google.iam.v1.Policy]> { + return this.iamClient.setIamPolicy(request, options, callback); + } + +/** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + */ + testIamPermissions( + request: IamProtos.google.iam.v1.TestIamPermissionsRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ):Promise<[IamProtos.google.iam.v1.TestIamPermissionsResponse]> { + return this.iamClient.testIamPermissions(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project:string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified projectTopic resource name string. + * + * @param {string} project + * @param {string} topic + * @returns {string} Resource name string. + */ + projectTopicPath(project:string,topic:string) { + return this.pathTemplates.projectTopicPathTemplate.render({ + project: project, + topic: topic, + }); + } + + /** + * Parse the project from ProjectTopic resource. + * + * @param {string} projectTopicName + * A fully-qualified path representing project_topic resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectTopicName(projectTopicName: string) { + return this.pathTemplates.projectTopicPathTemplate.match(projectTopicName).project; + } + + /** + * Parse the topic from ProjectTopic resource. + * + * @param {string} projectTopicName + * A fully-qualified path representing project_topic resource. + * @returns {string} A string representing the topic. + */ + matchTopicFromProjectTopicName(projectTopicName: string) { + return this.pathTemplates.projectTopicPathTemplate.match(projectTopicName).topic; + } + + /** + * Return a fully-qualified schema resource name string. + * + * @param {string} project + * @param {string} schema + * @returns {string} Resource name string. + */ + schemaPath(project:string,schema:string) { + return this.pathTemplates.schemaPathTemplate.render({ + project: project, + schema: schema, + }); + } + + /** + * Parse the project from Schema resource. + * + * @param {string} schemaName + * A fully-qualified path representing Schema resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSchemaName(schemaName: string) { + return this.pathTemplates.schemaPathTemplate.match(schemaName).project; + } + + /** + * Parse the schema from Schema resource. + * + * @param {string} schemaName + * A fully-qualified path representing Schema resource. + * @returns {string} A string representing the schema. + */ + matchSchemaFromSchemaName(schemaName: string) { + return this.pathTemplates.schemaPathTemplate.match(schemaName).schema; + } + + /** + * Return a fully-qualified snapshot resource name string. + * + * @param {string} project + * @param {string} snapshot + * @returns {string} Resource name string. + */ + snapshotPath(project:string,snapshot:string) { + return this.pathTemplates.snapshotPathTemplate.render({ + project: project, + snapshot: snapshot, + }); + } + + /** + * Parse the project from Snapshot resource. + * + * @param {string} snapshotName + * A fully-qualified path representing Snapshot resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSnapshotName(snapshotName: string) { + return this.pathTemplates.snapshotPathTemplate.match(snapshotName).project; + } + + /** + * Parse the snapshot from Snapshot resource. + * + * @param {string} snapshotName + * A fully-qualified path representing Snapshot resource. + * @returns {string} A string representing the snapshot. + */ + matchSnapshotFromSnapshotName(snapshotName: string) { + return this.pathTemplates.snapshotPathTemplate.match(snapshotName).snapshot; + } + + /** + * Return a fully-qualified subscription resource name string. + * + * @param {string} project + * @param {string} subscription + * @returns {string} Resource name string. + */ + subscriptionPath(project:string,subscription:string) { + return this.pathTemplates.subscriptionPathTemplate.render({ + project: project, + subscription: subscription, + }); + } + + /** + * Parse the project from Subscription resource. + * + * @param {string} subscriptionName + * A fully-qualified path representing Subscription resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSubscriptionName(subscriptionName: string) { + return this.pathTemplates.subscriptionPathTemplate.match(subscriptionName).project; + } + + /** + * Parse the subscription from Subscription resource. + * + * @param {string} subscriptionName + * A fully-qualified path representing Subscription resource. + * @returns {string} A string representing the subscription. + */ + matchSubscriptionFromSubscriptionName(subscriptionName: string) { + return this.pathTemplates.subscriptionPathTemplate.match(subscriptionName).subscription; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.schemaServiceStub && !this._terminated) { + return this.schemaServiceStub.then(stub => { + this._terminated = true; + stub.close(); + this.iamClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/v1/src/v1/schema_service_client_config.json b/owl-bot-staging/v1/src/v1/schema_service_client_config.json new file mode 100644 index 000000000..5a2280962 --- /dev/null +++ b/owl-bot-staging/v1/src/v1/schema_service_client_config.json @@ -0,0 +1,79 @@ +{ + "interfaces": { + "google.pubsub.v1.SchemaService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "unavailable": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "CreateSchema": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "GetSchema": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "ListSchemas": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "ListSchemaRevisions": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "CommitSchema": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "RollbackSchema": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "DeleteSchemaRevision": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "DeleteSchema": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "ValidateSchema": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "ValidateMessage": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/v1/src/v1/schema_service_proto_list.json b/owl-bot-staging/v1/src/v1/schema_service_proto_list.json new file mode 100644 index 000000000..91011aec1 --- /dev/null +++ b/owl-bot-staging/v1/src/v1/schema_service_proto_list.json @@ -0,0 +1,4 @@ +[ + "../../protos/google/pubsub/v1/pubsub.proto", + "../../protos/google/pubsub/v1/schema.proto" +] diff --git a/owl-bot-staging/v1/src/v1/subscriber_client.ts b/owl-bot-staging/v1/src/v1/subscriber_client.ts new file mode 100644 index 000000000..9dbd372b9 --- /dev/null +++ b/owl-bot-staging/v1/src/v1/subscriber_client.ts @@ -0,0 +1,2235 @@ +// 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type {Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback, GaxCall, IamClient, IamProtos} from 'google-gax'; +import {Transform, PassThrough} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); + +/** + * Client JSON configuration object, loaded from + * `src/v1/subscriber_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './subscriber_client_config.json'; +const version = require('../../../package.json').version; + +/** + * The service that an application uses to manipulate subscriptions and to + * consume messages from a subscription via the `Pull` method or by + * establishing a bi-directional stream using the `StreamingPull` method. + * @class + * @memberof v1 + */ +export class SubscriberClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + private _universeDomain: string; + private _servicePath: string; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + iamClient: IamClient; + pathTemplates: {[name: string]: gax.PathTemplate}; + subscriberStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of SubscriberClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new SubscriberClient({fallback: true}, gax); + * ``` + */ + constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof SubscriberClient; + if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) { + throw new Error('Please set either universe_domain or universeDomain, but not both.'); + } + const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined; + this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com'; + this._servicePath = 'pubsub.' + this._universeDomain; + const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; + this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== this._servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); + + + // Determine the client header string. + const clientHeader = [ + `gax/${this._gaxModule.version}`, + `gapic/${version}`, + ]; + if (typeof process === 'object' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + projectTopicPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/topics/{topic}' + ), + schemaPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/schemas/{schema}' + ), + snapshotPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/snapshots/{snapshot}' + ), + subscriptionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/subscriptions/{subscription}' + ), + }; + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this.descriptors.page = { + listSubscriptions: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'subscriptions'), + listSnapshots: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'snapshots') + }; + + // Some of the methods on this service provide streaming responses. + // Provide descriptors for these. + this.descriptors.stream = { + streamingPull: new this._gaxModule.StreamDescriptor(this._gaxModule.StreamType.BIDI_STREAMING, !!opts.fallback, !!opts.gaxServerStreamingRetries) + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.pubsub.v1.Subscriber', gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = this._gaxModule.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.subscriberStub) { + return this.subscriberStub; + } + + // Put together the "service stub" for + // google.pubsub.v1.Subscriber. + this.subscriberStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.pubsub.v1.Subscriber') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.pubsub.v1.Subscriber, + this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const subscriberStubMethods = + ['createSubscription', 'getSubscription', 'updateSubscription', 'listSubscriptions', 'deleteSubscription', 'modifyAckDeadline', 'acknowledge', 'pull', 'streamingPull', 'modifyPushConfig', 'getSnapshot', 'listSnapshots', 'createSnapshot', 'updateSnapshot', 'deleteSnapshot', 'seek']; + for (const methodName of subscriberStubMethods) { + const callPromise = this.subscriberStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + if (methodName in this.descriptors.stream) { + const stream = new PassThrough(); + setImmediate(() => { + stream.emit('error', new this._gaxModule.GoogleError('The client has already been closed.')); + }); + return stream; + } + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error|null|undefined) => () => { + throw err; + }); + + const descriptor = + this.descriptors.page[methodName] || + this.descriptors.stream[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.subscriberStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'pubsub.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'pubsub.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/pubsub' + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId(callback?: Callback): + Promise|void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- +/** + * Creates a subscription to a given topic. See the [resource name rules] + * (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). + * If the subscription already exists, returns `ALREADY_EXISTS`. + * If the corresponding topic doesn't exist, returns `NOT_FOUND`. + * + * If the name is not provided in the request, the server will assign a random + * name for this subscription on the same project as the topic, conforming + * to the [resource name format] + * (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). The + * generated name is populated in the returned Subscription object. Note that + * for REST API requests, you must specify a name in the request. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the subscription. It must have the format + * `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must + * start with a letter, and contain only letters (`[A-Za-z]`), numbers + * (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`), + * plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters + * in length, and it must not start with `"goog"`. + * @param {string} request.topic + * Required. The name of the topic from which this subscription is receiving + * messages. Format is `projects/{project}/topics/{topic}`. The value of this + * field will be `_deleted-topic_` if the topic has been deleted. + * @param {google.pubsub.v1.PushConfig} [request.pushConfig] + * Optional. If push delivery is used with this subscription, this field is + * used to configure it. + * @param {google.pubsub.v1.BigQueryConfig} [request.bigqueryConfig] + * Optional. If delivery to BigQuery is used with this subscription, this + * field is used to configure it. + * @param {google.pubsub.v1.CloudStorageConfig} [request.cloudStorageConfig] + * Optional. If delivery to Google Cloud Storage is used with this + * subscription, this field is used to configure it. + * @param {number} [request.ackDeadlineSeconds] + * Optional. The approximate amount of time (on a best-effort basis) Pub/Sub + * waits for the subscriber to acknowledge receipt before resending the + * message. In the interval after the message is delivered and before it is + * acknowledged, it is considered to be _outstanding_. During that time + * period, the message will not be redelivered (on a best-effort basis). + * + * For pull subscriptions, this value is used as the initial value for the ack + * deadline. To override this value for a given message, call + * `ModifyAckDeadline` with the corresponding `ack_id` if using + * non-streaming pull or send the `ack_id` in a + * `StreamingModifyAckDeadlineRequest` if using streaming pull. + * The minimum custom deadline you can specify is 10 seconds. + * The maximum custom deadline you can specify is 600 seconds (10 minutes). + * If this parameter is 0, a default value of 10 seconds is used. + * + * For push delivery, this value is also used to set the request timeout for + * the call to the push endpoint. + * + * If the subscriber never acknowledges the message, the Pub/Sub + * system will eventually redeliver the message. + * @param {boolean} [request.retainAckedMessages] + * Optional. Indicates whether to retain acknowledged messages. If true, then + * messages are not expunged from the subscription's backlog, even if they are + * acknowledged, until they fall out of the `message_retention_duration` + * window. This must be true if you would like to [`Seek` to a timestamp] + * (https://cloud.google.com/pubsub/docs/replay-overview#seek_to_a_time) in + * the past to replay previously-acknowledged messages. + * @param {google.protobuf.Duration} [request.messageRetentionDuration] + * Optional. How long to retain unacknowledged messages in the subscription's + * backlog, from the moment a message is published. If `retain_acked_messages` + * is true, then this also configures the retention of acknowledged messages, + * and thus configures how far back in time a `Seek` can be done. Defaults to + * 7 days. Cannot be more than 7 days or less than 10 minutes. + * @param {number[]} [request.labels] + * Optional. See [Creating and managing + * labels](https://cloud.google.com/pubsub/docs/labels). + * @param {boolean} [request.enableMessageOrdering] + * Optional. If true, messages published with the same `ordering_key` in + * `PubsubMessage` will be delivered to the subscribers in the order in which + * they are received by the Pub/Sub system. Otherwise, they may be delivered + * in any order. + * @param {google.pubsub.v1.ExpirationPolicy} [request.expirationPolicy] + * Optional. A policy that specifies the conditions for this subscription's + * expiration. A subscription is considered active as long as any connected + * subscriber is successfully consuming messages from the subscription or is + * issuing operations on the subscription. If `expiration_policy` is not set, + * a *default policy* with `ttl` of 31 days will be used. The minimum allowed + * value for `expiration_policy.ttl` is 1 day. If `expiration_policy` is set, + * but `expiration_policy.ttl` is not set, the subscription never expires. + * @param {string} [request.filter] + * Optional. An expression written in the Pub/Sub [filter + * language](https://cloud.google.com/pubsub/docs/filtering). If non-empty, + * then only `PubsubMessage`s whose `attributes` field matches the filter are + * delivered on this subscription. If empty, then no messages are filtered + * out. + * @param {google.pubsub.v1.DeadLetterPolicy} [request.deadLetterPolicy] + * Optional. A policy that specifies the conditions for dead lettering + * messages in this subscription. If dead_letter_policy is not set, dead + * lettering is disabled. + * + * The Pub/Sub service account associated with this subscriptions's + * parent project (i.e., + * service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have + * permission to Acknowledge() messages on this subscription. + * @param {google.pubsub.v1.RetryPolicy} [request.retryPolicy] + * Optional. A policy that specifies how Pub/Sub retries message delivery for + * this subscription. + * + * If not set, the default retry policy is applied. This generally implies + * that messages will be retried as soon as possible for healthy subscribers. + * RetryPolicy will be triggered on NACKs or acknowledgement deadline + * exceeded events for a given message. + * @param {boolean} [request.detached] + * Optional. Indicates whether the subscription is detached from its topic. + * Detached subscriptions don't receive messages from their topic and don't + * retain any backlog. `Pull` and `StreamingPull` requests will return + * FAILED_PRECONDITION. If the subscription is a push subscription, pushes to + * the endpoint will not be made. + * @param {boolean} [request.enableExactlyOnceDelivery] + * Optional. If true, Pub/Sub provides the following guarantees for the + * delivery of a message with a given value of `message_id` on this + * subscription: + * + * * The message sent to a subscriber is guaranteed not to be resent + * before the message's acknowledgement deadline expires. + * * An acknowledged message will not be resent to a subscriber. + * + * Note that subscribers may still receive multiple copies of a message + * when `enable_exactly_once_delivery` is true if the message was published + * multiple times by a publisher client. These copies are considered distinct + * by Pub/Sub and have distinct `message_id` values. + * @param {google.protobuf.Duration} request.topicMessageRetentionDuration + * Output only. Indicates the minimum duration for which a message is retained + * after it is published to the subscription's topic. If this field is set, + * messages published to the subscription's topic in the last + * `topic_message_retention_duration` are always available to subscribers. See + * the `message_retention_duration` field in `Topic`. This field is set only + * in responses from the server; it is ignored if it is set in any requests. + * @param {google.pubsub.v1.Subscription.State} request.state + * Output only. An output-only field indicating whether or not the + * subscription can receive messages. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.pubsub.v1.Subscription|Subscription}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + */ + createSubscription( + request?: protos.google.pubsub.v1.ISubscription, + options?: CallOptions): + Promise<[ + protos.google.pubsub.v1.ISubscription, + protos.google.pubsub.v1.ISubscription|undefined, {}|undefined + ]>; + createSubscription( + request: protos.google.pubsub.v1.ISubscription, + options: CallOptions, + callback: Callback< + protos.google.pubsub.v1.ISubscription, + protos.google.pubsub.v1.ISubscription|null|undefined, + {}|null|undefined>): void; + createSubscription( + request: protos.google.pubsub.v1.ISubscription, + callback: Callback< + protos.google.pubsub.v1.ISubscription, + protos.google.pubsub.v1.ISubscription|null|undefined, + {}|null|undefined>): void; + createSubscription( + request?: protos.google.pubsub.v1.ISubscription, + optionsOrCallback?: CallOptions|Callback< + protos.google.pubsub.v1.ISubscription, + protos.google.pubsub.v1.ISubscription|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.pubsub.v1.ISubscription, + protos.google.pubsub.v1.ISubscription|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.pubsub.v1.ISubscription, + protos.google.pubsub.v1.ISubscription|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.createSubscription(request, options, callback); + } +/** + * Gets the configuration details of a subscription. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.subscription + * Required. The name of the subscription to get. + * Format is `projects/{project}/subscriptions/{sub}`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.pubsub.v1.Subscription|Subscription}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + */ + getSubscription( + request?: protos.google.pubsub.v1.IGetSubscriptionRequest, + options?: CallOptions): + Promise<[ + protos.google.pubsub.v1.ISubscription, + protos.google.pubsub.v1.IGetSubscriptionRequest|undefined, {}|undefined + ]>; + getSubscription( + request: protos.google.pubsub.v1.IGetSubscriptionRequest, + options: CallOptions, + callback: Callback< + protos.google.pubsub.v1.ISubscription, + protos.google.pubsub.v1.IGetSubscriptionRequest|null|undefined, + {}|null|undefined>): void; + getSubscription( + request: protos.google.pubsub.v1.IGetSubscriptionRequest, + callback: Callback< + protos.google.pubsub.v1.ISubscription, + protos.google.pubsub.v1.IGetSubscriptionRequest|null|undefined, + {}|null|undefined>): void; + getSubscription( + request?: protos.google.pubsub.v1.IGetSubscriptionRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.pubsub.v1.ISubscription, + protos.google.pubsub.v1.IGetSubscriptionRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.pubsub.v1.ISubscription, + protos.google.pubsub.v1.IGetSubscriptionRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.pubsub.v1.ISubscription, + protos.google.pubsub.v1.IGetSubscriptionRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'subscription': request.subscription ?? '', + }); + this.initialize(); + return this.innerApiCalls.getSubscription(request, options, callback); + } +/** + * Updates an existing subscription by updating the fields specified in the + * update mask. Note that certain properties of a subscription, such as its + * topic, are not modifiable. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.pubsub.v1.Subscription} request.subscription + * Required. The updated subscription object. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Indicates which fields in the provided subscription to update. + * Must be specified and non-empty. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.pubsub.v1.Subscription|Subscription}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + */ + updateSubscription( + request?: protos.google.pubsub.v1.IUpdateSubscriptionRequest, + options?: CallOptions): + Promise<[ + protos.google.pubsub.v1.ISubscription, + protos.google.pubsub.v1.IUpdateSubscriptionRequest|undefined, {}|undefined + ]>; + updateSubscription( + request: protos.google.pubsub.v1.IUpdateSubscriptionRequest, + options: CallOptions, + callback: Callback< + protos.google.pubsub.v1.ISubscription, + protos.google.pubsub.v1.IUpdateSubscriptionRequest|null|undefined, + {}|null|undefined>): void; + updateSubscription( + request: protos.google.pubsub.v1.IUpdateSubscriptionRequest, + callback: Callback< + protos.google.pubsub.v1.ISubscription, + protos.google.pubsub.v1.IUpdateSubscriptionRequest|null|undefined, + {}|null|undefined>): void; + updateSubscription( + request?: protos.google.pubsub.v1.IUpdateSubscriptionRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.pubsub.v1.ISubscription, + protos.google.pubsub.v1.IUpdateSubscriptionRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.pubsub.v1.ISubscription, + protos.google.pubsub.v1.IUpdateSubscriptionRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.pubsub.v1.ISubscription, + protos.google.pubsub.v1.IUpdateSubscriptionRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'subscription.name': request.subscription!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateSubscription(request, options, callback); + } +/** + * Deletes an existing subscription. All messages retained in the subscription + * are immediately dropped. Calls to `Pull` after deletion will return + * `NOT_FOUND`. After a subscription is deleted, a new one may be created with + * the same name, but the new one has no association with the old + * subscription or its topic unless the same topic is specified. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.subscription + * Required. The subscription to delete. + * Format is `projects/{project}/subscriptions/{sub}`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + */ + deleteSubscription( + request?: protos.google.pubsub.v1.IDeleteSubscriptionRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IDeleteSubscriptionRequest|undefined, {}|undefined + ]>; + deleteSubscription( + request: protos.google.pubsub.v1.IDeleteSubscriptionRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IDeleteSubscriptionRequest|null|undefined, + {}|null|undefined>): void; + deleteSubscription( + request: protos.google.pubsub.v1.IDeleteSubscriptionRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IDeleteSubscriptionRequest|null|undefined, + {}|null|undefined>): void; + deleteSubscription( + request?: protos.google.pubsub.v1.IDeleteSubscriptionRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IDeleteSubscriptionRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IDeleteSubscriptionRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IDeleteSubscriptionRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'subscription': request.subscription ?? '', + }); + this.initialize(); + return this.innerApiCalls.deleteSubscription(request, options, callback); + } +/** + * Modifies the ack deadline for a specific message. This method is useful + * to indicate that more time is needed to process a message by the + * subscriber, or to make the message available for redelivery if the + * processing was interrupted. Note that this does not modify the + * subscription-level `ackDeadlineSeconds` used for subsequent messages. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.subscription + * Required. The name of the subscription. + * Format is `projects/{project}/subscriptions/{sub}`. + * @param {string[]} request.ackIds + * Required. List of acknowledgment IDs. + * @param {number} request.ackDeadlineSeconds + * Required. The new ack deadline with respect to the time this request was + * sent to the Pub/Sub system. For example, if the value is 10, the new ack + * deadline will expire 10 seconds after the `ModifyAckDeadline` call was + * made. Specifying zero might immediately make the message available for + * delivery to another subscriber client. This typically results in an + * increase in the rate of message redeliveries (that is, duplicates). + * The minimum deadline you can specify is 0 seconds. + * The maximum deadline you can specify in a single request is 600 seconds + * (10 minutes). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + */ + modifyAckDeadline( + request?: protos.google.pubsub.v1.IModifyAckDeadlineRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IModifyAckDeadlineRequest|undefined, {}|undefined + ]>; + modifyAckDeadline( + request: protos.google.pubsub.v1.IModifyAckDeadlineRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IModifyAckDeadlineRequest|null|undefined, + {}|null|undefined>): void; + modifyAckDeadline( + request: protos.google.pubsub.v1.IModifyAckDeadlineRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IModifyAckDeadlineRequest|null|undefined, + {}|null|undefined>): void; + modifyAckDeadline( + request?: protos.google.pubsub.v1.IModifyAckDeadlineRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IModifyAckDeadlineRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IModifyAckDeadlineRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IModifyAckDeadlineRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'subscription': request.subscription ?? '', + }); + this.initialize(); + return this.innerApiCalls.modifyAckDeadline(request, options, callback); + } +/** + * Acknowledges the messages associated with the `ack_ids` in the + * `AcknowledgeRequest`. The Pub/Sub system can remove the relevant messages + * from the subscription. + * + * Acknowledging a message whose ack deadline has expired may succeed, + * but such a message may be redelivered later. Acknowledging a message more + * than once will not result in an error. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.subscription + * Required. The subscription whose message is being acknowledged. + * Format is `projects/{project}/subscriptions/{sub}`. + * @param {string[]} request.ackIds + * Required. The acknowledgment ID for the messages being acknowledged that + * was returned by the Pub/Sub system in the `Pull` response. Must not be + * empty. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + */ + acknowledge( + request?: protos.google.pubsub.v1.IAcknowledgeRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IAcknowledgeRequest|undefined, {}|undefined + ]>; + acknowledge( + request: protos.google.pubsub.v1.IAcknowledgeRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IAcknowledgeRequest|null|undefined, + {}|null|undefined>): void; + acknowledge( + request: protos.google.pubsub.v1.IAcknowledgeRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IAcknowledgeRequest|null|undefined, + {}|null|undefined>): void; + acknowledge( + request?: protos.google.pubsub.v1.IAcknowledgeRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IAcknowledgeRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IAcknowledgeRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IAcknowledgeRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'subscription': request.subscription ?? '', + }); + this.initialize(); + return this.innerApiCalls.acknowledge(request, options, callback); + } +/** + * Pulls messages from the server. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.subscription + * Required. The subscription from which messages should be pulled. + * Format is `projects/{project}/subscriptions/{sub}`. + * @param {boolean} [request.returnImmediately] + * Optional. If this field set to true, the system will respond immediately + * even if it there are no messages available to return in the `Pull` + * response. Otherwise, the system may wait (for a bounded amount of time) + * until at least one message is available, rather than returning no messages. + * Warning: setting this field to `true` is discouraged because it adversely + * impacts the performance of `Pull` operations. We recommend that users do + * not set this field. + * @param {number} request.maxMessages + * Required. The maximum number of messages to return for this request. Must + * be a positive integer. The Pub/Sub system may return fewer than the number + * specified. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.pubsub.v1.PullResponse|PullResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + */ + pull( + request?: protos.google.pubsub.v1.IPullRequest, + options?: CallOptions): + Promise<[ + protos.google.pubsub.v1.IPullResponse, + protos.google.pubsub.v1.IPullRequest|undefined, {}|undefined + ]>; + pull( + request: protos.google.pubsub.v1.IPullRequest, + options: CallOptions, + callback: Callback< + protos.google.pubsub.v1.IPullResponse, + protos.google.pubsub.v1.IPullRequest|null|undefined, + {}|null|undefined>): void; + pull( + request: protos.google.pubsub.v1.IPullRequest, + callback: Callback< + protos.google.pubsub.v1.IPullResponse, + protos.google.pubsub.v1.IPullRequest|null|undefined, + {}|null|undefined>): void; + pull( + request?: protos.google.pubsub.v1.IPullRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.pubsub.v1.IPullResponse, + protos.google.pubsub.v1.IPullRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.pubsub.v1.IPullResponse, + protos.google.pubsub.v1.IPullRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.pubsub.v1.IPullResponse, + protos.google.pubsub.v1.IPullRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'subscription': request.subscription ?? '', + }); + this.initialize(); + return this.innerApiCalls.pull(request, options, callback); + } +/** + * Modifies the `PushConfig` for a specified subscription. + * + * This may be used to change a push subscription to a pull one (signified by + * an empty `PushConfig`) or vice versa, or change the endpoint URL and other + * attributes of a push subscription. Messages will accumulate for delivery + * continuously through the call regardless of changes to the `PushConfig`. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.subscription + * Required. The name of the subscription. + * Format is `projects/{project}/subscriptions/{sub}`. + * @param {google.pubsub.v1.PushConfig} request.pushConfig + * Required. The push configuration for future deliveries. + * + * An empty `pushConfig` indicates that the Pub/Sub system should + * stop pushing messages from the given subscription and allow + * messages to be pulled and acknowledged - effectively pausing + * the subscription if `Pull` or `StreamingPull` is not called. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + */ + modifyPushConfig( + request?: protos.google.pubsub.v1.IModifyPushConfigRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IModifyPushConfigRequest|undefined, {}|undefined + ]>; + modifyPushConfig( + request: protos.google.pubsub.v1.IModifyPushConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IModifyPushConfigRequest|null|undefined, + {}|null|undefined>): void; + modifyPushConfig( + request: protos.google.pubsub.v1.IModifyPushConfigRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IModifyPushConfigRequest|null|undefined, + {}|null|undefined>): void; + modifyPushConfig( + request?: protos.google.pubsub.v1.IModifyPushConfigRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IModifyPushConfigRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IModifyPushConfigRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IModifyPushConfigRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'subscription': request.subscription ?? '', + }); + this.initialize(); + return this.innerApiCalls.modifyPushConfig(request, options, callback); + } +/** + * Gets the configuration details of a snapshot. Snapshots are used in + * [Seek](https://cloud.google.com/pubsub/docs/replay-overview) operations, + * which allow you to manage message acknowledgments in bulk. That is, you can + * set the acknowledgment state of messages in an existing subscription to the + * state captured by a snapshot. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.snapshot + * Required. The name of the snapshot to get. + * Format is `projects/{project}/snapshots/{snap}`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.pubsub.v1.Snapshot|Snapshot}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + */ + getSnapshot( + request?: protos.google.pubsub.v1.IGetSnapshotRequest, + options?: CallOptions): + Promise<[ + protos.google.pubsub.v1.ISnapshot, + protos.google.pubsub.v1.IGetSnapshotRequest|undefined, {}|undefined + ]>; + getSnapshot( + request: protos.google.pubsub.v1.IGetSnapshotRequest, + options: CallOptions, + callback: Callback< + protos.google.pubsub.v1.ISnapshot, + protos.google.pubsub.v1.IGetSnapshotRequest|null|undefined, + {}|null|undefined>): void; + getSnapshot( + request: protos.google.pubsub.v1.IGetSnapshotRequest, + callback: Callback< + protos.google.pubsub.v1.ISnapshot, + protos.google.pubsub.v1.IGetSnapshotRequest|null|undefined, + {}|null|undefined>): void; + getSnapshot( + request?: protos.google.pubsub.v1.IGetSnapshotRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.pubsub.v1.ISnapshot, + protos.google.pubsub.v1.IGetSnapshotRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.pubsub.v1.ISnapshot, + protos.google.pubsub.v1.IGetSnapshotRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.pubsub.v1.ISnapshot, + protos.google.pubsub.v1.IGetSnapshotRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'snapshot': request.snapshot ?? '', + }); + this.initialize(); + return this.innerApiCalls.getSnapshot(request, options, callback); + } +/** + * Creates a snapshot from the requested subscription. Snapshots are used in + * [Seek](https://cloud.google.com/pubsub/docs/replay-overview) operations, + * which allow you to manage message acknowledgments in bulk. That is, you can + * set the acknowledgment state of messages in an existing subscription to the + * state captured by a snapshot. + * If the snapshot already exists, returns `ALREADY_EXISTS`. + * If the requested subscription doesn't exist, returns `NOT_FOUND`. + * If the backlog in the subscription is too old -- and the resulting snapshot + * would expire in less than 1 hour -- then `FAILED_PRECONDITION` is returned. + * See also the `Snapshot.expire_time` field. If the name is not provided in + * the request, the server will assign a random + * name for this snapshot on the same project as the subscription, conforming + * to the [resource name format] + * (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). The + * generated name is populated in the returned Snapshot object. Note that for + * REST API requests, you must specify a name in the request. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. User-provided name for this snapshot. If the name is not provided + * in the request, the server will assign a random name for this snapshot on + * the same project as the subscription. Note that for REST API requests, you + * must specify a name. See the [resource name + * rules](https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). + * Format is `projects/{project}/snapshots/{snap}`. + * @param {string} request.subscription + * Required. The subscription whose backlog the snapshot retains. + * Specifically, the created snapshot is guaranteed to retain: + * (a) The existing backlog on the subscription. More precisely, this is + * defined as the messages in the subscription's backlog that are + * unacknowledged upon the successful completion of the + * `CreateSnapshot` request; as well as: + * (b) Any messages published to the subscription's topic following the + * successful completion of the CreateSnapshot request. + * Format is `projects/{project}/subscriptions/{sub}`. + * @param {number[]} [request.labels] + * Optional. See [Creating and managing + * labels](https://cloud.google.com/pubsub/docs/labels). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.pubsub.v1.Snapshot|Snapshot}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + */ + createSnapshot( + request?: protos.google.pubsub.v1.ICreateSnapshotRequest, + options?: CallOptions): + Promise<[ + protos.google.pubsub.v1.ISnapshot, + protos.google.pubsub.v1.ICreateSnapshotRequest|undefined, {}|undefined + ]>; + createSnapshot( + request: protos.google.pubsub.v1.ICreateSnapshotRequest, + options: CallOptions, + callback: Callback< + protos.google.pubsub.v1.ISnapshot, + protos.google.pubsub.v1.ICreateSnapshotRequest|null|undefined, + {}|null|undefined>): void; + createSnapshot( + request: protos.google.pubsub.v1.ICreateSnapshotRequest, + callback: Callback< + protos.google.pubsub.v1.ISnapshot, + protos.google.pubsub.v1.ICreateSnapshotRequest|null|undefined, + {}|null|undefined>): void; + createSnapshot( + request?: protos.google.pubsub.v1.ICreateSnapshotRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.pubsub.v1.ISnapshot, + protos.google.pubsub.v1.ICreateSnapshotRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.pubsub.v1.ISnapshot, + protos.google.pubsub.v1.ICreateSnapshotRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.pubsub.v1.ISnapshot, + protos.google.pubsub.v1.ICreateSnapshotRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.createSnapshot(request, options, callback); + } +/** + * Updates an existing snapshot by updating the fields specified in the update + * mask. Snapshots are used in + * [Seek](https://cloud.google.com/pubsub/docs/replay-overview) operations, + * which allow you to manage message acknowledgments in bulk. That is, you can + * set the acknowledgment state of messages in an existing subscription to the + * state captured by a snapshot. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.pubsub.v1.Snapshot} request.snapshot + * Required. The updated snapshot object. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Indicates which fields in the provided snapshot to update. + * Must be specified and non-empty. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.pubsub.v1.Snapshot|Snapshot}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + */ + updateSnapshot( + request?: protos.google.pubsub.v1.IUpdateSnapshotRequest, + options?: CallOptions): + Promise<[ + protos.google.pubsub.v1.ISnapshot, + protos.google.pubsub.v1.IUpdateSnapshotRequest|undefined, {}|undefined + ]>; + updateSnapshot( + request: protos.google.pubsub.v1.IUpdateSnapshotRequest, + options: CallOptions, + callback: Callback< + protos.google.pubsub.v1.ISnapshot, + protos.google.pubsub.v1.IUpdateSnapshotRequest|null|undefined, + {}|null|undefined>): void; + updateSnapshot( + request: protos.google.pubsub.v1.IUpdateSnapshotRequest, + callback: Callback< + protos.google.pubsub.v1.ISnapshot, + protos.google.pubsub.v1.IUpdateSnapshotRequest|null|undefined, + {}|null|undefined>): void; + updateSnapshot( + request?: protos.google.pubsub.v1.IUpdateSnapshotRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.pubsub.v1.ISnapshot, + protos.google.pubsub.v1.IUpdateSnapshotRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.pubsub.v1.ISnapshot, + protos.google.pubsub.v1.IUpdateSnapshotRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.pubsub.v1.ISnapshot, + protos.google.pubsub.v1.IUpdateSnapshotRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'snapshot.name': request.snapshot!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateSnapshot(request, options, callback); + } +/** + * Removes an existing snapshot. Snapshots are used in [Seek] + * (https://cloud.google.com/pubsub/docs/replay-overview) operations, which + * allow you to manage message acknowledgments in bulk. That is, you can set + * the acknowledgment state of messages in an existing subscription to the + * state captured by a snapshot. + * When the snapshot is deleted, all messages retained in the snapshot + * are immediately dropped. After a snapshot is deleted, a new one may be + * created with the same name, but the new one has no association with the old + * snapshot or its subscription, unless the same subscription is specified. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.snapshot + * Required. The name of the snapshot to delete. + * Format is `projects/{project}/snapshots/{snap}`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + */ + deleteSnapshot( + request?: protos.google.pubsub.v1.IDeleteSnapshotRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IDeleteSnapshotRequest|undefined, {}|undefined + ]>; + deleteSnapshot( + request: protos.google.pubsub.v1.IDeleteSnapshotRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IDeleteSnapshotRequest|null|undefined, + {}|null|undefined>): void; + deleteSnapshot( + request: protos.google.pubsub.v1.IDeleteSnapshotRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IDeleteSnapshotRequest|null|undefined, + {}|null|undefined>): void; + deleteSnapshot( + request?: protos.google.pubsub.v1.IDeleteSnapshotRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IDeleteSnapshotRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IDeleteSnapshotRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IDeleteSnapshotRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'snapshot': request.snapshot ?? '', + }); + this.initialize(); + return this.innerApiCalls.deleteSnapshot(request, options, callback); + } +/** + * Seeks an existing subscription to a point in time or to a given snapshot, + * whichever is provided in the request. Snapshots are used in [Seek] + * (https://cloud.google.com/pubsub/docs/replay-overview) operations, which + * allow you to manage message acknowledgments in bulk. That is, you can set + * the acknowledgment state of messages in an existing subscription to the + * state captured by a snapshot. Note that both the subscription and the + * snapshot must be on the same topic. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.subscription + * Required. The subscription to affect. + * @param {google.protobuf.Timestamp} [request.time] + * Optional. The time to seek to. + * Messages retained in the subscription that were published before this + * time are marked as acknowledged, and messages retained in the + * subscription that were published after this time are marked as + * unacknowledged. Note that this operation affects only those messages + * retained in the subscription (configured by the combination of + * `message_retention_duration` and `retain_acked_messages`). For example, + * if `time` corresponds to a point before the message retention + * window (or to a point before the system's notion of the subscription + * creation time), only retained messages will be marked as unacknowledged, + * and already-expunged messages will not be restored. + * @param {string} [request.snapshot] + * Optional. The snapshot to seek to. The snapshot's topic must be the same + * as that of the provided subscription. Format is + * `projects/{project}/snapshots/{snap}`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.pubsub.v1.SeekResponse|SeekResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + */ + seek( + request?: protos.google.pubsub.v1.ISeekRequest, + options?: CallOptions): + Promise<[ + protos.google.pubsub.v1.ISeekResponse, + protos.google.pubsub.v1.ISeekRequest|undefined, {}|undefined + ]>; + seek( + request: protos.google.pubsub.v1.ISeekRequest, + options: CallOptions, + callback: Callback< + protos.google.pubsub.v1.ISeekResponse, + protos.google.pubsub.v1.ISeekRequest|null|undefined, + {}|null|undefined>): void; + seek( + request: protos.google.pubsub.v1.ISeekRequest, + callback: Callback< + protos.google.pubsub.v1.ISeekResponse, + protos.google.pubsub.v1.ISeekRequest|null|undefined, + {}|null|undefined>): void; + seek( + request?: protos.google.pubsub.v1.ISeekRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.pubsub.v1.ISeekResponse, + protos.google.pubsub.v1.ISeekRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.pubsub.v1.ISeekResponse, + protos.google.pubsub.v1.ISeekRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.pubsub.v1.ISeekResponse, + protos.google.pubsub.v1.ISeekRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'subscription': request.subscription ?? '', + }); + this.initialize(); + return this.innerApiCalls.seek(request, options, callback); + } + +/** + * Establishes a stream with the server, which sends messages down to the + * client. The client streams acknowledgements and ack deadline modifications + * back to the server. The server will close the stream and return the status + * on any error. The server may close the stream with status `UNAVAILABLE` to + * reassign server-side resources, in which case, the client should + * re-establish the stream. Flow control can be achieved by configuring the + * underlying RPC channel. + * + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which is both readable and writable. It accepts objects + * representing {@link protos.google.pubsub.v1.StreamingPullRequest|StreamingPullRequest} for write() method, and + * will emit objects representing {@link protos.google.pubsub.v1.StreamingPullResponse|StreamingPullResponse} on 'data' event asynchronously. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#bi-directional-streaming | documentation } + * for more details and examples. + */ + streamingPull( + options?: CallOptions): + gax.CancellableStream { + this.initialize(); + return this.innerApiCalls.streamingPull(null, options); + } + + /** + * Lists matching subscriptions. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Required. The name of the project in which to list subscriptions. + * Format is `projects/{project-id}`. + * @param {number} [request.pageSize] + * Optional. Maximum number of subscriptions to return. + * @param {string} [request.pageToken] + * Optional. The value returned by the last `ListSubscriptionsResponse`; + * indicates that this is a continuation of a prior `ListSubscriptions` call, + * and that the system should return the next page of data. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.pubsub.v1.Subscription|Subscription}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listSubscriptionsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listSubscriptions( + request?: protos.google.pubsub.v1.IListSubscriptionsRequest, + options?: CallOptions): + Promise<[ + protos.google.pubsub.v1.ISubscription[], + protos.google.pubsub.v1.IListSubscriptionsRequest|null, + protos.google.pubsub.v1.IListSubscriptionsResponse + ]>; + listSubscriptions( + request: protos.google.pubsub.v1.IListSubscriptionsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.pubsub.v1.IListSubscriptionsRequest, + protos.google.pubsub.v1.IListSubscriptionsResponse|null|undefined, + protos.google.pubsub.v1.ISubscription>): void; + listSubscriptions( + request: protos.google.pubsub.v1.IListSubscriptionsRequest, + callback: PaginationCallback< + protos.google.pubsub.v1.IListSubscriptionsRequest, + protos.google.pubsub.v1.IListSubscriptionsResponse|null|undefined, + protos.google.pubsub.v1.ISubscription>): void; + listSubscriptions( + request?: protos.google.pubsub.v1.IListSubscriptionsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.pubsub.v1.IListSubscriptionsRequest, + protos.google.pubsub.v1.IListSubscriptionsResponse|null|undefined, + protos.google.pubsub.v1.ISubscription>, + callback?: PaginationCallback< + protos.google.pubsub.v1.IListSubscriptionsRequest, + protos.google.pubsub.v1.IListSubscriptionsResponse|null|undefined, + protos.google.pubsub.v1.ISubscription>): + Promise<[ + protos.google.pubsub.v1.ISubscription[], + protos.google.pubsub.v1.IListSubscriptionsRequest|null, + protos.google.pubsub.v1.IListSubscriptionsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'project': request.project ?? '', + }); + this.initialize(); + return this.innerApiCalls.listSubscriptions(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Required. The name of the project in which to list subscriptions. + * Format is `projects/{project-id}`. + * @param {number} [request.pageSize] + * Optional. Maximum number of subscriptions to return. + * @param {string} [request.pageToken] + * Optional. The value returned by the last `ListSubscriptionsResponse`; + * indicates that this is a continuation of a prior `ListSubscriptions` call, + * and that the system should return the next page of data. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.pubsub.v1.Subscription|Subscription} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listSubscriptionsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listSubscriptionsStream( + request?: protos.google.pubsub.v1.IListSubscriptionsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'project': request.project ?? '', + }); + const defaultCallSettings = this._defaults['listSubscriptions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listSubscriptions.createStream( + this.innerApiCalls.listSubscriptions as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listSubscriptions`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Required. The name of the project in which to list subscriptions. + * Format is `projects/{project-id}`. + * @param {number} [request.pageSize] + * Optional. Maximum number of subscriptions to return. + * @param {string} [request.pageToken] + * Optional. The value returned by the last `ListSubscriptionsResponse`; + * indicates that this is a continuation of a prior `ListSubscriptions` call, + * and that the system should return the next page of data. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.pubsub.v1.Subscription|Subscription}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listSubscriptionsAsync( + request?: protos.google.pubsub.v1.IListSubscriptionsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'project': request.project ?? '', + }); + const defaultCallSettings = this._defaults['listSubscriptions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listSubscriptions.asyncIterate( + this.innerApiCalls['listSubscriptions'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists the existing snapshots. Snapshots are used in [Seek]( + * https://cloud.google.com/pubsub/docs/replay-overview) operations, which + * allow you to manage message acknowledgments in bulk. That is, you can set + * the acknowledgment state of messages in an existing subscription to the + * state captured by a snapshot. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Required. The name of the project in which to list snapshots. + * Format is `projects/{project-id}`. + * @param {number} [request.pageSize] + * Optional. Maximum number of snapshots to return. + * @param {string} [request.pageToken] + * Optional. The value returned by the last `ListSnapshotsResponse`; indicates + * that this is a continuation of a prior `ListSnapshots` call, and that the + * system should return the next page of data. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.pubsub.v1.Snapshot|Snapshot}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listSnapshotsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listSnapshots( + request?: protos.google.pubsub.v1.IListSnapshotsRequest, + options?: CallOptions): + Promise<[ + protos.google.pubsub.v1.ISnapshot[], + protos.google.pubsub.v1.IListSnapshotsRequest|null, + protos.google.pubsub.v1.IListSnapshotsResponse + ]>; + listSnapshots( + request: protos.google.pubsub.v1.IListSnapshotsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.pubsub.v1.IListSnapshotsRequest, + protos.google.pubsub.v1.IListSnapshotsResponse|null|undefined, + protos.google.pubsub.v1.ISnapshot>): void; + listSnapshots( + request: protos.google.pubsub.v1.IListSnapshotsRequest, + callback: PaginationCallback< + protos.google.pubsub.v1.IListSnapshotsRequest, + protos.google.pubsub.v1.IListSnapshotsResponse|null|undefined, + protos.google.pubsub.v1.ISnapshot>): void; + listSnapshots( + request?: protos.google.pubsub.v1.IListSnapshotsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.pubsub.v1.IListSnapshotsRequest, + protos.google.pubsub.v1.IListSnapshotsResponse|null|undefined, + protos.google.pubsub.v1.ISnapshot>, + callback?: PaginationCallback< + protos.google.pubsub.v1.IListSnapshotsRequest, + protos.google.pubsub.v1.IListSnapshotsResponse|null|undefined, + protos.google.pubsub.v1.ISnapshot>): + Promise<[ + protos.google.pubsub.v1.ISnapshot[], + protos.google.pubsub.v1.IListSnapshotsRequest|null, + protos.google.pubsub.v1.IListSnapshotsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'project': request.project ?? '', + }); + this.initialize(); + return this.innerApiCalls.listSnapshots(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Required. The name of the project in which to list snapshots. + * Format is `projects/{project-id}`. + * @param {number} [request.pageSize] + * Optional. Maximum number of snapshots to return. + * @param {string} [request.pageToken] + * Optional. The value returned by the last `ListSnapshotsResponse`; indicates + * that this is a continuation of a prior `ListSnapshots` call, and that the + * system should return the next page of data. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.pubsub.v1.Snapshot|Snapshot} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listSnapshotsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listSnapshotsStream( + request?: protos.google.pubsub.v1.IListSnapshotsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'project': request.project ?? '', + }); + const defaultCallSettings = this._defaults['listSnapshots']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listSnapshots.createStream( + this.innerApiCalls.listSnapshots as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listSnapshots`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Required. The name of the project in which to list snapshots. + * Format is `projects/{project-id}`. + * @param {number} [request.pageSize] + * Optional. Maximum number of snapshots to return. + * @param {string} [request.pageToken] + * Optional. The value returned by the last `ListSnapshotsResponse`; indicates + * that this is a continuation of a prior `ListSnapshots` call, and that the + * system should return the next page of data. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.pubsub.v1.Snapshot|Snapshot}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listSnapshotsAsync( + request?: protos.google.pubsub.v1.IListSnapshotsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'project': request.project ?? '', + }); + const defaultCallSettings = this._defaults['listSnapshots']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listSnapshots.asyncIterate( + this.innerApiCalls['listSnapshots'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } +/** + * Gets the access control policy for a resource. Returns an empty policy + * if the resource exists and does not have a policy set. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {Object} [request.options] + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. This field is only used by Cloud IAM. + * + * This object should have the same structure as {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing {@link google.iam.v1.Policy | Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.Policy | Policy}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getIamPolicy( + request: IamProtos.google.iam.v1.GetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ):Promise<[IamProtos.google.iam.v1.Policy]> { + return this.iamClient.getIamPolicy(request, options, callback); + } + +/** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + setIamPolicy( + request: IamProtos.google.iam.v1.SetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ):Promise<[IamProtos.google.iam.v1.Policy]> { + return this.iamClient.setIamPolicy(request, options, callback); + } + +/** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + */ + testIamPermissions( + request: IamProtos.google.iam.v1.TestIamPermissionsRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ):Promise<[IamProtos.google.iam.v1.TestIamPermissionsResponse]> { + return this.iamClient.testIamPermissions(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project:string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified projectTopic resource name string. + * + * @param {string} project + * @param {string} topic + * @returns {string} Resource name string. + */ + projectTopicPath(project:string,topic:string) { + return this.pathTemplates.projectTopicPathTemplate.render({ + project: project, + topic: topic, + }); + } + + /** + * Parse the project from ProjectTopic resource. + * + * @param {string} projectTopicName + * A fully-qualified path representing project_topic resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectTopicName(projectTopicName: string) { + return this.pathTemplates.projectTopicPathTemplate.match(projectTopicName).project; + } + + /** + * Parse the topic from ProjectTopic resource. + * + * @param {string} projectTopicName + * A fully-qualified path representing project_topic resource. + * @returns {string} A string representing the topic. + */ + matchTopicFromProjectTopicName(projectTopicName: string) { + return this.pathTemplates.projectTopicPathTemplate.match(projectTopicName).topic; + } + + /** + * Return a fully-qualified schema resource name string. + * + * @param {string} project + * @param {string} schema + * @returns {string} Resource name string. + */ + schemaPath(project:string,schema:string) { + return this.pathTemplates.schemaPathTemplate.render({ + project: project, + schema: schema, + }); + } + + /** + * Parse the project from Schema resource. + * + * @param {string} schemaName + * A fully-qualified path representing Schema resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSchemaName(schemaName: string) { + return this.pathTemplates.schemaPathTemplate.match(schemaName).project; + } + + /** + * Parse the schema from Schema resource. + * + * @param {string} schemaName + * A fully-qualified path representing Schema resource. + * @returns {string} A string representing the schema. + */ + matchSchemaFromSchemaName(schemaName: string) { + return this.pathTemplates.schemaPathTemplate.match(schemaName).schema; + } + + /** + * Return a fully-qualified snapshot resource name string. + * + * @param {string} project + * @param {string} snapshot + * @returns {string} Resource name string. + */ + snapshotPath(project:string,snapshot:string) { + return this.pathTemplates.snapshotPathTemplate.render({ + project: project, + snapshot: snapshot, + }); + } + + /** + * Parse the project from Snapshot resource. + * + * @param {string} snapshotName + * A fully-qualified path representing Snapshot resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSnapshotName(snapshotName: string) { + return this.pathTemplates.snapshotPathTemplate.match(snapshotName).project; + } + + /** + * Parse the snapshot from Snapshot resource. + * + * @param {string} snapshotName + * A fully-qualified path representing Snapshot resource. + * @returns {string} A string representing the snapshot. + */ + matchSnapshotFromSnapshotName(snapshotName: string) { + return this.pathTemplates.snapshotPathTemplate.match(snapshotName).snapshot; + } + + /** + * Return a fully-qualified subscription resource name string. + * + * @param {string} project + * @param {string} subscription + * @returns {string} Resource name string. + */ + subscriptionPath(project:string,subscription:string) { + return this.pathTemplates.subscriptionPathTemplate.render({ + project: project, + subscription: subscription, + }); + } + + /** + * Parse the project from Subscription resource. + * + * @param {string} subscriptionName + * A fully-qualified path representing Subscription resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSubscriptionName(subscriptionName: string) { + return this.pathTemplates.subscriptionPathTemplate.match(subscriptionName).project; + } + + /** + * Parse the subscription from Subscription resource. + * + * @param {string} subscriptionName + * A fully-qualified path representing Subscription resource. + * @returns {string} A string representing the subscription. + */ + matchSubscriptionFromSubscriptionName(subscriptionName: string) { + return this.pathTemplates.subscriptionPathTemplate.match(subscriptionName).subscription; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.subscriberStub && !this._terminated) { + return this.subscriberStub.then(stub => { + this._terminated = true; + stub.close(); + this.iamClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/v1/src/v1/subscriber_client_config.json b/owl-bot-staging/v1/src/v1/subscriber_client_config.json new file mode 100644 index 000000000..a549d3010 --- /dev/null +++ b/owl-bot-staging/v1/src/v1/subscriber_client_config.json @@ -0,0 +1,136 @@ +{ + "interfaces": { + "google.pubsub.v1.Subscriber": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "unknown_aborted_unavailable": [ + "UNKNOWN", + "ABORTED", + "UNAVAILABLE" + ], + "unavailable": [ + "UNAVAILABLE" + ], + "unknown_aborted_internal_unavailable": [ + "UNKNOWN", + "ABORTED", + "INTERNAL", + "UNAVAILABLE" + ], + "deadline_exceeded_resource_exhausted_aborted_internal_unavailable": [ + "DEADLINE_EXCEEDED", + "RESOURCE_EXHAUSTED", + "ABORTED", + "INTERNAL", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + }, + "693222d32e887d96c8faeadca469f7763ccda85a": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 4, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "CreateSubscription": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_aborted_unavailable", + "retry_params_name": "default" + }, + "GetSubscription": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_aborted_unavailable", + "retry_params_name": "default" + }, + "UpdateSubscription": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "ListSubscriptions": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_aborted_unavailable", + "retry_params_name": "default" + }, + "DeleteSubscription": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "ModifyAckDeadline": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "Acknowledge": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "Pull": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_aborted_internal_unavailable", + "retry_params_name": "default" + }, + "StreamingPull": { + "timeout_millis": 900000, + "retry_codes_name": "deadline_exceeded_resource_exhausted_aborted_internal_unavailable", + "retry_params_name": "693222d32e887d96c8faeadca469f7763ccda85a" + }, + "ModifyPushConfig": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "GetSnapshot": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_aborted_unavailable", + "retry_params_name": "default" + }, + "ListSnapshots": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_aborted_unavailable", + "retry_params_name": "default" + }, + "CreateSnapshot": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "UpdateSnapshot": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "DeleteSnapshot": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "Seek": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_aborted_unavailable", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/v1/src/v1/subscriber_proto_list.json b/owl-bot-staging/v1/src/v1/subscriber_proto_list.json new file mode 100644 index 000000000..91011aec1 --- /dev/null +++ b/owl-bot-staging/v1/src/v1/subscriber_proto_list.json @@ -0,0 +1,4 @@ +[ + "../../protos/google/pubsub/v1/pubsub.proto", + "../../protos/google/pubsub/v1/schema.proto" +] diff --git a/owl-bot-staging/v1/test/gapic_publisher_v1.ts b/owl-bot-staging/v1/test/gapic_publisher_v1.ts new file mode 100644 index 000000000..7510cebe7 --- /dev/null +++ b/owl-bot-staging/v1/test/gapic_publisher_v1.ts @@ -0,0 +1,2077 @@ +// 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as publisherModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, IamProtos} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message) + .toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { + return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); +} + +function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { mockStream.write({}); }); + } + setImmediate(() => { mockStream.end(); }); + } else { + setImmediate(() => { mockStream.write({}); }); + setImmediate(() => { mockStream.end(); }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + } + }; + } + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1.PublisherClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new publisherModule.v1.PublisherClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'pubsub.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new publisherModule.v1.PublisherClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, "googleapis.com"); + }); + + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = publisherModule.v1.PublisherClient.servicePath; + assert.strictEqual(servicePath, 'pubsub.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = publisherModule.v1.PublisherClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'pubsub.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new publisherModule.v1.PublisherClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'pubsub.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new publisherModule.v1.PublisherClient({universe_domain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'pubsub.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new publisherModule.v1.PublisherClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'pubsub.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new publisherModule.v1.PublisherClient({universeDomain: 'configured.example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'pubsub.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { new publisherModule.v1.PublisherClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = publisherModule.v1.PublisherClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new publisherModule.v1.PublisherClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new publisherModule.v1.PublisherClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.publisherStub, undefined); + await client.initialize(); + assert(client.publisherStub); + }); + + it('has close method for the initialized client', done => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.publisherStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.publisherStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error|null, projectId?: string|null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + }); + + describe('createTopic', () => { + it('invokes createTopic without error', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.Topic() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.Topic', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.pubsub.v1.Topic() + ); + client.innerApiCalls.createTopic = stubSimpleCall(expectedResponse); + const [response] = await client.createTopic(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createTopic as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createTopic as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createTopic without error using callback', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.Topic() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.Topic', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.pubsub.v1.Topic() + ); + client.innerApiCalls.createTopic = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createTopic( + request, + (err?: Error|null, result?: protos.google.pubsub.v1.ITopic|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createTopic as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createTopic as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createTopic with error', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.Topic() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.Topic', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createTopic = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createTopic(request), expectedError); + const actualRequest = (client.innerApiCalls.createTopic as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createTopic as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createTopic with closed client', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.Topic() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.Topic', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createTopic(request), expectedError); + }); + }); + + describe('updateTopic', () => { + it('invokes updateTopic without error', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.UpdateTopicRequest() + ); + request.topic ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.UpdateTopicRequest', ['topic', 'name']); + request.topic.name = defaultValue1; + const expectedHeaderRequestParams = `topic.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.pubsub.v1.Topic() + ); + client.innerApiCalls.updateTopic = stubSimpleCall(expectedResponse); + const [response] = await client.updateTopic(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateTopic as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateTopic as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateTopic without error using callback', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.UpdateTopicRequest() + ); + request.topic ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.UpdateTopicRequest', ['topic', 'name']); + request.topic.name = defaultValue1; + const expectedHeaderRequestParams = `topic.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.pubsub.v1.Topic() + ); + client.innerApiCalls.updateTopic = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateTopic( + request, + (err?: Error|null, result?: protos.google.pubsub.v1.ITopic|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateTopic as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateTopic as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateTopic with error', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.UpdateTopicRequest() + ); + request.topic ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.UpdateTopicRequest', ['topic', 'name']); + request.topic.name = defaultValue1; + const expectedHeaderRequestParams = `topic.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateTopic = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateTopic(request), expectedError); + const actualRequest = (client.innerApiCalls.updateTopic as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateTopic as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateTopic with closed client', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.UpdateTopicRequest() + ); + request.topic ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.UpdateTopicRequest', ['topic', 'name']); + request.topic.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateTopic(request), expectedError); + }); + }); + + describe('publish', () => { + it('invokes publish without error', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.PublishRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.PublishRequest', ['topic']); + request.topic = defaultValue1; + const expectedHeaderRequestParams = `topic=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.pubsub.v1.PublishResponse() + ); + client.innerApiCalls.publish = stubSimpleCall(expectedResponse); + const [response] = await client.publish(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.publish as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.publish as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes publish without error using callback', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.PublishRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.PublishRequest', ['topic']); + request.topic = defaultValue1; + const expectedHeaderRequestParams = `topic=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.pubsub.v1.PublishResponse() + ); + client.innerApiCalls.publish = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.publish( + request, + (err?: Error|null, result?: protos.google.pubsub.v1.IPublishResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.publish as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.publish as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes publish with error', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.PublishRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.PublishRequest', ['topic']); + request.topic = defaultValue1; + const expectedHeaderRequestParams = `topic=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.publish = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.publish(request), expectedError); + const actualRequest = (client.innerApiCalls.publish as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.publish as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes publish with closed client', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.PublishRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.PublishRequest', ['topic']); + request.topic = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.publish(request), expectedError); + }); + }); + + describe('getTopic', () => { + it('invokes getTopic without error', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.GetTopicRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.GetTopicRequest', ['topic']); + request.topic = defaultValue1; + const expectedHeaderRequestParams = `topic=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.pubsub.v1.Topic() + ); + client.innerApiCalls.getTopic = stubSimpleCall(expectedResponse); + const [response] = await client.getTopic(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getTopic as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getTopic as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTopic without error using callback', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.GetTopicRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.GetTopicRequest', ['topic']); + request.topic = defaultValue1; + const expectedHeaderRequestParams = `topic=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.pubsub.v1.Topic() + ); + client.innerApiCalls.getTopic = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getTopic( + request, + (err?: Error|null, result?: protos.google.pubsub.v1.ITopic|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getTopic as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getTopic as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTopic with error', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.GetTopicRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.GetTopicRequest', ['topic']); + request.topic = defaultValue1; + const expectedHeaderRequestParams = `topic=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getTopic = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getTopic(request), expectedError); + const actualRequest = (client.innerApiCalls.getTopic as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getTopic as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTopic with closed client', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.GetTopicRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.GetTopicRequest', ['topic']); + request.topic = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getTopic(request), expectedError); + }); + }); + + describe('deleteTopic', () => { + it('invokes deleteTopic without error', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.DeleteTopicRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.DeleteTopicRequest', ['topic']); + request.topic = defaultValue1; + const expectedHeaderRequestParams = `topic=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteTopic = stubSimpleCall(expectedResponse); + const [response] = await client.deleteTopic(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteTopic as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteTopic as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteTopic without error using callback', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.DeleteTopicRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.DeleteTopicRequest', ['topic']); + request.topic = defaultValue1; + const expectedHeaderRequestParams = `topic=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteTopic = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteTopic( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteTopic as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteTopic as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteTopic with error', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.DeleteTopicRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.DeleteTopicRequest', ['topic']); + request.topic = defaultValue1; + const expectedHeaderRequestParams = `topic=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteTopic = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteTopic(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteTopic as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteTopic as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteTopic with closed client', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.DeleteTopicRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.DeleteTopicRequest', ['topic']); + request.topic = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteTopic(request), expectedError); + }); + }); + + describe('detachSubscription', () => { + it('invokes detachSubscription without error', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.DetachSubscriptionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.DetachSubscriptionRequest', ['subscription']); + request.subscription = defaultValue1; + const expectedHeaderRequestParams = `subscription=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.pubsub.v1.DetachSubscriptionResponse() + ); + client.innerApiCalls.detachSubscription = stubSimpleCall(expectedResponse); + const [response] = await client.detachSubscription(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.detachSubscription as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.detachSubscription as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes detachSubscription without error using callback', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.DetachSubscriptionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.DetachSubscriptionRequest', ['subscription']); + request.subscription = defaultValue1; + const expectedHeaderRequestParams = `subscription=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.pubsub.v1.DetachSubscriptionResponse() + ); + client.innerApiCalls.detachSubscription = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.detachSubscription( + request, + (err?: Error|null, result?: protos.google.pubsub.v1.IDetachSubscriptionResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.detachSubscription as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.detachSubscription as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes detachSubscription with error', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.DetachSubscriptionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.DetachSubscriptionRequest', ['subscription']); + request.subscription = defaultValue1; + const expectedHeaderRequestParams = `subscription=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.detachSubscription = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.detachSubscription(request), expectedError); + const actualRequest = (client.innerApiCalls.detachSubscription as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.detachSubscription as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes detachSubscription with closed client', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.DetachSubscriptionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.DetachSubscriptionRequest', ['subscription']); + request.subscription = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.detachSubscription(request), expectedError); + }); + }); + + describe('listTopics', () => { + it('invokes listTopics without error', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListTopicsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.ListTopicsRequest', ['project']); + request.project = defaultValue1; + const expectedHeaderRequestParams = `project=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.pubsub.v1.Topic()), + generateSampleMessage(new protos.google.pubsub.v1.Topic()), + generateSampleMessage(new protos.google.pubsub.v1.Topic()), + ]; + client.innerApiCalls.listTopics = stubSimpleCall(expectedResponse); + const [response] = await client.listTopics(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listTopics as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listTopics as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTopics without error using callback', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListTopicsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.ListTopicsRequest', ['project']); + request.project = defaultValue1; + const expectedHeaderRequestParams = `project=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.pubsub.v1.Topic()), + generateSampleMessage(new protos.google.pubsub.v1.Topic()), + generateSampleMessage(new protos.google.pubsub.v1.Topic()), + ]; + client.innerApiCalls.listTopics = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listTopics( + request, + (err?: Error|null, result?: protos.google.pubsub.v1.ITopic[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listTopics as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listTopics as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTopics with error', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListTopicsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.ListTopicsRequest', ['project']); + request.project = defaultValue1; + const expectedHeaderRequestParams = `project=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listTopics = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listTopics(request), expectedError); + const actualRequest = (client.innerApiCalls.listTopics as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listTopics as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTopicsStream without error', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListTopicsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.ListTopicsRequest', ['project']); + request.project = defaultValue1; + const expectedHeaderRequestParams = `project=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.pubsub.v1.Topic()), + generateSampleMessage(new protos.google.pubsub.v1.Topic()), + generateSampleMessage(new protos.google.pubsub.v1.Topic()), + ]; + client.descriptors.page.listTopics.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listTopicsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.pubsub.v1.Topic[] = []; + stream.on('data', (response: protos.google.pubsub.v1.Topic) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listTopics.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listTopics, request)); + assert( + (client.descriptors.page.listTopics.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listTopicsStream with error', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListTopicsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.ListTopicsRequest', ['project']); + request.project = defaultValue1; + const expectedHeaderRequestParams = `project=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listTopics.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listTopicsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.pubsub.v1.Topic[] = []; + stream.on('data', (response: protos.google.pubsub.v1.Topic) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listTopics.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listTopics, request)); + assert( + (client.descriptors.page.listTopics.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listTopics without error', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListTopicsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.ListTopicsRequest', ['project']); + request.project = defaultValue1; + const expectedHeaderRequestParams = `project=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.pubsub.v1.Topic()), + generateSampleMessage(new protos.google.pubsub.v1.Topic()), + generateSampleMessage(new protos.google.pubsub.v1.Topic()), + ]; + client.descriptors.page.listTopics.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.pubsub.v1.ITopic[] = []; + const iterable = client.listTopicsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listTopics.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listTopics.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listTopics with error', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListTopicsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.ListTopicsRequest', ['project']); + request.project = defaultValue1; + const expectedHeaderRequestParams = `project=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listTopics.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listTopicsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.pubsub.v1.ITopic[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listTopics.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listTopics.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listTopicSubscriptions', () => { + it('invokes listTopicSubscriptions without error', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListTopicSubscriptionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.ListTopicSubscriptionsRequest', ['topic']); + request.topic = defaultValue1; + const expectedHeaderRequestParams = `topic=${defaultValue1}`;const expectedResponse = [new String(), new String(), new String()]; + client.innerApiCalls.listTopicSubscriptions = stubSimpleCall(expectedResponse); + const [response] = await client.listTopicSubscriptions(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listTopicSubscriptions as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listTopicSubscriptions as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTopicSubscriptions without error using callback', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListTopicSubscriptionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.ListTopicSubscriptionsRequest', ['topic']); + request.topic = defaultValue1; + const expectedHeaderRequestParams = `topic=${defaultValue1}`;const expectedResponse = [new String(), new String(), new String()]; + client.innerApiCalls.listTopicSubscriptions = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listTopicSubscriptions( + request, + (err?: Error|null, result?: string[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listTopicSubscriptions as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listTopicSubscriptions as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTopicSubscriptions with error', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListTopicSubscriptionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.ListTopicSubscriptionsRequest', ['topic']); + request.topic = defaultValue1; + const expectedHeaderRequestParams = `topic=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listTopicSubscriptions = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listTopicSubscriptions(request), expectedError); + const actualRequest = (client.innerApiCalls.listTopicSubscriptions as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listTopicSubscriptions as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTopicSubscriptionsStream without error', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListTopicSubscriptionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.ListTopicSubscriptionsRequest', ['topic']); + request.topic = defaultValue1; + const expectedHeaderRequestParams = `topic=${defaultValue1}`; + const expectedResponse = [new String(), new String(), new String()]; + client.descriptors.page.listTopicSubscriptions.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listTopicSubscriptionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: string[] = []; + stream.on('data', (response: string) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listTopicSubscriptions.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listTopicSubscriptions, request)); + assert( + (client.descriptors.page.listTopicSubscriptions.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listTopicSubscriptionsStream with error', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListTopicSubscriptionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.ListTopicSubscriptionsRequest', ['topic']); + request.topic = defaultValue1; + const expectedHeaderRequestParams = `topic=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listTopicSubscriptions.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listTopicSubscriptionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: string[] = []; + stream.on('data', (response: string) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listTopicSubscriptions.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listTopicSubscriptions, request)); + assert( + (client.descriptors.page.listTopicSubscriptions.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listTopicSubscriptions without error', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListTopicSubscriptionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.ListTopicSubscriptionsRequest', ['topic']); + request.topic = defaultValue1; + const expectedHeaderRequestParams = `topic=${defaultValue1}`; + const expectedResponse = [new String(), new String(), new String()]; + client.descriptors.page.listTopicSubscriptions.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: string[] = []; + const iterable = client.listTopicSubscriptionsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listTopicSubscriptions.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listTopicSubscriptions.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listTopicSubscriptions with error', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListTopicSubscriptionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.ListTopicSubscriptionsRequest', ['topic']); + request.topic = defaultValue1; + const expectedHeaderRequestParams = `topic=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listTopicSubscriptions.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listTopicSubscriptionsAsync(request); + await assert.rejects(async () => { + const responses: string[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listTopicSubscriptions.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listTopicSubscriptions.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listTopicSnapshots', () => { + it('invokes listTopicSnapshots without error', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListTopicSnapshotsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.ListTopicSnapshotsRequest', ['topic']); + request.topic = defaultValue1; + const expectedHeaderRequestParams = `topic=${defaultValue1}`;const expectedResponse = [new String(), new String(), new String()]; + client.innerApiCalls.listTopicSnapshots = stubSimpleCall(expectedResponse); + const [response] = await client.listTopicSnapshots(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listTopicSnapshots as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listTopicSnapshots as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTopicSnapshots without error using callback', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListTopicSnapshotsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.ListTopicSnapshotsRequest', ['topic']); + request.topic = defaultValue1; + const expectedHeaderRequestParams = `topic=${defaultValue1}`;const expectedResponse = [new String(), new String(), new String()]; + client.innerApiCalls.listTopicSnapshots = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listTopicSnapshots( + request, + (err?: Error|null, result?: string[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listTopicSnapshots as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listTopicSnapshots as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTopicSnapshots with error', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListTopicSnapshotsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.ListTopicSnapshotsRequest', ['topic']); + request.topic = defaultValue1; + const expectedHeaderRequestParams = `topic=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listTopicSnapshots = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listTopicSnapshots(request), expectedError); + const actualRequest = (client.innerApiCalls.listTopicSnapshots as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listTopicSnapshots as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTopicSnapshotsStream without error', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListTopicSnapshotsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.ListTopicSnapshotsRequest', ['topic']); + request.topic = defaultValue1; + const expectedHeaderRequestParams = `topic=${defaultValue1}`; + const expectedResponse = [new String(), new String(), new String()]; + client.descriptors.page.listTopicSnapshots.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listTopicSnapshotsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: string[] = []; + stream.on('data', (response: string) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listTopicSnapshots.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listTopicSnapshots, request)); + assert( + (client.descriptors.page.listTopicSnapshots.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listTopicSnapshotsStream with error', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListTopicSnapshotsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.ListTopicSnapshotsRequest', ['topic']); + request.topic = defaultValue1; + const expectedHeaderRequestParams = `topic=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listTopicSnapshots.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listTopicSnapshotsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: string[] = []; + stream.on('data', (response: string) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listTopicSnapshots.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listTopicSnapshots, request)); + assert( + (client.descriptors.page.listTopicSnapshots.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listTopicSnapshots without error', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListTopicSnapshotsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.ListTopicSnapshotsRequest', ['topic']); + request.topic = defaultValue1; + const expectedHeaderRequestParams = `topic=${defaultValue1}`; + const expectedResponse = [new String(), new String(), new String()]; + client.descriptors.page.listTopicSnapshots.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: string[] = []; + const iterable = client.listTopicSnapshotsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listTopicSnapshots.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listTopicSnapshots.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listTopicSnapshots with error', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListTopicSnapshotsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.ListTopicSnapshotsRequest', ['topic']); + request.topic = defaultValue1; + const expectedHeaderRequestParams = `topic=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listTopicSnapshots.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listTopicSnapshotsAsync(request); + await assert.rejects(async () => { + const responses: string[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listTopicSnapshots.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listTopicSnapshots.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.getIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getIamPolicy without error using callback', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIamPolicy( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0)); + }); + it('invokes getIamPolicy with error', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getIamPolicy(request, expectedOptions), expectedError); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.setIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes setIamPolicy without error using callback', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setIamPolicy( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0)); + }); + it('invokes setIamPolicy with error', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setIamPolicy(request, expectedOptions), expectedError); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); + const response = await client.testIamPermissions(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes testIamPermissions without error using callback', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.TestIamPermissionsResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0)); + }); + it('invokes testIamPermissions with error', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.testIamPermissions = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.testIamPermissions(request, expectedOptions), expectedError); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + + describe('Path templates', () => { + + describe('project', () => { + const fakePath = "/rendered/path/project"; + const expectedParameters = { + project: "projectValue", + }; + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath("projectValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectTopic', () => { + const fakePath = "/rendered/path/projectTopic"; + const expectedParameters = { + project: "projectValue", + topic: "topicValue", + }; + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectTopicPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectTopicPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectTopicPath', () => { + const result = client.projectTopicPath("projectValue", "topicValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectTopicPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectTopicName', () => { + const result = client.matchProjectFromProjectTopicName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectTopicPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTopicFromProjectTopicName', () => { + const result = client.matchTopicFromProjectTopicName(fakePath); + assert.strictEqual(result, "topicValue"); + assert((client.pathTemplates.projectTopicPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('schema', () => { + const fakePath = "/rendered/path/schema"; + const expectedParameters = { + project: "projectValue", + schema: "schemaValue", + }; + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.schemaPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.schemaPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('schemaPath', () => { + const result = client.schemaPath("projectValue", "schemaValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.schemaPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSchemaName', () => { + const result = client.matchProjectFromSchemaName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.schemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSchemaFromSchemaName', () => { + const result = client.matchSchemaFromSchemaName(fakePath); + assert.strictEqual(result, "schemaValue"); + assert((client.pathTemplates.schemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('snapshot', () => { + const fakePath = "/rendered/path/snapshot"; + const expectedParameters = { + project: "projectValue", + snapshot: "snapshotValue", + }; + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.snapshotPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.snapshotPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('snapshotPath', () => { + const result = client.snapshotPath("projectValue", "snapshotValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.snapshotPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSnapshotName', () => { + const result = client.matchProjectFromSnapshotName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.snapshotPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSnapshotFromSnapshotName', () => { + const result = client.matchSnapshotFromSnapshotName(fakePath); + assert.strictEqual(result, "snapshotValue"); + assert((client.pathTemplates.snapshotPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('subscription', () => { + const fakePath = "/rendered/path/subscription"; + const expectedParameters = { + project: "projectValue", + subscription: "subscriptionValue", + }; + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.subscriptionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.subscriptionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('subscriptionPath', () => { + const result = client.subscriptionPath("projectValue", "subscriptionValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.subscriptionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSubscriptionName', () => { + const result = client.matchProjectFromSubscriptionName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.subscriptionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSubscriptionFromSubscriptionName', () => { + const result = client.matchSubscriptionFromSubscriptionName(fakePath); + assert.strictEqual(result, "subscriptionValue"); + assert((client.pathTemplates.subscriptionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/v1/test/gapic_schema_service_v1.ts b/owl-bot-staging/v1/test/gapic_schema_service_v1.ts new file mode 100644 index 000000000..2ac9b09fc --- /dev/null +++ b/owl-bot-staging/v1/test/gapic_schema_service_v1.ts @@ -0,0 +1,2076 @@ +// 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as schemaserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, IamProtos} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message) + .toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { + return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); +} + +function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { mockStream.write({}); }); + } + setImmediate(() => { mockStream.end(); }); + } else { + setImmediate(() => { mockStream.write({}); }); + setImmediate(() => { mockStream.end(); }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + } + }; + } + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1.SchemaServiceClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new schemaserviceModule.v1.SchemaServiceClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'pubsub.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new schemaserviceModule.v1.SchemaServiceClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, "googleapis.com"); + }); + + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = schemaserviceModule.v1.SchemaServiceClient.servicePath; + assert.strictEqual(servicePath, 'pubsub.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = schemaserviceModule.v1.SchemaServiceClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'pubsub.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'pubsub.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({universe_domain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'pubsub.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new schemaserviceModule.v1.SchemaServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'pubsub.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new schemaserviceModule.v1.SchemaServiceClient({universeDomain: 'configured.example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'pubsub.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { new schemaserviceModule.v1.SchemaServiceClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = schemaserviceModule.v1.SchemaServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new schemaserviceModule.v1.SchemaServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.schemaServiceStub, undefined); + await client.initialize(); + assert(client.schemaServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.schemaServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.schemaServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error|null, projectId?: string|null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + }); + + describe('createSchema', () => { + it('invokes createSchema without error', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.CreateSchemaRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.CreateSchemaRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.pubsub.v1.Schema() + ); + client.innerApiCalls.createSchema = stubSimpleCall(expectedResponse); + const [response] = await client.createSchema(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createSchema as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createSchema as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSchema without error using callback', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.CreateSchemaRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.CreateSchemaRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.pubsub.v1.Schema() + ); + client.innerApiCalls.createSchema = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createSchema( + request, + (err?: Error|null, result?: protos.google.pubsub.v1.ISchema|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createSchema as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createSchema as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSchema with error', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.CreateSchemaRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.CreateSchemaRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createSchema = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createSchema(request), expectedError); + const actualRequest = (client.innerApiCalls.createSchema as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createSchema as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSchema with closed client', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.CreateSchemaRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.CreateSchemaRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createSchema(request), expectedError); + }); + }); + + describe('getSchema', () => { + it('invokes getSchema without error', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.GetSchemaRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.GetSchemaRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.pubsub.v1.Schema() + ); + client.innerApiCalls.getSchema = stubSimpleCall(expectedResponse); + const [response] = await client.getSchema(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getSchema as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getSchema as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSchema without error using callback', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.GetSchemaRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.GetSchemaRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.pubsub.v1.Schema() + ); + client.innerApiCalls.getSchema = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getSchema( + request, + (err?: Error|null, result?: protos.google.pubsub.v1.ISchema|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getSchema as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getSchema as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSchema with error', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.GetSchemaRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.GetSchemaRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getSchema = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getSchema(request), expectedError); + const actualRequest = (client.innerApiCalls.getSchema as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getSchema as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSchema with closed client', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.GetSchemaRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.GetSchemaRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getSchema(request), expectedError); + }); + }); + + describe('commitSchema', () => { + it('invokes commitSchema without error', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.CommitSchemaRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.CommitSchemaRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.pubsub.v1.Schema() + ); + client.innerApiCalls.commitSchema = stubSimpleCall(expectedResponse); + const [response] = await client.commitSchema(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.commitSchema as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.commitSchema as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes commitSchema without error using callback', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.CommitSchemaRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.CommitSchemaRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.pubsub.v1.Schema() + ); + client.innerApiCalls.commitSchema = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.commitSchema( + request, + (err?: Error|null, result?: protos.google.pubsub.v1.ISchema|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.commitSchema as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.commitSchema as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes commitSchema with error', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.CommitSchemaRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.CommitSchemaRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.commitSchema = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.commitSchema(request), expectedError); + const actualRequest = (client.innerApiCalls.commitSchema as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.commitSchema as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes commitSchema with closed client', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.CommitSchemaRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.CommitSchemaRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.commitSchema(request), expectedError); + }); + }); + + describe('rollbackSchema', () => { + it('invokes rollbackSchema without error', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.RollbackSchemaRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.RollbackSchemaRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.pubsub.v1.Schema() + ); + client.innerApiCalls.rollbackSchema = stubSimpleCall(expectedResponse); + const [response] = await client.rollbackSchema(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.rollbackSchema as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.rollbackSchema as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes rollbackSchema without error using callback', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.RollbackSchemaRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.RollbackSchemaRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.pubsub.v1.Schema() + ); + client.innerApiCalls.rollbackSchema = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.rollbackSchema( + request, + (err?: Error|null, result?: protos.google.pubsub.v1.ISchema|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.rollbackSchema as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.rollbackSchema as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes rollbackSchema with error', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.RollbackSchemaRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.RollbackSchemaRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.rollbackSchema = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.rollbackSchema(request), expectedError); + const actualRequest = (client.innerApiCalls.rollbackSchema as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.rollbackSchema as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes rollbackSchema with closed client', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.RollbackSchemaRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.RollbackSchemaRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.rollbackSchema(request), expectedError); + }); + }); + + describe('deleteSchemaRevision', () => { + it('invokes deleteSchemaRevision without error', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.DeleteSchemaRevisionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.DeleteSchemaRevisionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.pubsub.v1.Schema() + ); + client.innerApiCalls.deleteSchemaRevision = stubSimpleCall(expectedResponse); + const [response] = await client.deleteSchemaRevision(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteSchemaRevision as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteSchemaRevision as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSchemaRevision without error using callback', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.DeleteSchemaRevisionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.DeleteSchemaRevisionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.pubsub.v1.Schema() + ); + client.innerApiCalls.deleteSchemaRevision = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteSchemaRevision( + request, + (err?: Error|null, result?: protos.google.pubsub.v1.ISchema|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteSchemaRevision as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteSchemaRevision as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSchemaRevision with error', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.DeleteSchemaRevisionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.DeleteSchemaRevisionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteSchemaRevision = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteSchemaRevision(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteSchemaRevision as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteSchemaRevision as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSchemaRevision with closed client', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.DeleteSchemaRevisionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.DeleteSchemaRevisionRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteSchemaRevision(request), expectedError); + }); + }); + + describe('deleteSchema', () => { + it('invokes deleteSchema without error', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.DeleteSchemaRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.DeleteSchemaRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteSchema = stubSimpleCall(expectedResponse); + const [response] = await client.deleteSchema(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteSchema as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteSchema as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSchema without error using callback', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.DeleteSchemaRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.DeleteSchemaRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteSchema = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteSchema( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteSchema as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteSchema as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSchema with error', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.DeleteSchemaRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.DeleteSchemaRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteSchema = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteSchema(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteSchema as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteSchema as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSchema with closed client', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.DeleteSchemaRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.DeleteSchemaRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteSchema(request), expectedError); + }); + }); + + describe('validateSchema', () => { + it('invokes validateSchema without error', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ValidateSchemaRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.ValidateSchemaRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.pubsub.v1.ValidateSchemaResponse() + ); + client.innerApiCalls.validateSchema = stubSimpleCall(expectedResponse); + const [response] = await client.validateSchema(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.validateSchema as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.validateSchema as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes validateSchema without error using callback', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ValidateSchemaRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.ValidateSchemaRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.pubsub.v1.ValidateSchemaResponse() + ); + client.innerApiCalls.validateSchema = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.validateSchema( + request, + (err?: Error|null, result?: protos.google.pubsub.v1.IValidateSchemaResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.validateSchema as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.validateSchema as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes validateSchema with error', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ValidateSchemaRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.ValidateSchemaRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.validateSchema = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.validateSchema(request), expectedError); + const actualRequest = (client.innerApiCalls.validateSchema as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.validateSchema as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes validateSchema with closed client', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ValidateSchemaRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.ValidateSchemaRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.validateSchema(request), expectedError); + }); + }); + + describe('validateMessage', () => { + it('invokes validateMessage without error', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ValidateMessageRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.ValidateMessageRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.pubsub.v1.ValidateMessageResponse() + ); + client.innerApiCalls.validateMessage = stubSimpleCall(expectedResponse); + const [response] = await client.validateMessage(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.validateMessage as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.validateMessage as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes validateMessage without error using callback', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ValidateMessageRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.ValidateMessageRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.pubsub.v1.ValidateMessageResponse() + ); + client.innerApiCalls.validateMessage = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.validateMessage( + request, + (err?: Error|null, result?: protos.google.pubsub.v1.IValidateMessageResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.validateMessage as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.validateMessage as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes validateMessage with error', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ValidateMessageRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.ValidateMessageRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.validateMessage = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.validateMessage(request), expectedError); + const actualRequest = (client.innerApiCalls.validateMessage as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.validateMessage as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes validateMessage with closed client', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ValidateMessageRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.ValidateMessageRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.validateMessage(request), expectedError); + }); + }); + + describe('listSchemas', () => { + it('invokes listSchemas without error', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListSchemasRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.ListSchemasRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.pubsub.v1.Schema()), + generateSampleMessage(new protos.google.pubsub.v1.Schema()), + generateSampleMessage(new protos.google.pubsub.v1.Schema()), + ]; + client.innerApiCalls.listSchemas = stubSimpleCall(expectedResponse); + const [response] = await client.listSchemas(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listSchemas as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listSchemas as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSchemas without error using callback', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListSchemasRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.ListSchemasRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.pubsub.v1.Schema()), + generateSampleMessage(new protos.google.pubsub.v1.Schema()), + generateSampleMessage(new protos.google.pubsub.v1.Schema()), + ]; + client.innerApiCalls.listSchemas = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listSchemas( + request, + (err?: Error|null, result?: protos.google.pubsub.v1.ISchema[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listSchemas as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listSchemas as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSchemas with error', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListSchemasRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.ListSchemasRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listSchemas = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listSchemas(request), expectedError); + const actualRequest = (client.innerApiCalls.listSchemas as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listSchemas as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSchemasStream without error', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListSchemasRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.ListSchemasRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.pubsub.v1.Schema()), + generateSampleMessage(new protos.google.pubsub.v1.Schema()), + generateSampleMessage(new protos.google.pubsub.v1.Schema()), + ]; + client.descriptors.page.listSchemas.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listSchemasStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.pubsub.v1.Schema[] = []; + stream.on('data', (response: protos.google.pubsub.v1.Schema) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listSchemas.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listSchemas, request)); + assert( + (client.descriptors.page.listSchemas.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listSchemasStream with error', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListSchemasRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.ListSchemasRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listSchemas.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listSchemasStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.pubsub.v1.Schema[] = []; + stream.on('data', (response: protos.google.pubsub.v1.Schema) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listSchemas.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listSchemas, request)); + assert( + (client.descriptors.page.listSchemas.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listSchemas without error', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListSchemasRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.ListSchemasRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.pubsub.v1.Schema()), + generateSampleMessage(new protos.google.pubsub.v1.Schema()), + generateSampleMessage(new protos.google.pubsub.v1.Schema()), + ]; + client.descriptors.page.listSchemas.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.pubsub.v1.ISchema[] = []; + const iterable = client.listSchemasAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listSchemas.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listSchemas.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listSchemas with error', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListSchemasRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.ListSchemasRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listSchemas.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listSchemasAsync(request); + await assert.rejects(async () => { + const responses: protos.google.pubsub.v1.ISchema[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listSchemas.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listSchemas.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listSchemaRevisions', () => { + it('invokes listSchemaRevisions without error', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListSchemaRevisionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.ListSchemaRevisionsRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.pubsub.v1.Schema()), + generateSampleMessage(new protos.google.pubsub.v1.Schema()), + generateSampleMessage(new protos.google.pubsub.v1.Schema()), + ]; + client.innerApiCalls.listSchemaRevisions = stubSimpleCall(expectedResponse); + const [response] = await client.listSchemaRevisions(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listSchemaRevisions as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listSchemaRevisions as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSchemaRevisions without error using callback', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListSchemaRevisionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.ListSchemaRevisionsRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.pubsub.v1.Schema()), + generateSampleMessage(new protos.google.pubsub.v1.Schema()), + generateSampleMessage(new protos.google.pubsub.v1.Schema()), + ]; + client.innerApiCalls.listSchemaRevisions = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listSchemaRevisions( + request, + (err?: Error|null, result?: protos.google.pubsub.v1.ISchema[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listSchemaRevisions as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listSchemaRevisions as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSchemaRevisions with error', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListSchemaRevisionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.ListSchemaRevisionsRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listSchemaRevisions = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listSchemaRevisions(request), expectedError); + const actualRequest = (client.innerApiCalls.listSchemaRevisions as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listSchemaRevisions as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSchemaRevisionsStream without error', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListSchemaRevisionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.ListSchemaRevisionsRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.pubsub.v1.Schema()), + generateSampleMessage(new protos.google.pubsub.v1.Schema()), + generateSampleMessage(new protos.google.pubsub.v1.Schema()), + ]; + client.descriptors.page.listSchemaRevisions.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listSchemaRevisionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.pubsub.v1.Schema[] = []; + stream.on('data', (response: protos.google.pubsub.v1.Schema) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listSchemaRevisions.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listSchemaRevisions, request)); + assert( + (client.descriptors.page.listSchemaRevisions.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listSchemaRevisionsStream with error', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListSchemaRevisionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.ListSchemaRevisionsRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listSchemaRevisions.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listSchemaRevisionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.pubsub.v1.Schema[] = []; + stream.on('data', (response: protos.google.pubsub.v1.Schema) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listSchemaRevisions.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listSchemaRevisions, request)); + assert( + (client.descriptors.page.listSchemaRevisions.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listSchemaRevisions without error', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListSchemaRevisionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.ListSchemaRevisionsRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.pubsub.v1.Schema()), + generateSampleMessage(new protos.google.pubsub.v1.Schema()), + generateSampleMessage(new protos.google.pubsub.v1.Schema()), + ]; + client.descriptors.page.listSchemaRevisions.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.pubsub.v1.ISchema[] = []; + const iterable = client.listSchemaRevisionsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listSchemaRevisions.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listSchemaRevisions.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listSchemaRevisions with error', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListSchemaRevisionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.ListSchemaRevisionsRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listSchemaRevisions.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listSchemaRevisionsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.pubsub.v1.ISchema[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listSchemaRevisions.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listSchemaRevisions.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.getIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getIamPolicy without error using callback', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIamPolicy( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0)); + }); + it('invokes getIamPolicy with error', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getIamPolicy(request, expectedOptions), expectedError); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.setIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes setIamPolicy without error using callback', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setIamPolicy( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0)); + }); + it('invokes setIamPolicy with error', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setIamPolicy(request, expectedOptions), expectedError); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); + const response = await client.testIamPermissions(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes testIamPermissions without error using callback', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.TestIamPermissionsResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0)); + }); + it('invokes testIamPermissions with error', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.testIamPermissions = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.testIamPermissions(request, expectedOptions), expectedError); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + + describe('Path templates', () => { + + describe('project', () => { + const fakePath = "/rendered/path/project"; + const expectedParameters = { + project: "projectValue", + }; + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath("projectValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectTopic', () => { + const fakePath = "/rendered/path/projectTopic"; + const expectedParameters = { + project: "projectValue", + topic: "topicValue", + }; + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectTopicPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectTopicPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectTopicPath', () => { + const result = client.projectTopicPath("projectValue", "topicValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectTopicPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectTopicName', () => { + const result = client.matchProjectFromProjectTopicName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectTopicPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTopicFromProjectTopicName', () => { + const result = client.matchTopicFromProjectTopicName(fakePath); + assert.strictEqual(result, "topicValue"); + assert((client.pathTemplates.projectTopicPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('schema', () => { + const fakePath = "/rendered/path/schema"; + const expectedParameters = { + project: "projectValue", + schema: "schemaValue", + }; + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.schemaPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.schemaPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('schemaPath', () => { + const result = client.schemaPath("projectValue", "schemaValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.schemaPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSchemaName', () => { + const result = client.matchProjectFromSchemaName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.schemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSchemaFromSchemaName', () => { + const result = client.matchSchemaFromSchemaName(fakePath); + assert.strictEqual(result, "schemaValue"); + assert((client.pathTemplates.schemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('snapshot', () => { + const fakePath = "/rendered/path/snapshot"; + const expectedParameters = { + project: "projectValue", + snapshot: "snapshotValue", + }; + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.snapshotPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.snapshotPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('snapshotPath', () => { + const result = client.snapshotPath("projectValue", "snapshotValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.snapshotPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSnapshotName', () => { + const result = client.matchProjectFromSnapshotName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.snapshotPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSnapshotFromSnapshotName', () => { + const result = client.matchSnapshotFromSnapshotName(fakePath); + assert.strictEqual(result, "snapshotValue"); + assert((client.pathTemplates.snapshotPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('subscription', () => { + const fakePath = "/rendered/path/subscription"; + const expectedParameters = { + project: "projectValue", + subscription: "subscriptionValue", + }; + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.subscriptionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.subscriptionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('subscriptionPath', () => { + const result = client.subscriptionPath("projectValue", "subscriptionValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.subscriptionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSubscriptionName', () => { + const result = client.matchProjectFromSubscriptionName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.subscriptionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSubscriptionFromSubscriptionName', () => { + const result = client.matchSubscriptionFromSubscriptionName(fakePath); + assert.strictEqual(result, "subscriptionValue"); + assert((client.pathTemplates.subscriptionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/v1/test/gapic_subscriber_v1.ts b/owl-bot-staging/v1/test/gapic_subscriber_v1.ts new file mode 100644 index 000000000..73fc01c96 --- /dev/null +++ b/owl-bot-staging/v1/test/gapic_subscriber_v1.ts @@ -0,0 +1,2697 @@ +// 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as subscriberModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, IamProtos} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message) + .toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { + return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); +} + +function stubBidiStreamingCall(response?: ResponseType, error?: Error) { + const transformStub = error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + return sinon.stub().returns(mockStream); +} + +function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { mockStream.write({}); }); + } + setImmediate(() => { mockStream.end(); }); + } else { + setImmediate(() => { mockStream.write({}); }); + setImmediate(() => { mockStream.end(); }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + } + }; + } + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1.SubscriberClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new subscriberModule.v1.SubscriberClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'pubsub.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new subscriberModule.v1.SubscriberClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, "googleapis.com"); + }); + + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = subscriberModule.v1.SubscriberClient.servicePath; + assert.strictEqual(servicePath, 'pubsub.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = subscriberModule.v1.SubscriberClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'pubsub.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new subscriberModule.v1.SubscriberClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'pubsub.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new subscriberModule.v1.SubscriberClient({universe_domain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'pubsub.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new subscriberModule.v1.SubscriberClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'pubsub.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new subscriberModule.v1.SubscriberClient({universeDomain: 'configured.example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'pubsub.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { new subscriberModule.v1.SubscriberClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = subscriberModule.v1.SubscriberClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new subscriberModule.v1.SubscriberClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new subscriberModule.v1.SubscriberClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.subscriberStub, undefined); + await client.initialize(); + assert(client.subscriberStub); + }); + + it('has close method for the initialized client', done => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.subscriberStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.subscriberStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error|null, projectId?: string|null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + }); + + describe('createSubscription', () => { + it('invokes createSubscription without error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.Subscription() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.Subscription', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.pubsub.v1.Subscription() + ); + client.innerApiCalls.createSubscription = stubSimpleCall(expectedResponse); + const [response] = await client.createSubscription(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createSubscription as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createSubscription as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSubscription without error using callback', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.Subscription() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.Subscription', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.pubsub.v1.Subscription() + ); + client.innerApiCalls.createSubscription = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createSubscription( + request, + (err?: Error|null, result?: protos.google.pubsub.v1.ISubscription|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createSubscription as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createSubscription as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSubscription with error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.Subscription() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.Subscription', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createSubscription = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createSubscription(request), expectedError); + const actualRequest = (client.innerApiCalls.createSubscription as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createSubscription as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSubscription with closed client', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.Subscription() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.Subscription', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createSubscription(request), expectedError); + }); + }); + + describe('getSubscription', () => { + it('invokes getSubscription without error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.GetSubscriptionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.GetSubscriptionRequest', ['subscription']); + request.subscription = defaultValue1; + const expectedHeaderRequestParams = `subscription=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.pubsub.v1.Subscription() + ); + client.innerApiCalls.getSubscription = stubSimpleCall(expectedResponse); + const [response] = await client.getSubscription(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getSubscription as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getSubscription as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSubscription without error using callback', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.GetSubscriptionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.GetSubscriptionRequest', ['subscription']); + request.subscription = defaultValue1; + const expectedHeaderRequestParams = `subscription=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.pubsub.v1.Subscription() + ); + client.innerApiCalls.getSubscription = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getSubscription( + request, + (err?: Error|null, result?: protos.google.pubsub.v1.ISubscription|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getSubscription as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getSubscription as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSubscription with error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.GetSubscriptionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.GetSubscriptionRequest', ['subscription']); + request.subscription = defaultValue1; + const expectedHeaderRequestParams = `subscription=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getSubscription = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getSubscription(request), expectedError); + const actualRequest = (client.innerApiCalls.getSubscription as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getSubscription as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSubscription with closed client', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.GetSubscriptionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.GetSubscriptionRequest', ['subscription']); + request.subscription = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getSubscription(request), expectedError); + }); + }); + + describe('updateSubscription', () => { + it('invokes updateSubscription without error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.UpdateSubscriptionRequest() + ); + request.subscription ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.UpdateSubscriptionRequest', ['subscription', 'name']); + request.subscription.name = defaultValue1; + const expectedHeaderRequestParams = `subscription.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.pubsub.v1.Subscription() + ); + client.innerApiCalls.updateSubscription = stubSimpleCall(expectedResponse); + const [response] = await client.updateSubscription(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateSubscription as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateSubscription as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSubscription without error using callback', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.UpdateSubscriptionRequest() + ); + request.subscription ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.UpdateSubscriptionRequest', ['subscription', 'name']); + request.subscription.name = defaultValue1; + const expectedHeaderRequestParams = `subscription.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.pubsub.v1.Subscription() + ); + client.innerApiCalls.updateSubscription = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateSubscription( + request, + (err?: Error|null, result?: protos.google.pubsub.v1.ISubscription|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateSubscription as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateSubscription as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSubscription with error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.UpdateSubscriptionRequest() + ); + request.subscription ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.UpdateSubscriptionRequest', ['subscription', 'name']); + request.subscription.name = defaultValue1; + const expectedHeaderRequestParams = `subscription.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateSubscription = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateSubscription(request), expectedError); + const actualRequest = (client.innerApiCalls.updateSubscription as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateSubscription as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSubscription with closed client', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.UpdateSubscriptionRequest() + ); + request.subscription ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.UpdateSubscriptionRequest', ['subscription', 'name']); + request.subscription.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateSubscription(request), expectedError); + }); + }); + + describe('deleteSubscription', () => { + it('invokes deleteSubscription without error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.DeleteSubscriptionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.DeleteSubscriptionRequest', ['subscription']); + request.subscription = defaultValue1; + const expectedHeaderRequestParams = `subscription=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteSubscription = stubSimpleCall(expectedResponse); + const [response] = await client.deleteSubscription(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteSubscription as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteSubscription as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSubscription without error using callback', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.DeleteSubscriptionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.DeleteSubscriptionRequest', ['subscription']); + request.subscription = defaultValue1; + const expectedHeaderRequestParams = `subscription=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteSubscription = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteSubscription( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteSubscription as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteSubscription as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSubscription with error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.DeleteSubscriptionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.DeleteSubscriptionRequest', ['subscription']); + request.subscription = defaultValue1; + const expectedHeaderRequestParams = `subscription=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteSubscription = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteSubscription(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteSubscription as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteSubscription as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSubscription with closed client', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.DeleteSubscriptionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.DeleteSubscriptionRequest', ['subscription']); + request.subscription = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteSubscription(request), expectedError); + }); + }); + + describe('modifyAckDeadline', () => { + it('invokes modifyAckDeadline without error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ModifyAckDeadlineRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.ModifyAckDeadlineRequest', ['subscription']); + request.subscription = defaultValue1; + const expectedHeaderRequestParams = `subscription=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.modifyAckDeadline = stubSimpleCall(expectedResponse); + const [response] = await client.modifyAckDeadline(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.modifyAckDeadline as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.modifyAckDeadline as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes modifyAckDeadline without error using callback', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ModifyAckDeadlineRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.ModifyAckDeadlineRequest', ['subscription']); + request.subscription = defaultValue1; + const expectedHeaderRequestParams = `subscription=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.modifyAckDeadline = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.modifyAckDeadline( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.modifyAckDeadline as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.modifyAckDeadline as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes modifyAckDeadline with error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ModifyAckDeadlineRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.ModifyAckDeadlineRequest', ['subscription']); + request.subscription = defaultValue1; + const expectedHeaderRequestParams = `subscription=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.modifyAckDeadline = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.modifyAckDeadline(request), expectedError); + const actualRequest = (client.innerApiCalls.modifyAckDeadline as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.modifyAckDeadline as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes modifyAckDeadline with closed client', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ModifyAckDeadlineRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.ModifyAckDeadlineRequest', ['subscription']); + request.subscription = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.modifyAckDeadline(request), expectedError); + }); + }); + + describe('acknowledge', () => { + it('invokes acknowledge without error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.AcknowledgeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.AcknowledgeRequest', ['subscription']); + request.subscription = defaultValue1; + const expectedHeaderRequestParams = `subscription=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.acknowledge = stubSimpleCall(expectedResponse); + const [response] = await client.acknowledge(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.acknowledge as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.acknowledge as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes acknowledge without error using callback', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.AcknowledgeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.AcknowledgeRequest', ['subscription']); + request.subscription = defaultValue1; + const expectedHeaderRequestParams = `subscription=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.acknowledge = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.acknowledge( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.acknowledge as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.acknowledge as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes acknowledge with error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.AcknowledgeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.AcknowledgeRequest', ['subscription']); + request.subscription = defaultValue1; + const expectedHeaderRequestParams = `subscription=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.acknowledge = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.acknowledge(request), expectedError); + const actualRequest = (client.innerApiCalls.acknowledge as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.acknowledge as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes acknowledge with closed client', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.AcknowledgeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.AcknowledgeRequest', ['subscription']); + request.subscription = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.acknowledge(request), expectedError); + }); + }); + + describe('pull', () => { + it('invokes pull without error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.PullRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.PullRequest', ['subscription']); + request.subscription = defaultValue1; + const expectedHeaderRequestParams = `subscription=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.pubsub.v1.PullResponse() + ); + client.innerApiCalls.pull = stubSimpleCall(expectedResponse); + const [response] = await client.pull(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.pull as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.pull as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes pull without error using callback', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.PullRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.PullRequest', ['subscription']); + request.subscription = defaultValue1; + const expectedHeaderRequestParams = `subscription=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.pubsub.v1.PullResponse() + ); + client.innerApiCalls.pull = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.pull( + request, + (err?: Error|null, result?: protos.google.pubsub.v1.IPullResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.pull as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.pull as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes pull with error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.PullRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.PullRequest', ['subscription']); + request.subscription = defaultValue1; + const expectedHeaderRequestParams = `subscription=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.pull = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.pull(request), expectedError); + const actualRequest = (client.innerApiCalls.pull as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.pull as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes pull with closed client', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.PullRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.PullRequest', ['subscription']); + request.subscription = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.pull(request), expectedError); + }); + }); + + describe('modifyPushConfig', () => { + it('invokes modifyPushConfig without error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ModifyPushConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.ModifyPushConfigRequest', ['subscription']); + request.subscription = defaultValue1; + const expectedHeaderRequestParams = `subscription=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.modifyPushConfig = stubSimpleCall(expectedResponse); + const [response] = await client.modifyPushConfig(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.modifyPushConfig as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.modifyPushConfig as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes modifyPushConfig without error using callback', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ModifyPushConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.ModifyPushConfigRequest', ['subscription']); + request.subscription = defaultValue1; + const expectedHeaderRequestParams = `subscription=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.modifyPushConfig = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.modifyPushConfig( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.modifyPushConfig as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.modifyPushConfig as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes modifyPushConfig with error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ModifyPushConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.ModifyPushConfigRequest', ['subscription']); + request.subscription = defaultValue1; + const expectedHeaderRequestParams = `subscription=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.modifyPushConfig = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.modifyPushConfig(request), expectedError); + const actualRequest = (client.innerApiCalls.modifyPushConfig as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.modifyPushConfig as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes modifyPushConfig with closed client', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ModifyPushConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.ModifyPushConfigRequest', ['subscription']); + request.subscription = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.modifyPushConfig(request), expectedError); + }); + }); + + describe('getSnapshot', () => { + it('invokes getSnapshot without error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.GetSnapshotRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.GetSnapshotRequest', ['snapshot']); + request.snapshot = defaultValue1; + const expectedHeaderRequestParams = `snapshot=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.pubsub.v1.Snapshot() + ); + client.innerApiCalls.getSnapshot = stubSimpleCall(expectedResponse); + const [response] = await client.getSnapshot(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getSnapshot as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getSnapshot as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSnapshot without error using callback', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.GetSnapshotRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.GetSnapshotRequest', ['snapshot']); + request.snapshot = defaultValue1; + const expectedHeaderRequestParams = `snapshot=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.pubsub.v1.Snapshot() + ); + client.innerApiCalls.getSnapshot = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getSnapshot( + request, + (err?: Error|null, result?: protos.google.pubsub.v1.ISnapshot|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getSnapshot as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getSnapshot as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSnapshot with error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.GetSnapshotRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.GetSnapshotRequest', ['snapshot']); + request.snapshot = defaultValue1; + const expectedHeaderRequestParams = `snapshot=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getSnapshot = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getSnapshot(request), expectedError); + const actualRequest = (client.innerApiCalls.getSnapshot as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getSnapshot as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSnapshot with closed client', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.GetSnapshotRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.GetSnapshotRequest', ['snapshot']); + request.snapshot = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getSnapshot(request), expectedError); + }); + }); + + describe('createSnapshot', () => { + it('invokes createSnapshot without error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.CreateSnapshotRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.CreateSnapshotRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.pubsub.v1.Snapshot() + ); + client.innerApiCalls.createSnapshot = stubSimpleCall(expectedResponse); + const [response] = await client.createSnapshot(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createSnapshot as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createSnapshot as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSnapshot without error using callback', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.CreateSnapshotRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.CreateSnapshotRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.pubsub.v1.Snapshot() + ); + client.innerApiCalls.createSnapshot = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createSnapshot( + request, + (err?: Error|null, result?: protos.google.pubsub.v1.ISnapshot|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createSnapshot as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createSnapshot as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSnapshot with error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.CreateSnapshotRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.CreateSnapshotRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createSnapshot = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createSnapshot(request), expectedError); + const actualRequest = (client.innerApiCalls.createSnapshot as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createSnapshot as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSnapshot with closed client', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.CreateSnapshotRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.CreateSnapshotRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createSnapshot(request), expectedError); + }); + }); + + describe('updateSnapshot', () => { + it('invokes updateSnapshot without error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.UpdateSnapshotRequest() + ); + request.snapshot ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.UpdateSnapshotRequest', ['snapshot', 'name']); + request.snapshot.name = defaultValue1; + const expectedHeaderRequestParams = `snapshot.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.pubsub.v1.Snapshot() + ); + client.innerApiCalls.updateSnapshot = stubSimpleCall(expectedResponse); + const [response] = await client.updateSnapshot(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateSnapshot as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateSnapshot as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSnapshot without error using callback', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.UpdateSnapshotRequest() + ); + request.snapshot ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.UpdateSnapshotRequest', ['snapshot', 'name']); + request.snapshot.name = defaultValue1; + const expectedHeaderRequestParams = `snapshot.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.pubsub.v1.Snapshot() + ); + client.innerApiCalls.updateSnapshot = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateSnapshot( + request, + (err?: Error|null, result?: protos.google.pubsub.v1.ISnapshot|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateSnapshot as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateSnapshot as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSnapshot with error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.UpdateSnapshotRequest() + ); + request.snapshot ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.UpdateSnapshotRequest', ['snapshot', 'name']); + request.snapshot.name = defaultValue1; + const expectedHeaderRequestParams = `snapshot.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateSnapshot = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateSnapshot(request), expectedError); + const actualRequest = (client.innerApiCalls.updateSnapshot as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateSnapshot as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSnapshot with closed client', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.UpdateSnapshotRequest() + ); + request.snapshot ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.UpdateSnapshotRequest', ['snapshot', 'name']); + request.snapshot.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateSnapshot(request), expectedError); + }); + }); + + describe('deleteSnapshot', () => { + it('invokes deleteSnapshot without error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.DeleteSnapshotRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.DeleteSnapshotRequest', ['snapshot']); + request.snapshot = defaultValue1; + const expectedHeaderRequestParams = `snapshot=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteSnapshot = stubSimpleCall(expectedResponse); + const [response] = await client.deleteSnapshot(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteSnapshot as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteSnapshot as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSnapshot without error using callback', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.DeleteSnapshotRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.DeleteSnapshotRequest', ['snapshot']); + request.snapshot = defaultValue1; + const expectedHeaderRequestParams = `snapshot=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteSnapshot = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteSnapshot( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteSnapshot as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteSnapshot as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSnapshot with error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.DeleteSnapshotRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.DeleteSnapshotRequest', ['snapshot']); + request.snapshot = defaultValue1; + const expectedHeaderRequestParams = `snapshot=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteSnapshot = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteSnapshot(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteSnapshot as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteSnapshot as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSnapshot with closed client', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.DeleteSnapshotRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.DeleteSnapshotRequest', ['snapshot']); + request.snapshot = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteSnapshot(request), expectedError); + }); + }); + + describe('seek', () => { + it('invokes seek without error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.SeekRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.SeekRequest', ['subscription']); + request.subscription = defaultValue1; + const expectedHeaderRequestParams = `subscription=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.pubsub.v1.SeekResponse() + ); + client.innerApiCalls.seek = stubSimpleCall(expectedResponse); + const [response] = await client.seek(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.seek as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.seek as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes seek without error using callback', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.SeekRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.SeekRequest', ['subscription']); + request.subscription = defaultValue1; + const expectedHeaderRequestParams = `subscription=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.pubsub.v1.SeekResponse() + ); + client.innerApiCalls.seek = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.seek( + request, + (err?: Error|null, result?: protos.google.pubsub.v1.ISeekResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.seek as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.seek as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes seek with error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.SeekRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.SeekRequest', ['subscription']); + request.subscription = defaultValue1; + const expectedHeaderRequestParams = `subscription=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.seek = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.seek(request), expectedError); + const actualRequest = (client.innerApiCalls.seek as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.seek as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes seek with closed client', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.SeekRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.SeekRequest', ['subscription']); + request.subscription = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.seek(request), expectedError); + }); + }); + + describe('streamingPull', () => { + it('invokes streamingPull without error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.StreamingPullRequest() + ); + + const expectedResponse = generateSampleMessage( + new protos.google.pubsub.v1.StreamingPullResponse() + ); + client.innerApiCalls.streamingPull = stubBidiStreamingCall(expectedResponse); + const stream = client.streamingPull(); + const promise = new Promise((resolve, reject) => { + stream.on('data', (response: protos.google.pubsub.v1.StreamingPullResponse) => { + resolve(response); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + stream.write(request); + stream.end(); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.streamingPull as SinonStub) + .getCall(0).calledWith(null)); + assert.deepStrictEqual(((stream as unknown as PassThrough) + ._transform as SinonStub).getCall(0).args[0], request); + }); + + it('invokes streamingPull with error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.StreamingPullRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.streamingPull = stubBidiStreamingCall(undefined, expectedError); + const stream = client.streamingPull(); + const promise = new Promise((resolve, reject) => { + stream.on('data', (response: protos.google.pubsub.v1.StreamingPullResponse) => { + resolve(response); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + stream.write(request); + stream.end(); + }); + await assert.rejects(promise, expectedError); + assert((client.innerApiCalls.streamingPull as SinonStub) + .getCall(0).calledWith(null)); + assert.deepStrictEqual(((stream as unknown as PassThrough) + ._transform as SinonStub).getCall(0).args[0], request); + }); + }); + + describe('listSubscriptions', () => { + it('invokes listSubscriptions without error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListSubscriptionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.ListSubscriptionsRequest', ['project']); + request.project = defaultValue1; + const expectedHeaderRequestParams = `project=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.pubsub.v1.Subscription()), + generateSampleMessage(new protos.google.pubsub.v1.Subscription()), + generateSampleMessage(new protos.google.pubsub.v1.Subscription()), + ]; + client.innerApiCalls.listSubscriptions = stubSimpleCall(expectedResponse); + const [response] = await client.listSubscriptions(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listSubscriptions as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listSubscriptions as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSubscriptions without error using callback', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListSubscriptionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.ListSubscriptionsRequest', ['project']); + request.project = defaultValue1; + const expectedHeaderRequestParams = `project=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.pubsub.v1.Subscription()), + generateSampleMessage(new protos.google.pubsub.v1.Subscription()), + generateSampleMessage(new protos.google.pubsub.v1.Subscription()), + ]; + client.innerApiCalls.listSubscriptions = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listSubscriptions( + request, + (err?: Error|null, result?: protos.google.pubsub.v1.ISubscription[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listSubscriptions as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listSubscriptions as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSubscriptions with error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListSubscriptionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.ListSubscriptionsRequest', ['project']); + request.project = defaultValue1; + const expectedHeaderRequestParams = `project=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listSubscriptions = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listSubscriptions(request), expectedError); + const actualRequest = (client.innerApiCalls.listSubscriptions as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listSubscriptions as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSubscriptionsStream without error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListSubscriptionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.ListSubscriptionsRequest', ['project']); + request.project = defaultValue1; + const expectedHeaderRequestParams = `project=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.pubsub.v1.Subscription()), + generateSampleMessage(new protos.google.pubsub.v1.Subscription()), + generateSampleMessage(new protos.google.pubsub.v1.Subscription()), + ]; + client.descriptors.page.listSubscriptions.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listSubscriptionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.pubsub.v1.Subscription[] = []; + stream.on('data', (response: protos.google.pubsub.v1.Subscription) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listSubscriptions.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listSubscriptions, request)); + assert( + (client.descriptors.page.listSubscriptions.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listSubscriptionsStream with error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListSubscriptionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.ListSubscriptionsRequest', ['project']); + request.project = defaultValue1; + const expectedHeaderRequestParams = `project=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listSubscriptions.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listSubscriptionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.pubsub.v1.Subscription[] = []; + stream.on('data', (response: protos.google.pubsub.v1.Subscription) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listSubscriptions.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listSubscriptions, request)); + assert( + (client.descriptors.page.listSubscriptions.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listSubscriptions without error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListSubscriptionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.ListSubscriptionsRequest', ['project']); + request.project = defaultValue1; + const expectedHeaderRequestParams = `project=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.pubsub.v1.Subscription()), + generateSampleMessage(new protos.google.pubsub.v1.Subscription()), + generateSampleMessage(new protos.google.pubsub.v1.Subscription()), + ]; + client.descriptors.page.listSubscriptions.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.pubsub.v1.ISubscription[] = []; + const iterable = client.listSubscriptionsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listSubscriptions.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listSubscriptions.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listSubscriptions with error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListSubscriptionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.ListSubscriptionsRequest', ['project']); + request.project = defaultValue1; + const expectedHeaderRequestParams = `project=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listSubscriptions.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listSubscriptionsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.pubsub.v1.ISubscription[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listSubscriptions.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listSubscriptions.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listSnapshots', () => { + it('invokes listSnapshots without error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListSnapshotsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.ListSnapshotsRequest', ['project']); + request.project = defaultValue1; + const expectedHeaderRequestParams = `project=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.pubsub.v1.Snapshot()), + generateSampleMessage(new protos.google.pubsub.v1.Snapshot()), + generateSampleMessage(new protos.google.pubsub.v1.Snapshot()), + ]; + client.innerApiCalls.listSnapshots = stubSimpleCall(expectedResponse); + const [response] = await client.listSnapshots(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listSnapshots as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listSnapshots as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSnapshots without error using callback', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListSnapshotsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.ListSnapshotsRequest', ['project']); + request.project = defaultValue1; + const expectedHeaderRequestParams = `project=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.pubsub.v1.Snapshot()), + generateSampleMessage(new protos.google.pubsub.v1.Snapshot()), + generateSampleMessage(new protos.google.pubsub.v1.Snapshot()), + ]; + client.innerApiCalls.listSnapshots = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listSnapshots( + request, + (err?: Error|null, result?: protos.google.pubsub.v1.ISnapshot[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listSnapshots as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listSnapshots as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSnapshots with error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListSnapshotsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.ListSnapshotsRequest', ['project']); + request.project = defaultValue1; + const expectedHeaderRequestParams = `project=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listSnapshots = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listSnapshots(request), expectedError); + const actualRequest = (client.innerApiCalls.listSnapshots as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listSnapshots as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSnapshotsStream without error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListSnapshotsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.ListSnapshotsRequest', ['project']); + request.project = defaultValue1; + const expectedHeaderRequestParams = `project=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.pubsub.v1.Snapshot()), + generateSampleMessage(new protos.google.pubsub.v1.Snapshot()), + generateSampleMessage(new protos.google.pubsub.v1.Snapshot()), + ]; + client.descriptors.page.listSnapshots.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listSnapshotsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.pubsub.v1.Snapshot[] = []; + stream.on('data', (response: protos.google.pubsub.v1.Snapshot) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listSnapshots.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listSnapshots, request)); + assert( + (client.descriptors.page.listSnapshots.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listSnapshotsStream with error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListSnapshotsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.ListSnapshotsRequest', ['project']); + request.project = defaultValue1; + const expectedHeaderRequestParams = `project=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listSnapshots.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listSnapshotsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.pubsub.v1.Snapshot[] = []; + stream.on('data', (response: protos.google.pubsub.v1.Snapshot) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listSnapshots.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listSnapshots, request)); + assert( + (client.descriptors.page.listSnapshots.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listSnapshots without error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListSnapshotsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.ListSnapshotsRequest', ['project']); + request.project = defaultValue1; + const expectedHeaderRequestParams = `project=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.pubsub.v1.Snapshot()), + generateSampleMessage(new protos.google.pubsub.v1.Snapshot()), + generateSampleMessage(new protos.google.pubsub.v1.Snapshot()), + ]; + client.descriptors.page.listSnapshots.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.pubsub.v1.ISnapshot[] = []; + const iterable = client.listSnapshotsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listSnapshots.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listSnapshots.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listSnapshots with error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListSnapshotsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.pubsub.v1.ListSnapshotsRequest', ['project']); + request.project = defaultValue1; + const expectedHeaderRequestParams = `project=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listSnapshots.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listSnapshotsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.pubsub.v1.ISnapshot[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listSnapshots.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listSnapshots.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.getIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getIamPolicy without error using callback', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIamPolicy( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0)); + }); + it('invokes getIamPolicy with error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getIamPolicy(request, expectedOptions), expectedError); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.setIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes setIamPolicy without error using callback', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setIamPolicy( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0)); + }); + it('invokes setIamPolicy with error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setIamPolicy(request, expectedOptions), expectedError); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); + const response = await client.testIamPermissions(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes testIamPermissions without error using callback', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.TestIamPermissionsResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0)); + }); + it('invokes testIamPermissions with error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.testIamPermissions = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.testIamPermissions(request, expectedOptions), expectedError); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + + describe('Path templates', () => { + + describe('project', () => { + const fakePath = "/rendered/path/project"; + const expectedParameters = { + project: "projectValue", + }; + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath("projectValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectTopic', () => { + const fakePath = "/rendered/path/projectTopic"; + const expectedParameters = { + project: "projectValue", + topic: "topicValue", + }; + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectTopicPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectTopicPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectTopicPath', () => { + const result = client.projectTopicPath("projectValue", "topicValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectTopicPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectTopicName', () => { + const result = client.matchProjectFromProjectTopicName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectTopicPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTopicFromProjectTopicName', () => { + const result = client.matchTopicFromProjectTopicName(fakePath); + assert.strictEqual(result, "topicValue"); + assert((client.pathTemplates.projectTopicPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('schema', () => { + const fakePath = "/rendered/path/schema"; + const expectedParameters = { + project: "projectValue", + schema: "schemaValue", + }; + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.schemaPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.schemaPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('schemaPath', () => { + const result = client.schemaPath("projectValue", "schemaValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.schemaPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSchemaName', () => { + const result = client.matchProjectFromSchemaName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.schemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSchemaFromSchemaName', () => { + const result = client.matchSchemaFromSchemaName(fakePath); + assert.strictEqual(result, "schemaValue"); + assert((client.pathTemplates.schemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('snapshot', () => { + const fakePath = "/rendered/path/snapshot"; + const expectedParameters = { + project: "projectValue", + snapshot: "snapshotValue", + }; + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.snapshotPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.snapshotPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('snapshotPath', () => { + const result = client.snapshotPath("projectValue", "snapshotValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.snapshotPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSnapshotName', () => { + const result = client.matchProjectFromSnapshotName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.snapshotPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSnapshotFromSnapshotName', () => { + const result = client.matchSnapshotFromSnapshotName(fakePath); + assert.strictEqual(result, "snapshotValue"); + assert((client.pathTemplates.snapshotPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('subscription', () => { + const fakePath = "/rendered/path/subscription"; + const expectedParameters = { + project: "projectValue", + subscription: "subscriptionValue", + }; + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.subscriptionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.subscriptionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('subscriptionPath', () => { + const result = client.subscriptionPath("projectValue", "subscriptionValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.subscriptionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSubscriptionName', () => { + const result = client.matchProjectFromSubscriptionName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.subscriptionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSubscriptionFromSubscriptionName', () => { + const result = client.matchSubscriptionFromSubscriptionName(fakePath); + assert.strictEqual(result, "subscriptionValue"); + assert((client.pathTemplates.subscriptionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/v1/tsconfig.json b/owl-bot-staging/v1/tsconfig.json new file mode 100644 index 000000000..c78f1c884 --- /dev/null +++ b/owl-bot-staging/v1/tsconfig.json @@ -0,0 +1,19 @@ +{ + "extends": "./node_modules/gts/tsconfig-google.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "build", + "resolveJsonModule": true, + "lib": [ + "es2018", + "dom" + ] + }, + "include": [ + "src/*.ts", + "src/**/*.ts", + "test/*.ts", + "test/**/*.ts", + "system-test/*.ts" + ] +} diff --git a/owl-bot-staging/v1/webpack.config.js b/owl-bot-staging/v1/webpack.config.js new file mode 100644 index 000000000..3575e0eba --- /dev/null +++ b/owl-bot-staging/v1/webpack.config.js @@ -0,0 +1,64 @@ +// Copyright 2021 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 +// +// https://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. + +const path = require('path'); + +module.exports = { + entry: './src/index.ts', + output: { + library: 'pubsub', + filename: './pubsub.js', + }, + node: { + child_process: 'empty', + fs: 'empty', + crypto: 'empty', + }, + resolve: { + alias: { + '../../../package.json': path.resolve(__dirname, 'package.json'), + }, + extensions: ['.js', '.json', '.ts'], + }, + module: { + rules: [ + { + test: /\.tsx?$/, + use: 'ts-loader', + exclude: /node_modules/ + }, + { + test: /node_modules[\\/]@grpc[\\/]grpc-js/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]grpc/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]retry-request/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]https?-proxy-agent/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]gtoken/, + use: 'null-loader' + }, + ], + }, + mode: 'production', +}; From 486ec7e007802b666d260f6f2d3dc4828402a591 Mon Sep 17 00:00:00 2001 From: feywind <57276408+feywind@users.noreply.github.com> Date: Wed, 10 Jul 2024 16:29:40 -0400 Subject: [PATCH 2/5] build: ignore owl-bot-staging while doing owlbot PRs --- .eslintignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.eslintignore b/.eslintignore index c4a0963e9..5236619c4 100644 --- a/.eslintignore +++ b/.eslintignore @@ -4,5 +4,6 @@ test/fixtures build/ docs/ protos/ +owl-bot-staging/ samples/generated/ system-test/**/fixtures From 090d8715ce7b5942934631334c3219629f5a412f Mon Sep 17 00:00:00 2001 From: feywind <57276408+feywind@users.noreply.github.com> Date: Wed, 10 Jul 2024 16:36:00 -0400 Subject: [PATCH 3/5] build: exclude the owl-bot-staging tree from the header CI --- .github/.header-checker-lint.yaml | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 .github/.header-checker-lint.yaml diff --git a/.github/.header-checker-lint.yaml b/.github/.header-checker-lint.yaml new file mode 100644 index 000000000..e74512f1c --- /dev/null +++ b/.github/.header-checker-lint.yaml @@ -0,0 +1,12 @@ +allowedCopyrightHolders: + - 'Google LLC' +allowedLicenses: + - 'Apache-2.0' + - 'MIT' + - 'BSD-3' +sourceFileExtensions: + - 'ts' + - 'js' + - 'java' +ignoreFiles: + - 'owl-bot-staging/**' From 51a46b2d723bd24dc148352d89ab3f470f03438d Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Wed, 10 Jul 2024 20:36:10 +0000 Subject: [PATCH 4/5] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot=20po?= =?UTF-8?q?st-processor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --- .eslintignore | 1 - .gitignore | 1 - owl-bot-staging/v1/.eslintignore | 7 - owl-bot-staging/v1/.eslintrc.json | 3 - owl-bot-staging/v1/.gitignore | 14 - owl-bot-staging/v1/.jsdoc.js | 55 - owl-bot-staging/v1/.mocharc.js | 33 - owl-bot-staging/v1/.prettierrc.js | 22 - owl-bot-staging/v1/README.md | 1 - owl-bot-staging/v1/package.json | 60 - .../v1/protos/google/pubsub/v1/pubsub.proto | 1777 - .../v1/protos/google/pubsub/v1/schema.proto | 410 - owl-bot-staging/v1/protos/protos.d.ts | 15218 ------ owl-bot-staging/v1/protos/protos.js | 38732 ---------------- owl-bot-staging/v1/protos/protos.json | 4338 -- owl-bot-staging/v1/src/index.ts | 29 - owl-bot-staging/v1/src/v1/index.ts | 21 - owl-bot-staging/v1/src/v1/publisher_client.ts | 1701 - .../v1/src/v1/publisher_client_config.json | 103 - .../v1/src/v1/publisher_proto_list.json | 4 - .../v1/src/v1/schema_service_client.ts | 1643 - .../src/v1/schema_service_client_config.json | 79 - .../v1/src/v1/schema_service_proto_list.json | 4 - .../v1/src/v1/subscriber_client.ts | 2235 - .../v1/src/v1/subscriber_client_config.json | 136 - .../v1/src/v1/subscriber_proto_list.json | 4 - owl-bot-staging/v1/test/gapic_publisher_v1.ts | 2077 - .../v1/test/gapic_schema_service_v1.ts | 2076 - .../v1/test/gapic_subscriber_v1.ts | 2697 -- owl-bot-staging/v1/tsconfig.json | 19 - owl-bot-staging/v1/webpack.config.js | 64 - protos/google/pubsub/v1/pubsub.proto | 8 + protos/protos.d.ts | 9 +- protos/protos.js | 33 +- protos/protos.json | 10 +- 35 files changed, 57 insertions(+), 73567 deletions(-) delete mode 100644 owl-bot-staging/v1/.eslintignore delete mode 100644 owl-bot-staging/v1/.eslintrc.json delete mode 100644 owl-bot-staging/v1/.gitignore delete mode 100644 owl-bot-staging/v1/.jsdoc.js delete mode 100644 owl-bot-staging/v1/.mocharc.js delete mode 100644 owl-bot-staging/v1/.prettierrc.js delete mode 100644 owl-bot-staging/v1/README.md delete mode 100644 owl-bot-staging/v1/package.json delete mode 100644 owl-bot-staging/v1/protos/google/pubsub/v1/pubsub.proto delete mode 100644 owl-bot-staging/v1/protos/google/pubsub/v1/schema.proto delete mode 100644 owl-bot-staging/v1/protos/protos.d.ts delete mode 100644 owl-bot-staging/v1/protos/protos.js delete mode 100644 owl-bot-staging/v1/protos/protos.json delete mode 100644 owl-bot-staging/v1/src/index.ts delete mode 100644 owl-bot-staging/v1/src/v1/index.ts delete mode 100644 owl-bot-staging/v1/src/v1/publisher_client.ts delete mode 100644 owl-bot-staging/v1/src/v1/publisher_client_config.json delete mode 100644 owl-bot-staging/v1/src/v1/publisher_proto_list.json delete mode 100644 owl-bot-staging/v1/src/v1/schema_service_client.ts delete mode 100644 owl-bot-staging/v1/src/v1/schema_service_client_config.json delete mode 100644 owl-bot-staging/v1/src/v1/schema_service_proto_list.json delete mode 100644 owl-bot-staging/v1/src/v1/subscriber_client.ts delete mode 100644 owl-bot-staging/v1/src/v1/subscriber_client_config.json delete mode 100644 owl-bot-staging/v1/src/v1/subscriber_proto_list.json delete mode 100644 owl-bot-staging/v1/test/gapic_publisher_v1.ts delete mode 100644 owl-bot-staging/v1/test/gapic_schema_service_v1.ts delete mode 100644 owl-bot-staging/v1/test/gapic_subscriber_v1.ts delete mode 100644 owl-bot-staging/v1/tsconfig.json delete mode 100644 owl-bot-staging/v1/webpack.config.js diff --git a/.eslintignore b/.eslintignore index 5236619c4..c4a0963e9 100644 --- a/.eslintignore +++ b/.eslintignore @@ -4,6 +4,5 @@ test/fixtures build/ docs/ protos/ -owl-bot-staging/ samples/generated/ system-test/**/fixtures diff --git a/.gitignore b/.gitignore index 6e0935927..d4f03a0df 100644 --- a/.gitignore +++ b/.gitignore @@ -6,7 +6,6 @@ /docs/ /out/ /build/ -samples/build/ system-test/secrets.js system-test/*key.json *.lock diff --git a/owl-bot-staging/v1/.eslintignore b/owl-bot-staging/v1/.eslintignore deleted file mode 100644 index cfc348ec4..000000000 --- a/owl-bot-staging/v1/.eslintignore +++ /dev/null @@ -1,7 +0,0 @@ -**/node_modules -**/.coverage -build/ -docs/ -protos/ -system-test/ -samples/generated/ diff --git a/owl-bot-staging/v1/.eslintrc.json b/owl-bot-staging/v1/.eslintrc.json deleted file mode 100644 index 782153495..000000000 --- a/owl-bot-staging/v1/.eslintrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./node_modules/gts" -} diff --git a/owl-bot-staging/v1/.gitignore b/owl-bot-staging/v1/.gitignore deleted file mode 100644 index d4f03a0df..000000000 --- a/owl-bot-staging/v1/.gitignore +++ /dev/null @@ -1,14 +0,0 @@ -**/*.log -**/node_modules -/.coverage -/coverage -/.nyc_output -/docs/ -/out/ -/build/ -system-test/secrets.js -system-test/*key.json -*.lock -.DS_Store -package-lock.json -__pycache__ diff --git a/owl-bot-staging/v1/.jsdoc.js b/owl-bot-staging/v1/.jsdoc.js deleted file mode 100644 index 0093b3142..000000000 --- a/owl-bot-staging/v1/.jsdoc.js +++ /dev/null @@ -1,55 +0,0 @@ -// 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 -// -// https://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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -'use strict'; - -module.exports = { - opts: { - readme: './README.md', - package: './package.json', - template: './node_modules/jsdoc-fresh', - recurse: true, - verbose: true, - destination: './docs/' - }, - plugins: [ - 'plugins/markdown', - 'jsdoc-region-tag' - ], - source: { - excludePattern: '(^|\\/|\\\\)[._]', - include: [ - 'build/src', - 'protos' - ], - includePattern: '\\.js$' - }, - templates: { - copyright: 'Copyright 2024 Google LLC', - includeDate: false, - sourceFiles: false, - systemName: '@google-cloud/pubsub', - theme: 'lumen', - default: { - outputSourceFiles: false - } - }, - markdown: { - idInHeadings: true - } -}; diff --git a/owl-bot-staging/v1/.mocharc.js b/owl-bot-staging/v1/.mocharc.js deleted file mode 100644 index 13b67c34e..000000000 --- a/owl-bot-staging/v1/.mocharc.js +++ /dev/null @@ -1,33 +0,0 @@ -// 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 -// -// https://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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -const config = { - "enable-source-maps": true, - "throw-deprecation": true, - "timeout": 10000 -} -if (process.env.MOCHA_THROW_DEPRECATION === 'false') { - delete config['throw-deprecation']; -} -if (process.env.MOCHA_REPORTER) { - config.reporter = process.env.MOCHA_REPORTER; -} -if (process.env.MOCHA_REPORTER_OUTPUT) { - config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`; -} -module.exports = config diff --git a/owl-bot-staging/v1/.prettierrc.js b/owl-bot-staging/v1/.prettierrc.js deleted file mode 100644 index 9a8fd6909..000000000 --- a/owl-bot-staging/v1/.prettierrc.js +++ /dev/null @@ -1,22 +0,0 @@ -// 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 -// -// https://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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - -module.exports = { - ...require('gts/.prettierrc.json') -} diff --git a/owl-bot-staging/v1/README.md b/owl-bot-staging/v1/README.md deleted file mode 100644 index cdb58308f..000000000 --- a/owl-bot-staging/v1/README.md +++ /dev/null @@ -1 +0,0 @@ -Pubsub: Nodejs Client diff --git a/owl-bot-staging/v1/package.json b/owl-bot-staging/v1/package.json deleted file mode 100644 index db5207cc6..000000000 --- a/owl-bot-staging/v1/package.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "name": "@google-cloud/pubsub", - "version": "0.1.0", - "description": "Pubsub client for Node.js", - "repository": "googleapis/nodejs-pubsub", - "license": "Apache-2.0", - "author": "Google LLC", - "main": "build/src/index.js", - "files": [ - "build/src", - "build/protos" - ], - "keywords": [ - "google apis client", - "google api client", - "google apis", - "google api", - "google", - "google cloud platform", - "google cloud", - "cloud", - "google pubsub", - "pubsub", - "publisher", - "schema service", - "subscriber" - ], - "scripts": { - "clean": "gts clean", - "compile": "tsc -p . && cp -r protos build/ && minifyProtoJson", - "compile-protos": "compileProtos src", - "docs": "jsdoc -c .jsdoc.js", - "fix": "gts fix", - "lint": "gts check", - "prepare": "npm run compile-protos && npm run compile", - "system-test": "c8 mocha build/system-test", - "test": "c8 mocha build/test" - }, - "dependencies": { - "google-gax": "^4.3.4" - }, - "devDependencies": { - "@types/mocha": "^10.0.6", - "@types/node": "^20.12.12", - "@types/sinon": "^10.0.20", - "c8": "^9.1.0", - "gapic-tools": "^0.4.2", - "gts": "5.3.0", - "jsdoc": "^4.0.3", - "jsdoc-fresh": "^3.0.0", - "jsdoc-region-tag": "^3.0.0", - "mocha": "^10.4.0", - "pack-n-play": "^2.0.3", - "sinon": "^15.2.0", - "typescript": "5.1.6" - }, - "engines": { - "node": ">=v14" - } -} diff --git a/owl-bot-staging/v1/protos/google/pubsub/v1/pubsub.proto b/owl-bot-staging/v1/protos/google/pubsub/v1/pubsub.proto deleted file mode 100644 index b70bda11a..000000000 --- a/owl-bot-staging/v1/protos/google/pubsub/v1/pubsub.proto +++ /dev/null @@ -1,1777 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.pubsub.v1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/empty.proto"; -import "google/protobuf/field_mask.proto"; -import "google/protobuf/timestamp.proto"; -import "google/pubsub/v1/schema.proto"; - -option cc_enable_arenas = true; -option csharp_namespace = "Google.Cloud.PubSub.V1"; -option go_package = "cloud.google.com/go/pubsub/apiv1/pubsubpb;pubsubpb"; -option java_multiple_files = true; -option java_outer_classname = "PubsubProto"; -option java_package = "com.google.pubsub.v1"; -option php_namespace = "Google\\Cloud\\PubSub\\V1"; -option ruby_package = "Google::Cloud::PubSub::V1"; - -// The service that an application uses to manipulate topics, and to send -// messages to a topic. -service Publisher { - option (google.api.default_host) = "pubsub.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform," - "https://www.googleapis.com/auth/pubsub"; - - // Creates the given topic with the given name. See the [resource name rules] - // (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). - rpc CreateTopic(Topic) returns (Topic) { - option (google.api.http) = { - put: "/v1/{name=projects/*/topics/*}" - body: "*" - }; - option (google.api.method_signature) = "name"; - } - - // Updates an existing topic by updating the fields specified in the update - // mask. Note that certain properties of a topic are not modifiable. - rpc UpdateTopic(UpdateTopicRequest) returns (Topic) { - option (google.api.http) = { - patch: "/v1/{topic.name=projects/*/topics/*}" - body: "*" - }; - option (google.api.method_signature) = "topic,update_mask"; - } - - // Adds one or more messages to the topic. Returns `NOT_FOUND` if the topic - // does not exist. - rpc Publish(PublishRequest) returns (PublishResponse) { - option (google.api.http) = { - post: "/v1/{topic=projects/*/topics/*}:publish" - body: "*" - }; - option (google.api.method_signature) = "topic,messages"; - } - - // Gets the configuration of a topic. - rpc GetTopic(GetTopicRequest) returns (Topic) { - option (google.api.http) = { - get: "/v1/{topic=projects/*/topics/*}" - }; - option (google.api.method_signature) = "topic"; - } - - // Lists matching topics. - rpc ListTopics(ListTopicsRequest) returns (ListTopicsResponse) { - option (google.api.http) = { - get: "/v1/{project=projects/*}/topics" - }; - option (google.api.method_signature) = "project"; - } - - // Lists the names of the attached subscriptions on this topic. - rpc ListTopicSubscriptions(ListTopicSubscriptionsRequest) - returns (ListTopicSubscriptionsResponse) { - option (google.api.http) = { - get: "/v1/{topic=projects/*/topics/*}/subscriptions" - }; - option (google.api.method_signature) = "topic"; - } - - // Lists the names of the snapshots on this topic. Snapshots are used in - // [Seek](https://cloud.google.com/pubsub/docs/replay-overview) operations, - // which allow you to manage message acknowledgments in bulk. That is, you can - // set the acknowledgment state of messages in an existing subscription to the - // state captured by a snapshot. - rpc ListTopicSnapshots(ListTopicSnapshotsRequest) - returns (ListTopicSnapshotsResponse) { - option (google.api.http) = { - get: "/v1/{topic=projects/*/topics/*}/snapshots" - }; - option (google.api.method_signature) = "topic"; - } - - // Deletes the topic with the given name. Returns `NOT_FOUND` if the topic - // does not exist. After a topic is deleted, a new topic may be created with - // the same name; this is an entirely new topic with none of the old - // configuration or subscriptions. Existing subscriptions to this topic are - // not deleted, but their `topic` field is set to `_deleted-topic_`. - rpc DeleteTopic(DeleteTopicRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1/{topic=projects/*/topics/*}" - }; - option (google.api.method_signature) = "topic"; - } - - // Detaches a subscription from this topic. All messages retained in the - // subscription are dropped. Subsequent `Pull` and `StreamingPull` requests - // will return FAILED_PRECONDITION. If the subscription is a push - // subscription, pushes to the endpoint will stop. - rpc DetachSubscription(DetachSubscriptionRequest) - returns (DetachSubscriptionResponse) { - option (google.api.http) = { - post: "/v1/{subscription=projects/*/subscriptions/*}:detach" - }; - } -} - -// A policy constraining the storage of messages published to the topic. -message MessageStoragePolicy { - // Optional. A list of IDs of Google Cloud regions where messages that are - // published to the topic may be persisted in storage. Messages published by - // publishers running in non-allowed Google Cloud regions (or running outside - // of Google Cloud altogether) are routed for storage in one of the allowed - // regions. An empty list means that no regions are allowed, and is not a - // valid configuration. - repeated string allowed_persistence_regions = 1 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If true, `allowed_persistence_regions` is also used to enforce - // in-transit guarantees for messages. That is, Pub/Sub will fail - // Publish operations on this topic and subscribe operations - // on any subscription attached to this topic in any region that is - // not in `allowed_persistence_regions`. - bool enforce_in_transit = 2 [(google.api.field_behavior) = OPTIONAL]; -} - -// Settings for validating messages published against a schema. -message SchemaSettings { - // Required. The name of the schema that messages published should be - // validated against. Format is `projects/{project}/schemas/{schema}`. The - // value of this field will be `_deleted-schema_` if the schema has been - // deleted. - string schema = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "pubsub.googleapis.com/Schema" } - ]; - - // Optional. The encoding of messages validated against `schema`. - Encoding encoding = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The minimum (inclusive) revision allowed for validating messages. - // If empty or not present, allow any revision to be validated against - // last_revision or any revision created before. - string first_revision_id = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The maximum (inclusive) revision allowed for validating messages. - // If empty or not present, allow any revision to be validated against - // first_revision or any revision created after. - string last_revision_id = 4 [(google.api.field_behavior) = OPTIONAL]; -} - -// Settings for an ingestion data source on a topic. -message IngestionDataSourceSettings { - // Ingestion settings for Amazon Kinesis Data Streams. - message AwsKinesis { - // Possible states for ingestion from Amazon Kinesis Data Streams. - enum State { - // Default value. This value is unused. - STATE_UNSPECIFIED = 0; - - // Ingestion is active. - ACTIVE = 1; - - // Permission denied encountered while consuming data from Kinesis. - // This can happen if: - // - The provided `aws_role_arn` does not exist or does not have the - // appropriate permissions attached. - // - The provided `aws_role_arn` is not set up properly for Identity - // Federation using `gcp_service_account`. - // - The Pub/Sub SA is not granted the - // `iam.serviceAccounts.getOpenIdToken` permission on - // `gcp_service_account`. - KINESIS_PERMISSION_DENIED = 2; - - // Permission denied encountered while publishing to the topic. This can - // happen if the Pub/Sub SA has not been granted the [appropriate publish - // permissions](https://cloud.google.com/pubsub/docs/access-control#pubsub.publisher) - PUBLISH_PERMISSION_DENIED = 3; - - // The Kinesis stream does not exist. - STREAM_NOT_FOUND = 4; - - // The Kinesis consumer does not exist. - CONSUMER_NOT_FOUND = 5; - } - - // Output only. An output-only field that indicates the state of the Kinesis - // ingestion source. - State state = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Required. The Kinesis stream ARN to ingest data from. - string stream_arn = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The Kinesis consumer ARN to used for ingestion in Enhanced - // Fan-Out mode. The consumer must be already created and ready to be used. - string consumer_arn = 3 [(google.api.field_behavior) = REQUIRED]; - - // Required. AWS role ARN to be used for Federated Identity authentication - // with Kinesis. Check the Pub/Sub docs for how to set up this role and the - // required permissions that need to be attached to it. - string aws_role_arn = 4 [(google.api.field_behavior) = REQUIRED]; - - // Required. The GCP service account to be used for Federated Identity - // authentication with Kinesis (via a `AssumeRoleWithWebIdentity` call for - // the provided role). The `aws_role_arn` must be set up with - // `accounts.google.com:sub` equals to this service account number. - string gcp_service_account = 5 [(google.api.field_behavior) = REQUIRED]; - } - - // Only one source type can have settings set. - oneof source { - // Optional. Amazon Kinesis Data Streams. - AwsKinesis aws_kinesis = 1 [(google.api.field_behavior) = OPTIONAL]; - } -} - -// A topic resource. -message Topic { - option (google.api.resource) = { - type: "pubsub.googleapis.com/Topic" - pattern: "projects/{project}/topics/{topic}" - pattern: "_deleted-topic_" - }; - - // The state of the topic. - enum State { - // Default value. This value is unused. - STATE_UNSPECIFIED = 0; - - // The topic does not have any persistent errors. - ACTIVE = 1; - - // Ingestion from the data source has encountered a permanent error. - // See the more detailed error state in the corresponding ingestion - // source configuration. - INGESTION_RESOURCE_ERROR = 2; - } - - // Required. The name of the topic. It must have the format - // `"projects/{project}/topics/{topic}"`. `{topic}` must start with a letter, - // and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), - // underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent - // signs (`%`). It must be between 3 and 255 characters in length, and it - // must not start with `"goog"`. - string name = 1 [(google.api.field_behavior) = REQUIRED]; - - // Optional. See [Creating and managing labels] - // (https://cloud.google.com/pubsub/docs/labels). - map labels = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Policy constraining the set of Google Cloud Platform regions - // where messages published to the topic may be stored. If not present, then - // no constraints are in effect. - MessageStoragePolicy message_storage_policy = 3 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The resource name of the Cloud KMS CryptoKey to be used to - // protect access to messages published on this topic. - // - // The expected format is `projects/*/locations/*/keyRings/*/cryptoKeys/*`. - string kms_key_name = 5 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Settings for validating messages published against a schema. - SchemaSettings schema_settings = 6 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Reserved for future use. This field is set only in responses from - // the server; it is ignored if it is set in any requests. - bool satisfies_pzs = 7 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Indicates the minimum duration to retain a message after it is - // published to the topic. If this field is set, messages published to the - // topic in the last `message_retention_duration` are always available to - // subscribers. For instance, it allows any attached subscription to [seek to - // a - // timestamp](https://cloud.google.com/pubsub/docs/replay-overview#seek_to_a_time) - // that is up to `message_retention_duration` in the past. If this field is - // not set, message retention is controlled by settings on individual - // subscriptions. Cannot be more than 31 days or less than 10 minutes. - google.protobuf.Duration message_retention_duration = 8 - [(google.api.field_behavior) = OPTIONAL]; - - // Output only. An output-only field indicating the state of the topic. - State state = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. Settings for ingestion from a data source into this topic. - IngestionDataSourceSettings ingestion_data_source_settings = 10 - [(google.api.field_behavior) = OPTIONAL]; -} - -// A message that is published by publishers and consumed by subscribers. The -// message must contain either a non-empty data field or at least one attribute. -// Note that client libraries represent this object differently -// depending on the language. See the corresponding [client library -// documentation](https://cloud.google.com/pubsub/docs/reference/libraries) for -// more information. See [quotas and limits] -// (https://cloud.google.com/pubsub/quotas) for more information about message -// limits. -message PubsubMessage { - // Optional. The message data field. If this field is empty, the message must - // contain at least one attribute. - bytes data = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Attributes for this message. If this field is empty, the message - // must contain non-empty data. This can be used to filter messages on the - // subscription. - map attributes = 2 [(google.api.field_behavior) = OPTIONAL]; - - // ID of this message, assigned by the server when the message is published. - // Guaranteed to be unique within the topic. This value may be read by a - // subscriber that receives a `PubsubMessage` via a `Pull` call or a push - // delivery. It must not be populated by the publisher in a `Publish` call. - string message_id = 3; - - // The time at which the message was published, populated by the server when - // it receives the `Publish` call. It must not be populated by the - // publisher in a `Publish` call. - google.protobuf.Timestamp publish_time = 4; - - // Optional. If non-empty, identifies related messages for which publish order - // should be respected. If a `Subscription` has `enable_message_ordering` set - // to `true`, messages published with the same non-empty `ordering_key` value - // will be delivered to subscribers in the order in which they are received by - // the Pub/Sub system. All `PubsubMessage`s published in a given - // `PublishRequest` must specify the same `ordering_key` value. For more - // information, see [ordering - // messages](https://cloud.google.com/pubsub/docs/ordering). - string ordering_key = 5 [(google.api.field_behavior) = OPTIONAL]; -} - -// Request for the GetTopic method. -message GetTopicRequest { - // Required. The name of the topic to get. - // Format is `projects/{project}/topics/{topic}`. - string topic = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "pubsub.googleapis.com/Topic" } - ]; -} - -// Request for the UpdateTopic method. -message UpdateTopicRequest { - // Required. The updated topic object. - Topic topic = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. Indicates which fields in the provided topic to update. Must be - // specified and non-empty. Note that if `update_mask` contains - // "message_storage_policy" but the `message_storage_policy` is not set in - // the `topic` provided above, then the updated value is determined by the - // policy configured at the project or organization level. - google.protobuf.FieldMask update_mask = 2 - [(google.api.field_behavior) = REQUIRED]; -} - -// Request for the Publish method. -message PublishRequest { - // Required. The messages in the request will be published on this topic. - // Format is `projects/{project}/topics/{topic}`. - string topic = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "pubsub.googleapis.com/Topic" } - ]; - - // Required. The messages to publish. - repeated PubsubMessage messages = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Response for the `Publish` method. -message PublishResponse { - // Optional. The server-assigned ID of each published message, in the same - // order as the messages in the request. IDs are guaranteed to be unique - // within the topic. - repeated string message_ids = 1 [(google.api.field_behavior) = OPTIONAL]; -} - -// Request for the `ListTopics` method. -message ListTopicsRequest { - // Required. The name of the project in which to list topics. - // Format is `projects/{project-id}`. - string project = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "cloudresourcemanager.googleapis.com/Project" - } - ]; - - // Optional. Maximum number of topics to return. - int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The value returned by the last `ListTopicsResponse`; indicates - // that this is a continuation of a prior `ListTopics` call, and that the - // system should return the next page of data. - string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; -} - -// Response for the `ListTopics` method. -message ListTopicsResponse { - // Optional. The resulting topics. - repeated Topic topics = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If not empty, indicates that there may be more topics that match - // the request; this value should be passed in a new `ListTopicsRequest`. - string next_page_token = 2 [(google.api.field_behavior) = OPTIONAL]; -} - -// Request for the `ListTopicSubscriptions` method. -message ListTopicSubscriptionsRequest { - // Required. The name of the topic that subscriptions are attached to. - // Format is `projects/{project}/topics/{topic}`. - string topic = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "pubsub.googleapis.com/Topic" } - ]; - - // Optional. Maximum number of subscription names to return. - int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The value returned by the last `ListTopicSubscriptionsResponse`; - // indicates that this is a continuation of a prior `ListTopicSubscriptions` - // call, and that the system should return the next page of data. - string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; -} - -// Response for the `ListTopicSubscriptions` method. -message ListTopicSubscriptionsResponse { - // Optional. The names of subscriptions attached to the topic specified in the - // request. - repeated string subscriptions = 1 [ - (google.api.field_behavior) = OPTIONAL, - (google.api.resource_reference) = { - type: "pubsub.googleapis.com/Subscription" - } - ]; - - // Optional. If not empty, indicates that there may be more subscriptions that - // match the request; this value should be passed in a new - // `ListTopicSubscriptionsRequest` to get more subscriptions. - string next_page_token = 2 [(google.api.field_behavior) = OPTIONAL]; -} - -// Request for the `ListTopicSnapshots` method. -message ListTopicSnapshotsRequest { - // Required. The name of the topic that snapshots are attached to. - // Format is `projects/{project}/topics/{topic}`. - string topic = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "pubsub.googleapis.com/Topic" } - ]; - - // Optional. Maximum number of snapshot names to return. - int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The value returned by the last `ListTopicSnapshotsResponse`; - // indicates that this is a continuation of a prior `ListTopicSnapshots` call, - // and that the system should return the next page of data. - string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; -} - -// Response for the `ListTopicSnapshots` method. -message ListTopicSnapshotsResponse { - // Optional. The names of the snapshots that match the request. - repeated string snapshots = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If not empty, indicates that there may be more snapshots that - // match the request; this value should be passed in a new - // `ListTopicSnapshotsRequest` to get more snapshots. - string next_page_token = 2 [(google.api.field_behavior) = OPTIONAL]; -} - -// Request for the `DeleteTopic` method. -message DeleteTopicRequest { - // Required. Name of the topic to delete. - // Format is `projects/{project}/topics/{topic}`. - string topic = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "pubsub.googleapis.com/Topic" } - ]; -} - -// Request for the DetachSubscription method. -message DetachSubscriptionRequest { - // Required. The subscription to detach. - // Format is `projects/{project}/subscriptions/{subscription}`. - string subscription = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "pubsub.googleapis.com/Subscription" - } - ]; -} - -// Response for the DetachSubscription method. -// Reserved for future use. -message DetachSubscriptionResponse {} - -// The service that an application uses to manipulate subscriptions and to -// consume messages from a subscription via the `Pull` method or by -// establishing a bi-directional stream using the `StreamingPull` method. -service Subscriber { - option (google.api.default_host) = "pubsub.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform," - "https://www.googleapis.com/auth/pubsub"; - - // Creates a subscription to a given topic. See the [resource name rules] - // (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). - // If the subscription already exists, returns `ALREADY_EXISTS`. - // If the corresponding topic doesn't exist, returns `NOT_FOUND`. - // - // If the name is not provided in the request, the server will assign a random - // name for this subscription on the same project as the topic, conforming - // to the [resource name format] - // (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). The - // generated name is populated in the returned Subscription object. Note that - // for REST API requests, you must specify a name in the request. - rpc CreateSubscription(Subscription) returns (Subscription) { - option (google.api.http) = { - put: "/v1/{name=projects/*/subscriptions/*}" - body: "*" - }; - option (google.api.method_signature) = - "name,topic,push_config,ack_deadline_seconds"; - } - - // Gets the configuration details of a subscription. - rpc GetSubscription(GetSubscriptionRequest) returns (Subscription) { - option (google.api.http) = { - get: "/v1/{subscription=projects/*/subscriptions/*}" - }; - option (google.api.method_signature) = "subscription"; - } - - // Updates an existing subscription by updating the fields specified in the - // update mask. Note that certain properties of a subscription, such as its - // topic, are not modifiable. - rpc UpdateSubscription(UpdateSubscriptionRequest) returns (Subscription) { - option (google.api.http) = { - patch: "/v1/{subscription.name=projects/*/subscriptions/*}" - body: "*" - }; - option (google.api.method_signature) = "subscription,update_mask"; - } - - // Lists matching subscriptions. - rpc ListSubscriptions(ListSubscriptionsRequest) - returns (ListSubscriptionsResponse) { - option (google.api.http) = { - get: "/v1/{project=projects/*}/subscriptions" - }; - option (google.api.method_signature) = "project"; - } - - // Deletes an existing subscription. All messages retained in the subscription - // are immediately dropped. Calls to `Pull` after deletion will return - // `NOT_FOUND`. After a subscription is deleted, a new one may be created with - // the same name, but the new one has no association with the old - // subscription or its topic unless the same topic is specified. - rpc DeleteSubscription(DeleteSubscriptionRequest) - returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1/{subscription=projects/*/subscriptions/*}" - }; - option (google.api.method_signature) = "subscription"; - } - - // Modifies the ack deadline for a specific message. This method is useful - // to indicate that more time is needed to process a message by the - // subscriber, or to make the message available for redelivery if the - // processing was interrupted. Note that this does not modify the - // subscription-level `ackDeadlineSeconds` used for subsequent messages. - rpc ModifyAckDeadline(ModifyAckDeadlineRequest) - returns (google.protobuf.Empty) { - option (google.api.http) = { - post: "/v1/{subscription=projects/*/subscriptions/*}:modifyAckDeadline" - body: "*" - }; - option (google.api.method_signature) = - "subscription,ack_ids,ack_deadline_seconds"; - } - - // Acknowledges the messages associated with the `ack_ids` in the - // `AcknowledgeRequest`. The Pub/Sub system can remove the relevant messages - // from the subscription. - // - // Acknowledging a message whose ack deadline has expired may succeed, - // but such a message may be redelivered later. Acknowledging a message more - // than once will not result in an error. - rpc Acknowledge(AcknowledgeRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - post: "/v1/{subscription=projects/*/subscriptions/*}:acknowledge" - body: "*" - }; - option (google.api.method_signature) = "subscription,ack_ids"; - } - - // Pulls messages from the server. - rpc Pull(PullRequest) returns (PullResponse) { - option (google.api.http) = { - post: "/v1/{subscription=projects/*/subscriptions/*}:pull" - body: "*" - }; - option (google.api.method_signature) = - "subscription,return_immediately,max_messages"; - option (google.api.method_signature) = "subscription,max_messages"; - } - - // Establishes a stream with the server, which sends messages down to the - // client. The client streams acknowledgements and ack deadline modifications - // back to the server. The server will close the stream and return the status - // on any error. The server may close the stream with status `UNAVAILABLE` to - // reassign server-side resources, in which case, the client should - // re-establish the stream. Flow control can be achieved by configuring the - // underlying RPC channel. - rpc StreamingPull(stream StreamingPullRequest) - returns (stream StreamingPullResponse) {} - - // Modifies the `PushConfig` for a specified subscription. - // - // This may be used to change a push subscription to a pull one (signified by - // an empty `PushConfig`) or vice versa, or change the endpoint URL and other - // attributes of a push subscription. Messages will accumulate for delivery - // continuously through the call regardless of changes to the `PushConfig`. - rpc ModifyPushConfig(ModifyPushConfigRequest) - returns (google.protobuf.Empty) { - option (google.api.http) = { - post: "/v1/{subscription=projects/*/subscriptions/*}:modifyPushConfig" - body: "*" - }; - option (google.api.method_signature) = "subscription,push_config"; - } - - // Gets the configuration details of a snapshot. Snapshots are used in - // [Seek](https://cloud.google.com/pubsub/docs/replay-overview) operations, - // which allow you to manage message acknowledgments in bulk. That is, you can - // set the acknowledgment state of messages in an existing subscription to the - // state captured by a snapshot. - rpc GetSnapshot(GetSnapshotRequest) returns (Snapshot) { - option (google.api.http) = { - get: "/v1/{snapshot=projects/*/snapshots/*}" - }; - option (google.api.method_signature) = "snapshot"; - } - - // Lists the existing snapshots. Snapshots are used in [Seek]( - // https://cloud.google.com/pubsub/docs/replay-overview) operations, which - // allow you to manage message acknowledgments in bulk. That is, you can set - // the acknowledgment state of messages in an existing subscription to the - // state captured by a snapshot. - rpc ListSnapshots(ListSnapshotsRequest) returns (ListSnapshotsResponse) { - option (google.api.http) = { - get: "/v1/{project=projects/*}/snapshots" - }; - option (google.api.method_signature) = "project"; - } - - // Creates a snapshot from the requested subscription. Snapshots are used in - // [Seek](https://cloud.google.com/pubsub/docs/replay-overview) operations, - // which allow you to manage message acknowledgments in bulk. That is, you can - // set the acknowledgment state of messages in an existing subscription to the - // state captured by a snapshot. - // If the snapshot already exists, returns `ALREADY_EXISTS`. - // If the requested subscription doesn't exist, returns `NOT_FOUND`. - // If the backlog in the subscription is too old -- and the resulting snapshot - // would expire in less than 1 hour -- then `FAILED_PRECONDITION` is returned. - // See also the `Snapshot.expire_time` field. If the name is not provided in - // the request, the server will assign a random - // name for this snapshot on the same project as the subscription, conforming - // to the [resource name format] - // (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). The - // generated name is populated in the returned Snapshot object. Note that for - // REST API requests, you must specify a name in the request. - rpc CreateSnapshot(CreateSnapshotRequest) returns (Snapshot) { - option (google.api.http) = { - put: "/v1/{name=projects/*/snapshots/*}" - body: "*" - }; - option (google.api.method_signature) = "name,subscription"; - } - - // Updates an existing snapshot by updating the fields specified in the update - // mask. Snapshots are used in - // [Seek](https://cloud.google.com/pubsub/docs/replay-overview) operations, - // which allow you to manage message acknowledgments in bulk. That is, you can - // set the acknowledgment state of messages in an existing subscription to the - // state captured by a snapshot. - rpc UpdateSnapshot(UpdateSnapshotRequest) returns (Snapshot) { - option (google.api.http) = { - patch: "/v1/{snapshot.name=projects/*/snapshots/*}" - body: "*" - }; - option (google.api.method_signature) = "snapshot,update_mask"; - } - - // Removes an existing snapshot. Snapshots are used in [Seek] - // (https://cloud.google.com/pubsub/docs/replay-overview) operations, which - // allow you to manage message acknowledgments in bulk. That is, you can set - // the acknowledgment state of messages in an existing subscription to the - // state captured by a snapshot. - // When the snapshot is deleted, all messages retained in the snapshot - // are immediately dropped. After a snapshot is deleted, a new one may be - // created with the same name, but the new one has no association with the old - // snapshot or its subscription, unless the same subscription is specified. - rpc DeleteSnapshot(DeleteSnapshotRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1/{snapshot=projects/*/snapshots/*}" - }; - option (google.api.method_signature) = "snapshot"; - } - - // Seeks an existing subscription to a point in time or to a given snapshot, - // whichever is provided in the request. Snapshots are used in [Seek] - // (https://cloud.google.com/pubsub/docs/replay-overview) operations, which - // allow you to manage message acknowledgments in bulk. That is, you can set - // the acknowledgment state of messages in an existing subscription to the - // state captured by a snapshot. Note that both the subscription and the - // snapshot must be on the same topic. - rpc Seek(SeekRequest) returns (SeekResponse) { - option (google.api.http) = { - post: "/v1/{subscription=projects/*/subscriptions/*}:seek" - body: "*" - }; - } -} - -// A subscription resource. If none of `push_config`, `bigquery_config`, or -// `cloud_storage_config` is set, then the subscriber will pull and ack messages -// using API methods. At most one of these fields may be set. -message Subscription { - option (google.api.resource) = { - type: "pubsub.googleapis.com/Subscription" - pattern: "projects/{project}/subscriptions/{subscription}" - }; - - // Possible states for a subscription. - enum State { - // Default value. This value is unused. - STATE_UNSPECIFIED = 0; - - // The subscription can actively receive messages - ACTIVE = 1; - - // The subscription cannot receive messages because of an error with the - // resource to which it pushes messages. See the more detailed error state - // in the corresponding configuration. - RESOURCE_ERROR = 2; - } - - // Required. The name of the subscription. It must have the format - // `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must - // start with a letter, and contain only letters (`[A-Za-z]`), numbers - // (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`), - // plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters - // in length, and it must not start with `"goog"`. - string name = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The name of the topic from which this subscription is receiving - // messages. Format is `projects/{project}/topics/{topic}`. The value of this - // field will be `_deleted-topic_` if the topic has been deleted. - string topic = 2 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "pubsub.googleapis.com/Topic" } - ]; - - // Optional. If push delivery is used with this subscription, this field is - // used to configure it. - PushConfig push_config = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If delivery to BigQuery is used with this subscription, this - // field is used to configure it. - BigQueryConfig bigquery_config = 18 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If delivery to Google Cloud Storage is used with this - // subscription, this field is used to configure it. - CloudStorageConfig cloud_storage_config = 22 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The approximate amount of time (on a best-effort basis) Pub/Sub - // waits for the subscriber to acknowledge receipt before resending the - // message. In the interval after the message is delivered and before it is - // acknowledged, it is considered to be _outstanding_. During that time - // period, the message will not be redelivered (on a best-effort basis). - // - // For pull subscriptions, this value is used as the initial value for the ack - // deadline. To override this value for a given message, call - // `ModifyAckDeadline` with the corresponding `ack_id` if using - // non-streaming pull or send the `ack_id` in a - // `StreamingModifyAckDeadlineRequest` if using streaming pull. - // The minimum custom deadline you can specify is 10 seconds. - // The maximum custom deadline you can specify is 600 seconds (10 minutes). - // If this parameter is 0, a default value of 10 seconds is used. - // - // For push delivery, this value is also used to set the request timeout for - // the call to the push endpoint. - // - // If the subscriber never acknowledges the message, the Pub/Sub - // system will eventually redeliver the message. - int32 ack_deadline_seconds = 5 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Indicates whether to retain acknowledged messages. If true, then - // messages are not expunged from the subscription's backlog, even if they are - // acknowledged, until they fall out of the `message_retention_duration` - // window. This must be true if you would like to [`Seek` to a timestamp] - // (https://cloud.google.com/pubsub/docs/replay-overview#seek_to_a_time) in - // the past to replay previously-acknowledged messages. - bool retain_acked_messages = 7 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. How long to retain unacknowledged messages in the subscription's - // backlog, from the moment a message is published. If `retain_acked_messages` - // is true, then this also configures the retention of acknowledged messages, - // and thus configures how far back in time a `Seek` can be done. Defaults to - // 7 days. Cannot be more than 7 days or less than 10 minutes. - google.protobuf.Duration message_retention_duration = 8 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. See [Creating and managing - // labels](https://cloud.google.com/pubsub/docs/labels). - map labels = 9 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If true, messages published with the same `ordering_key` in - // `PubsubMessage` will be delivered to the subscribers in the order in which - // they are received by the Pub/Sub system. Otherwise, they may be delivered - // in any order. - bool enable_message_ordering = 10 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A policy that specifies the conditions for this subscription's - // expiration. A subscription is considered active as long as any connected - // subscriber is successfully consuming messages from the subscription or is - // issuing operations on the subscription. If `expiration_policy` is not set, - // a *default policy* with `ttl` of 31 days will be used. The minimum allowed - // value for `expiration_policy.ttl` is 1 day. If `expiration_policy` is set, - // but `expiration_policy.ttl` is not set, the subscription never expires. - ExpirationPolicy expiration_policy = 11 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. An expression written in the Pub/Sub [filter - // language](https://cloud.google.com/pubsub/docs/filtering). If non-empty, - // then only `PubsubMessage`s whose `attributes` field matches the filter are - // delivered on this subscription. If empty, then no messages are filtered - // out. - string filter = 12 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A policy that specifies the conditions for dead lettering - // messages in this subscription. If dead_letter_policy is not set, dead - // lettering is disabled. - // - // The Pub/Sub service account associated with this subscriptions's - // parent project (i.e., - // service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have - // permission to Acknowledge() messages on this subscription. - DeadLetterPolicy dead_letter_policy = 13 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A policy that specifies how Pub/Sub retries message delivery for - // this subscription. - // - // If not set, the default retry policy is applied. This generally implies - // that messages will be retried as soon as possible for healthy subscribers. - // RetryPolicy will be triggered on NACKs or acknowledgement deadline - // exceeded events for a given message. - RetryPolicy retry_policy = 14 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Indicates whether the subscription is detached from its topic. - // Detached subscriptions don't receive messages from their topic and don't - // retain any backlog. `Pull` and `StreamingPull` requests will return - // FAILED_PRECONDITION. If the subscription is a push subscription, pushes to - // the endpoint will not be made. - bool detached = 15 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If true, Pub/Sub provides the following guarantees for the - // delivery of a message with a given value of `message_id` on this - // subscription: - // - // * The message sent to a subscriber is guaranteed not to be resent - // before the message's acknowledgement deadline expires. - // * An acknowledged message will not be resent to a subscriber. - // - // Note that subscribers may still receive multiple copies of a message - // when `enable_exactly_once_delivery` is true if the message was published - // multiple times by a publisher client. These copies are considered distinct - // by Pub/Sub and have distinct `message_id` values. - bool enable_exactly_once_delivery = 16 - [(google.api.field_behavior) = OPTIONAL]; - - // Output only. Indicates the minimum duration for which a message is retained - // after it is published to the subscription's topic. If this field is set, - // messages published to the subscription's topic in the last - // `topic_message_retention_duration` are always available to subscribers. See - // the `message_retention_duration` field in `Topic`. This field is set only - // in responses from the server; it is ignored if it is set in any requests. - google.protobuf.Duration topic_message_retention_duration = 17 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. An output-only field indicating whether or not the - // subscription can receive messages. - State state = 19 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// A policy that specifies how Pub/Sub retries message delivery. -// -// Retry delay will be exponential based on provided minimum and maximum -// backoffs. https://en.wikipedia.org/wiki/Exponential_backoff. -// -// RetryPolicy will be triggered on NACKs or acknowledgement deadline exceeded -// events for a given message. -// -// Retry Policy is implemented on a best effort basis. At times, the delay -// between consecutive deliveries may not match the configuration. That is, -// delay can be more or less than configured backoff. -message RetryPolicy { - // Optional. The minimum delay between consecutive deliveries of a given - // message. Value should be between 0 and 600 seconds. Defaults to 10 seconds. - google.protobuf.Duration minimum_backoff = 1 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The maximum delay between consecutive deliveries of a given - // message. Value should be between 0 and 600 seconds. Defaults to 600 - // seconds. - google.protobuf.Duration maximum_backoff = 2 - [(google.api.field_behavior) = OPTIONAL]; -} - -// Dead lettering is done on a best effort basis. The same message might be -// dead lettered multiple times. -// -// If validation on any of the fields fails at subscription creation/updation, -// the create/update subscription request will fail. -message DeadLetterPolicy { - // Optional. The name of the topic to which dead letter messages should be - // published. Format is `projects/{project}/topics/{topic}`.The Pub/Sub - // service account associated with the enclosing subscription's parent project - // (i.e., service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must - // have permission to Publish() to this topic. - // - // The operation will fail if the topic does not exist. - // Users should ensure that there is a subscription attached to this topic - // since messages published to a topic with no subscriptions are lost. - string dead_letter_topic = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The maximum number of delivery attempts for any message. The - // value must be between 5 and 100. - // - // The number of delivery attempts is defined as 1 + (the sum of number of - // NACKs and number of times the acknowledgement deadline has been exceeded - // for the message). - // - // A NACK is any call to ModifyAckDeadline with a 0 deadline. Note that - // client libraries may automatically extend ack_deadlines. - // - // This field will be honored on a best effort basis. - // - // If this parameter is 0, a default value of 5 is used. - int32 max_delivery_attempts = 2 [(google.api.field_behavior) = OPTIONAL]; -} - -// A policy that specifies the conditions for resource expiration (i.e., -// automatic resource deletion). -message ExpirationPolicy { - // Optional. Specifies the "time-to-live" duration for an associated resource. - // The resource expires if it is not active for a period of `ttl`. The - // definition of "activity" depends on the type of the associated resource. - // The minimum and maximum allowed values for `ttl` depend on the type of the - // associated resource, as well. If `ttl` is not set, the associated resource - // never expires. - google.protobuf.Duration ttl = 1 [(google.api.field_behavior) = OPTIONAL]; -} - -// Configuration for a push delivery endpoint. -message PushConfig { - // Contains information needed for generating an - // [OpenID Connect - // token](https://developers.google.com/identity/protocols/OpenIDConnect). - message OidcToken { - // Optional. [Service account - // email](https://cloud.google.com/iam/docs/service-accounts) - // used for generating the OIDC token. For more information - // on setting up authentication, see - // [Push subscriptions](https://cloud.google.com/pubsub/docs/push). - string service_account_email = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Audience to be used when generating OIDC token. The audience - // claim identifies the recipients that the JWT is intended for. The - // audience value is a single case-sensitive string. Having multiple values - // (array) for the audience field is not supported. More info about the OIDC - // JWT token audience here: - // https://tools.ietf.org/html/rfc7519#section-4.1.3 Note: if not specified, - // the Push endpoint URL will be used. - string audience = 2 [(google.api.field_behavior) = OPTIONAL]; - } - - // The payload to the push endpoint is in the form of the JSON representation - // of a PubsubMessage - // (https://cloud.google.com/pubsub/docs/reference/rpc/google.pubsub.v1#pubsubmessage). - message PubsubWrapper {} - - // Sets the `data` field as the HTTP body for delivery. - message NoWrapper { - // Optional. When true, writes the Pub/Sub message metadata to - // `x-goog-pubsub-:` headers of the HTTP request. Writes the - // Pub/Sub message attributes to `:` headers of the HTTP request. - bool write_metadata = 1 [(google.api.field_behavior) = OPTIONAL]; - } - - // Optional. A URL locating the endpoint to which messages should be pushed. - // For example, a Webhook endpoint might use `https://example.com/push`. - string push_endpoint = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Endpoint configuration attributes that can be used to control - // different aspects of the message delivery. - // - // The only currently supported attribute is `x-goog-version`, which you can - // use to change the format of the pushed message. This attribute - // indicates the version of the data expected by the endpoint. This - // controls the shape of the pushed message (i.e., its fields and metadata). - // - // If not present during the `CreateSubscription` call, it will default to - // the version of the Pub/Sub API used to make such call. If not present in a - // `ModifyPushConfig` call, its value will not be changed. `GetSubscription` - // calls will always return a valid version, even if the subscription was - // created without this attribute. - // - // The only supported values for the `x-goog-version` attribute are: - // - // * `v1beta1`: uses the push format defined in the v1beta1 Pub/Sub API. - // * `v1` or `v1beta2`: uses the push format defined in the v1 Pub/Sub API. - // - // For example: - // `attributes { "x-goog-version": "v1" }` - map attributes = 2 [(google.api.field_behavior) = OPTIONAL]; - - // An authentication method used by push endpoints to verify the source of - // push requests. This can be used with push endpoints that are private by - // default to allow requests only from the Pub/Sub system, for example. - // This field is optional and should be set only by users interested in - // authenticated push. - oneof authentication_method { - // Optional. If specified, Pub/Sub will generate and attach an OIDC JWT - // token as an `Authorization` header in the HTTP request for every pushed - // message. - OidcToken oidc_token = 3 [(google.api.field_behavior) = OPTIONAL]; - } - - // The format of the delivered message to the push endpoint is defined by - // the chosen wrapper. When unset, `PubsubWrapper` is used. - oneof wrapper { - // Optional. When set, the payload to the push endpoint is in the form of - // the JSON representation of a PubsubMessage - // (https://cloud.google.com/pubsub/docs/reference/rpc/google.pubsub.v1#pubsubmessage). - PubsubWrapper pubsub_wrapper = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. When set, the payload to the push endpoint is not wrapped. - NoWrapper no_wrapper = 5 [(google.api.field_behavior) = OPTIONAL]; - } -} - -// Configuration for a BigQuery subscription. -message BigQueryConfig { - // Possible states for a BigQuery subscription. - enum State { - // Default value. This value is unused. - STATE_UNSPECIFIED = 0; - - // The subscription can actively send messages to BigQuery - ACTIVE = 1; - - // Cannot write to the BigQuery table because of permission denied errors. - // This can happen if - // - Pub/Sub SA has not been granted the [appropriate BigQuery IAM - // permissions](https://cloud.google.com/pubsub/docs/create-subscription#assign_bigquery_service_account) - // - bigquery.googleapis.com API is not enabled for the project - // ([instructions](https://cloud.google.com/service-usage/docs/enable-disable)) - PERMISSION_DENIED = 2; - - // Cannot write to the BigQuery table because it does not exist. - NOT_FOUND = 3; - - // Cannot write to the BigQuery table due to a schema mismatch. - SCHEMA_MISMATCH = 4; - - // Cannot write to the destination because enforce_in_transit is set to true - // and the destination locations are not in the allowed regions. - IN_TRANSIT_LOCATION_RESTRICTION = 5; - } - - // Optional. The name of the table to which to write data, of the form - // {projectId}.{datasetId}.{tableId} - string table = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. When true, use the topic's schema as the columns to write to in - // BigQuery, if it exists. `use_topic_schema` and `use_table_schema` cannot be - // enabled at the same time. - bool use_topic_schema = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. When true, write the subscription name, message_id, publish_time, - // attributes, and ordering_key to additional columns in the table. The - // subscription name, message_id, and publish_time fields are put in their own - // columns while all other message properties (other than data) are written to - // a JSON object in the attributes column. - bool write_metadata = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. When true and use_topic_schema is true, any fields that are a - // part of the topic schema that are not part of the BigQuery table schema are - // dropped when writing to BigQuery. Otherwise, the schemas must be kept in - // sync and any messages with extra fields are not written and remain in the - // subscription's backlog. - bool drop_unknown_fields = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Output only. An output-only field that indicates whether or not the - // subscription can receive messages. - State state = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. When true, use the BigQuery table's schema as the columns to - // write to in BigQuery. `use_table_schema` and `use_topic_schema` cannot be - // enabled at the same time. - bool use_table_schema = 6 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The service account to use to write to BigQuery. The subscription - // creator or updater that specifies this field must have - // `iam.serviceAccounts.actAs` permission on the service account. If not - // specified, the Pub/Sub [service - // agent](https://cloud.google.com/iam/docs/service-agents), - // service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com, is used. - string service_account_email = 7 [(google.api.field_behavior) = OPTIONAL]; -} - -// Configuration for a Cloud Storage subscription. -message CloudStorageConfig { - // Configuration for writing message data in text format. - // Message payloads will be written to files as raw text, separated by a - // newline. - message TextConfig {} - - // Configuration for writing message data in Avro format. - // Message payloads and metadata will be written to files as an Avro binary. - message AvroConfig { - // Optional. When true, write the subscription name, message_id, - // publish_time, attributes, and ordering_key as additional fields in the - // output. The subscription name, message_id, and publish_time fields are - // put in their own fields while all other message properties other than - // data (for example, an ordering_key, if present) are added as entries in - // the attributes map. - bool write_metadata = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. When true, the output Cloud Storage file will be serialized - // using the topic schema, if it exists. - bool use_topic_schema = 2 [(google.api.field_behavior) = OPTIONAL]; - } - - // Possible states for a Cloud Storage subscription. - enum State { - // Default value. This value is unused. - STATE_UNSPECIFIED = 0; - - // The subscription can actively send messages to Cloud Storage. - ACTIVE = 1; - - // Cannot write to the Cloud Storage bucket because of permission denied - // errors. - PERMISSION_DENIED = 2; - - // Cannot write to the Cloud Storage bucket because it does not exist. - NOT_FOUND = 3; - - // Cannot write to the destination because enforce_in_transit is set to true - // and the destination locations are not in the allowed regions. - IN_TRANSIT_LOCATION_RESTRICTION = 4; - - // Cannot write to the Cloud Storage bucket due to an incompatibility - // between the topic schema and subscription settings. - SCHEMA_MISMATCH = 5; - } - - // Required. User-provided name for the Cloud Storage bucket. - // The bucket must be created by the user. The bucket name must be without - // any prefix like "gs://". See the [bucket naming - // requirements] (https://cloud.google.com/storage/docs/buckets#naming). - string bucket = 1 [(google.api.field_behavior) = REQUIRED]; - - // Optional. User-provided prefix for Cloud Storage filename. See the [object - // naming requirements](https://cloud.google.com/storage/docs/objects#naming). - string filename_prefix = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. User-provided suffix for Cloud Storage filename. See the [object - // naming requirements](https://cloud.google.com/storage/docs/objects#naming). - // Must not end in "/". - string filename_suffix = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. User-provided format string specifying how to represent datetimes - // in Cloud Storage filenames. See the [datetime format - // guidance](https://cloud.google.com/pubsub/docs/create-cloudstorage-subscription#file_names). - string filename_datetime_format = 10 [(google.api.field_behavior) = OPTIONAL]; - - // Defaults to text format. - oneof output_format { - // Optional. If set, message data will be written to Cloud Storage in text - // format. - TextConfig text_config = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If set, message data will be written to Cloud Storage in Avro - // format. - AvroConfig avro_config = 5 [(google.api.field_behavior) = OPTIONAL]; - } - - // Optional. The maximum duration that can elapse before a new Cloud Storage - // file is created. Min 1 minute, max 10 minutes, default 5 minutes. May not - // exceed the subscription's acknowledgement deadline. - google.protobuf.Duration max_duration = 6 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The maximum bytes that can be written to a Cloud Storage file - // before a new file is created. Min 1 KB, max 10 GiB. The max_bytes limit may - // be exceeded in cases where messages are larger than the limit. - int64 max_bytes = 7 [(google.api.field_behavior) = OPTIONAL]; - - // Output only. An output-only field that indicates whether or not the - // subscription can receive messages. - State state = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. The service account to use to write to Cloud Storage. The - // subscription creator or updater that specifies this field must have - // `iam.serviceAccounts.actAs` permission on the service account. If not - // specified, the Pub/Sub - // [service agent](https://cloud.google.com/iam/docs/service-agents), - // service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com, is used. - string service_account_email = 11 [(google.api.field_behavior) = OPTIONAL]; -} - -// A message and its corresponding acknowledgment ID. -message ReceivedMessage { - // Optional. This ID can be used to acknowledge the received message. - string ack_id = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The message. - PubsubMessage message = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The approximate number of times that Pub/Sub has attempted to - // deliver the associated message to a subscriber. - // - // More precisely, this is 1 + (number of NACKs) + - // (number of ack_deadline exceeds) for this message. - // - // A NACK is any call to ModifyAckDeadline with a 0 deadline. An ack_deadline - // exceeds event is whenever a message is not acknowledged within - // ack_deadline. Note that ack_deadline is initially - // Subscription.ackDeadlineSeconds, but may get extended automatically by - // the client library. - // - // Upon the first delivery of a given message, `delivery_attempt` will have a - // value of 1. The value is calculated at best effort and is approximate. - // - // If a DeadLetterPolicy is not set on the subscription, this will be 0. - int32 delivery_attempt = 3 [(google.api.field_behavior) = OPTIONAL]; -} - -// Request for the GetSubscription method. -message GetSubscriptionRequest { - // Required. The name of the subscription to get. - // Format is `projects/{project}/subscriptions/{sub}`. - string subscription = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "pubsub.googleapis.com/Subscription" - } - ]; -} - -// Request for the UpdateSubscription method. -message UpdateSubscriptionRequest { - // Required. The updated subscription object. - Subscription subscription = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. Indicates which fields in the provided subscription to update. - // Must be specified and non-empty. - google.protobuf.FieldMask update_mask = 2 - [(google.api.field_behavior) = REQUIRED]; -} - -// Request for the `ListSubscriptions` method. -message ListSubscriptionsRequest { - // Required. The name of the project in which to list subscriptions. - // Format is `projects/{project-id}`. - string project = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "cloudresourcemanager.googleapis.com/Project" - } - ]; - - // Optional. Maximum number of subscriptions to return. - int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The value returned by the last `ListSubscriptionsResponse`; - // indicates that this is a continuation of a prior `ListSubscriptions` call, - // and that the system should return the next page of data. - string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; -} - -// Response for the `ListSubscriptions` method. -message ListSubscriptionsResponse { - // Optional. The subscriptions that match the request. - repeated Subscription subscriptions = 1 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If not empty, indicates that there may be more subscriptions that - // match the request; this value should be passed in a new - // `ListSubscriptionsRequest` to get more subscriptions. - string next_page_token = 2 [(google.api.field_behavior) = OPTIONAL]; -} - -// Request for the DeleteSubscription method. -message DeleteSubscriptionRequest { - // Required. The subscription to delete. - // Format is `projects/{project}/subscriptions/{sub}`. - string subscription = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "pubsub.googleapis.com/Subscription" - } - ]; -} - -// Request for the ModifyPushConfig method. -message ModifyPushConfigRequest { - // Required. The name of the subscription. - // Format is `projects/{project}/subscriptions/{sub}`. - string subscription = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "pubsub.googleapis.com/Subscription" - } - ]; - - // Required. The push configuration for future deliveries. - // - // An empty `pushConfig` indicates that the Pub/Sub system should - // stop pushing messages from the given subscription and allow - // messages to be pulled and acknowledged - effectively pausing - // the subscription if `Pull` or `StreamingPull` is not called. - PushConfig push_config = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request for the `Pull` method. -message PullRequest { - // Required. The subscription from which messages should be pulled. - // Format is `projects/{project}/subscriptions/{sub}`. - string subscription = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "pubsub.googleapis.com/Subscription" - } - ]; - - // Optional. If this field set to true, the system will respond immediately - // even if it there are no messages available to return in the `Pull` - // response. Otherwise, the system may wait (for a bounded amount of time) - // until at least one message is available, rather than returning no messages. - // Warning: setting this field to `true` is discouraged because it adversely - // impacts the performance of `Pull` operations. We recommend that users do - // not set this field. - bool return_immediately = 2 - [deprecated = true, (google.api.field_behavior) = OPTIONAL]; - - // Required. The maximum number of messages to return for this request. Must - // be a positive integer. The Pub/Sub system may return fewer than the number - // specified. - int32 max_messages = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// Response for the `Pull` method. -message PullResponse { - // Optional. Received Pub/Sub messages. The list will be empty if there are no - // more messages available in the backlog, or if no messages could be returned - // before the request timeout. For JSON, the response can be entirely - // empty. The Pub/Sub system may return fewer than the `maxMessages` requested - // even if there are more messages available in the backlog. - repeated ReceivedMessage received_messages = 1 - [(google.api.field_behavior) = OPTIONAL]; -} - -// Request for the ModifyAckDeadline method. -message ModifyAckDeadlineRequest { - // Required. The name of the subscription. - // Format is `projects/{project}/subscriptions/{sub}`. - string subscription = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "pubsub.googleapis.com/Subscription" - } - ]; - - // Required. List of acknowledgment IDs. - repeated string ack_ids = 4 [(google.api.field_behavior) = REQUIRED]; - - // Required. The new ack deadline with respect to the time this request was - // sent to the Pub/Sub system. For example, if the value is 10, the new ack - // deadline will expire 10 seconds after the `ModifyAckDeadline` call was - // made. Specifying zero might immediately make the message available for - // delivery to another subscriber client. This typically results in an - // increase in the rate of message redeliveries (that is, duplicates). - // The minimum deadline you can specify is 0 seconds. - // The maximum deadline you can specify in a single request is 600 seconds - // (10 minutes). - int32 ack_deadline_seconds = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// Request for the Acknowledge method. -message AcknowledgeRequest { - // Required. The subscription whose message is being acknowledged. - // Format is `projects/{project}/subscriptions/{sub}`. - string subscription = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "pubsub.googleapis.com/Subscription" - } - ]; - - // Required. The acknowledgment ID for the messages being acknowledged that - // was returned by the Pub/Sub system in the `Pull` response. Must not be - // empty. - repeated string ack_ids = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request for the `StreamingPull` streaming RPC method. This request is used to -// establish the initial stream as well as to stream acknowledgements and ack -// deadline modifications from the client to the server. -message StreamingPullRequest { - // Required. The subscription for which to initialize the new stream. This - // must be provided in the first request on the stream, and must not be set in - // subsequent requests from client to server. - // Format is `projects/{project}/subscriptions/{sub}`. - string subscription = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "pubsub.googleapis.com/Subscription" - } - ]; - - // Optional. List of acknowledgement IDs for acknowledging previously received - // messages (received on this stream or a different stream). If an ack ID has - // expired, the corresponding message may be redelivered later. Acknowledging - // a message more than once will not result in an error. If the - // acknowledgement ID is malformed, the stream will be aborted with status - // `INVALID_ARGUMENT`. - repeated string ack_ids = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The list of new ack deadlines for the IDs listed in - // `modify_deadline_ack_ids`. The size of this list must be the same as the - // size of `modify_deadline_ack_ids`. If it differs the stream will be aborted - // with `INVALID_ARGUMENT`. Each element in this list is applied to the - // element in the same position in `modify_deadline_ack_ids`. The new ack - // deadline is with respect to the time this request was sent to the Pub/Sub - // system. Must be >= 0. For example, if the value is 10, the new ack deadline - // will expire 10 seconds after this request is received. If the value is 0, - // the message is immediately made available for another streaming or - // non-streaming pull request. If the value is < 0 (an error), the stream will - // be aborted with status `INVALID_ARGUMENT`. - repeated int32 modify_deadline_seconds = 3 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. List of acknowledgement IDs whose deadline will be modified based - // on the corresponding element in `modify_deadline_seconds`. This field can - // be used to indicate that more time is needed to process a message by the - // subscriber, or to make the message available for redelivery if the - // processing was interrupted. - repeated string modify_deadline_ack_ids = 4 - [(google.api.field_behavior) = OPTIONAL]; - - // Required. The ack deadline to use for the stream. This must be provided in - // the first request on the stream, but it can also be updated on subsequent - // requests from client to server. The minimum deadline you can specify is 10 - // seconds. The maximum deadline you can specify is 600 seconds (10 minutes). - int32 stream_ack_deadline_seconds = 5 - [(google.api.field_behavior) = REQUIRED]; - - // Optional. A unique identifier that is used to distinguish client instances - // from each other. Only needs to be provided on the initial request. When a - // stream disconnects and reconnects for the same stream, the client_id should - // be set to the same value so that state associated with the old stream can - // be transferred to the new stream. The same client_id should not be used for - // different client instances. - string client_id = 6 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Flow control settings for the maximum number of outstanding - // messages. When there are `max_outstanding_messages` currently sent to the - // streaming pull client that have not yet been acked or nacked, the server - // stops sending more messages. The sending of messages resumes once the - // number of outstanding messages is less than this value. If the value is - // <= 0, there is no limit to the number of outstanding messages. This - // property can only be set on the initial StreamingPullRequest. If it is set - // on a subsequent request, the stream will be aborted with status - // `INVALID_ARGUMENT`. - int64 max_outstanding_messages = 7 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Flow control settings for the maximum number of outstanding - // bytes. When there are `max_outstanding_bytes` or more worth of messages - // currently sent to the streaming pull client that have not yet been acked or - // nacked, the server will stop sending more messages. The sending of messages - // resumes once the number of outstanding bytes is less than this value. If - // the value is <= 0, there is no limit to the number of outstanding bytes. - // This property can only be set on the initial StreamingPullRequest. If it is - // set on a subsequent request, the stream will be aborted with status - // `INVALID_ARGUMENT`. - int64 max_outstanding_bytes = 8 [(google.api.field_behavior) = OPTIONAL]; -} - -// Response for the `StreamingPull` method. This response is used to stream -// messages from the server to the client. -message StreamingPullResponse { - // Acknowledgement IDs sent in one or more previous requests to acknowledge a - // previously received message. - message AcknowledgeConfirmation { - // Optional. Successfully processed acknowledgement IDs. - repeated string ack_ids = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. List of acknowledgement IDs that were malformed or whose - // acknowledgement deadline has expired. - repeated string invalid_ack_ids = 2 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. List of acknowledgement IDs that were out of order. - repeated string unordered_ack_ids = 3 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. List of acknowledgement IDs that failed processing with - // temporary issues. - repeated string temporary_failed_ack_ids = 4 - [(google.api.field_behavior) = OPTIONAL]; - } - - // Acknowledgement IDs sent in one or more previous requests to modify the - // deadline for a specific message. - message ModifyAckDeadlineConfirmation { - // Optional. Successfully processed acknowledgement IDs. - repeated string ack_ids = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. List of acknowledgement IDs that were malformed or whose - // acknowledgement deadline has expired. - repeated string invalid_ack_ids = 2 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. List of acknowledgement IDs that failed processing with - // temporary issues. - repeated string temporary_failed_ack_ids = 3 - [(google.api.field_behavior) = OPTIONAL]; - } - - // Subscription properties sent as part of the response. - message SubscriptionProperties { - // Optional. True iff exactly once delivery is enabled for this - // subscription. - bool exactly_once_delivery_enabled = 1 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. True iff message ordering is enabled for this subscription. - bool message_ordering_enabled = 2 [(google.api.field_behavior) = OPTIONAL]; - } - - // Optional. Received Pub/Sub messages. This will not be empty. - repeated ReceivedMessage received_messages = 1 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. This field will only be set if `enable_exactly_once_delivery` is - // set to `true`. - AcknowledgeConfirmation acknowledge_confirmation = 5 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. This field will only be set if `enable_exactly_once_delivery` is - // set to `true`. - ModifyAckDeadlineConfirmation modify_ack_deadline_confirmation = 3 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Properties associated with this subscription. - SubscriptionProperties subscription_properties = 4 - [(google.api.field_behavior) = OPTIONAL]; -} - -// Request for the `CreateSnapshot` method. -message CreateSnapshotRequest { - // Required. User-provided name for this snapshot. If the name is not provided - // in the request, the server will assign a random name for this snapshot on - // the same project as the subscription. Note that for REST API requests, you - // must specify a name. See the [resource name - // rules](https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). - // Format is `projects/{project}/snapshots/{snap}`. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "pubsub.googleapis.com/Snapshot" } - ]; - - // Required. The subscription whose backlog the snapshot retains. - // Specifically, the created snapshot is guaranteed to retain: - // (a) The existing backlog on the subscription. More precisely, this is - // defined as the messages in the subscription's backlog that are - // unacknowledged upon the successful completion of the - // `CreateSnapshot` request; as well as: - // (b) Any messages published to the subscription's topic following the - // successful completion of the CreateSnapshot request. - // Format is `projects/{project}/subscriptions/{sub}`. - string subscription = 2 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "pubsub.googleapis.com/Subscription" - } - ]; - - // Optional. See [Creating and managing - // labels](https://cloud.google.com/pubsub/docs/labels). - map labels = 3 [(google.api.field_behavior) = OPTIONAL]; -} - -// Request for the UpdateSnapshot method. -message UpdateSnapshotRequest { - // Required. The updated snapshot object. - Snapshot snapshot = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. Indicates which fields in the provided snapshot to update. - // Must be specified and non-empty. - google.protobuf.FieldMask update_mask = 2 - [(google.api.field_behavior) = REQUIRED]; -} - -// A snapshot resource. Snapshots are used in -// [Seek](https://cloud.google.com/pubsub/docs/replay-overview) -// operations, which allow you to manage message acknowledgments in bulk. That -// is, you can set the acknowledgment state of messages in an existing -// subscription to the state captured by a snapshot. -message Snapshot { - option (google.api.resource) = { - type: "pubsub.googleapis.com/Snapshot" - pattern: "projects/{project}/snapshots/{snapshot}" - }; - - // Optional. The name of the snapshot. - string name = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The name of the topic from which this snapshot is retaining - // messages. - string topic = 2 [ - (google.api.field_behavior) = OPTIONAL, - (google.api.resource_reference) = { type: "pubsub.googleapis.com/Topic" } - ]; - - // Optional. The snapshot is guaranteed to exist up until this time. - // A newly-created snapshot expires no later than 7 days from the time of its - // creation. Its exact lifetime is determined at creation by the existing - // backlog in the source subscription. Specifically, the lifetime of the - // snapshot is `7 days - (age of oldest unacked message in the subscription)`. - // For example, consider a subscription whose oldest unacked message is 3 days - // old. If a snapshot is created from this subscription, the snapshot -- which - // will always capture this 3-day-old backlog as long as the snapshot - // exists -- will expire in 4 days. The service will refuse to create a - // snapshot that would expire in less than 1 hour after creation. - google.protobuf.Timestamp expire_time = 3 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. See [Creating and managing labels] - // (https://cloud.google.com/pubsub/docs/labels). - map labels = 4 [(google.api.field_behavior) = OPTIONAL]; -} - -// Request for the GetSnapshot method. -message GetSnapshotRequest { - // Required. The name of the snapshot to get. - // Format is `projects/{project}/snapshots/{snap}`. - string snapshot = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "pubsub.googleapis.com/Snapshot" } - ]; -} - -// Request for the `ListSnapshots` method. -message ListSnapshotsRequest { - // Required. The name of the project in which to list snapshots. - // Format is `projects/{project-id}`. - string project = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "cloudresourcemanager.googleapis.com/Project" - } - ]; - - // Optional. Maximum number of snapshots to return. - int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The value returned by the last `ListSnapshotsResponse`; indicates - // that this is a continuation of a prior `ListSnapshots` call, and that the - // system should return the next page of data. - string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; -} - -// Response for the `ListSnapshots` method. -message ListSnapshotsResponse { - // Optional. The resulting snapshots. - repeated Snapshot snapshots = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If not empty, indicates that there may be more snapshot that - // match the request; this value should be passed in a new - // `ListSnapshotsRequest`. - string next_page_token = 2 [(google.api.field_behavior) = OPTIONAL]; -} - -// Request for the `DeleteSnapshot` method. -message DeleteSnapshotRequest { - // Required. The name of the snapshot to delete. - // Format is `projects/{project}/snapshots/{snap}`. - string snapshot = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "pubsub.googleapis.com/Snapshot" } - ]; -} - -// Request for the `Seek` method. -message SeekRequest { - // Required. The subscription to affect. - string subscription = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "pubsub.googleapis.com/Subscription" - } - ]; - - oneof target { - // Optional. The time to seek to. - // Messages retained in the subscription that were published before this - // time are marked as acknowledged, and messages retained in the - // subscription that were published after this time are marked as - // unacknowledged. Note that this operation affects only those messages - // retained in the subscription (configured by the combination of - // `message_retention_duration` and `retain_acked_messages`). For example, - // if `time` corresponds to a point before the message retention - // window (or to a point before the system's notion of the subscription - // creation time), only retained messages will be marked as unacknowledged, - // and already-expunged messages will not be restored. - google.protobuf.Timestamp time = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The snapshot to seek to. The snapshot's topic must be the same - // as that of the provided subscription. Format is - // `projects/{project}/snapshots/{snap}`. - string snapshot = 3 [ - (google.api.field_behavior) = OPTIONAL, - (google.api.resource_reference) = { - type: "pubsub.googleapis.com/Snapshot" - } - ]; - } -} - -// Response for the `Seek` method (this response is empty). -message SeekResponse {} diff --git a/owl-bot-staging/v1/protos/google/pubsub/v1/schema.proto b/owl-bot-staging/v1/protos/google/pubsub/v1/schema.proto deleted file mode 100644 index d52c678c5..000000000 --- a/owl-bot-staging/v1/protos/google/pubsub/v1/schema.proto +++ /dev/null @@ -1,410 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.pubsub.v1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/protobuf/empty.proto"; -import "google/protobuf/timestamp.proto"; - -option cc_enable_arenas = true; -option csharp_namespace = "Google.Cloud.PubSub.V1"; -option go_package = "cloud.google.com/go/pubsub/apiv1/pubsubpb;pubsubpb"; -option java_multiple_files = true; -option java_outer_classname = "SchemaProto"; -option java_package = "com.google.pubsub.v1"; -option php_namespace = "Google\\Cloud\\PubSub\\V1"; -option ruby_package = "Google::Cloud::PubSub::V1"; - -// Service for doing schema-related operations. -service SchemaService { - option (google.api.default_host) = "pubsub.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform," - "https://www.googleapis.com/auth/pubsub"; - - // Creates a schema. - rpc CreateSchema(CreateSchemaRequest) returns (Schema) { - option (google.api.http) = { - post: "/v1/{parent=projects/*}/schemas" - body: "schema" - }; - option (google.api.method_signature) = "parent,schema,schema_id"; - } - - // Gets a schema. - rpc GetSchema(GetSchemaRequest) returns (Schema) { - option (google.api.http) = { - get: "/v1/{name=projects/*/schemas/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists schemas in a project. - rpc ListSchemas(ListSchemasRequest) returns (ListSchemasResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*}/schemas" - }; - option (google.api.method_signature) = "parent"; - } - - // Lists all schema revisions for the named schema. - rpc ListSchemaRevisions(ListSchemaRevisionsRequest) - returns (ListSchemaRevisionsResponse) { - option (google.api.http) = { - get: "/v1/{name=projects/*/schemas/*}:listRevisions" - }; - option (google.api.method_signature) = "name"; - } - - // Commits a new schema revision to an existing schema. - rpc CommitSchema(CommitSchemaRequest) returns (Schema) { - option (google.api.http) = { - post: "/v1/{name=projects/*/schemas/*}:commit" - body: "*" - }; - option (google.api.method_signature) = "name,schema"; - } - - // Creates a new schema revision that is a copy of the provided revision_id. - rpc RollbackSchema(RollbackSchemaRequest) returns (Schema) { - option (google.api.http) = { - post: "/v1/{name=projects/*/schemas/*}:rollback" - body: "*" - }; - option (google.api.method_signature) = "name,revision_id"; - } - - // Deletes a specific schema revision. - rpc DeleteSchemaRevision(DeleteSchemaRevisionRequest) returns (Schema) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/schemas/*}:deleteRevision" - }; - option (google.api.method_signature) = "name,revision_id"; - } - - // Deletes a schema. - rpc DeleteSchema(DeleteSchemaRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/schemas/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Validates a schema. - rpc ValidateSchema(ValidateSchemaRequest) returns (ValidateSchemaResponse) { - option (google.api.http) = { - post: "/v1/{parent=projects/*}/schemas:validate" - body: "*" - }; - option (google.api.method_signature) = "parent,schema"; - } - - // Validates a message against a schema. - rpc ValidateMessage(ValidateMessageRequest) - returns (ValidateMessageResponse) { - option (google.api.http) = { - post: "/v1/{parent=projects/*}/schemas:validateMessage" - body: "*" - }; - } -} - -// A schema resource. -message Schema { - option (google.api.resource) = { - type: "pubsub.googleapis.com/Schema" - pattern: "projects/{project}/schemas/{schema}" - }; - - // Possible schema definition types. - enum Type { - // Default value. This value is unused. - TYPE_UNSPECIFIED = 0; - - // A Protocol Buffer schema definition. - PROTOCOL_BUFFER = 1; - - // An Avro schema definition. - AVRO = 2; - } - - // Required. Name of the schema. - // Format is `projects/{project}/schemas/{schema}`. - string name = 1 [(google.api.field_behavior) = REQUIRED]; - - // The type of the schema definition. - Type type = 2; - - // The definition of the schema. This should contain a string representing - // the full definition of the schema that is a valid schema definition of - // the type specified in `type`. - string definition = 3; - - // Output only. Immutable. The revision ID of the schema. - string revision_id = 4 [ - (google.api.field_behavior) = IMMUTABLE, - (google.api.field_behavior) = OUTPUT_ONLY - ]; - - // Output only. The timestamp that the revision was created. - google.protobuf.Timestamp revision_create_time = 6 - [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// View of Schema object fields to be returned by GetSchema and ListSchemas. -enum SchemaView { - // The default / unset value. - // The API will default to the BASIC view. - SCHEMA_VIEW_UNSPECIFIED = 0; - - // Include the name and type of the schema, but not the definition. - BASIC = 1; - - // Include all Schema object fields. - FULL = 2; -} - -// Request for the CreateSchema method. -message CreateSchemaRequest { - // Required. The name of the project in which to create the schema. - // Format is `projects/{project-id}`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "pubsub.googleapis.com/Schema" - } - ]; - - // Required. The schema object to create. - // - // This schema's `name` parameter is ignored. The schema object returned - // by CreateSchema will have a `name` made using the given `parent` and - // `schema_id`. - Schema schema = 2 [(google.api.field_behavior) = REQUIRED]; - - // The ID to use for the schema, which will become the final component of - // the schema's resource name. - // - // See https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names for - // resource name constraints. - string schema_id = 3; -} - -// Request for the GetSchema method. -message GetSchemaRequest { - // Required. The name of the schema to get. - // Format is `projects/{project}/schemas/{schema}`. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "pubsub.googleapis.com/Schema" } - ]; - - // The set of fields to return in the response. If not set, returns a Schema - // with all fields filled out. Set to `BASIC` to omit the `definition`. - SchemaView view = 2; -} - -// Request for the `ListSchemas` method. -message ListSchemasRequest { - // Required. The name of the project in which to list schemas. - // Format is `projects/{project-id}`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "cloudresourcemanager.googleapis.com/Project" - } - ]; - - // The set of Schema fields to return in the response. If not set, returns - // Schemas with `name` and `type`, but not `definition`. Set to `FULL` to - // retrieve all fields. - SchemaView view = 2; - - // Maximum number of schemas to return. - int32 page_size = 3; - - // The value returned by the last `ListSchemasResponse`; indicates that - // this is a continuation of a prior `ListSchemas` call, and that the - // system should return the next page of data. - string page_token = 4; -} - -// Response for the `ListSchemas` method. -message ListSchemasResponse { - // The resulting schemas. - repeated Schema schemas = 1; - - // If not empty, indicates that there may be more schemas that match the - // request; this value should be passed in a new `ListSchemasRequest`. - string next_page_token = 2; -} - -// Request for the `ListSchemaRevisions` method. -message ListSchemaRevisionsRequest { - // Required. The name of the schema to list revisions for. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "pubsub.googleapis.com/Schema" } - ]; - - // The set of Schema fields to return in the response. If not set, returns - // Schemas with `name` and `type`, but not `definition`. Set to `FULL` to - // retrieve all fields. - SchemaView view = 2; - - // The maximum number of revisions to return per page. - int32 page_size = 3; - - // The page token, received from a previous ListSchemaRevisions call. - // Provide this to retrieve the subsequent page. - string page_token = 4; -} - -// Response for the `ListSchemaRevisions` method. -message ListSchemaRevisionsResponse { - // The revisions of the schema. - repeated Schema schemas = 1; - - // A token that can be sent as `page_token` to retrieve the next page. - // If this field is empty, there are no subsequent pages. - string next_page_token = 2; -} - -// Request for CommitSchema method. -message CommitSchemaRequest { - // Required. The name of the schema we are revising. - // Format is `projects/{project}/schemas/{schema}`. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "pubsub.googleapis.com/Schema" } - ]; - - // Required. The schema revision to commit. - Schema schema = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request for the `RollbackSchema` method. -message RollbackSchemaRequest { - // Required. The schema being rolled back with revision id. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "pubsub.googleapis.com/Schema" } - ]; - - // Required. The revision ID to roll back to. - // It must be a revision of the same schema. - // - // Example: c7cfa2a8 - string revision_id = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request for the `DeleteSchemaRevision` method. -message DeleteSchemaRevisionRequest { - // Required. The name of the schema revision to be deleted, with a revision ID - // explicitly included. - // - // Example: `projects/123/schemas/my-schema@c7cfa2a8` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "pubsub.googleapis.com/Schema" } - ]; - - // Optional. This field is deprecated and should not be used for specifying - // the revision ID. The revision ID should be specified via the `name` - // parameter. - string revision_id = 2 - [deprecated = true, (google.api.field_behavior) = OPTIONAL]; -} - -// Request for the `DeleteSchema` method. -message DeleteSchemaRequest { - // Required. Name of the schema to delete. - // Format is `projects/{project}/schemas/{schema}`. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "pubsub.googleapis.com/Schema" } - ]; -} - -// Request for the `ValidateSchema` method. -message ValidateSchemaRequest { - // Required. The name of the project in which to validate schemas. - // Format is `projects/{project-id}`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "cloudresourcemanager.googleapis.com/Project" - } - ]; - - // Required. The schema object to validate. - Schema schema = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Response for the `ValidateSchema` method. -// Empty for now. -message ValidateSchemaResponse {} - -// Request for the `ValidateMessage` method. -message ValidateMessageRequest { - // Required. The name of the project in which to validate schemas. - // Format is `projects/{project-id}`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "cloudresourcemanager.googleapis.com/Project" - } - ]; - - oneof schema_spec { - // Name of the schema against which to validate. - // - // Format is `projects/{project}/schemas/{schema}`. - string name = 2 [ - (google.api.resource_reference) = { type: "pubsub.googleapis.com/Schema" } - ]; - - // Ad-hoc schema against which to validate - Schema schema = 3; - } - - // Message to validate against the provided `schema_spec`. - bytes message = 4; - - // The encoding expected for messages - Encoding encoding = 5; -} - -// Response for the `ValidateMessage` method. -// Empty for now. -message ValidateMessageResponse {} - -// Possible encoding types for messages. -enum Encoding { - // Unspecified - ENCODING_UNSPECIFIED = 0; - - // JSON encoding - JSON = 1; - - // Binary encoding, as defined by the schema type. For some schema types, - // binary encoding may not be available. - BINARY = 2; -} diff --git a/owl-bot-staging/v1/protos/protos.d.ts b/owl-bot-staging/v1/protos/protos.d.ts deleted file mode 100644 index 19956f26c..000000000 --- a/owl-bot-staging/v1/protos/protos.d.ts +++ /dev/null @@ -1,15218 +0,0 @@ -// 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 google. */ -export namespace google { - - /** Namespace pubsub. */ - namespace pubsub { - - /** Namespace v1. */ - namespace v1 { - - /** Represents a Publisher */ - class Publisher extends $protobuf.rpc.Service { - - /** - * Constructs a new Publisher service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - - /** - * Creates new Publisher 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): Publisher; - - /** - * Calls CreateTopic. - * @param request Topic message or plain object - * @param callback Node-style callback called with the error, if any, and Topic - */ - public createTopic(request: google.pubsub.v1.ITopic, callback: google.pubsub.v1.Publisher.CreateTopicCallback): void; - - /** - * Calls CreateTopic. - * @param request Topic message or plain object - * @returns Promise - */ - public createTopic(request: google.pubsub.v1.ITopic): Promise; - - /** - * Calls UpdateTopic. - * @param request UpdateTopicRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Topic - */ - public updateTopic(request: google.pubsub.v1.IUpdateTopicRequest, callback: google.pubsub.v1.Publisher.UpdateTopicCallback): void; - - /** - * Calls UpdateTopic. - * @param request UpdateTopicRequest message or plain object - * @returns Promise - */ - public updateTopic(request: google.pubsub.v1.IUpdateTopicRequest): Promise; - - /** - * Calls Publish. - * @param request PublishRequest message or plain object - * @param callback Node-style callback called with the error, if any, and PublishResponse - */ - public publish(request: google.pubsub.v1.IPublishRequest, callback: google.pubsub.v1.Publisher.PublishCallback): void; - - /** - * Calls Publish. - * @param request PublishRequest message or plain object - * @returns Promise - */ - public publish(request: google.pubsub.v1.IPublishRequest): Promise; - - /** - * Calls GetTopic. - * @param request GetTopicRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Topic - */ - public getTopic(request: google.pubsub.v1.IGetTopicRequest, callback: google.pubsub.v1.Publisher.GetTopicCallback): void; - - /** - * Calls GetTopic. - * @param request GetTopicRequest message or plain object - * @returns Promise - */ - public getTopic(request: google.pubsub.v1.IGetTopicRequest): Promise; - - /** - * Calls ListTopics. - * @param request ListTopicsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListTopicsResponse - */ - public listTopics(request: google.pubsub.v1.IListTopicsRequest, callback: google.pubsub.v1.Publisher.ListTopicsCallback): void; - - /** - * Calls ListTopics. - * @param request ListTopicsRequest message or plain object - * @returns Promise - */ - public listTopics(request: google.pubsub.v1.IListTopicsRequest): Promise; - - /** - * Calls ListTopicSubscriptions. - * @param request ListTopicSubscriptionsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListTopicSubscriptionsResponse - */ - public listTopicSubscriptions(request: google.pubsub.v1.IListTopicSubscriptionsRequest, callback: google.pubsub.v1.Publisher.ListTopicSubscriptionsCallback): void; - - /** - * Calls ListTopicSubscriptions. - * @param request ListTopicSubscriptionsRequest message or plain object - * @returns Promise - */ - public listTopicSubscriptions(request: google.pubsub.v1.IListTopicSubscriptionsRequest): Promise; - - /** - * Calls ListTopicSnapshots. - * @param request ListTopicSnapshotsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListTopicSnapshotsResponse - */ - public listTopicSnapshots(request: google.pubsub.v1.IListTopicSnapshotsRequest, callback: google.pubsub.v1.Publisher.ListTopicSnapshotsCallback): void; - - /** - * Calls ListTopicSnapshots. - * @param request ListTopicSnapshotsRequest message or plain object - * @returns Promise - */ - public listTopicSnapshots(request: google.pubsub.v1.IListTopicSnapshotsRequest): Promise; - - /** - * Calls DeleteTopic. - * @param request DeleteTopicRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public deleteTopic(request: google.pubsub.v1.IDeleteTopicRequest, callback: google.pubsub.v1.Publisher.DeleteTopicCallback): void; - - /** - * Calls DeleteTopic. - * @param request DeleteTopicRequest message or plain object - * @returns Promise - */ - public deleteTopic(request: google.pubsub.v1.IDeleteTopicRequest): Promise; - - /** - * Calls DetachSubscription. - * @param request DetachSubscriptionRequest message or plain object - * @param callback Node-style callback called with the error, if any, and DetachSubscriptionResponse - */ - public detachSubscription(request: google.pubsub.v1.IDetachSubscriptionRequest, callback: google.pubsub.v1.Publisher.DetachSubscriptionCallback): void; - - /** - * Calls DetachSubscription. - * @param request DetachSubscriptionRequest message or plain object - * @returns Promise - */ - public detachSubscription(request: google.pubsub.v1.IDetachSubscriptionRequest): Promise; - } - - namespace Publisher { - - /** - * Callback as used by {@link google.pubsub.v1.Publisher|createTopic}. - * @param error Error, if any - * @param [response] Topic - */ - type CreateTopicCallback = (error: (Error|null), response?: google.pubsub.v1.Topic) => void; - - /** - * Callback as used by {@link google.pubsub.v1.Publisher|updateTopic}. - * @param error Error, if any - * @param [response] Topic - */ - type UpdateTopicCallback = (error: (Error|null), response?: google.pubsub.v1.Topic) => void; - - /** - * Callback as used by {@link google.pubsub.v1.Publisher|publish}. - * @param error Error, if any - * @param [response] PublishResponse - */ - type PublishCallback = (error: (Error|null), response?: google.pubsub.v1.PublishResponse) => void; - - /** - * Callback as used by {@link google.pubsub.v1.Publisher|getTopic}. - * @param error Error, if any - * @param [response] Topic - */ - type GetTopicCallback = (error: (Error|null), response?: google.pubsub.v1.Topic) => void; - - /** - * Callback as used by {@link google.pubsub.v1.Publisher|listTopics}. - * @param error Error, if any - * @param [response] ListTopicsResponse - */ - type ListTopicsCallback = (error: (Error|null), response?: google.pubsub.v1.ListTopicsResponse) => void; - - /** - * Callback as used by {@link google.pubsub.v1.Publisher|listTopicSubscriptions}. - * @param error Error, if any - * @param [response] ListTopicSubscriptionsResponse - */ - type ListTopicSubscriptionsCallback = (error: (Error|null), response?: google.pubsub.v1.ListTopicSubscriptionsResponse) => void; - - /** - * Callback as used by {@link google.pubsub.v1.Publisher|listTopicSnapshots}. - * @param error Error, if any - * @param [response] ListTopicSnapshotsResponse - */ - type ListTopicSnapshotsCallback = (error: (Error|null), response?: google.pubsub.v1.ListTopicSnapshotsResponse) => void; - - /** - * Callback as used by {@link google.pubsub.v1.Publisher|deleteTopic}. - * @param error Error, if any - * @param [response] Empty - */ - type DeleteTopicCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.pubsub.v1.Publisher|detachSubscription}. - * @param error Error, if any - * @param [response] DetachSubscriptionResponse - */ - type DetachSubscriptionCallback = (error: (Error|null), response?: google.pubsub.v1.DetachSubscriptionResponse) => void; - } - - /** Properties of a MessageStoragePolicy. */ - interface IMessageStoragePolicy { - - /** MessageStoragePolicy allowedPersistenceRegions */ - allowedPersistenceRegions?: (string[]|null); - - /** MessageStoragePolicy enforceInTransit */ - enforceInTransit?: (boolean|null); - } - - /** Represents a MessageStoragePolicy. */ - class MessageStoragePolicy implements IMessageStoragePolicy { - - /** - * Constructs a new MessageStoragePolicy. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.IMessageStoragePolicy); - - /** MessageStoragePolicy allowedPersistenceRegions. */ - public allowedPersistenceRegions: string[]; - - /** MessageStoragePolicy enforceInTransit. */ - public enforceInTransit: boolean; - - /** - * Creates a new MessageStoragePolicy instance using the specified properties. - * @param [properties] Properties to set - * @returns MessageStoragePolicy instance - */ - public static create(properties?: google.pubsub.v1.IMessageStoragePolicy): google.pubsub.v1.MessageStoragePolicy; - - /** - * Encodes the specified MessageStoragePolicy message. Does not implicitly {@link google.pubsub.v1.MessageStoragePolicy.verify|verify} messages. - * @param message MessageStoragePolicy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.IMessageStoragePolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MessageStoragePolicy message, length delimited. Does not implicitly {@link google.pubsub.v1.MessageStoragePolicy.verify|verify} messages. - * @param message MessageStoragePolicy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.IMessageStoragePolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MessageStoragePolicy message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MessageStoragePolicy - * @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.pubsub.v1.MessageStoragePolicy; - - /** - * Decodes a MessageStoragePolicy message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MessageStoragePolicy - * @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.pubsub.v1.MessageStoragePolicy; - - /** - * Verifies a MessageStoragePolicy 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 MessageStoragePolicy message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MessageStoragePolicy - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.MessageStoragePolicy; - - /** - * Creates a plain object from a MessageStoragePolicy message. Also converts values to other types if specified. - * @param message MessageStoragePolicy - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.MessageStoragePolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MessageStoragePolicy to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MessageStoragePolicy - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a SchemaSettings. */ - interface ISchemaSettings { - - /** SchemaSettings schema */ - schema?: (string|null); - - /** SchemaSettings encoding */ - encoding?: (google.pubsub.v1.Encoding|keyof typeof google.pubsub.v1.Encoding|null); - - /** SchemaSettings firstRevisionId */ - firstRevisionId?: (string|null); - - /** SchemaSettings lastRevisionId */ - lastRevisionId?: (string|null); - } - - /** Represents a SchemaSettings. */ - class SchemaSettings implements ISchemaSettings { - - /** - * Constructs a new SchemaSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.ISchemaSettings); - - /** SchemaSettings schema. */ - public schema: string; - - /** SchemaSettings encoding. */ - public encoding: (google.pubsub.v1.Encoding|keyof typeof google.pubsub.v1.Encoding); - - /** SchemaSettings firstRevisionId. */ - public firstRevisionId: string; - - /** SchemaSettings lastRevisionId. */ - public lastRevisionId: string; - - /** - * Creates a new SchemaSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns SchemaSettings instance - */ - public static create(properties?: google.pubsub.v1.ISchemaSettings): google.pubsub.v1.SchemaSettings; - - /** - * Encodes the specified SchemaSettings message. Does not implicitly {@link google.pubsub.v1.SchemaSettings.verify|verify} messages. - * @param message SchemaSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.ISchemaSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SchemaSettings message, length delimited. Does not implicitly {@link google.pubsub.v1.SchemaSettings.verify|verify} messages. - * @param message SchemaSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.ISchemaSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SchemaSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SchemaSettings - * @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.pubsub.v1.SchemaSettings; - - /** - * Decodes a SchemaSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SchemaSettings - * @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.pubsub.v1.SchemaSettings; - - /** - * Verifies a SchemaSettings 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 SchemaSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SchemaSettings - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.SchemaSettings; - - /** - * Creates a plain object from a SchemaSettings message. Also converts values to other types if specified. - * @param message SchemaSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.SchemaSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SchemaSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SchemaSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an IngestionDataSourceSettings. */ - interface IIngestionDataSourceSettings { - - /** IngestionDataSourceSettings awsKinesis */ - awsKinesis?: (google.pubsub.v1.IngestionDataSourceSettings.IAwsKinesis|null); - } - - /** Represents an IngestionDataSourceSettings. */ - class IngestionDataSourceSettings implements IIngestionDataSourceSettings { - - /** - * Constructs a new IngestionDataSourceSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.IIngestionDataSourceSettings); - - /** IngestionDataSourceSettings awsKinesis. */ - public awsKinesis?: (google.pubsub.v1.IngestionDataSourceSettings.IAwsKinesis|null); - - /** IngestionDataSourceSettings source. */ - public source?: "awsKinesis"; - - /** - * Creates a new IngestionDataSourceSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns IngestionDataSourceSettings instance - */ - public static create(properties?: google.pubsub.v1.IIngestionDataSourceSettings): google.pubsub.v1.IngestionDataSourceSettings; - - /** - * Encodes the specified IngestionDataSourceSettings message. Does not implicitly {@link google.pubsub.v1.IngestionDataSourceSettings.verify|verify} messages. - * @param message IngestionDataSourceSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.IIngestionDataSourceSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified IngestionDataSourceSettings message, length delimited. Does not implicitly {@link google.pubsub.v1.IngestionDataSourceSettings.verify|verify} messages. - * @param message IngestionDataSourceSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.IIngestionDataSourceSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an IngestionDataSourceSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns IngestionDataSourceSettings - * @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.pubsub.v1.IngestionDataSourceSettings; - - /** - * Decodes an IngestionDataSourceSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns IngestionDataSourceSettings - * @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.pubsub.v1.IngestionDataSourceSettings; - - /** - * Verifies an IngestionDataSourceSettings 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 IngestionDataSourceSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns IngestionDataSourceSettings - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.IngestionDataSourceSettings; - - /** - * Creates a plain object from an IngestionDataSourceSettings message. Also converts values to other types if specified. - * @param message IngestionDataSourceSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.IngestionDataSourceSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this IngestionDataSourceSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for IngestionDataSourceSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace IngestionDataSourceSettings { - - /** Properties of an AwsKinesis. */ - interface IAwsKinesis { - - /** AwsKinesis state */ - state?: (google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis.State|keyof typeof google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis.State|null); - - /** AwsKinesis streamArn */ - streamArn?: (string|null); - - /** AwsKinesis consumerArn */ - consumerArn?: (string|null); - - /** AwsKinesis awsRoleArn */ - awsRoleArn?: (string|null); - - /** AwsKinesis gcpServiceAccount */ - gcpServiceAccount?: (string|null); - } - - /** Represents an AwsKinesis. */ - class AwsKinesis implements IAwsKinesis { - - /** - * Constructs a new AwsKinesis. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.IngestionDataSourceSettings.IAwsKinesis); - - /** AwsKinesis state. */ - public state: (google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis.State|keyof typeof google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis.State); - - /** AwsKinesis streamArn. */ - public streamArn: string; - - /** AwsKinesis consumerArn. */ - public consumerArn: string; - - /** AwsKinesis awsRoleArn. */ - public awsRoleArn: string; - - /** AwsKinesis gcpServiceAccount. */ - public gcpServiceAccount: string; - - /** - * Creates a new AwsKinesis instance using the specified properties. - * @param [properties] Properties to set - * @returns AwsKinesis instance - */ - public static create(properties?: google.pubsub.v1.IngestionDataSourceSettings.IAwsKinesis): google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis; - - /** - * Encodes the specified AwsKinesis message. Does not implicitly {@link google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis.verify|verify} messages. - * @param message AwsKinesis message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.IngestionDataSourceSettings.IAwsKinesis, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AwsKinesis message, length delimited. Does not implicitly {@link google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis.verify|verify} messages. - * @param message AwsKinesis message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.IngestionDataSourceSettings.IAwsKinesis, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AwsKinesis message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AwsKinesis - * @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.pubsub.v1.IngestionDataSourceSettings.AwsKinesis; - - /** - * Decodes an AwsKinesis message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AwsKinesis - * @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.pubsub.v1.IngestionDataSourceSettings.AwsKinesis; - - /** - * Verifies an AwsKinesis 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 AwsKinesis message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AwsKinesis - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis; - - /** - * Creates a plain object from an AwsKinesis message. Also converts values to other types if specified. - * @param message AwsKinesis - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AwsKinesis to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AwsKinesis - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace AwsKinesis { - - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - ACTIVE = 1, - KINESIS_PERMISSION_DENIED = 2, - PUBLISH_PERMISSION_DENIED = 3, - STREAM_NOT_FOUND = 4, - CONSUMER_NOT_FOUND = 5 - } - } - } - - /** Properties of a Topic. */ - interface ITopic { - - /** Topic name */ - name?: (string|null); - - /** Topic labels */ - labels?: ({ [k: string]: string }|null); - - /** Topic messageStoragePolicy */ - messageStoragePolicy?: (google.pubsub.v1.IMessageStoragePolicy|null); - - /** Topic kmsKeyName */ - kmsKeyName?: (string|null); - - /** Topic schemaSettings */ - schemaSettings?: (google.pubsub.v1.ISchemaSettings|null); - - /** Topic satisfiesPzs */ - satisfiesPzs?: (boolean|null); - - /** Topic messageRetentionDuration */ - messageRetentionDuration?: (google.protobuf.IDuration|null); - - /** Topic state */ - state?: (google.pubsub.v1.Topic.State|keyof typeof google.pubsub.v1.Topic.State|null); - - /** Topic ingestionDataSourceSettings */ - ingestionDataSourceSettings?: (google.pubsub.v1.IIngestionDataSourceSettings|null); - } - - /** Represents a Topic. */ - class Topic implements ITopic { - - /** - * Constructs a new Topic. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.ITopic); - - /** Topic name. */ - public name: string; - - /** Topic labels. */ - public labels: { [k: string]: string }; - - /** Topic messageStoragePolicy. */ - public messageStoragePolicy?: (google.pubsub.v1.IMessageStoragePolicy|null); - - /** Topic kmsKeyName. */ - public kmsKeyName: string; - - /** Topic schemaSettings. */ - public schemaSettings?: (google.pubsub.v1.ISchemaSettings|null); - - /** Topic satisfiesPzs. */ - public satisfiesPzs: boolean; - - /** Topic messageRetentionDuration. */ - public messageRetentionDuration?: (google.protobuf.IDuration|null); - - /** Topic state. */ - public state: (google.pubsub.v1.Topic.State|keyof typeof google.pubsub.v1.Topic.State); - - /** Topic ingestionDataSourceSettings. */ - public ingestionDataSourceSettings?: (google.pubsub.v1.IIngestionDataSourceSettings|null); - - /** - * Creates a new Topic instance using the specified properties. - * @param [properties] Properties to set - * @returns Topic instance - */ - public static create(properties?: google.pubsub.v1.ITopic): google.pubsub.v1.Topic; - - /** - * Encodes the specified Topic message. Does not implicitly {@link google.pubsub.v1.Topic.verify|verify} messages. - * @param message Topic message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.ITopic, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Topic message, length delimited. Does not implicitly {@link google.pubsub.v1.Topic.verify|verify} messages. - * @param message Topic message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.ITopic, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Topic message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Topic - * @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.pubsub.v1.Topic; - - /** - * Decodes a Topic message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Topic - * @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.pubsub.v1.Topic; - - /** - * Verifies a Topic 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 Topic message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Topic - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.Topic; - - /** - * Creates a plain object from a Topic message. Also converts values to other types if specified. - * @param message Topic - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.Topic, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Topic to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Topic - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Topic { - - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - ACTIVE = 1, - INGESTION_RESOURCE_ERROR = 2 - } - } - - /** Properties of a PubsubMessage. */ - interface IPubsubMessage { - - /** PubsubMessage data */ - data?: (Uint8Array|string|null); - - /** PubsubMessage attributes */ - attributes?: ({ [k: string]: string }|null); - - /** PubsubMessage messageId */ - messageId?: (string|null); - - /** PubsubMessage publishTime */ - publishTime?: (google.protobuf.ITimestamp|null); - - /** PubsubMessage orderingKey */ - orderingKey?: (string|null); - } - - /** Represents a PubsubMessage. */ - class PubsubMessage implements IPubsubMessage { - - /** - * Constructs a new PubsubMessage. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.IPubsubMessage); - - /** PubsubMessage data. */ - public data: (Uint8Array|string); - - /** PubsubMessage attributes. */ - public attributes: { [k: string]: string }; - - /** PubsubMessage messageId. */ - public messageId: string; - - /** PubsubMessage publishTime. */ - public publishTime?: (google.protobuf.ITimestamp|null); - - /** PubsubMessage orderingKey. */ - public orderingKey: string; - - /** - * Creates a new PubsubMessage instance using the specified properties. - * @param [properties] Properties to set - * @returns PubsubMessage instance - */ - public static create(properties?: google.pubsub.v1.IPubsubMessage): google.pubsub.v1.PubsubMessage; - - /** - * Encodes the specified PubsubMessage message. Does not implicitly {@link google.pubsub.v1.PubsubMessage.verify|verify} messages. - * @param message PubsubMessage message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.IPubsubMessage, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PubsubMessage message, length delimited. Does not implicitly {@link google.pubsub.v1.PubsubMessage.verify|verify} messages. - * @param message PubsubMessage message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.IPubsubMessage, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PubsubMessage message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PubsubMessage - * @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.pubsub.v1.PubsubMessage; - - /** - * Decodes a PubsubMessage message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PubsubMessage - * @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.pubsub.v1.PubsubMessage; - - /** - * Verifies a PubsubMessage 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 PubsubMessage message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PubsubMessage - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.PubsubMessage; - - /** - * Creates a plain object from a PubsubMessage message. Also converts values to other types if specified. - * @param message PubsubMessage - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.PubsubMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PubsubMessage to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PubsubMessage - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetTopicRequest. */ - interface IGetTopicRequest { - - /** GetTopicRequest topic */ - topic?: (string|null); - } - - /** Represents a GetTopicRequest. */ - class GetTopicRequest implements IGetTopicRequest { - - /** - * Constructs a new GetTopicRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.IGetTopicRequest); - - /** GetTopicRequest topic. */ - public topic: string; - - /** - * Creates a new GetTopicRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetTopicRequest instance - */ - public static create(properties?: google.pubsub.v1.IGetTopicRequest): google.pubsub.v1.GetTopicRequest; - - /** - * Encodes the specified GetTopicRequest message. Does not implicitly {@link google.pubsub.v1.GetTopicRequest.verify|verify} messages. - * @param message GetTopicRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.IGetTopicRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetTopicRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.GetTopicRequest.verify|verify} messages. - * @param message GetTopicRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.IGetTopicRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetTopicRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetTopicRequest - * @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.pubsub.v1.GetTopicRequest; - - /** - * Decodes a GetTopicRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetTopicRequest - * @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.pubsub.v1.GetTopicRequest; - - /** - * Verifies a GetTopicRequest 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 GetTopicRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetTopicRequest - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.GetTopicRequest; - - /** - * Creates a plain object from a GetTopicRequest message. Also converts values to other types if specified. - * @param message GetTopicRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.GetTopicRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetTopicRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetTopicRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateTopicRequest. */ - interface IUpdateTopicRequest { - - /** UpdateTopicRequest topic */ - topic?: (google.pubsub.v1.ITopic|null); - - /** UpdateTopicRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - } - - /** Represents an UpdateTopicRequest. */ - class UpdateTopicRequest implements IUpdateTopicRequest { - - /** - * Constructs a new UpdateTopicRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.IUpdateTopicRequest); - - /** UpdateTopicRequest topic. */ - public topic?: (google.pubsub.v1.ITopic|null); - - /** UpdateTopicRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); - - /** - * Creates a new UpdateTopicRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateTopicRequest instance - */ - public static create(properties?: google.pubsub.v1.IUpdateTopicRequest): google.pubsub.v1.UpdateTopicRequest; - - /** - * Encodes the specified UpdateTopicRequest message. Does not implicitly {@link google.pubsub.v1.UpdateTopicRequest.verify|verify} messages. - * @param message UpdateTopicRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.IUpdateTopicRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateTopicRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.UpdateTopicRequest.verify|verify} messages. - * @param message UpdateTopicRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.IUpdateTopicRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateTopicRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateTopicRequest - * @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.pubsub.v1.UpdateTopicRequest; - - /** - * Decodes an UpdateTopicRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateTopicRequest - * @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.pubsub.v1.UpdateTopicRequest; - - /** - * Verifies an UpdateTopicRequest 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 UpdateTopicRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateTopicRequest - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.UpdateTopicRequest; - - /** - * Creates a plain object from an UpdateTopicRequest message. Also converts values to other types if specified. - * @param message UpdateTopicRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.UpdateTopicRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateTopicRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateTopicRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a PublishRequest. */ - interface IPublishRequest { - - /** PublishRequest topic */ - topic?: (string|null); - - /** PublishRequest messages */ - messages?: (google.pubsub.v1.IPubsubMessage[]|null); - } - - /** Represents a PublishRequest. */ - class PublishRequest implements IPublishRequest { - - /** - * Constructs a new PublishRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.IPublishRequest); - - /** PublishRequest topic. */ - public topic: string; - - /** PublishRequest messages. */ - public messages: google.pubsub.v1.IPubsubMessage[]; - - /** - * Creates a new PublishRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns PublishRequest instance - */ - public static create(properties?: google.pubsub.v1.IPublishRequest): google.pubsub.v1.PublishRequest; - - /** - * Encodes the specified PublishRequest message. Does not implicitly {@link google.pubsub.v1.PublishRequest.verify|verify} messages. - * @param message PublishRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.IPublishRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PublishRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.PublishRequest.verify|verify} messages. - * @param message PublishRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.IPublishRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PublishRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PublishRequest - * @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.pubsub.v1.PublishRequest; - - /** - * Decodes a PublishRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PublishRequest - * @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.pubsub.v1.PublishRequest; - - /** - * Verifies a PublishRequest 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 PublishRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PublishRequest - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.PublishRequest; - - /** - * Creates a plain object from a PublishRequest message. Also converts values to other types if specified. - * @param message PublishRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.PublishRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PublishRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PublishRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a PublishResponse. */ - interface IPublishResponse { - - /** PublishResponse messageIds */ - messageIds?: (string[]|null); - } - - /** Represents a PublishResponse. */ - class PublishResponse implements IPublishResponse { - - /** - * Constructs a new PublishResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.IPublishResponse); - - /** PublishResponse messageIds. */ - public messageIds: string[]; - - /** - * Creates a new PublishResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns PublishResponse instance - */ - public static create(properties?: google.pubsub.v1.IPublishResponse): google.pubsub.v1.PublishResponse; - - /** - * Encodes the specified PublishResponse message. Does not implicitly {@link google.pubsub.v1.PublishResponse.verify|verify} messages. - * @param message PublishResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.IPublishResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PublishResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.PublishResponse.verify|verify} messages. - * @param message PublishResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.IPublishResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PublishResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PublishResponse - * @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.pubsub.v1.PublishResponse; - - /** - * Decodes a PublishResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PublishResponse - * @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.pubsub.v1.PublishResponse; - - /** - * Verifies a PublishResponse 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 PublishResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PublishResponse - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.PublishResponse; - - /** - * Creates a plain object from a PublishResponse message. Also converts values to other types if specified. - * @param message PublishResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.PublishResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PublishResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PublishResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListTopicsRequest. */ - interface IListTopicsRequest { - - /** ListTopicsRequest project */ - project?: (string|null); - - /** ListTopicsRequest pageSize */ - pageSize?: (number|null); - - /** ListTopicsRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a ListTopicsRequest. */ - class ListTopicsRequest implements IListTopicsRequest { - - /** - * Constructs a new ListTopicsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.IListTopicsRequest); - - /** ListTopicsRequest project. */ - public project: string; - - /** ListTopicsRequest pageSize. */ - public pageSize: number; - - /** ListTopicsRequest pageToken. */ - public pageToken: string; - - /** - * Creates a new ListTopicsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListTopicsRequest instance - */ - public static create(properties?: google.pubsub.v1.IListTopicsRequest): google.pubsub.v1.ListTopicsRequest; - - /** - * Encodes the specified ListTopicsRequest message. Does not implicitly {@link google.pubsub.v1.ListTopicsRequest.verify|verify} messages. - * @param message ListTopicsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.IListTopicsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListTopicsRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.ListTopicsRequest.verify|verify} messages. - * @param message ListTopicsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.IListTopicsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListTopicsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListTopicsRequest - * @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.pubsub.v1.ListTopicsRequest; - - /** - * Decodes a ListTopicsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListTopicsRequest - * @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.pubsub.v1.ListTopicsRequest; - - /** - * Verifies a ListTopicsRequest 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 ListTopicsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListTopicsRequest - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.ListTopicsRequest; - - /** - * Creates a plain object from a ListTopicsRequest message. Also converts values to other types if specified. - * @param message ListTopicsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.ListTopicsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListTopicsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListTopicsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListTopicsResponse. */ - interface IListTopicsResponse { - - /** ListTopicsResponse topics */ - topics?: (google.pubsub.v1.ITopic[]|null); - - /** ListTopicsResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListTopicsResponse. */ - class ListTopicsResponse implements IListTopicsResponse { - - /** - * Constructs a new ListTopicsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.IListTopicsResponse); - - /** ListTopicsResponse topics. */ - public topics: google.pubsub.v1.ITopic[]; - - /** ListTopicsResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListTopicsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListTopicsResponse instance - */ - public static create(properties?: google.pubsub.v1.IListTopicsResponse): google.pubsub.v1.ListTopicsResponse; - - /** - * Encodes the specified ListTopicsResponse message. Does not implicitly {@link google.pubsub.v1.ListTopicsResponse.verify|verify} messages. - * @param message ListTopicsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.IListTopicsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListTopicsResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.ListTopicsResponse.verify|verify} messages. - * @param message ListTopicsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.IListTopicsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListTopicsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListTopicsResponse - * @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.pubsub.v1.ListTopicsResponse; - - /** - * Decodes a ListTopicsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListTopicsResponse - * @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.pubsub.v1.ListTopicsResponse; - - /** - * Verifies a ListTopicsResponse 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 ListTopicsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListTopicsResponse - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.ListTopicsResponse; - - /** - * Creates a plain object from a ListTopicsResponse message. Also converts values to other types if specified. - * @param message ListTopicsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.ListTopicsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListTopicsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListTopicsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListTopicSubscriptionsRequest. */ - interface IListTopicSubscriptionsRequest { - - /** ListTopicSubscriptionsRequest topic */ - topic?: (string|null); - - /** ListTopicSubscriptionsRequest pageSize */ - pageSize?: (number|null); - - /** ListTopicSubscriptionsRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a ListTopicSubscriptionsRequest. */ - class ListTopicSubscriptionsRequest implements IListTopicSubscriptionsRequest { - - /** - * Constructs a new ListTopicSubscriptionsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.IListTopicSubscriptionsRequest); - - /** ListTopicSubscriptionsRequest topic. */ - public topic: string; - - /** ListTopicSubscriptionsRequest pageSize. */ - public pageSize: number; - - /** ListTopicSubscriptionsRequest pageToken. */ - public pageToken: string; - - /** - * Creates a new ListTopicSubscriptionsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListTopicSubscriptionsRequest instance - */ - public static create(properties?: google.pubsub.v1.IListTopicSubscriptionsRequest): google.pubsub.v1.ListTopicSubscriptionsRequest; - - /** - * Encodes the specified ListTopicSubscriptionsRequest message. Does not implicitly {@link google.pubsub.v1.ListTopicSubscriptionsRequest.verify|verify} messages. - * @param message ListTopicSubscriptionsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.IListTopicSubscriptionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListTopicSubscriptionsRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.ListTopicSubscriptionsRequest.verify|verify} messages. - * @param message ListTopicSubscriptionsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.IListTopicSubscriptionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListTopicSubscriptionsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListTopicSubscriptionsRequest - * @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.pubsub.v1.ListTopicSubscriptionsRequest; - - /** - * Decodes a ListTopicSubscriptionsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListTopicSubscriptionsRequest - * @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.pubsub.v1.ListTopicSubscriptionsRequest; - - /** - * Verifies a ListTopicSubscriptionsRequest 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 ListTopicSubscriptionsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListTopicSubscriptionsRequest - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.ListTopicSubscriptionsRequest; - - /** - * Creates a plain object from a ListTopicSubscriptionsRequest message. Also converts values to other types if specified. - * @param message ListTopicSubscriptionsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.ListTopicSubscriptionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListTopicSubscriptionsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListTopicSubscriptionsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListTopicSubscriptionsResponse. */ - interface IListTopicSubscriptionsResponse { - - /** ListTopicSubscriptionsResponse subscriptions */ - subscriptions?: (string[]|null); - - /** ListTopicSubscriptionsResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListTopicSubscriptionsResponse. */ - class ListTopicSubscriptionsResponse implements IListTopicSubscriptionsResponse { - - /** - * Constructs a new ListTopicSubscriptionsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.IListTopicSubscriptionsResponse); - - /** ListTopicSubscriptionsResponse subscriptions. */ - public subscriptions: string[]; - - /** ListTopicSubscriptionsResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListTopicSubscriptionsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListTopicSubscriptionsResponse instance - */ - public static create(properties?: google.pubsub.v1.IListTopicSubscriptionsResponse): google.pubsub.v1.ListTopicSubscriptionsResponse; - - /** - * Encodes the specified ListTopicSubscriptionsResponse message. Does not implicitly {@link google.pubsub.v1.ListTopicSubscriptionsResponse.verify|verify} messages. - * @param message ListTopicSubscriptionsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.IListTopicSubscriptionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListTopicSubscriptionsResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.ListTopicSubscriptionsResponse.verify|verify} messages. - * @param message ListTopicSubscriptionsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.IListTopicSubscriptionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListTopicSubscriptionsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListTopicSubscriptionsResponse - * @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.pubsub.v1.ListTopicSubscriptionsResponse; - - /** - * Decodes a ListTopicSubscriptionsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListTopicSubscriptionsResponse - * @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.pubsub.v1.ListTopicSubscriptionsResponse; - - /** - * Verifies a ListTopicSubscriptionsResponse 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 ListTopicSubscriptionsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListTopicSubscriptionsResponse - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.ListTopicSubscriptionsResponse; - - /** - * Creates a plain object from a ListTopicSubscriptionsResponse message. Also converts values to other types if specified. - * @param message ListTopicSubscriptionsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.ListTopicSubscriptionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListTopicSubscriptionsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListTopicSubscriptionsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListTopicSnapshotsRequest. */ - interface IListTopicSnapshotsRequest { - - /** ListTopicSnapshotsRequest topic */ - topic?: (string|null); - - /** ListTopicSnapshotsRequest pageSize */ - pageSize?: (number|null); - - /** ListTopicSnapshotsRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a ListTopicSnapshotsRequest. */ - class ListTopicSnapshotsRequest implements IListTopicSnapshotsRequest { - - /** - * Constructs a new ListTopicSnapshotsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.IListTopicSnapshotsRequest); - - /** ListTopicSnapshotsRequest topic. */ - public topic: string; - - /** ListTopicSnapshotsRequest pageSize. */ - public pageSize: number; - - /** ListTopicSnapshotsRequest pageToken. */ - public pageToken: string; - - /** - * Creates a new ListTopicSnapshotsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListTopicSnapshotsRequest instance - */ - public static create(properties?: google.pubsub.v1.IListTopicSnapshotsRequest): google.pubsub.v1.ListTopicSnapshotsRequest; - - /** - * Encodes the specified ListTopicSnapshotsRequest message. Does not implicitly {@link google.pubsub.v1.ListTopicSnapshotsRequest.verify|verify} messages. - * @param message ListTopicSnapshotsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.IListTopicSnapshotsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListTopicSnapshotsRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.ListTopicSnapshotsRequest.verify|verify} messages. - * @param message ListTopicSnapshotsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.IListTopicSnapshotsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListTopicSnapshotsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListTopicSnapshotsRequest - * @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.pubsub.v1.ListTopicSnapshotsRequest; - - /** - * Decodes a ListTopicSnapshotsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListTopicSnapshotsRequest - * @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.pubsub.v1.ListTopicSnapshotsRequest; - - /** - * Verifies a ListTopicSnapshotsRequest 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 ListTopicSnapshotsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListTopicSnapshotsRequest - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.ListTopicSnapshotsRequest; - - /** - * Creates a plain object from a ListTopicSnapshotsRequest message. Also converts values to other types if specified. - * @param message ListTopicSnapshotsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.ListTopicSnapshotsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListTopicSnapshotsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListTopicSnapshotsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListTopicSnapshotsResponse. */ - interface IListTopicSnapshotsResponse { - - /** ListTopicSnapshotsResponse snapshots */ - snapshots?: (string[]|null); - - /** ListTopicSnapshotsResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListTopicSnapshotsResponse. */ - class ListTopicSnapshotsResponse implements IListTopicSnapshotsResponse { - - /** - * Constructs a new ListTopicSnapshotsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.IListTopicSnapshotsResponse); - - /** ListTopicSnapshotsResponse snapshots. */ - public snapshots: string[]; - - /** ListTopicSnapshotsResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListTopicSnapshotsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListTopicSnapshotsResponse instance - */ - public static create(properties?: google.pubsub.v1.IListTopicSnapshotsResponse): google.pubsub.v1.ListTopicSnapshotsResponse; - - /** - * Encodes the specified ListTopicSnapshotsResponse message. Does not implicitly {@link google.pubsub.v1.ListTopicSnapshotsResponse.verify|verify} messages. - * @param message ListTopicSnapshotsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.IListTopicSnapshotsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListTopicSnapshotsResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.ListTopicSnapshotsResponse.verify|verify} messages. - * @param message ListTopicSnapshotsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.IListTopicSnapshotsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListTopicSnapshotsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListTopicSnapshotsResponse - * @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.pubsub.v1.ListTopicSnapshotsResponse; - - /** - * Decodes a ListTopicSnapshotsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListTopicSnapshotsResponse - * @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.pubsub.v1.ListTopicSnapshotsResponse; - - /** - * Verifies a ListTopicSnapshotsResponse 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 ListTopicSnapshotsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListTopicSnapshotsResponse - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.ListTopicSnapshotsResponse; - - /** - * Creates a plain object from a ListTopicSnapshotsResponse message. Also converts values to other types if specified. - * @param message ListTopicSnapshotsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.ListTopicSnapshotsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListTopicSnapshotsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListTopicSnapshotsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteTopicRequest. */ - interface IDeleteTopicRequest { - - /** DeleteTopicRequest topic */ - topic?: (string|null); - } - - /** Represents a DeleteTopicRequest. */ - class DeleteTopicRequest implements IDeleteTopicRequest { - - /** - * Constructs a new DeleteTopicRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.IDeleteTopicRequest); - - /** DeleteTopicRequest topic. */ - public topic: string; - - /** - * Creates a new DeleteTopicRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteTopicRequest instance - */ - public static create(properties?: google.pubsub.v1.IDeleteTopicRequest): google.pubsub.v1.DeleteTopicRequest; - - /** - * Encodes the specified DeleteTopicRequest message. Does not implicitly {@link google.pubsub.v1.DeleteTopicRequest.verify|verify} messages. - * @param message DeleteTopicRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.IDeleteTopicRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteTopicRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.DeleteTopicRequest.verify|verify} messages. - * @param message DeleteTopicRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.IDeleteTopicRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteTopicRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteTopicRequest - * @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.pubsub.v1.DeleteTopicRequest; - - /** - * Decodes a DeleteTopicRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteTopicRequest - * @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.pubsub.v1.DeleteTopicRequest; - - /** - * Verifies a DeleteTopicRequest 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 DeleteTopicRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteTopicRequest - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.DeleteTopicRequest; - - /** - * Creates a plain object from a DeleteTopicRequest message. Also converts values to other types if specified. - * @param message DeleteTopicRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.DeleteTopicRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteTopicRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteTopicRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DetachSubscriptionRequest. */ - interface IDetachSubscriptionRequest { - - /** DetachSubscriptionRequest subscription */ - subscription?: (string|null); - } - - /** Represents a DetachSubscriptionRequest. */ - class DetachSubscriptionRequest implements IDetachSubscriptionRequest { - - /** - * Constructs a new DetachSubscriptionRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.IDetachSubscriptionRequest); - - /** DetachSubscriptionRequest subscription. */ - public subscription: string; - - /** - * Creates a new DetachSubscriptionRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DetachSubscriptionRequest instance - */ - public static create(properties?: google.pubsub.v1.IDetachSubscriptionRequest): google.pubsub.v1.DetachSubscriptionRequest; - - /** - * Encodes the specified DetachSubscriptionRequest message. Does not implicitly {@link google.pubsub.v1.DetachSubscriptionRequest.verify|verify} messages. - * @param message DetachSubscriptionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.IDetachSubscriptionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DetachSubscriptionRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.DetachSubscriptionRequest.verify|verify} messages. - * @param message DetachSubscriptionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.IDetachSubscriptionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DetachSubscriptionRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DetachSubscriptionRequest - * @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.pubsub.v1.DetachSubscriptionRequest; - - /** - * Decodes a DetachSubscriptionRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DetachSubscriptionRequest - * @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.pubsub.v1.DetachSubscriptionRequest; - - /** - * Verifies a DetachSubscriptionRequest 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 DetachSubscriptionRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DetachSubscriptionRequest - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.DetachSubscriptionRequest; - - /** - * Creates a plain object from a DetachSubscriptionRequest message. Also converts values to other types if specified. - * @param message DetachSubscriptionRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.DetachSubscriptionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DetachSubscriptionRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DetachSubscriptionRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DetachSubscriptionResponse. */ - interface IDetachSubscriptionResponse { - } - - /** Represents a DetachSubscriptionResponse. */ - class DetachSubscriptionResponse implements IDetachSubscriptionResponse { - - /** - * Constructs a new DetachSubscriptionResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.IDetachSubscriptionResponse); - - /** - * Creates a new DetachSubscriptionResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns DetachSubscriptionResponse instance - */ - public static create(properties?: google.pubsub.v1.IDetachSubscriptionResponse): google.pubsub.v1.DetachSubscriptionResponse; - - /** - * Encodes the specified DetachSubscriptionResponse message. Does not implicitly {@link google.pubsub.v1.DetachSubscriptionResponse.verify|verify} messages. - * @param message DetachSubscriptionResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.IDetachSubscriptionResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DetachSubscriptionResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.DetachSubscriptionResponse.verify|verify} messages. - * @param message DetachSubscriptionResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.IDetachSubscriptionResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DetachSubscriptionResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DetachSubscriptionResponse - * @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.pubsub.v1.DetachSubscriptionResponse; - - /** - * Decodes a DetachSubscriptionResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DetachSubscriptionResponse - * @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.pubsub.v1.DetachSubscriptionResponse; - - /** - * Verifies a DetachSubscriptionResponse 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 DetachSubscriptionResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DetachSubscriptionResponse - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.DetachSubscriptionResponse; - - /** - * Creates a plain object from a DetachSubscriptionResponse message. Also converts values to other types if specified. - * @param message DetachSubscriptionResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.DetachSubscriptionResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DetachSubscriptionResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DetachSubscriptionResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Represents a Subscriber */ - class Subscriber extends $protobuf.rpc.Service { - - /** - * Constructs a new Subscriber service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - - /** - * Creates new Subscriber 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): Subscriber; - - /** - * Calls CreateSubscription. - * @param request Subscription message or plain object - * @param callback Node-style callback called with the error, if any, and Subscription - */ - public createSubscription(request: google.pubsub.v1.ISubscription, callback: google.pubsub.v1.Subscriber.CreateSubscriptionCallback): void; - - /** - * Calls CreateSubscription. - * @param request Subscription message or plain object - * @returns Promise - */ - public createSubscription(request: google.pubsub.v1.ISubscription): Promise; - - /** - * Calls GetSubscription. - * @param request GetSubscriptionRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Subscription - */ - public getSubscription(request: google.pubsub.v1.IGetSubscriptionRequest, callback: google.pubsub.v1.Subscriber.GetSubscriptionCallback): void; - - /** - * Calls GetSubscription. - * @param request GetSubscriptionRequest message or plain object - * @returns Promise - */ - public getSubscription(request: google.pubsub.v1.IGetSubscriptionRequest): Promise; - - /** - * Calls UpdateSubscription. - * @param request UpdateSubscriptionRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Subscription - */ - public updateSubscription(request: google.pubsub.v1.IUpdateSubscriptionRequest, callback: google.pubsub.v1.Subscriber.UpdateSubscriptionCallback): void; - - /** - * Calls UpdateSubscription. - * @param request UpdateSubscriptionRequest message or plain object - * @returns Promise - */ - public updateSubscription(request: google.pubsub.v1.IUpdateSubscriptionRequest): Promise; - - /** - * Calls ListSubscriptions. - * @param request ListSubscriptionsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListSubscriptionsResponse - */ - public listSubscriptions(request: google.pubsub.v1.IListSubscriptionsRequest, callback: google.pubsub.v1.Subscriber.ListSubscriptionsCallback): void; - - /** - * Calls ListSubscriptions. - * @param request ListSubscriptionsRequest message or plain object - * @returns Promise - */ - public listSubscriptions(request: google.pubsub.v1.IListSubscriptionsRequest): Promise; - - /** - * Calls DeleteSubscription. - * @param request DeleteSubscriptionRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public deleteSubscription(request: google.pubsub.v1.IDeleteSubscriptionRequest, callback: google.pubsub.v1.Subscriber.DeleteSubscriptionCallback): void; - - /** - * Calls DeleteSubscription. - * @param request DeleteSubscriptionRequest message or plain object - * @returns Promise - */ - public deleteSubscription(request: google.pubsub.v1.IDeleteSubscriptionRequest): Promise; - - /** - * Calls ModifyAckDeadline. - * @param request ModifyAckDeadlineRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public modifyAckDeadline(request: google.pubsub.v1.IModifyAckDeadlineRequest, callback: google.pubsub.v1.Subscriber.ModifyAckDeadlineCallback): void; - - /** - * Calls ModifyAckDeadline. - * @param request ModifyAckDeadlineRequest message or plain object - * @returns Promise - */ - public modifyAckDeadline(request: google.pubsub.v1.IModifyAckDeadlineRequest): Promise; - - /** - * Calls Acknowledge. - * @param request AcknowledgeRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public acknowledge(request: google.pubsub.v1.IAcknowledgeRequest, callback: google.pubsub.v1.Subscriber.AcknowledgeCallback): void; - - /** - * Calls Acknowledge. - * @param request AcknowledgeRequest message or plain object - * @returns Promise - */ - public acknowledge(request: google.pubsub.v1.IAcknowledgeRequest): Promise; - - /** - * Calls Pull. - * @param request PullRequest message or plain object - * @param callback Node-style callback called with the error, if any, and PullResponse - */ - public pull(request: google.pubsub.v1.IPullRequest, callback: google.pubsub.v1.Subscriber.PullCallback): void; - - /** - * Calls Pull. - * @param request PullRequest message or plain object - * @returns Promise - */ - public pull(request: google.pubsub.v1.IPullRequest): Promise; - - /** - * Calls StreamingPull. - * @param request StreamingPullRequest message or plain object - * @param callback Node-style callback called with the error, if any, and StreamingPullResponse - */ - public streamingPull(request: google.pubsub.v1.IStreamingPullRequest, callback: google.pubsub.v1.Subscriber.StreamingPullCallback): void; - - /** - * Calls StreamingPull. - * @param request StreamingPullRequest message or plain object - * @returns Promise - */ - public streamingPull(request: google.pubsub.v1.IStreamingPullRequest): Promise; - - /** - * Calls ModifyPushConfig. - * @param request ModifyPushConfigRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public modifyPushConfig(request: google.pubsub.v1.IModifyPushConfigRequest, callback: google.pubsub.v1.Subscriber.ModifyPushConfigCallback): void; - - /** - * Calls ModifyPushConfig. - * @param request ModifyPushConfigRequest message or plain object - * @returns Promise - */ - public modifyPushConfig(request: google.pubsub.v1.IModifyPushConfigRequest): Promise; - - /** - * Calls GetSnapshot. - * @param request GetSnapshotRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Snapshot - */ - public getSnapshot(request: google.pubsub.v1.IGetSnapshotRequest, callback: google.pubsub.v1.Subscriber.GetSnapshotCallback): void; - - /** - * Calls GetSnapshot. - * @param request GetSnapshotRequest message or plain object - * @returns Promise - */ - public getSnapshot(request: google.pubsub.v1.IGetSnapshotRequest): Promise; - - /** - * Calls ListSnapshots. - * @param request ListSnapshotsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListSnapshotsResponse - */ - public listSnapshots(request: google.pubsub.v1.IListSnapshotsRequest, callback: google.pubsub.v1.Subscriber.ListSnapshotsCallback): void; - - /** - * Calls ListSnapshots. - * @param request ListSnapshotsRequest message or plain object - * @returns Promise - */ - public listSnapshots(request: google.pubsub.v1.IListSnapshotsRequest): Promise; - - /** - * Calls CreateSnapshot. - * @param request CreateSnapshotRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Snapshot - */ - public createSnapshot(request: google.pubsub.v1.ICreateSnapshotRequest, callback: google.pubsub.v1.Subscriber.CreateSnapshotCallback): void; - - /** - * Calls CreateSnapshot. - * @param request CreateSnapshotRequest message or plain object - * @returns Promise - */ - public createSnapshot(request: google.pubsub.v1.ICreateSnapshotRequest): Promise; - - /** - * Calls UpdateSnapshot. - * @param request UpdateSnapshotRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Snapshot - */ - public updateSnapshot(request: google.pubsub.v1.IUpdateSnapshotRequest, callback: google.pubsub.v1.Subscriber.UpdateSnapshotCallback): void; - - /** - * Calls UpdateSnapshot. - * @param request UpdateSnapshotRequest message or plain object - * @returns Promise - */ - public updateSnapshot(request: google.pubsub.v1.IUpdateSnapshotRequest): Promise; - - /** - * Calls DeleteSnapshot. - * @param request DeleteSnapshotRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public deleteSnapshot(request: google.pubsub.v1.IDeleteSnapshotRequest, callback: google.pubsub.v1.Subscriber.DeleteSnapshotCallback): void; - - /** - * Calls DeleteSnapshot. - * @param request DeleteSnapshotRequest message or plain object - * @returns Promise - */ - public deleteSnapshot(request: google.pubsub.v1.IDeleteSnapshotRequest): Promise; - - /** - * Calls Seek. - * @param request SeekRequest message or plain object - * @param callback Node-style callback called with the error, if any, and SeekResponse - */ - public seek(request: google.pubsub.v1.ISeekRequest, callback: google.pubsub.v1.Subscriber.SeekCallback): void; - - /** - * Calls Seek. - * @param request SeekRequest message or plain object - * @returns Promise - */ - public seek(request: google.pubsub.v1.ISeekRequest): Promise; - } - - namespace Subscriber { - - /** - * Callback as used by {@link google.pubsub.v1.Subscriber|createSubscription}. - * @param error Error, if any - * @param [response] Subscription - */ - type CreateSubscriptionCallback = (error: (Error|null), response?: google.pubsub.v1.Subscription) => void; - - /** - * Callback as used by {@link google.pubsub.v1.Subscriber|getSubscription}. - * @param error Error, if any - * @param [response] Subscription - */ - type GetSubscriptionCallback = (error: (Error|null), response?: google.pubsub.v1.Subscription) => void; - - /** - * Callback as used by {@link google.pubsub.v1.Subscriber|updateSubscription}. - * @param error Error, if any - * @param [response] Subscription - */ - type UpdateSubscriptionCallback = (error: (Error|null), response?: google.pubsub.v1.Subscription) => void; - - /** - * Callback as used by {@link google.pubsub.v1.Subscriber|listSubscriptions}. - * @param error Error, if any - * @param [response] ListSubscriptionsResponse - */ - type ListSubscriptionsCallback = (error: (Error|null), response?: google.pubsub.v1.ListSubscriptionsResponse) => void; - - /** - * Callback as used by {@link google.pubsub.v1.Subscriber|deleteSubscription}. - * @param error Error, if any - * @param [response] Empty - */ - type DeleteSubscriptionCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.pubsub.v1.Subscriber|modifyAckDeadline}. - * @param error Error, if any - * @param [response] Empty - */ - type ModifyAckDeadlineCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.pubsub.v1.Subscriber|acknowledge}. - * @param error Error, if any - * @param [response] Empty - */ - type AcknowledgeCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.pubsub.v1.Subscriber|pull}. - * @param error Error, if any - * @param [response] PullResponse - */ - type PullCallback = (error: (Error|null), response?: google.pubsub.v1.PullResponse) => void; - - /** - * Callback as used by {@link google.pubsub.v1.Subscriber|streamingPull}. - * @param error Error, if any - * @param [response] StreamingPullResponse - */ - type StreamingPullCallback = (error: (Error|null), response?: google.pubsub.v1.StreamingPullResponse) => void; - - /** - * Callback as used by {@link google.pubsub.v1.Subscriber|modifyPushConfig}. - * @param error Error, if any - * @param [response] Empty - */ - type ModifyPushConfigCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.pubsub.v1.Subscriber|getSnapshot}. - * @param error Error, if any - * @param [response] Snapshot - */ - type GetSnapshotCallback = (error: (Error|null), response?: google.pubsub.v1.Snapshot) => void; - - /** - * Callback as used by {@link google.pubsub.v1.Subscriber|listSnapshots}. - * @param error Error, if any - * @param [response] ListSnapshotsResponse - */ - type ListSnapshotsCallback = (error: (Error|null), response?: google.pubsub.v1.ListSnapshotsResponse) => void; - - /** - * Callback as used by {@link google.pubsub.v1.Subscriber|createSnapshot}. - * @param error Error, if any - * @param [response] Snapshot - */ - type CreateSnapshotCallback = (error: (Error|null), response?: google.pubsub.v1.Snapshot) => void; - - /** - * Callback as used by {@link google.pubsub.v1.Subscriber|updateSnapshot}. - * @param error Error, if any - * @param [response] Snapshot - */ - type UpdateSnapshotCallback = (error: (Error|null), response?: google.pubsub.v1.Snapshot) => void; - - /** - * Callback as used by {@link google.pubsub.v1.Subscriber|deleteSnapshot}. - * @param error Error, if any - * @param [response] Empty - */ - type DeleteSnapshotCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.pubsub.v1.Subscriber|seek}. - * @param error Error, if any - * @param [response] SeekResponse - */ - type SeekCallback = (error: (Error|null), response?: google.pubsub.v1.SeekResponse) => void; - } - - /** Properties of a Subscription. */ - interface ISubscription { - - /** Subscription name */ - name?: (string|null); - - /** Subscription topic */ - topic?: (string|null); - - /** Subscription pushConfig */ - pushConfig?: (google.pubsub.v1.IPushConfig|null); - - /** Subscription bigqueryConfig */ - bigqueryConfig?: (google.pubsub.v1.IBigQueryConfig|null); - - /** Subscription cloudStorageConfig */ - cloudStorageConfig?: (google.pubsub.v1.ICloudStorageConfig|null); - - /** Subscription ackDeadlineSeconds */ - ackDeadlineSeconds?: (number|null); - - /** Subscription retainAckedMessages */ - retainAckedMessages?: (boolean|null); - - /** Subscription messageRetentionDuration */ - messageRetentionDuration?: (google.protobuf.IDuration|null); - - /** Subscription labels */ - labels?: ({ [k: string]: string }|null); - - /** Subscription enableMessageOrdering */ - enableMessageOrdering?: (boolean|null); - - /** Subscription expirationPolicy */ - expirationPolicy?: (google.pubsub.v1.IExpirationPolicy|null); - - /** Subscription filter */ - filter?: (string|null); - - /** Subscription deadLetterPolicy */ - deadLetterPolicy?: (google.pubsub.v1.IDeadLetterPolicy|null); - - /** Subscription retryPolicy */ - retryPolicy?: (google.pubsub.v1.IRetryPolicy|null); - - /** Subscription detached */ - detached?: (boolean|null); - - /** Subscription enableExactlyOnceDelivery */ - enableExactlyOnceDelivery?: (boolean|null); - - /** Subscription topicMessageRetentionDuration */ - topicMessageRetentionDuration?: (google.protobuf.IDuration|null); - - /** Subscription state */ - state?: (google.pubsub.v1.Subscription.State|keyof typeof google.pubsub.v1.Subscription.State|null); - } - - /** Represents a Subscription. */ - class Subscription implements ISubscription { - - /** - * Constructs a new Subscription. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.ISubscription); - - /** Subscription name. */ - public name: string; - - /** Subscription topic. */ - public topic: string; - - /** Subscription pushConfig. */ - public pushConfig?: (google.pubsub.v1.IPushConfig|null); - - /** Subscription bigqueryConfig. */ - public bigqueryConfig?: (google.pubsub.v1.IBigQueryConfig|null); - - /** Subscription cloudStorageConfig. */ - public cloudStorageConfig?: (google.pubsub.v1.ICloudStorageConfig|null); - - /** Subscription ackDeadlineSeconds. */ - public ackDeadlineSeconds: number; - - /** Subscription retainAckedMessages. */ - public retainAckedMessages: boolean; - - /** Subscription messageRetentionDuration. */ - public messageRetentionDuration?: (google.protobuf.IDuration|null); - - /** Subscription labels. */ - public labels: { [k: string]: string }; - - /** Subscription enableMessageOrdering. */ - public enableMessageOrdering: boolean; - - /** Subscription expirationPolicy. */ - public expirationPolicy?: (google.pubsub.v1.IExpirationPolicy|null); - - /** Subscription filter. */ - public filter: string; - - /** Subscription deadLetterPolicy. */ - public deadLetterPolicy?: (google.pubsub.v1.IDeadLetterPolicy|null); - - /** Subscription retryPolicy. */ - public retryPolicy?: (google.pubsub.v1.IRetryPolicy|null); - - /** Subscription detached. */ - public detached: boolean; - - /** Subscription enableExactlyOnceDelivery. */ - public enableExactlyOnceDelivery: boolean; - - /** Subscription topicMessageRetentionDuration. */ - public topicMessageRetentionDuration?: (google.protobuf.IDuration|null); - - /** Subscription state. */ - public state: (google.pubsub.v1.Subscription.State|keyof typeof google.pubsub.v1.Subscription.State); - - /** - * Creates a new Subscription instance using the specified properties. - * @param [properties] Properties to set - * @returns Subscription instance - */ - public static create(properties?: google.pubsub.v1.ISubscription): google.pubsub.v1.Subscription; - - /** - * Encodes the specified Subscription message. Does not implicitly {@link google.pubsub.v1.Subscription.verify|verify} messages. - * @param message Subscription message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.ISubscription, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Subscription message, length delimited. Does not implicitly {@link google.pubsub.v1.Subscription.verify|verify} messages. - * @param message Subscription message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.ISubscription, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Subscription message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Subscription - * @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.pubsub.v1.Subscription; - - /** - * Decodes a Subscription message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Subscription - * @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.pubsub.v1.Subscription; - - /** - * Verifies a Subscription 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 Subscription message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Subscription - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.Subscription; - - /** - * Creates a plain object from a Subscription message. Also converts values to other types if specified. - * @param message Subscription - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.Subscription, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Subscription to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Subscription - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Subscription { - - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - ACTIVE = 1, - RESOURCE_ERROR = 2 - } - } - - /** Properties of a RetryPolicy. */ - interface IRetryPolicy { - - /** RetryPolicy minimumBackoff */ - minimumBackoff?: (google.protobuf.IDuration|null); - - /** RetryPolicy maximumBackoff */ - maximumBackoff?: (google.protobuf.IDuration|null); - } - - /** Represents a RetryPolicy. */ - class RetryPolicy implements IRetryPolicy { - - /** - * Constructs a new RetryPolicy. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.IRetryPolicy); - - /** RetryPolicy minimumBackoff. */ - public minimumBackoff?: (google.protobuf.IDuration|null); - - /** RetryPolicy maximumBackoff. */ - public maximumBackoff?: (google.protobuf.IDuration|null); - - /** - * Creates a new RetryPolicy instance using the specified properties. - * @param [properties] Properties to set - * @returns RetryPolicy instance - */ - public static create(properties?: google.pubsub.v1.IRetryPolicy): google.pubsub.v1.RetryPolicy; - - /** - * Encodes the specified RetryPolicy message. Does not implicitly {@link google.pubsub.v1.RetryPolicy.verify|verify} messages. - * @param message RetryPolicy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.IRetryPolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RetryPolicy message, length delimited. Does not implicitly {@link google.pubsub.v1.RetryPolicy.verify|verify} messages. - * @param message RetryPolicy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.IRetryPolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RetryPolicy message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RetryPolicy - * @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.pubsub.v1.RetryPolicy; - - /** - * Decodes a RetryPolicy message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RetryPolicy - * @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.pubsub.v1.RetryPolicy; - - /** - * Verifies a RetryPolicy 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 RetryPolicy message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RetryPolicy - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.RetryPolicy; - - /** - * Creates a plain object from a RetryPolicy message. Also converts values to other types if specified. - * @param message RetryPolicy - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.RetryPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RetryPolicy to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RetryPolicy - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeadLetterPolicy. */ - interface IDeadLetterPolicy { - - /** DeadLetterPolicy deadLetterTopic */ - deadLetterTopic?: (string|null); - - /** DeadLetterPolicy maxDeliveryAttempts */ - maxDeliveryAttempts?: (number|null); - } - - /** Represents a DeadLetterPolicy. */ - class DeadLetterPolicy implements IDeadLetterPolicy { - - /** - * Constructs a new DeadLetterPolicy. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.IDeadLetterPolicy); - - /** DeadLetterPolicy deadLetterTopic. */ - public deadLetterTopic: string; - - /** DeadLetterPolicy maxDeliveryAttempts. */ - public maxDeliveryAttempts: number; - - /** - * Creates a new DeadLetterPolicy instance using the specified properties. - * @param [properties] Properties to set - * @returns DeadLetterPolicy instance - */ - public static create(properties?: google.pubsub.v1.IDeadLetterPolicy): google.pubsub.v1.DeadLetterPolicy; - - /** - * Encodes the specified DeadLetterPolicy message. Does not implicitly {@link google.pubsub.v1.DeadLetterPolicy.verify|verify} messages. - * @param message DeadLetterPolicy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.IDeadLetterPolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeadLetterPolicy message, length delimited. Does not implicitly {@link google.pubsub.v1.DeadLetterPolicy.verify|verify} messages. - * @param message DeadLetterPolicy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.IDeadLetterPolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeadLetterPolicy message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeadLetterPolicy - * @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.pubsub.v1.DeadLetterPolicy; - - /** - * Decodes a DeadLetterPolicy message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeadLetterPolicy - * @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.pubsub.v1.DeadLetterPolicy; - - /** - * Verifies a DeadLetterPolicy 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 DeadLetterPolicy message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeadLetterPolicy - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.DeadLetterPolicy; - - /** - * Creates a plain object from a DeadLetterPolicy message. Also converts values to other types if specified. - * @param message DeadLetterPolicy - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.DeadLetterPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeadLetterPolicy to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeadLetterPolicy - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an ExpirationPolicy. */ - interface IExpirationPolicy { - - /** ExpirationPolicy ttl */ - ttl?: (google.protobuf.IDuration|null); - } - - /** Represents an ExpirationPolicy. */ - class ExpirationPolicy implements IExpirationPolicy { - - /** - * Constructs a new ExpirationPolicy. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.IExpirationPolicy); - - /** ExpirationPolicy ttl. */ - public ttl?: (google.protobuf.IDuration|null); - - /** - * Creates a new ExpirationPolicy instance using the specified properties. - * @param [properties] Properties to set - * @returns ExpirationPolicy instance - */ - public static create(properties?: google.pubsub.v1.IExpirationPolicy): google.pubsub.v1.ExpirationPolicy; - - /** - * Encodes the specified ExpirationPolicy message. Does not implicitly {@link google.pubsub.v1.ExpirationPolicy.verify|verify} messages. - * @param message ExpirationPolicy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.IExpirationPolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ExpirationPolicy message, length delimited. Does not implicitly {@link google.pubsub.v1.ExpirationPolicy.verify|verify} messages. - * @param message ExpirationPolicy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.IExpirationPolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ExpirationPolicy message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExpirationPolicy - * @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.pubsub.v1.ExpirationPolicy; - - /** - * Decodes an ExpirationPolicy message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExpirationPolicy - * @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.pubsub.v1.ExpirationPolicy; - - /** - * Verifies an ExpirationPolicy 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 ExpirationPolicy message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExpirationPolicy - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.ExpirationPolicy; - - /** - * Creates a plain object from an ExpirationPolicy message. Also converts values to other types if specified. - * @param message ExpirationPolicy - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.ExpirationPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExpirationPolicy to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ExpirationPolicy - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a PushConfig. */ - interface IPushConfig { - - /** PushConfig pushEndpoint */ - pushEndpoint?: (string|null); - - /** PushConfig attributes */ - attributes?: ({ [k: string]: string }|null); - - /** PushConfig oidcToken */ - oidcToken?: (google.pubsub.v1.PushConfig.IOidcToken|null); - - /** PushConfig pubsubWrapper */ - pubsubWrapper?: (google.pubsub.v1.PushConfig.IPubsubWrapper|null); - - /** PushConfig noWrapper */ - noWrapper?: (google.pubsub.v1.PushConfig.INoWrapper|null); - } - - /** Represents a PushConfig. */ - class PushConfig implements IPushConfig { - - /** - * Constructs a new PushConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.IPushConfig); - - /** PushConfig pushEndpoint. */ - public pushEndpoint: string; - - /** PushConfig attributes. */ - public attributes: { [k: string]: string }; - - /** PushConfig oidcToken. */ - public oidcToken?: (google.pubsub.v1.PushConfig.IOidcToken|null); - - /** PushConfig pubsubWrapper. */ - public pubsubWrapper?: (google.pubsub.v1.PushConfig.IPubsubWrapper|null); - - /** PushConfig noWrapper. */ - public noWrapper?: (google.pubsub.v1.PushConfig.INoWrapper|null); - - /** PushConfig authenticationMethod. */ - public authenticationMethod?: "oidcToken"; - - /** PushConfig wrapper. */ - public wrapper?: ("pubsubWrapper"|"noWrapper"); - - /** - * Creates a new PushConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns PushConfig instance - */ - public static create(properties?: google.pubsub.v1.IPushConfig): google.pubsub.v1.PushConfig; - - /** - * Encodes the specified PushConfig message. Does not implicitly {@link google.pubsub.v1.PushConfig.verify|verify} messages. - * @param message PushConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.IPushConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PushConfig message, length delimited. Does not implicitly {@link google.pubsub.v1.PushConfig.verify|verify} messages. - * @param message PushConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.IPushConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PushConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PushConfig - * @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.pubsub.v1.PushConfig; - - /** - * Decodes a PushConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PushConfig - * @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.pubsub.v1.PushConfig; - - /** - * Verifies a PushConfig 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 PushConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PushConfig - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.PushConfig; - - /** - * Creates a plain object from a PushConfig message. Also converts values to other types if specified. - * @param message PushConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.PushConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PushConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PushConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace PushConfig { - - /** Properties of an OidcToken. */ - interface IOidcToken { - - /** OidcToken serviceAccountEmail */ - serviceAccountEmail?: (string|null); - - /** OidcToken audience */ - audience?: (string|null); - } - - /** Represents an OidcToken. */ - class OidcToken implements IOidcToken { - - /** - * Constructs a new OidcToken. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.PushConfig.IOidcToken); - - /** OidcToken serviceAccountEmail. */ - public serviceAccountEmail: string; - - /** OidcToken audience. */ - public audience: string; - - /** - * Creates a new OidcToken instance using the specified properties. - * @param [properties] Properties to set - * @returns OidcToken instance - */ - public static create(properties?: google.pubsub.v1.PushConfig.IOidcToken): google.pubsub.v1.PushConfig.OidcToken; - - /** - * Encodes the specified OidcToken message. Does not implicitly {@link google.pubsub.v1.PushConfig.OidcToken.verify|verify} messages. - * @param message OidcToken message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.PushConfig.IOidcToken, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified OidcToken message, length delimited. Does not implicitly {@link google.pubsub.v1.PushConfig.OidcToken.verify|verify} messages. - * @param message OidcToken message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.PushConfig.IOidcToken, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an OidcToken message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OidcToken - * @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.pubsub.v1.PushConfig.OidcToken; - - /** - * Decodes an OidcToken message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OidcToken - * @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.pubsub.v1.PushConfig.OidcToken; - - /** - * Verifies an OidcToken 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 OidcToken message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OidcToken - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.PushConfig.OidcToken; - - /** - * Creates a plain object from an OidcToken message. Also converts values to other types if specified. - * @param message OidcToken - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.PushConfig.OidcToken, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OidcToken to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for OidcToken - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a PubsubWrapper. */ - interface IPubsubWrapper { - } - - /** Represents a PubsubWrapper. */ - class PubsubWrapper implements IPubsubWrapper { - - /** - * Constructs a new PubsubWrapper. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.PushConfig.IPubsubWrapper); - - /** - * Creates a new PubsubWrapper instance using the specified properties. - * @param [properties] Properties to set - * @returns PubsubWrapper instance - */ - public static create(properties?: google.pubsub.v1.PushConfig.IPubsubWrapper): google.pubsub.v1.PushConfig.PubsubWrapper; - - /** - * Encodes the specified PubsubWrapper message. Does not implicitly {@link google.pubsub.v1.PushConfig.PubsubWrapper.verify|verify} messages. - * @param message PubsubWrapper message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.PushConfig.IPubsubWrapper, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PubsubWrapper message, length delimited. Does not implicitly {@link google.pubsub.v1.PushConfig.PubsubWrapper.verify|verify} messages. - * @param message PubsubWrapper message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.PushConfig.IPubsubWrapper, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PubsubWrapper message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PubsubWrapper - * @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.pubsub.v1.PushConfig.PubsubWrapper; - - /** - * Decodes a PubsubWrapper message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PubsubWrapper - * @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.pubsub.v1.PushConfig.PubsubWrapper; - - /** - * Verifies a PubsubWrapper 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 PubsubWrapper message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PubsubWrapper - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.PushConfig.PubsubWrapper; - - /** - * Creates a plain object from a PubsubWrapper message. Also converts values to other types if specified. - * @param message PubsubWrapper - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.PushConfig.PubsubWrapper, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PubsubWrapper to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PubsubWrapper - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a NoWrapper. */ - interface INoWrapper { - - /** NoWrapper writeMetadata */ - writeMetadata?: (boolean|null); - } - - /** Represents a NoWrapper. */ - class NoWrapper implements INoWrapper { - - /** - * Constructs a new NoWrapper. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.PushConfig.INoWrapper); - - /** NoWrapper writeMetadata. */ - public writeMetadata: boolean; - - /** - * Creates a new NoWrapper instance using the specified properties. - * @param [properties] Properties to set - * @returns NoWrapper instance - */ - public static create(properties?: google.pubsub.v1.PushConfig.INoWrapper): google.pubsub.v1.PushConfig.NoWrapper; - - /** - * Encodes the specified NoWrapper message. Does not implicitly {@link google.pubsub.v1.PushConfig.NoWrapper.verify|verify} messages. - * @param message NoWrapper message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.PushConfig.INoWrapper, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified NoWrapper message, length delimited. Does not implicitly {@link google.pubsub.v1.PushConfig.NoWrapper.verify|verify} messages. - * @param message NoWrapper message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.PushConfig.INoWrapper, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a NoWrapper message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns NoWrapper - * @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.pubsub.v1.PushConfig.NoWrapper; - - /** - * Decodes a NoWrapper message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns NoWrapper - * @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.pubsub.v1.PushConfig.NoWrapper; - - /** - * Verifies a NoWrapper 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 NoWrapper message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns NoWrapper - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.PushConfig.NoWrapper; - - /** - * Creates a plain object from a NoWrapper message. Also converts values to other types if specified. - * @param message NoWrapper - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.PushConfig.NoWrapper, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this NoWrapper to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for NoWrapper - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a BigQueryConfig. */ - interface IBigQueryConfig { - - /** BigQueryConfig table */ - table?: (string|null); - - /** BigQueryConfig useTopicSchema */ - useTopicSchema?: (boolean|null); - - /** BigQueryConfig writeMetadata */ - writeMetadata?: (boolean|null); - - /** BigQueryConfig dropUnknownFields */ - dropUnknownFields?: (boolean|null); - - /** BigQueryConfig state */ - state?: (google.pubsub.v1.BigQueryConfig.State|keyof typeof google.pubsub.v1.BigQueryConfig.State|null); - - /** BigQueryConfig useTableSchema */ - useTableSchema?: (boolean|null); - - /** BigQueryConfig serviceAccountEmail */ - serviceAccountEmail?: (string|null); - } - - /** Represents a BigQueryConfig. */ - class BigQueryConfig implements IBigQueryConfig { - - /** - * Constructs a new BigQueryConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.IBigQueryConfig); - - /** BigQueryConfig table. */ - public table: string; - - /** BigQueryConfig useTopicSchema. */ - public useTopicSchema: boolean; - - /** BigQueryConfig writeMetadata. */ - public writeMetadata: boolean; - - /** BigQueryConfig dropUnknownFields. */ - public dropUnknownFields: boolean; - - /** BigQueryConfig state. */ - public state: (google.pubsub.v1.BigQueryConfig.State|keyof typeof google.pubsub.v1.BigQueryConfig.State); - - /** BigQueryConfig useTableSchema. */ - public useTableSchema: boolean; - - /** BigQueryConfig serviceAccountEmail. */ - public serviceAccountEmail: string; - - /** - * Creates a new BigQueryConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns BigQueryConfig instance - */ - public static create(properties?: google.pubsub.v1.IBigQueryConfig): google.pubsub.v1.BigQueryConfig; - - /** - * Encodes the specified BigQueryConfig message. Does not implicitly {@link google.pubsub.v1.BigQueryConfig.verify|verify} messages. - * @param message BigQueryConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.IBigQueryConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BigQueryConfig message, length delimited. Does not implicitly {@link google.pubsub.v1.BigQueryConfig.verify|verify} messages. - * @param message BigQueryConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.IBigQueryConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BigQueryConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BigQueryConfig - * @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.pubsub.v1.BigQueryConfig; - - /** - * Decodes a BigQueryConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BigQueryConfig - * @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.pubsub.v1.BigQueryConfig; - - /** - * Verifies a BigQueryConfig 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 BigQueryConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BigQueryConfig - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.BigQueryConfig; - - /** - * Creates a plain object from a BigQueryConfig message. Also converts values to other types if specified. - * @param message BigQueryConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.BigQueryConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BigQueryConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BigQueryConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace BigQueryConfig { - - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - ACTIVE = 1, - PERMISSION_DENIED = 2, - NOT_FOUND = 3, - SCHEMA_MISMATCH = 4, - IN_TRANSIT_LOCATION_RESTRICTION = 5 - } - } - - /** Properties of a CloudStorageConfig. */ - interface ICloudStorageConfig { - - /** CloudStorageConfig bucket */ - bucket?: (string|null); - - /** CloudStorageConfig filenamePrefix */ - filenamePrefix?: (string|null); - - /** CloudStorageConfig filenameSuffix */ - filenameSuffix?: (string|null); - - /** CloudStorageConfig filenameDatetimeFormat */ - filenameDatetimeFormat?: (string|null); - - /** CloudStorageConfig textConfig */ - textConfig?: (google.pubsub.v1.CloudStorageConfig.ITextConfig|null); - - /** CloudStorageConfig avroConfig */ - avroConfig?: (google.pubsub.v1.CloudStorageConfig.IAvroConfig|null); - - /** CloudStorageConfig maxDuration */ - maxDuration?: (google.protobuf.IDuration|null); - - /** CloudStorageConfig maxBytes */ - maxBytes?: (number|Long|string|null); - - /** CloudStorageConfig state */ - state?: (google.pubsub.v1.CloudStorageConfig.State|keyof typeof google.pubsub.v1.CloudStorageConfig.State|null); - - /** CloudStorageConfig serviceAccountEmail */ - serviceAccountEmail?: (string|null); - } - - /** Represents a CloudStorageConfig. */ - class CloudStorageConfig implements ICloudStorageConfig { - - /** - * Constructs a new CloudStorageConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.ICloudStorageConfig); - - /** CloudStorageConfig bucket. */ - public bucket: string; - - /** CloudStorageConfig filenamePrefix. */ - public filenamePrefix: string; - - /** CloudStorageConfig filenameSuffix. */ - public filenameSuffix: string; - - /** CloudStorageConfig filenameDatetimeFormat. */ - public filenameDatetimeFormat: string; - - /** CloudStorageConfig textConfig. */ - public textConfig?: (google.pubsub.v1.CloudStorageConfig.ITextConfig|null); - - /** CloudStorageConfig avroConfig. */ - public avroConfig?: (google.pubsub.v1.CloudStorageConfig.IAvroConfig|null); - - /** CloudStorageConfig maxDuration. */ - public maxDuration?: (google.protobuf.IDuration|null); - - /** CloudStorageConfig maxBytes. */ - public maxBytes: (number|Long|string); - - /** CloudStorageConfig state. */ - public state: (google.pubsub.v1.CloudStorageConfig.State|keyof typeof google.pubsub.v1.CloudStorageConfig.State); - - /** CloudStorageConfig serviceAccountEmail. */ - public serviceAccountEmail: string; - - /** CloudStorageConfig outputFormat. */ - public outputFormat?: ("textConfig"|"avroConfig"); - - /** - * Creates a new CloudStorageConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns CloudStorageConfig instance - */ - public static create(properties?: google.pubsub.v1.ICloudStorageConfig): google.pubsub.v1.CloudStorageConfig; - - /** - * Encodes the specified CloudStorageConfig message. Does not implicitly {@link google.pubsub.v1.CloudStorageConfig.verify|verify} messages. - * @param message CloudStorageConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.ICloudStorageConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CloudStorageConfig message, length delimited. Does not implicitly {@link google.pubsub.v1.CloudStorageConfig.verify|verify} messages. - * @param message CloudStorageConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.ICloudStorageConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CloudStorageConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CloudStorageConfig - * @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.pubsub.v1.CloudStorageConfig; - - /** - * Decodes a CloudStorageConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CloudStorageConfig - * @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.pubsub.v1.CloudStorageConfig; - - /** - * Verifies a CloudStorageConfig 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 CloudStorageConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CloudStorageConfig - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.CloudStorageConfig; - - /** - * Creates a plain object from a CloudStorageConfig message. Also converts values to other types if specified. - * @param message CloudStorageConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.CloudStorageConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CloudStorageConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CloudStorageConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace CloudStorageConfig { - - /** Properties of a TextConfig. */ - interface ITextConfig { - } - - /** Represents a TextConfig. */ - class TextConfig implements ITextConfig { - - /** - * Constructs a new TextConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.CloudStorageConfig.ITextConfig); - - /** - * Creates a new TextConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns TextConfig instance - */ - public static create(properties?: google.pubsub.v1.CloudStorageConfig.ITextConfig): google.pubsub.v1.CloudStorageConfig.TextConfig; - - /** - * Encodes the specified TextConfig message. Does not implicitly {@link google.pubsub.v1.CloudStorageConfig.TextConfig.verify|verify} messages. - * @param message TextConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.CloudStorageConfig.ITextConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TextConfig message, length delimited. Does not implicitly {@link google.pubsub.v1.CloudStorageConfig.TextConfig.verify|verify} messages. - * @param message TextConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.CloudStorageConfig.ITextConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TextConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TextConfig - * @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.pubsub.v1.CloudStorageConfig.TextConfig; - - /** - * Decodes a TextConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TextConfig - * @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.pubsub.v1.CloudStorageConfig.TextConfig; - - /** - * Verifies a TextConfig 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 TextConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TextConfig - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.CloudStorageConfig.TextConfig; - - /** - * Creates a plain object from a TextConfig message. Also converts values to other types if specified. - * @param message TextConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.CloudStorageConfig.TextConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TextConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TextConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an AvroConfig. */ - interface IAvroConfig { - - /** AvroConfig writeMetadata */ - writeMetadata?: (boolean|null); - - /** AvroConfig useTopicSchema */ - useTopicSchema?: (boolean|null); - } - - /** Represents an AvroConfig. */ - class AvroConfig implements IAvroConfig { - - /** - * Constructs a new AvroConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.CloudStorageConfig.IAvroConfig); - - /** AvroConfig writeMetadata. */ - public writeMetadata: boolean; - - /** AvroConfig useTopicSchema. */ - public useTopicSchema: boolean; - - /** - * Creates a new AvroConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns AvroConfig instance - */ - public static create(properties?: google.pubsub.v1.CloudStorageConfig.IAvroConfig): google.pubsub.v1.CloudStorageConfig.AvroConfig; - - /** - * Encodes the specified AvroConfig message. Does not implicitly {@link google.pubsub.v1.CloudStorageConfig.AvroConfig.verify|verify} messages. - * @param message AvroConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.CloudStorageConfig.IAvroConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AvroConfig message, length delimited. Does not implicitly {@link google.pubsub.v1.CloudStorageConfig.AvroConfig.verify|verify} messages. - * @param message AvroConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.CloudStorageConfig.IAvroConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AvroConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AvroConfig - * @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.pubsub.v1.CloudStorageConfig.AvroConfig; - - /** - * Decodes an AvroConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AvroConfig - * @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.pubsub.v1.CloudStorageConfig.AvroConfig; - - /** - * Verifies an AvroConfig 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 AvroConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AvroConfig - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.CloudStorageConfig.AvroConfig; - - /** - * Creates a plain object from an AvroConfig message. Also converts values to other types if specified. - * @param message AvroConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.CloudStorageConfig.AvroConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AvroConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AvroConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - ACTIVE = 1, - PERMISSION_DENIED = 2, - NOT_FOUND = 3, - IN_TRANSIT_LOCATION_RESTRICTION = 4, - SCHEMA_MISMATCH = 5 - } - } - - /** Properties of a ReceivedMessage. */ - interface IReceivedMessage { - - /** ReceivedMessage ackId */ - ackId?: (string|null); - - /** ReceivedMessage message */ - message?: (google.pubsub.v1.IPubsubMessage|null); - - /** ReceivedMessage deliveryAttempt */ - deliveryAttempt?: (number|null); - } - - /** Represents a ReceivedMessage. */ - class ReceivedMessage implements IReceivedMessage { - - /** - * Constructs a new ReceivedMessage. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.IReceivedMessage); - - /** ReceivedMessage ackId. */ - public ackId: string; - - /** ReceivedMessage message. */ - public message?: (google.pubsub.v1.IPubsubMessage|null); - - /** ReceivedMessage deliveryAttempt. */ - public deliveryAttempt: number; - - /** - * Creates a new ReceivedMessage instance using the specified properties. - * @param [properties] Properties to set - * @returns ReceivedMessage instance - */ - public static create(properties?: google.pubsub.v1.IReceivedMessage): google.pubsub.v1.ReceivedMessage; - - /** - * Encodes the specified ReceivedMessage message. Does not implicitly {@link google.pubsub.v1.ReceivedMessage.verify|verify} messages. - * @param message ReceivedMessage message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.IReceivedMessage, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ReceivedMessage message, length delimited. Does not implicitly {@link google.pubsub.v1.ReceivedMessage.verify|verify} messages. - * @param message ReceivedMessage message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.IReceivedMessage, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ReceivedMessage message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ReceivedMessage - * @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.pubsub.v1.ReceivedMessage; - - /** - * Decodes a ReceivedMessage message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ReceivedMessage - * @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.pubsub.v1.ReceivedMessage; - - /** - * Verifies a ReceivedMessage 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 ReceivedMessage message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ReceivedMessage - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.ReceivedMessage; - - /** - * Creates a plain object from a ReceivedMessage message. Also converts values to other types if specified. - * @param message ReceivedMessage - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.ReceivedMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ReceivedMessage to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ReceivedMessage - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetSubscriptionRequest. */ - interface IGetSubscriptionRequest { - - /** GetSubscriptionRequest subscription */ - subscription?: (string|null); - } - - /** Represents a GetSubscriptionRequest. */ - class GetSubscriptionRequest implements IGetSubscriptionRequest { - - /** - * Constructs a new GetSubscriptionRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.IGetSubscriptionRequest); - - /** GetSubscriptionRequest subscription. */ - public subscription: string; - - /** - * Creates a new GetSubscriptionRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetSubscriptionRequest instance - */ - public static create(properties?: google.pubsub.v1.IGetSubscriptionRequest): google.pubsub.v1.GetSubscriptionRequest; - - /** - * Encodes the specified GetSubscriptionRequest message. Does not implicitly {@link google.pubsub.v1.GetSubscriptionRequest.verify|verify} messages. - * @param message GetSubscriptionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.IGetSubscriptionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetSubscriptionRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.GetSubscriptionRequest.verify|verify} messages. - * @param message GetSubscriptionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.IGetSubscriptionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetSubscriptionRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetSubscriptionRequest - * @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.pubsub.v1.GetSubscriptionRequest; - - /** - * Decodes a GetSubscriptionRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetSubscriptionRequest - * @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.pubsub.v1.GetSubscriptionRequest; - - /** - * Verifies a GetSubscriptionRequest 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 GetSubscriptionRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetSubscriptionRequest - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.GetSubscriptionRequest; - - /** - * Creates a plain object from a GetSubscriptionRequest message. Also converts values to other types if specified. - * @param message GetSubscriptionRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.GetSubscriptionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetSubscriptionRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetSubscriptionRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateSubscriptionRequest. */ - interface IUpdateSubscriptionRequest { - - /** UpdateSubscriptionRequest subscription */ - subscription?: (google.pubsub.v1.ISubscription|null); - - /** UpdateSubscriptionRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - } - - /** Represents an UpdateSubscriptionRequest. */ - class UpdateSubscriptionRequest implements IUpdateSubscriptionRequest { - - /** - * Constructs a new UpdateSubscriptionRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.IUpdateSubscriptionRequest); - - /** UpdateSubscriptionRequest subscription. */ - public subscription?: (google.pubsub.v1.ISubscription|null); - - /** UpdateSubscriptionRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); - - /** - * Creates a new UpdateSubscriptionRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateSubscriptionRequest instance - */ - public static create(properties?: google.pubsub.v1.IUpdateSubscriptionRequest): google.pubsub.v1.UpdateSubscriptionRequest; - - /** - * Encodes the specified UpdateSubscriptionRequest message. Does not implicitly {@link google.pubsub.v1.UpdateSubscriptionRequest.verify|verify} messages. - * @param message UpdateSubscriptionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.IUpdateSubscriptionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateSubscriptionRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.UpdateSubscriptionRequest.verify|verify} messages. - * @param message UpdateSubscriptionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.IUpdateSubscriptionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateSubscriptionRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateSubscriptionRequest - * @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.pubsub.v1.UpdateSubscriptionRequest; - - /** - * Decodes an UpdateSubscriptionRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateSubscriptionRequest - * @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.pubsub.v1.UpdateSubscriptionRequest; - - /** - * Verifies an UpdateSubscriptionRequest 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 UpdateSubscriptionRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateSubscriptionRequest - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.UpdateSubscriptionRequest; - - /** - * Creates a plain object from an UpdateSubscriptionRequest message. Also converts values to other types if specified. - * @param message UpdateSubscriptionRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.UpdateSubscriptionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateSubscriptionRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateSubscriptionRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListSubscriptionsRequest. */ - interface IListSubscriptionsRequest { - - /** ListSubscriptionsRequest project */ - project?: (string|null); - - /** ListSubscriptionsRequest pageSize */ - pageSize?: (number|null); - - /** ListSubscriptionsRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a ListSubscriptionsRequest. */ - class ListSubscriptionsRequest implements IListSubscriptionsRequest { - - /** - * Constructs a new ListSubscriptionsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.IListSubscriptionsRequest); - - /** ListSubscriptionsRequest project. */ - public project: string; - - /** ListSubscriptionsRequest pageSize. */ - public pageSize: number; - - /** ListSubscriptionsRequest pageToken. */ - public pageToken: string; - - /** - * Creates a new ListSubscriptionsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListSubscriptionsRequest instance - */ - public static create(properties?: google.pubsub.v1.IListSubscriptionsRequest): google.pubsub.v1.ListSubscriptionsRequest; - - /** - * Encodes the specified ListSubscriptionsRequest message. Does not implicitly {@link google.pubsub.v1.ListSubscriptionsRequest.verify|verify} messages. - * @param message ListSubscriptionsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.IListSubscriptionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListSubscriptionsRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.ListSubscriptionsRequest.verify|verify} messages. - * @param message ListSubscriptionsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.IListSubscriptionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListSubscriptionsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListSubscriptionsRequest - * @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.pubsub.v1.ListSubscriptionsRequest; - - /** - * Decodes a ListSubscriptionsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListSubscriptionsRequest - * @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.pubsub.v1.ListSubscriptionsRequest; - - /** - * Verifies a ListSubscriptionsRequest 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 ListSubscriptionsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListSubscriptionsRequest - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.ListSubscriptionsRequest; - - /** - * Creates a plain object from a ListSubscriptionsRequest message. Also converts values to other types if specified. - * @param message ListSubscriptionsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.ListSubscriptionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListSubscriptionsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListSubscriptionsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListSubscriptionsResponse. */ - interface IListSubscriptionsResponse { - - /** ListSubscriptionsResponse subscriptions */ - subscriptions?: (google.pubsub.v1.ISubscription[]|null); - - /** ListSubscriptionsResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListSubscriptionsResponse. */ - class ListSubscriptionsResponse implements IListSubscriptionsResponse { - - /** - * Constructs a new ListSubscriptionsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.IListSubscriptionsResponse); - - /** ListSubscriptionsResponse subscriptions. */ - public subscriptions: google.pubsub.v1.ISubscription[]; - - /** ListSubscriptionsResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListSubscriptionsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListSubscriptionsResponse instance - */ - public static create(properties?: google.pubsub.v1.IListSubscriptionsResponse): google.pubsub.v1.ListSubscriptionsResponse; - - /** - * Encodes the specified ListSubscriptionsResponse message. Does not implicitly {@link google.pubsub.v1.ListSubscriptionsResponse.verify|verify} messages. - * @param message ListSubscriptionsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.IListSubscriptionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListSubscriptionsResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.ListSubscriptionsResponse.verify|verify} messages. - * @param message ListSubscriptionsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.IListSubscriptionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListSubscriptionsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListSubscriptionsResponse - * @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.pubsub.v1.ListSubscriptionsResponse; - - /** - * Decodes a ListSubscriptionsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListSubscriptionsResponse - * @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.pubsub.v1.ListSubscriptionsResponse; - - /** - * Verifies a ListSubscriptionsResponse 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 ListSubscriptionsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListSubscriptionsResponse - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.ListSubscriptionsResponse; - - /** - * Creates a plain object from a ListSubscriptionsResponse message. Also converts values to other types if specified. - * @param message ListSubscriptionsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.ListSubscriptionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListSubscriptionsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListSubscriptionsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteSubscriptionRequest. */ - interface IDeleteSubscriptionRequest { - - /** DeleteSubscriptionRequest subscription */ - subscription?: (string|null); - } - - /** Represents a DeleteSubscriptionRequest. */ - class DeleteSubscriptionRequest implements IDeleteSubscriptionRequest { - - /** - * Constructs a new DeleteSubscriptionRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.IDeleteSubscriptionRequest); - - /** DeleteSubscriptionRequest subscription. */ - public subscription: string; - - /** - * Creates a new DeleteSubscriptionRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteSubscriptionRequest instance - */ - public static create(properties?: google.pubsub.v1.IDeleteSubscriptionRequest): google.pubsub.v1.DeleteSubscriptionRequest; - - /** - * Encodes the specified DeleteSubscriptionRequest message. Does not implicitly {@link google.pubsub.v1.DeleteSubscriptionRequest.verify|verify} messages. - * @param message DeleteSubscriptionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.IDeleteSubscriptionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteSubscriptionRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.DeleteSubscriptionRequest.verify|verify} messages. - * @param message DeleteSubscriptionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.IDeleteSubscriptionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteSubscriptionRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteSubscriptionRequest - * @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.pubsub.v1.DeleteSubscriptionRequest; - - /** - * Decodes a DeleteSubscriptionRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteSubscriptionRequest - * @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.pubsub.v1.DeleteSubscriptionRequest; - - /** - * Verifies a DeleteSubscriptionRequest 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 DeleteSubscriptionRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteSubscriptionRequest - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.DeleteSubscriptionRequest; - - /** - * Creates a plain object from a DeleteSubscriptionRequest message. Also converts values to other types if specified. - * @param message DeleteSubscriptionRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.DeleteSubscriptionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteSubscriptionRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteSubscriptionRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ModifyPushConfigRequest. */ - interface IModifyPushConfigRequest { - - /** ModifyPushConfigRequest subscription */ - subscription?: (string|null); - - /** ModifyPushConfigRequest pushConfig */ - pushConfig?: (google.pubsub.v1.IPushConfig|null); - } - - /** Represents a ModifyPushConfigRequest. */ - class ModifyPushConfigRequest implements IModifyPushConfigRequest { - - /** - * Constructs a new ModifyPushConfigRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.IModifyPushConfigRequest); - - /** ModifyPushConfigRequest subscription. */ - public subscription: string; - - /** ModifyPushConfigRequest pushConfig. */ - public pushConfig?: (google.pubsub.v1.IPushConfig|null); - - /** - * Creates a new ModifyPushConfigRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ModifyPushConfigRequest instance - */ - public static create(properties?: google.pubsub.v1.IModifyPushConfigRequest): google.pubsub.v1.ModifyPushConfigRequest; - - /** - * Encodes the specified ModifyPushConfigRequest message. Does not implicitly {@link google.pubsub.v1.ModifyPushConfigRequest.verify|verify} messages. - * @param message ModifyPushConfigRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.IModifyPushConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ModifyPushConfigRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.ModifyPushConfigRequest.verify|verify} messages. - * @param message ModifyPushConfigRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.IModifyPushConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ModifyPushConfigRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ModifyPushConfigRequest - * @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.pubsub.v1.ModifyPushConfigRequest; - - /** - * Decodes a ModifyPushConfigRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ModifyPushConfigRequest - * @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.pubsub.v1.ModifyPushConfigRequest; - - /** - * Verifies a ModifyPushConfigRequest 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 ModifyPushConfigRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ModifyPushConfigRequest - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.ModifyPushConfigRequest; - - /** - * Creates a plain object from a ModifyPushConfigRequest message. Also converts values to other types if specified. - * @param message ModifyPushConfigRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.ModifyPushConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ModifyPushConfigRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ModifyPushConfigRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a PullRequest. */ - interface IPullRequest { - - /** PullRequest subscription */ - subscription?: (string|null); - - /** PullRequest returnImmediately */ - returnImmediately?: (boolean|null); - - /** PullRequest maxMessages */ - maxMessages?: (number|null); - } - - /** Represents a PullRequest. */ - class PullRequest implements IPullRequest { - - /** - * Constructs a new PullRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.IPullRequest); - - /** PullRequest subscription. */ - public subscription: string; - - /** PullRequest returnImmediately. */ - public returnImmediately: boolean; - - /** PullRequest maxMessages. */ - public maxMessages: number; - - /** - * Creates a new PullRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns PullRequest instance - */ - public static create(properties?: google.pubsub.v1.IPullRequest): google.pubsub.v1.PullRequest; - - /** - * Encodes the specified PullRequest message. Does not implicitly {@link google.pubsub.v1.PullRequest.verify|verify} messages. - * @param message PullRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.IPullRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PullRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.PullRequest.verify|verify} messages. - * @param message PullRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.IPullRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PullRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PullRequest - * @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.pubsub.v1.PullRequest; - - /** - * Decodes a PullRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PullRequest - * @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.pubsub.v1.PullRequest; - - /** - * Verifies a PullRequest 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 PullRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PullRequest - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.PullRequest; - - /** - * Creates a plain object from a PullRequest message. Also converts values to other types if specified. - * @param message PullRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.PullRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PullRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PullRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a PullResponse. */ - interface IPullResponse { - - /** PullResponse receivedMessages */ - receivedMessages?: (google.pubsub.v1.IReceivedMessage[]|null); - } - - /** Represents a PullResponse. */ - class PullResponse implements IPullResponse { - - /** - * Constructs a new PullResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.IPullResponse); - - /** PullResponse receivedMessages. */ - public receivedMessages: google.pubsub.v1.IReceivedMessage[]; - - /** - * Creates a new PullResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns PullResponse instance - */ - public static create(properties?: google.pubsub.v1.IPullResponse): google.pubsub.v1.PullResponse; - - /** - * Encodes the specified PullResponse message. Does not implicitly {@link google.pubsub.v1.PullResponse.verify|verify} messages. - * @param message PullResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.IPullResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PullResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.PullResponse.verify|verify} messages. - * @param message PullResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.IPullResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PullResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PullResponse - * @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.pubsub.v1.PullResponse; - - /** - * Decodes a PullResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PullResponse - * @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.pubsub.v1.PullResponse; - - /** - * Verifies a PullResponse 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 PullResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PullResponse - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.PullResponse; - - /** - * Creates a plain object from a PullResponse message. Also converts values to other types if specified. - * @param message PullResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.PullResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PullResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PullResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ModifyAckDeadlineRequest. */ - interface IModifyAckDeadlineRequest { - - /** ModifyAckDeadlineRequest subscription */ - subscription?: (string|null); - - /** ModifyAckDeadlineRequest ackIds */ - ackIds?: (string[]|null); - - /** ModifyAckDeadlineRequest ackDeadlineSeconds */ - ackDeadlineSeconds?: (number|null); - } - - /** Represents a ModifyAckDeadlineRequest. */ - class ModifyAckDeadlineRequest implements IModifyAckDeadlineRequest { - - /** - * Constructs a new ModifyAckDeadlineRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.IModifyAckDeadlineRequest); - - /** ModifyAckDeadlineRequest subscription. */ - public subscription: string; - - /** ModifyAckDeadlineRequest ackIds. */ - public ackIds: string[]; - - /** ModifyAckDeadlineRequest ackDeadlineSeconds. */ - public ackDeadlineSeconds: number; - - /** - * Creates a new ModifyAckDeadlineRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ModifyAckDeadlineRequest instance - */ - public static create(properties?: google.pubsub.v1.IModifyAckDeadlineRequest): google.pubsub.v1.ModifyAckDeadlineRequest; - - /** - * Encodes the specified ModifyAckDeadlineRequest message. Does not implicitly {@link google.pubsub.v1.ModifyAckDeadlineRequest.verify|verify} messages. - * @param message ModifyAckDeadlineRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.IModifyAckDeadlineRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ModifyAckDeadlineRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.ModifyAckDeadlineRequest.verify|verify} messages. - * @param message ModifyAckDeadlineRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.IModifyAckDeadlineRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ModifyAckDeadlineRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ModifyAckDeadlineRequest - * @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.pubsub.v1.ModifyAckDeadlineRequest; - - /** - * Decodes a ModifyAckDeadlineRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ModifyAckDeadlineRequest - * @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.pubsub.v1.ModifyAckDeadlineRequest; - - /** - * Verifies a ModifyAckDeadlineRequest 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 ModifyAckDeadlineRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ModifyAckDeadlineRequest - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.ModifyAckDeadlineRequest; - - /** - * Creates a plain object from a ModifyAckDeadlineRequest message. Also converts values to other types if specified. - * @param message ModifyAckDeadlineRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.ModifyAckDeadlineRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ModifyAckDeadlineRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ModifyAckDeadlineRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an AcknowledgeRequest. */ - interface IAcknowledgeRequest { - - /** AcknowledgeRequest subscription */ - subscription?: (string|null); - - /** AcknowledgeRequest ackIds */ - ackIds?: (string[]|null); - } - - /** Represents an AcknowledgeRequest. */ - class AcknowledgeRequest implements IAcknowledgeRequest { - - /** - * Constructs a new AcknowledgeRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.IAcknowledgeRequest); - - /** AcknowledgeRequest subscription. */ - public subscription: string; - - /** AcknowledgeRequest ackIds. */ - public ackIds: string[]; - - /** - * Creates a new AcknowledgeRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns AcknowledgeRequest instance - */ - public static create(properties?: google.pubsub.v1.IAcknowledgeRequest): google.pubsub.v1.AcknowledgeRequest; - - /** - * Encodes the specified AcknowledgeRequest message. Does not implicitly {@link google.pubsub.v1.AcknowledgeRequest.verify|verify} messages. - * @param message AcknowledgeRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.IAcknowledgeRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AcknowledgeRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.AcknowledgeRequest.verify|verify} messages. - * @param message AcknowledgeRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.IAcknowledgeRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AcknowledgeRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AcknowledgeRequest - * @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.pubsub.v1.AcknowledgeRequest; - - /** - * Decodes an AcknowledgeRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AcknowledgeRequest - * @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.pubsub.v1.AcknowledgeRequest; - - /** - * Verifies an AcknowledgeRequest 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 AcknowledgeRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AcknowledgeRequest - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.AcknowledgeRequest; - - /** - * Creates a plain object from an AcknowledgeRequest message. Also converts values to other types if specified. - * @param message AcknowledgeRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.AcknowledgeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AcknowledgeRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AcknowledgeRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a StreamingPullRequest. */ - interface IStreamingPullRequest { - - /** StreamingPullRequest subscription */ - subscription?: (string|null); - - /** StreamingPullRequest ackIds */ - ackIds?: (string[]|null); - - /** StreamingPullRequest modifyDeadlineSeconds */ - modifyDeadlineSeconds?: (number[]|null); - - /** StreamingPullRequest modifyDeadlineAckIds */ - modifyDeadlineAckIds?: (string[]|null); - - /** StreamingPullRequest streamAckDeadlineSeconds */ - streamAckDeadlineSeconds?: (number|null); - - /** StreamingPullRequest clientId */ - clientId?: (string|null); - - /** StreamingPullRequest maxOutstandingMessages */ - maxOutstandingMessages?: (number|Long|string|null); - - /** StreamingPullRequest maxOutstandingBytes */ - maxOutstandingBytes?: (number|Long|string|null); - } - - /** Represents a StreamingPullRequest. */ - class StreamingPullRequest implements IStreamingPullRequest { - - /** - * Constructs a new StreamingPullRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.IStreamingPullRequest); - - /** StreamingPullRequest subscription. */ - public subscription: string; - - /** StreamingPullRequest ackIds. */ - public ackIds: string[]; - - /** StreamingPullRequest modifyDeadlineSeconds. */ - public modifyDeadlineSeconds: number[]; - - /** StreamingPullRequest modifyDeadlineAckIds. */ - public modifyDeadlineAckIds: string[]; - - /** StreamingPullRequest streamAckDeadlineSeconds. */ - public streamAckDeadlineSeconds: number; - - /** StreamingPullRequest clientId. */ - public clientId: string; - - /** StreamingPullRequest maxOutstandingMessages. */ - public maxOutstandingMessages: (number|Long|string); - - /** StreamingPullRequest maxOutstandingBytes. */ - public maxOutstandingBytes: (number|Long|string); - - /** - * Creates a new StreamingPullRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns StreamingPullRequest instance - */ - public static create(properties?: google.pubsub.v1.IStreamingPullRequest): google.pubsub.v1.StreamingPullRequest; - - /** - * Encodes the specified StreamingPullRequest message. Does not implicitly {@link google.pubsub.v1.StreamingPullRequest.verify|verify} messages. - * @param message StreamingPullRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.IStreamingPullRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified StreamingPullRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.StreamingPullRequest.verify|verify} messages. - * @param message StreamingPullRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.IStreamingPullRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a StreamingPullRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns StreamingPullRequest - * @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.pubsub.v1.StreamingPullRequest; - - /** - * Decodes a StreamingPullRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns StreamingPullRequest - * @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.pubsub.v1.StreamingPullRequest; - - /** - * Verifies a StreamingPullRequest 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 StreamingPullRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns StreamingPullRequest - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.StreamingPullRequest; - - /** - * Creates a plain object from a StreamingPullRequest message. Also converts values to other types if specified. - * @param message StreamingPullRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.StreamingPullRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this StreamingPullRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for StreamingPullRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a StreamingPullResponse. */ - interface IStreamingPullResponse { - - /** StreamingPullResponse receivedMessages */ - receivedMessages?: (google.pubsub.v1.IReceivedMessage[]|null); - - /** StreamingPullResponse acknowledgeConfirmation */ - acknowledgeConfirmation?: (google.pubsub.v1.StreamingPullResponse.IAcknowledgeConfirmation|null); - - /** StreamingPullResponse modifyAckDeadlineConfirmation */ - modifyAckDeadlineConfirmation?: (google.pubsub.v1.StreamingPullResponse.IModifyAckDeadlineConfirmation|null); - - /** StreamingPullResponse subscriptionProperties */ - subscriptionProperties?: (google.pubsub.v1.StreamingPullResponse.ISubscriptionProperties|null); - } - - /** Represents a StreamingPullResponse. */ - class StreamingPullResponse implements IStreamingPullResponse { - - /** - * Constructs a new StreamingPullResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.IStreamingPullResponse); - - /** StreamingPullResponse receivedMessages. */ - public receivedMessages: google.pubsub.v1.IReceivedMessage[]; - - /** StreamingPullResponse acknowledgeConfirmation. */ - public acknowledgeConfirmation?: (google.pubsub.v1.StreamingPullResponse.IAcknowledgeConfirmation|null); - - /** StreamingPullResponse modifyAckDeadlineConfirmation. */ - public modifyAckDeadlineConfirmation?: (google.pubsub.v1.StreamingPullResponse.IModifyAckDeadlineConfirmation|null); - - /** StreamingPullResponse subscriptionProperties. */ - public subscriptionProperties?: (google.pubsub.v1.StreamingPullResponse.ISubscriptionProperties|null); - - /** - * Creates a new StreamingPullResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns StreamingPullResponse instance - */ - public static create(properties?: google.pubsub.v1.IStreamingPullResponse): google.pubsub.v1.StreamingPullResponse; - - /** - * Encodes the specified StreamingPullResponse message. Does not implicitly {@link google.pubsub.v1.StreamingPullResponse.verify|verify} messages. - * @param message StreamingPullResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.IStreamingPullResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified StreamingPullResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.StreamingPullResponse.verify|verify} messages. - * @param message StreamingPullResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.IStreamingPullResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a StreamingPullResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns StreamingPullResponse - * @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.pubsub.v1.StreamingPullResponse; - - /** - * Decodes a StreamingPullResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns StreamingPullResponse - * @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.pubsub.v1.StreamingPullResponse; - - /** - * Verifies a StreamingPullResponse 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 StreamingPullResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns StreamingPullResponse - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.StreamingPullResponse; - - /** - * Creates a plain object from a StreamingPullResponse message. Also converts values to other types if specified. - * @param message StreamingPullResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.StreamingPullResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this StreamingPullResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for StreamingPullResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace StreamingPullResponse { - - /** Properties of an AcknowledgeConfirmation. */ - interface IAcknowledgeConfirmation { - - /** AcknowledgeConfirmation ackIds */ - ackIds?: (string[]|null); - - /** AcknowledgeConfirmation invalidAckIds */ - invalidAckIds?: (string[]|null); - - /** AcknowledgeConfirmation unorderedAckIds */ - unorderedAckIds?: (string[]|null); - - /** AcknowledgeConfirmation temporaryFailedAckIds */ - temporaryFailedAckIds?: (string[]|null); - } - - /** Represents an AcknowledgeConfirmation. */ - class AcknowledgeConfirmation implements IAcknowledgeConfirmation { - - /** - * Constructs a new AcknowledgeConfirmation. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.StreamingPullResponse.IAcknowledgeConfirmation); - - /** AcknowledgeConfirmation ackIds. */ - public ackIds: string[]; - - /** AcknowledgeConfirmation invalidAckIds. */ - public invalidAckIds: string[]; - - /** AcknowledgeConfirmation unorderedAckIds. */ - public unorderedAckIds: string[]; - - /** AcknowledgeConfirmation temporaryFailedAckIds. */ - public temporaryFailedAckIds: string[]; - - /** - * Creates a new AcknowledgeConfirmation instance using the specified properties. - * @param [properties] Properties to set - * @returns AcknowledgeConfirmation instance - */ - public static create(properties?: google.pubsub.v1.StreamingPullResponse.IAcknowledgeConfirmation): google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation; - - /** - * Encodes the specified AcknowledgeConfirmation message. Does not implicitly {@link google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation.verify|verify} messages. - * @param message AcknowledgeConfirmation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.StreamingPullResponse.IAcknowledgeConfirmation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AcknowledgeConfirmation message, length delimited. Does not implicitly {@link google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation.verify|verify} messages. - * @param message AcknowledgeConfirmation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.StreamingPullResponse.IAcknowledgeConfirmation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AcknowledgeConfirmation message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AcknowledgeConfirmation - * @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.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation; - - /** - * Decodes an AcknowledgeConfirmation message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AcknowledgeConfirmation - * @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.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation; - - /** - * Verifies an AcknowledgeConfirmation 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 AcknowledgeConfirmation message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AcknowledgeConfirmation - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation; - - /** - * Creates a plain object from an AcknowledgeConfirmation message. Also converts values to other types if specified. - * @param message AcknowledgeConfirmation - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AcknowledgeConfirmation to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AcknowledgeConfirmation - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ModifyAckDeadlineConfirmation. */ - interface IModifyAckDeadlineConfirmation { - - /** ModifyAckDeadlineConfirmation ackIds */ - ackIds?: (string[]|null); - - /** ModifyAckDeadlineConfirmation invalidAckIds */ - invalidAckIds?: (string[]|null); - - /** ModifyAckDeadlineConfirmation temporaryFailedAckIds */ - temporaryFailedAckIds?: (string[]|null); - } - - /** Represents a ModifyAckDeadlineConfirmation. */ - class ModifyAckDeadlineConfirmation implements IModifyAckDeadlineConfirmation { - - /** - * Constructs a new ModifyAckDeadlineConfirmation. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.StreamingPullResponse.IModifyAckDeadlineConfirmation); - - /** ModifyAckDeadlineConfirmation ackIds. */ - public ackIds: string[]; - - /** ModifyAckDeadlineConfirmation invalidAckIds. */ - public invalidAckIds: string[]; - - /** ModifyAckDeadlineConfirmation temporaryFailedAckIds. */ - public temporaryFailedAckIds: string[]; - - /** - * Creates a new ModifyAckDeadlineConfirmation instance using the specified properties. - * @param [properties] Properties to set - * @returns ModifyAckDeadlineConfirmation instance - */ - public static create(properties?: google.pubsub.v1.StreamingPullResponse.IModifyAckDeadlineConfirmation): google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation; - - /** - * Encodes the specified ModifyAckDeadlineConfirmation message. Does not implicitly {@link google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation.verify|verify} messages. - * @param message ModifyAckDeadlineConfirmation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.StreamingPullResponse.IModifyAckDeadlineConfirmation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ModifyAckDeadlineConfirmation message, length delimited. Does not implicitly {@link google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation.verify|verify} messages. - * @param message ModifyAckDeadlineConfirmation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.StreamingPullResponse.IModifyAckDeadlineConfirmation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ModifyAckDeadlineConfirmation message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ModifyAckDeadlineConfirmation - * @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.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation; - - /** - * Decodes a ModifyAckDeadlineConfirmation message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ModifyAckDeadlineConfirmation - * @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.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation; - - /** - * Verifies a ModifyAckDeadlineConfirmation 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 ModifyAckDeadlineConfirmation message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ModifyAckDeadlineConfirmation - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation; - - /** - * Creates a plain object from a ModifyAckDeadlineConfirmation message. Also converts values to other types if specified. - * @param message ModifyAckDeadlineConfirmation - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ModifyAckDeadlineConfirmation to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ModifyAckDeadlineConfirmation - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a SubscriptionProperties. */ - interface ISubscriptionProperties { - - /** SubscriptionProperties exactlyOnceDeliveryEnabled */ - exactlyOnceDeliveryEnabled?: (boolean|null); - - /** SubscriptionProperties messageOrderingEnabled */ - messageOrderingEnabled?: (boolean|null); - } - - /** Represents a SubscriptionProperties. */ - class SubscriptionProperties implements ISubscriptionProperties { - - /** - * Constructs a new SubscriptionProperties. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.StreamingPullResponse.ISubscriptionProperties); - - /** SubscriptionProperties exactlyOnceDeliveryEnabled. */ - public exactlyOnceDeliveryEnabled: boolean; - - /** SubscriptionProperties messageOrderingEnabled. */ - public messageOrderingEnabled: boolean; - - /** - * Creates a new SubscriptionProperties instance using the specified properties. - * @param [properties] Properties to set - * @returns SubscriptionProperties instance - */ - public static create(properties?: google.pubsub.v1.StreamingPullResponse.ISubscriptionProperties): google.pubsub.v1.StreamingPullResponse.SubscriptionProperties; - - /** - * Encodes the specified SubscriptionProperties message. Does not implicitly {@link google.pubsub.v1.StreamingPullResponse.SubscriptionProperties.verify|verify} messages. - * @param message SubscriptionProperties message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.StreamingPullResponse.ISubscriptionProperties, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SubscriptionProperties message, length delimited. Does not implicitly {@link google.pubsub.v1.StreamingPullResponse.SubscriptionProperties.verify|verify} messages. - * @param message SubscriptionProperties message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.StreamingPullResponse.ISubscriptionProperties, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SubscriptionProperties message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SubscriptionProperties - * @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.pubsub.v1.StreamingPullResponse.SubscriptionProperties; - - /** - * Decodes a SubscriptionProperties message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SubscriptionProperties - * @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.pubsub.v1.StreamingPullResponse.SubscriptionProperties; - - /** - * Verifies a SubscriptionProperties 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 SubscriptionProperties message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SubscriptionProperties - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.StreamingPullResponse.SubscriptionProperties; - - /** - * Creates a plain object from a SubscriptionProperties message. Also converts values to other types if specified. - * @param message SubscriptionProperties - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.StreamingPullResponse.SubscriptionProperties, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SubscriptionProperties to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SubscriptionProperties - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a CreateSnapshotRequest. */ - interface ICreateSnapshotRequest { - - /** CreateSnapshotRequest name */ - name?: (string|null); - - /** CreateSnapshotRequest subscription */ - subscription?: (string|null); - - /** CreateSnapshotRequest labels */ - labels?: ({ [k: string]: string }|null); - } - - /** Represents a CreateSnapshotRequest. */ - class CreateSnapshotRequest implements ICreateSnapshotRequest { - - /** - * Constructs a new CreateSnapshotRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.ICreateSnapshotRequest); - - /** CreateSnapshotRequest name. */ - public name: string; - - /** CreateSnapshotRequest subscription. */ - public subscription: string; - - /** CreateSnapshotRequest labels. */ - public labels: { [k: string]: string }; - - /** - * Creates a new CreateSnapshotRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateSnapshotRequest instance - */ - public static create(properties?: google.pubsub.v1.ICreateSnapshotRequest): google.pubsub.v1.CreateSnapshotRequest; - - /** - * Encodes the specified CreateSnapshotRequest message. Does not implicitly {@link google.pubsub.v1.CreateSnapshotRequest.verify|verify} messages. - * @param message CreateSnapshotRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.ICreateSnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateSnapshotRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.CreateSnapshotRequest.verify|verify} messages. - * @param message CreateSnapshotRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.ICreateSnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateSnapshotRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateSnapshotRequest - * @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.pubsub.v1.CreateSnapshotRequest; - - /** - * Decodes a CreateSnapshotRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateSnapshotRequest - * @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.pubsub.v1.CreateSnapshotRequest; - - /** - * Verifies a CreateSnapshotRequest 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 CreateSnapshotRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateSnapshotRequest - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.CreateSnapshotRequest; - - /** - * Creates a plain object from a CreateSnapshotRequest message. Also converts values to other types if specified. - * @param message CreateSnapshotRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.CreateSnapshotRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateSnapshotRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateSnapshotRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateSnapshotRequest. */ - interface IUpdateSnapshotRequest { - - /** UpdateSnapshotRequest snapshot */ - snapshot?: (google.pubsub.v1.ISnapshot|null); - - /** UpdateSnapshotRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - } - - /** Represents an UpdateSnapshotRequest. */ - class UpdateSnapshotRequest implements IUpdateSnapshotRequest { - - /** - * Constructs a new UpdateSnapshotRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.IUpdateSnapshotRequest); - - /** UpdateSnapshotRequest snapshot. */ - public snapshot?: (google.pubsub.v1.ISnapshot|null); - - /** UpdateSnapshotRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); - - /** - * Creates a new UpdateSnapshotRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateSnapshotRequest instance - */ - public static create(properties?: google.pubsub.v1.IUpdateSnapshotRequest): google.pubsub.v1.UpdateSnapshotRequest; - - /** - * Encodes the specified UpdateSnapshotRequest message. Does not implicitly {@link google.pubsub.v1.UpdateSnapshotRequest.verify|verify} messages. - * @param message UpdateSnapshotRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.IUpdateSnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateSnapshotRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.UpdateSnapshotRequest.verify|verify} messages. - * @param message UpdateSnapshotRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.IUpdateSnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateSnapshotRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateSnapshotRequest - * @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.pubsub.v1.UpdateSnapshotRequest; - - /** - * Decodes an UpdateSnapshotRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateSnapshotRequest - * @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.pubsub.v1.UpdateSnapshotRequest; - - /** - * Verifies an UpdateSnapshotRequest 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 UpdateSnapshotRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateSnapshotRequest - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.UpdateSnapshotRequest; - - /** - * Creates a plain object from an UpdateSnapshotRequest message. Also converts values to other types if specified. - * @param message UpdateSnapshotRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.UpdateSnapshotRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateSnapshotRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateSnapshotRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Snapshot. */ - interface ISnapshot { - - /** Snapshot name */ - name?: (string|null); - - /** Snapshot topic */ - topic?: (string|null); - - /** Snapshot expireTime */ - expireTime?: (google.protobuf.ITimestamp|null); - - /** Snapshot labels */ - labels?: ({ [k: string]: string }|null); - } - - /** Represents a Snapshot. */ - class Snapshot implements ISnapshot { - - /** - * Constructs a new Snapshot. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.ISnapshot); - - /** Snapshot name. */ - public name: string; - - /** Snapshot topic. */ - public topic: string; - - /** Snapshot expireTime. */ - public expireTime?: (google.protobuf.ITimestamp|null); - - /** Snapshot labels. */ - public labels: { [k: string]: string }; - - /** - * Creates a new Snapshot instance using the specified properties. - * @param [properties] Properties to set - * @returns Snapshot instance - */ - public static create(properties?: google.pubsub.v1.ISnapshot): google.pubsub.v1.Snapshot; - - /** - * Encodes the specified Snapshot message. Does not implicitly {@link google.pubsub.v1.Snapshot.verify|verify} messages. - * @param message Snapshot message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.ISnapshot, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Snapshot message, length delimited. Does not implicitly {@link google.pubsub.v1.Snapshot.verify|verify} messages. - * @param message Snapshot message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.ISnapshot, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Snapshot message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Snapshot - * @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.pubsub.v1.Snapshot; - - /** - * Decodes a Snapshot message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Snapshot - * @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.pubsub.v1.Snapshot; - - /** - * Verifies a Snapshot 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 Snapshot message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Snapshot - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.Snapshot; - - /** - * Creates a plain object from a Snapshot message. Also converts values to other types if specified. - * @param message Snapshot - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.Snapshot, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Snapshot to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Snapshot - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetSnapshotRequest. */ - interface IGetSnapshotRequest { - - /** GetSnapshotRequest snapshot */ - snapshot?: (string|null); - } - - /** Represents a GetSnapshotRequest. */ - class GetSnapshotRequest implements IGetSnapshotRequest { - - /** - * Constructs a new GetSnapshotRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.IGetSnapshotRequest); - - /** GetSnapshotRequest snapshot. */ - public snapshot: string; - - /** - * Creates a new GetSnapshotRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetSnapshotRequest instance - */ - public static create(properties?: google.pubsub.v1.IGetSnapshotRequest): google.pubsub.v1.GetSnapshotRequest; - - /** - * Encodes the specified GetSnapshotRequest message. Does not implicitly {@link google.pubsub.v1.GetSnapshotRequest.verify|verify} messages. - * @param message GetSnapshotRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.IGetSnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetSnapshotRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.GetSnapshotRequest.verify|verify} messages. - * @param message GetSnapshotRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.IGetSnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetSnapshotRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetSnapshotRequest - * @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.pubsub.v1.GetSnapshotRequest; - - /** - * Decodes a GetSnapshotRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetSnapshotRequest - * @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.pubsub.v1.GetSnapshotRequest; - - /** - * Verifies a GetSnapshotRequest 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 GetSnapshotRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetSnapshotRequest - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.GetSnapshotRequest; - - /** - * Creates a plain object from a GetSnapshotRequest message. Also converts values to other types if specified. - * @param message GetSnapshotRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.GetSnapshotRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetSnapshotRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetSnapshotRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListSnapshotsRequest. */ - interface IListSnapshotsRequest { - - /** ListSnapshotsRequest project */ - project?: (string|null); - - /** ListSnapshotsRequest pageSize */ - pageSize?: (number|null); - - /** ListSnapshotsRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a ListSnapshotsRequest. */ - class ListSnapshotsRequest implements IListSnapshotsRequest { - - /** - * Constructs a new ListSnapshotsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.IListSnapshotsRequest); - - /** ListSnapshotsRequest project. */ - public project: string; - - /** ListSnapshotsRequest pageSize. */ - public pageSize: number; - - /** ListSnapshotsRequest pageToken. */ - public pageToken: string; - - /** - * Creates a new ListSnapshotsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListSnapshotsRequest instance - */ - public static create(properties?: google.pubsub.v1.IListSnapshotsRequest): google.pubsub.v1.ListSnapshotsRequest; - - /** - * Encodes the specified ListSnapshotsRequest message. Does not implicitly {@link google.pubsub.v1.ListSnapshotsRequest.verify|verify} messages. - * @param message ListSnapshotsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.IListSnapshotsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListSnapshotsRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.ListSnapshotsRequest.verify|verify} messages. - * @param message ListSnapshotsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.IListSnapshotsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListSnapshotsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListSnapshotsRequest - * @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.pubsub.v1.ListSnapshotsRequest; - - /** - * Decodes a ListSnapshotsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListSnapshotsRequest - * @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.pubsub.v1.ListSnapshotsRequest; - - /** - * Verifies a ListSnapshotsRequest 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 ListSnapshotsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListSnapshotsRequest - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.ListSnapshotsRequest; - - /** - * Creates a plain object from a ListSnapshotsRequest message. Also converts values to other types if specified. - * @param message ListSnapshotsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.ListSnapshotsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListSnapshotsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListSnapshotsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListSnapshotsResponse. */ - interface IListSnapshotsResponse { - - /** ListSnapshotsResponse snapshots */ - snapshots?: (google.pubsub.v1.ISnapshot[]|null); - - /** ListSnapshotsResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListSnapshotsResponse. */ - class ListSnapshotsResponse implements IListSnapshotsResponse { - - /** - * Constructs a new ListSnapshotsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.IListSnapshotsResponse); - - /** ListSnapshotsResponse snapshots. */ - public snapshots: google.pubsub.v1.ISnapshot[]; - - /** ListSnapshotsResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListSnapshotsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListSnapshotsResponse instance - */ - public static create(properties?: google.pubsub.v1.IListSnapshotsResponse): google.pubsub.v1.ListSnapshotsResponse; - - /** - * Encodes the specified ListSnapshotsResponse message. Does not implicitly {@link google.pubsub.v1.ListSnapshotsResponse.verify|verify} messages. - * @param message ListSnapshotsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.IListSnapshotsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListSnapshotsResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.ListSnapshotsResponse.verify|verify} messages. - * @param message ListSnapshotsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.IListSnapshotsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListSnapshotsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListSnapshotsResponse - * @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.pubsub.v1.ListSnapshotsResponse; - - /** - * Decodes a ListSnapshotsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListSnapshotsResponse - * @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.pubsub.v1.ListSnapshotsResponse; - - /** - * Verifies a ListSnapshotsResponse 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 ListSnapshotsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListSnapshotsResponse - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.ListSnapshotsResponse; - - /** - * Creates a plain object from a ListSnapshotsResponse message. Also converts values to other types if specified. - * @param message ListSnapshotsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.ListSnapshotsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListSnapshotsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListSnapshotsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteSnapshotRequest. */ - interface IDeleteSnapshotRequest { - - /** DeleteSnapshotRequest snapshot */ - snapshot?: (string|null); - } - - /** Represents a DeleteSnapshotRequest. */ - class DeleteSnapshotRequest implements IDeleteSnapshotRequest { - - /** - * Constructs a new DeleteSnapshotRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.IDeleteSnapshotRequest); - - /** DeleteSnapshotRequest snapshot. */ - public snapshot: string; - - /** - * Creates a new DeleteSnapshotRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteSnapshotRequest instance - */ - public static create(properties?: google.pubsub.v1.IDeleteSnapshotRequest): google.pubsub.v1.DeleteSnapshotRequest; - - /** - * Encodes the specified DeleteSnapshotRequest message. Does not implicitly {@link google.pubsub.v1.DeleteSnapshotRequest.verify|verify} messages. - * @param message DeleteSnapshotRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.IDeleteSnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteSnapshotRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.DeleteSnapshotRequest.verify|verify} messages. - * @param message DeleteSnapshotRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.IDeleteSnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteSnapshotRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteSnapshotRequest - * @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.pubsub.v1.DeleteSnapshotRequest; - - /** - * Decodes a DeleteSnapshotRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteSnapshotRequest - * @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.pubsub.v1.DeleteSnapshotRequest; - - /** - * Verifies a DeleteSnapshotRequest 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 DeleteSnapshotRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteSnapshotRequest - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.DeleteSnapshotRequest; - - /** - * Creates a plain object from a DeleteSnapshotRequest message. Also converts values to other types if specified. - * @param message DeleteSnapshotRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.DeleteSnapshotRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteSnapshotRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteSnapshotRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a SeekRequest. */ - interface ISeekRequest { - - /** SeekRequest subscription */ - subscription?: (string|null); - - /** SeekRequest time */ - time?: (google.protobuf.ITimestamp|null); - - /** SeekRequest snapshot */ - snapshot?: (string|null); - } - - /** Represents a SeekRequest. */ - class SeekRequest implements ISeekRequest { - - /** - * Constructs a new SeekRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.ISeekRequest); - - /** SeekRequest subscription. */ - public subscription: string; - - /** SeekRequest time. */ - public time?: (google.protobuf.ITimestamp|null); - - /** SeekRequest snapshot. */ - public snapshot?: (string|null); - - /** SeekRequest target. */ - public target?: ("time"|"snapshot"); - - /** - * Creates a new SeekRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns SeekRequest instance - */ - public static create(properties?: google.pubsub.v1.ISeekRequest): google.pubsub.v1.SeekRequest; - - /** - * Encodes the specified SeekRequest message. Does not implicitly {@link google.pubsub.v1.SeekRequest.verify|verify} messages. - * @param message SeekRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.ISeekRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SeekRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.SeekRequest.verify|verify} messages. - * @param message SeekRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.ISeekRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SeekRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SeekRequest - * @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.pubsub.v1.SeekRequest; - - /** - * Decodes a SeekRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SeekRequest - * @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.pubsub.v1.SeekRequest; - - /** - * Verifies a SeekRequest 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 SeekRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SeekRequest - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.SeekRequest; - - /** - * Creates a plain object from a SeekRequest message. Also converts values to other types if specified. - * @param message SeekRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.SeekRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SeekRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SeekRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a SeekResponse. */ - interface ISeekResponse { - } - - /** Represents a SeekResponse. */ - class SeekResponse implements ISeekResponse { - - /** - * Constructs a new SeekResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.ISeekResponse); - - /** - * Creates a new SeekResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns SeekResponse instance - */ - public static create(properties?: google.pubsub.v1.ISeekResponse): google.pubsub.v1.SeekResponse; - - /** - * Encodes the specified SeekResponse message. Does not implicitly {@link google.pubsub.v1.SeekResponse.verify|verify} messages. - * @param message SeekResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.ISeekResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SeekResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.SeekResponse.verify|verify} messages. - * @param message SeekResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.ISeekResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SeekResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SeekResponse - * @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.pubsub.v1.SeekResponse; - - /** - * Decodes a SeekResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SeekResponse - * @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.pubsub.v1.SeekResponse; - - /** - * Verifies a SeekResponse 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 SeekResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SeekResponse - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.SeekResponse; - - /** - * Creates a plain object from a SeekResponse message. Also converts values to other types if specified. - * @param message SeekResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.SeekResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SeekResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SeekResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Represents a SchemaService */ - class SchemaService extends $protobuf.rpc.Service { - - /** - * Constructs a new SchemaService service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - - /** - * Creates new SchemaService 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): SchemaService; - - /** - * Calls CreateSchema. - * @param request CreateSchemaRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Schema - */ - public createSchema(request: google.pubsub.v1.ICreateSchemaRequest, callback: google.pubsub.v1.SchemaService.CreateSchemaCallback): void; - - /** - * Calls CreateSchema. - * @param request CreateSchemaRequest message or plain object - * @returns Promise - */ - public createSchema(request: google.pubsub.v1.ICreateSchemaRequest): Promise; - - /** - * Calls GetSchema. - * @param request GetSchemaRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Schema - */ - public getSchema(request: google.pubsub.v1.IGetSchemaRequest, callback: google.pubsub.v1.SchemaService.GetSchemaCallback): void; - - /** - * Calls GetSchema. - * @param request GetSchemaRequest message or plain object - * @returns Promise - */ - public getSchema(request: google.pubsub.v1.IGetSchemaRequest): Promise; - - /** - * Calls ListSchemas. - * @param request ListSchemasRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListSchemasResponse - */ - public listSchemas(request: google.pubsub.v1.IListSchemasRequest, callback: google.pubsub.v1.SchemaService.ListSchemasCallback): void; - - /** - * Calls ListSchemas. - * @param request ListSchemasRequest message or plain object - * @returns Promise - */ - public listSchemas(request: google.pubsub.v1.IListSchemasRequest): Promise; - - /** - * Calls ListSchemaRevisions. - * @param request ListSchemaRevisionsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListSchemaRevisionsResponse - */ - public listSchemaRevisions(request: google.pubsub.v1.IListSchemaRevisionsRequest, callback: google.pubsub.v1.SchemaService.ListSchemaRevisionsCallback): void; - - /** - * Calls ListSchemaRevisions. - * @param request ListSchemaRevisionsRequest message or plain object - * @returns Promise - */ - public listSchemaRevisions(request: google.pubsub.v1.IListSchemaRevisionsRequest): Promise; - - /** - * Calls CommitSchema. - * @param request CommitSchemaRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Schema - */ - public commitSchema(request: google.pubsub.v1.ICommitSchemaRequest, callback: google.pubsub.v1.SchemaService.CommitSchemaCallback): void; - - /** - * Calls CommitSchema. - * @param request CommitSchemaRequest message or plain object - * @returns Promise - */ - public commitSchema(request: google.pubsub.v1.ICommitSchemaRequest): Promise; - - /** - * Calls RollbackSchema. - * @param request RollbackSchemaRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Schema - */ - public rollbackSchema(request: google.pubsub.v1.IRollbackSchemaRequest, callback: google.pubsub.v1.SchemaService.RollbackSchemaCallback): void; - - /** - * Calls RollbackSchema. - * @param request RollbackSchemaRequest message or plain object - * @returns Promise - */ - public rollbackSchema(request: google.pubsub.v1.IRollbackSchemaRequest): Promise; - - /** - * Calls DeleteSchemaRevision. - * @param request DeleteSchemaRevisionRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Schema - */ - public deleteSchemaRevision(request: google.pubsub.v1.IDeleteSchemaRevisionRequest, callback: google.pubsub.v1.SchemaService.DeleteSchemaRevisionCallback): void; - - /** - * Calls DeleteSchemaRevision. - * @param request DeleteSchemaRevisionRequest message or plain object - * @returns Promise - */ - public deleteSchemaRevision(request: google.pubsub.v1.IDeleteSchemaRevisionRequest): Promise; - - /** - * Calls DeleteSchema. - * @param request DeleteSchemaRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public deleteSchema(request: google.pubsub.v1.IDeleteSchemaRequest, callback: google.pubsub.v1.SchemaService.DeleteSchemaCallback): void; - - /** - * Calls DeleteSchema. - * @param request DeleteSchemaRequest message or plain object - * @returns Promise - */ - public deleteSchema(request: google.pubsub.v1.IDeleteSchemaRequest): Promise; - - /** - * Calls ValidateSchema. - * @param request ValidateSchemaRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ValidateSchemaResponse - */ - public validateSchema(request: google.pubsub.v1.IValidateSchemaRequest, callback: google.pubsub.v1.SchemaService.ValidateSchemaCallback): void; - - /** - * Calls ValidateSchema. - * @param request ValidateSchemaRequest message or plain object - * @returns Promise - */ - public validateSchema(request: google.pubsub.v1.IValidateSchemaRequest): Promise; - - /** - * Calls ValidateMessage. - * @param request ValidateMessageRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ValidateMessageResponse - */ - public validateMessage(request: google.pubsub.v1.IValidateMessageRequest, callback: google.pubsub.v1.SchemaService.ValidateMessageCallback): void; - - /** - * Calls ValidateMessage. - * @param request ValidateMessageRequest message or plain object - * @returns Promise - */ - public validateMessage(request: google.pubsub.v1.IValidateMessageRequest): Promise; - } - - namespace SchemaService { - - /** - * Callback as used by {@link google.pubsub.v1.SchemaService|createSchema}. - * @param error Error, if any - * @param [response] Schema - */ - type CreateSchemaCallback = (error: (Error|null), response?: google.pubsub.v1.Schema) => void; - - /** - * Callback as used by {@link google.pubsub.v1.SchemaService|getSchema}. - * @param error Error, if any - * @param [response] Schema - */ - type GetSchemaCallback = (error: (Error|null), response?: google.pubsub.v1.Schema) => void; - - /** - * Callback as used by {@link google.pubsub.v1.SchemaService|listSchemas}. - * @param error Error, if any - * @param [response] ListSchemasResponse - */ - type ListSchemasCallback = (error: (Error|null), response?: google.pubsub.v1.ListSchemasResponse) => void; - - /** - * Callback as used by {@link google.pubsub.v1.SchemaService|listSchemaRevisions}. - * @param error Error, if any - * @param [response] ListSchemaRevisionsResponse - */ - type ListSchemaRevisionsCallback = (error: (Error|null), response?: google.pubsub.v1.ListSchemaRevisionsResponse) => void; - - /** - * Callback as used by {@link google.pubsub.v1.SchemaService|commitSchema}. - * @param error Error, if any - * @param [response] Schema - */ - type CommitSchemaCallback = (error: (Error|null), response?: google.pubsub.v1.Schema) => void; - - /** - * Callback as used by {@link google.pubsub.v1.SchemaService|rollbackSchema}. - * @param error Error, if any - * @param [response] Schema - */ - type RollbackSchemaCallback = (error: (Error|null), response?: google.pubsub.v1.Schema) => void; - - /** - * Callback as used by {@link google.pubsub.v1.SchemaService|deleteSchemaRevision}. - * @param error Error, if any - * @param [response] Schema - */ - type DeleteSchemaRevisionCallback = (error: (Error|null), response?: google.pubsub.v1.Schema) => void; - - /** - * Callback as used by {@link google.pubsub.v1.SchemaService|deleteSchema}. - * @param error Error, if any - * @param [response] Empty - */ - type DeleteSchemaCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.pubsub.v1.SchemaService|validateSchema}. - * @param error Error, if any - * @param [response] ValidateSchemaResponse - */ - type ValidateSchemaCallback = (error: (Error|null), response?: google.pubsub.v1.ValidateSchemaResponse) => void; - - /** - * Callback as used by {@link google.pubsub.v1.SchemaService|validateMessage}. - * @param error Error, if any - * @param [response] ValidateMessageResponse - */ - type ValidateMessageCallback = (error: (Error|null), response?: google.pubsub.v1.ValidateMessageResponse) => void; - } - - /** Properties of a Schema. */ - interface ISchema { - - /** Schema name */ - name?: (string|null); - - /** Schema type */ - type?: (google.pubsub.v1.Schema.Type|keyof typeof google.pubsub.v1.Schema.Type|null); - - /** Schema definition */ - definition?: (string|null); - - /** Schema revisionId */ - revisionId?: (string|null); - - /** Schema revisionCreateTime */ - revisionCreateTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents a Schema. */ - class Schema implements ISchema { - - /** - * Constructs a new Schema. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.ISchema); - - /** Schema name. */ - public name: string; - - /** Schema type. */ - public type: (google.pubsub.v1.Schema.Type|keyof typeof google.pubsub.v1.Schema.Type); - - /** Schema definition. */ - public definition: string; - - /** Schema revisionId. */ - public revisionId: string; - - /** Schema revisionCreateTime. */ - public revisionCreateTime?: (google.protobuf.ITimestamp|null); - - /** - * Creates a new Schema instance using the specified properties. - * @param [properties] Properties to set - * @returns Schema instance - */ - public static create(properties?: google.pubsub.v1.ISchema): google.pubsub.v1.Schema; - - /** - * Encodes the specified Schema message. Does not implicitly {@link google.pubsub.v1.Schema.verify|verify} messages. - * @param message Schema message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.ISchema, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Schema message, length delimited. Does not implicitly {@link google.pubsub.v1.Schema.verify|verify} messages. - * @param message Schema message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.ISchema, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Schema message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Schema - * @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.pubsub.v1.Schema; - - /** - * Decodes a Schema message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Schema - * @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.pubsub.v1.Schema; - - /** - * Verifies a Schema 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 Schema message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Schema - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.Schema; - - /** - * Creates a plain object from a Schema message. Also converts values to other types if specified. - * @param message Schema - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.Schema, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Schema to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Schema - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Schema { - - /** Type enum. */ - enum Type { - TYPE_UNSPECIFIED = 0, - PROTOCOL_BUFFER = 1, - AVRO = 2 - } - } - - /** SchemaView enum. */ - enum SchemaView { - SCHEMA_VIEW_UNSPECIFIED = 0, - BASIC = 1, - FULL = 2 - } - - /** Properties of a CreateSchemaRequest. */ - interface ICreateSchemaRequest { - - /** CreateSchemaRequest parent */ - parent?: (string|null); - - /** CreateSchemaRequest schema */ - schema?: (google.pubsub.v1.ISchema|null); - - /** CreateSchemaRequest schemaId */ - schemaId?: (string|null); - } - - /** Represents a CreateSchemaRequest. */ - class CreateSchemaRequest implements ICreateSchemaRequest { - - /** - * Constructs a new CreateSchemaRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.ICreateSchemaRequest); - - /** CreateSchemaRequest parent. */ - public parent: string; - - /** CreateSchemaRequest schema. */ - public schema?: (google.pubsub.v1.ISchema|null); - - /** CreateSchemaRequest schemaId. */ - public schemaId: string; - - /** - * Creates a new CreateSchemaRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateSchemaRequest instance - */ - public static create(properties?: google.pubsub.v1.ICreateSchemaRequest): google.pubsub.v1.CreateSchemaRequest; - - /** - * Encodes the specified CreateSchemaRequest message. Does not implicitly {@link google.pubsub.v1.CreateSchemaRequest.verify|verify} messages. - * @param message CreateSchemaRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.ICreateSchemaRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateSchemaRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.CreateSchemaRequest.verify|verify} messages. - * @param message CreateSchemaRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.ICreateSchemaRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateSchemaRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateSchemaRequest - * @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.pubsub.v1.CreateSchemaRequest; - - /** - * Decodes a CreateSchemaRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateSchemaRequest - * @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.pubsub.v1.CreateSchemaRequest; - - /** - * Verifies a CreateSchemaRequest 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 CreateSchemaRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateSchemaRequest - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.CreateSchemaRequest; - - /** - * Creates a plain object from a CreateSchemaRequest message. Also converts values to other types if specified. - * @param message CreateSchemaRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.CreateSchemaRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateSchemaRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateSchemaRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetSchemaRequest. */ - interface IGetSchemaRequest { - - /** GetSchemaRequest name */ - name?: (string|null); - - /** GetSchemaRequest view */ - view?: (google.pubsub.v1.SchemaView|keyof typeof google.pubsub.v1.SchemaView|null); - } - - /** Represents a GetSchemaRequest. */ - class GetSchemaRequest implements IGetSchemaRequest { - - /** - * Constructs a new GetSchemaRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.IGetSchemaRequest); - - /** GetSchemaRequest name. */ - public name: string; - - /** GetSchemaRequest view. */ - public view: (google.pubsub.v1.SchemaView|keyof typeof google.pubsub.v1.SchemaView); - - /** - * Creates a new GetSchemaRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetSchemaRequest instance - */ - public static create(properties?: google.pubsub.v1.IGetSchemaRequest): google.pubsub.v1.GetSchemaRequest; - - /** - * Encodes the specified GetSchemaRequest message. Does not implicitly {@link google.pubsub.v1.GetSchemaRequest.verify|verify} messages. - * @param message GetSchemaRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.IGetSchemaRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetSchemaRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.GetSchemaRequest.verify|verify} messages. - * @param message GetSchemaRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.IGetSchemaRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetSchemaRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetSchemaRequest - * @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.pubsub.v1.GetSchemaRequest; - - /** - * Decodes a GetSchemaRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetSchemaRequest - * @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.pubsub.v1.GetSchemaRequest; - - /** - * Verifies a GetSchemaRequest 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 GetSchemaRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetSchemaRequest - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.GetSchemaRequest; - - /** - * Creates a plain object from a GetSchemaRequest message. Also converts values to other types if specified. - * @param message GetSchemaRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.GetSchemaRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetSchemaRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetSchemaRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListSchemasRequest. */ - interface IListSchemasRequest { - - /** ListSchemasRequest parent */ - parent?: (string|null); - - /** ListSchemasRequest view */ - view?: (google.pubsub.v1.SchemaView|keyof typeof google.pubsub.v1.SchemaView|null); - - /** ListSchemasRequest pageSize */ - pageSize?: (number|null); - - /** ListSchemasRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a ListSchemasRequest. */ - class ListSchemasRequest implements IListSchemasRequest { - - /** - * Constructs a new ListSchemasRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.IListSchemasRequest); - - /** ListSchemasRequest parent. */ - public parent: string; - - /** ListSchemasRequest view. */ - public view: (google.pubsub.v1.SchemaView|keyof typeof google.pubsub.v1.SchemaView); - - /** ListSchemasRequest pageSize. */ - public pageSize: number; - - /** ListSchemasRequest pageToken. */ - public pageToken: string; - - /** - * Creates a new ListSchemasRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListSchemasRequest instance - */ - public static create(properties?: google.pubsub.v1.IListSchemasRequest): google.pubsub.v1.ListSchemasRequest; - - /** - * Encodes the specified ListSchemasRequest message. Does not implicitly {@link google.pubsub.v1.ListSchemasRequest.verify|verify} messages. - * @param message ListSchemasRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.IListSchemasRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListSchemasRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.ListSchemasRequest.verify|verify} messages. - * @param message ListSchemasRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.IListSchemasRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListSchemasRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListSchemasRequest - * @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.pubsub.v1.ListSchemasRequest; - - /** - * Decodes a ListSchemasRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListSchemasRequest - * @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.pubsub.v1.ListSchemasRequest; - - /** - * Verifies a ListSchemasRequest 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 ListSchemasRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListSchemasRequest - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.ListSchemasRequest; - - /** - * Creates a plain object from a ListSchemasRequest message. Also converts values to other types if specified. - * @param message ListSchemasRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.ListSchemasRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListSchemasRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListSchemasRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListSchemasResponse. */ - interface IListSchemasResponse { - - /** ListSchemasResponse schemas */ - schemas?: (google.pubsub.v1.ISchema[]|null); - - /** ListSchemasResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListSchemasResponse. */ - class ListSchemasResponse implements IListSchemasResponse { - - /** - * Constructs a new ListSchemasResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.IListSchemasResponse); - - /** ListSchemasResponse schemas. */ - public schemas: google.pubsub.v1.ISchema[]; - - /** ListSchemasResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListSchemasResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListSchemasResponse instance - */ - public static create(properties?: google.pubsub.v1.IListSchemasResponse): google.pubsub.v1.ListSchemasResponse; - - /** - * Encodes the specified ListSchemasResponse message. Does not implicitly {@link google.pubsub.v1.ListSchemasResponse.verify|verify} messages. - * @param message ListSchemasResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.IListSchemasResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListSchemasResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.ListSchemasResponse.verify|verify} messages. - * @param message ListSchemasResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.IListSchemasResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListSchemasResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListSchemasResponse - * @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.pubsub.v1.ListSchemasResponse; - - /** - * Decodes a ListSchemasResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListSchemasResponse - * @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.pubsub.v1.ListSchemasResponse; - - /** - * Verifies a ListSchemasResponse 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 ListSchemasResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListSchemasResponse - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.ListSchemasResponse; - - /** - * Creates a plain object from a ListSchemasResponse message. Also converts values to other types if specified. - * @param message ListSchemasResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.ListSchemasResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListSchemasResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListSchemasResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListSchemaRevisionsRequest. */ - interface IListSchemaRevisionsRequest { - - /** ListSchemaRevisionsRequest name */ - name?: (string|null); - - /** ListSchemaRevisionsRequest view */ - view?: (google.pubsub.v1.SchemaView|keyof typeof google.pubsub.v1.SchemaView|null); - - /** ListSchemaRevisionsRequest pageSize */ - pageSize?: (number|null); - - /** ListSchemaRevisionsRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a ListSchemaRevisionsRequest. */ - class ListSchemaRevisionsRequest implements IListSchemaRevisionsRequest { - - /** - * Constructs a new ListSchemaRevisionsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.IListSchemaRevisionsRequest); - - /** ListSchemaRevisionsRequest name. */ - public name: string; - - /** ListSchemaRevisionsRequest view. */ - public view: (google.pubsub.v1.SchemaView|keyof typeof google.pubsub.v1.SchemaView); - - /** ListSchemaRevisionsRequest pageSize. */ - public pageSize: number; - - /** ListSchemaRevisionsRequest pageToken. */ - public pageToken: string; - - /** - * Creates a new ListSchemaRevisionsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListSchemaRevisionsRequest instance - */ - public static create(properties?: google.pubsub.v1.IListSchemaRevisionsRequest): google.pubsub.v1.ListSchemaRevisionsRequest; - - /** - * Encodes the specified ListSchemaRevisionsRequest message. Does not implicitly {@link google.pubsub.v1.ListSchemaRevisionsRequest.verify|verify} messages. - * @param message ListSchemaRevisionsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.IListSchemaRevisionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListSchemaRevisionsRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.ListSchemaRevisionsRequest.verify|verify} messages. - * @param message ListSchemaRevisionsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.IListSchemaRevisionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListSchemaRevisionsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListSchemaRevisionsRequest - * @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.pubsub.v1.ListSchemaRevisionsRequest; - - /** - * Decodes a ListSchemaRevisionsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListSchemaRevisionsRequest - * @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.pubsub.v1.ListSchemaRevisionsRequest; - - /** - * Verifies a ListSchemaRevisionsRequest 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 ListSchemaRevisionsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListSchemaRevisionsRequest - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.ListSchemaRevisionsRequest; - - /** - * Creates a plain object from a ListSchemaRevisionsRequest message. Also converts values to other types if specified. - * @param message ListSchemaRevisionsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.ListSchemaRevisionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListSchemaRevisionsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListSchemaRevisionsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListSchemaRevisionsResponse. */ - interface IListSchemaRevisionsResponse { - - /** ListSchemaRevisionsResponse schemas */ - schemas?: (google.pubsub.v1.ISchema[]|null); - - /** ListSchemaRevisionsResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListSchemaRevisionsResponse. */ - class ListSchemaRevisionsResponse implements IListSchemaRevisionsResponse { - - /** - * Constructs a new ListSchemaRevisionsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.IListSchemaRevisionsResponse); - - /** ListSchemaRevisionsResponse schemas. */ - public schemas: google.pubsub.v1.ISchema[]; - - /** ListSchemaRevisionsResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListSchemaRevisionsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListSchemaRevisionsResponse instance - */ - public static create(properties?: google.pubsub.v1.IListSchemaRevisionsResponse): google.pubsub.v1.ListSchemaRevisionsResponse; - - /** - * Encodes the specified ListSchemaRevisionsResponse message. Does not implicitly {@link google.pubsub.v1.ListSchemaRevisionsResponse.verify|verify} messages. - * @param message ListSchemaRevisionsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.IListSchemaRevisionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListSchemaRevisionsResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.ListSchemaRevisionsResponse.verify|verify} messages. - * @param message ListSchemaRevisionsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.IListSchemaRevisionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListSchemaRevisionsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListSchemaRevisionsResponse - * @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.pubsub.v1.ListSchemaRevisionsResponse; - - /** - * Decodes a ListSchemaRevisionsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListSchemaRevisionsResponse - * @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.pubsub.v1.ListSchemaRevisionsResponse; - - /** - * Verifies a ListSchemaRevisionsResponse 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 ListSchemaRevisionsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListSchemaRevisionsResponse - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.ListSchemaRevisionsResponse; - - /** - * Creates a plain object from a ListSchemaRevisionsResponse message. Also converts values to other types if specified. - * @param message ListSchemaRevisionsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.ListSchemaRevisionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListSchemaRevisionsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListSchemaRevisionsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CommitSchemaRequest. */ - interface ICommitSchemaRequest { - - /** CommitSchemaRequest name */ - name?: (string|null); - - /** CommitSchemaRequest schema */ - schema?: (google.pubsub.v1.ISchema|null); - } - - /** Represents a CommitSchemaRequest. */ - class CommitSchemaRequest implements ICommitSchemaRequest { - - /** - * Constructs a new CommitSchemaRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.ICommitSchemaRequest); - - /** CommitSchemaRequest name. */ - public name: string; - - /** CommitSchemaRequest schema. */ - public schema?: (google.pubsub.v1.ISchema|null); - - /** - * Creates a new CommitSchemaRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CommitSchemaRequest instance - */ - public static create(properties?: google.pubsub.v1.ICommitSchemaRequest): google.pubsub.v1.CommitSchemaRequest; - - /** - * Encodes the specified CommitSchemaRequest message. Does not implicitly {@link google.pubsub.v1.CommitSchemaRequest.verify|verify} messages. - * @param message CommitSchemaRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.ICommitSchemaRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CommitSchemaRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.CommitSchemaRequest.verify|verify} messages. - * @param message CommitSchemaRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.ICommitSchemaRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CommitSchemaRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CommitSchemaRequest - * @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.pubsub.v1.CommitSchemaRequest; - - /** - * Decodes a CommitSchemaRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CommitSchemaRequest - * @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.pubsub.v1.CommitSchemaRequest; - - /** - * Verifies a CommitSchemaRequest 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 CommitSchemaRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CommitSchemaRequest - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.CommitSchemaRequest; - - /** - * Creates a plain object from a CommitSchemaRequest message. Also converts values to other types if specified. - * @param message CommitSchemaRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.CommitSchemaRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CommitSchemaRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CommitSchemaRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a RollbackSchemaRequest. */ - interface IRollbackSchemaRequest { - - /** RollbackSchemaRequest name */ - name?: (string|null); - - /** RollbackSchemaRequest revisionId */ - revisionId?: (string|null); - } - - /** Represents a RollbackSchemaRequest. */ - class RollbackSchemaRequest implements IRollbackSchemaRequest { - - /** - * Constructs a new RollbackSchemaRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.IRollbackSchemaRequest); - - /** RollbackSchemaRequest name. */ - public name: string; - - /** RollbackSchemaRequest revisionId. */ - public revisionId: string; - - /** - * Creates a new RollbackSchemaRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns RollbackSchemaRequest instance - */ - public static create(properties?: google.pubsub.v1.IRollbackSchemaRequest): google.pubsub.v1.RollbackSchemaRequest; - - /** - * Encodes the specified RollbackSchemaRequest message. Does not implicitly {@link google.pubsub.v1.RollbackSchemaRequest.verify|verify} messages. - * @param message RollbackSchemaRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.IRollbackSchemaRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RollbackSchemaRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.RollbackSchemaRequest.verify|verify} messages. - * @param message RollbackSchemaRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.IRollbackSchemaRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RollbackSchemaRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RollbackSchemaRequest - * @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.pubsub.v1.RollbackSchemaRequest; - - /** - * Decodes a RollbackSchemaRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RollbackSchemaRequest - * @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.pubsub.v1.RollbackSchemaRequest; - - /** - * Verifies a RollbackSchemaRequest 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 RollbackSchemaRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RollbackSchemaRequest - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.RollbackSchemaRequest; - - /** - * Creates a plain object from a RollbackSchemaRequest message. Also converts values to other types if specified. - * @param message RollbackSchemaRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.RollbackSchemaRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RollbackSchemaRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RollbackSchemaRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteSchemaRevisionRequest. */ - interface IDeleteSchemaRevisionRequest { - - /** DeleteSchemaRevisionRequest name */ - name?: (string|null); - - /** DeleteSchemaRevisionRequest revisionId */ - revisionId?: (string|null); - } - - /** Represents a DeleteSchemaRevisionRequest. */ - class DeleteSchemaRevisionRequest implements IDeleteSchemaRevisionRequest { - - /** - * Constructs a new DeleteSchemaRevisionRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.IDeleteSchemaRevisionRequest); - - /** DeleteSchemaRevisionRequest name. */ - public name: string; - - /** DeleteSchemaRevisionRequest revisionId. */ - public revisionId: string; - - /** - * Creates a new DeleteSchemaRevisionRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteSchemaRevisionRequest instance - */ - public static create(properties?: google.pubsub.v1.IDeleteSchemaRevisionRequest): google.pubsub.v1.DeleteSchemaRevisionRequest; - - /** - * Encodes the specified DeleteSchemaRevisionRequest message. Does not implicitly {@link google.pubsub.v1.DeleteSchemaRevisionRequest.verify|verify} messages. - * @param message DeleteSchemaRevisionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.IDeleteSchemaRevisionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteSchemaRevisionRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.DeleteSchemaRevisionRequest.verify|verify} messages. - * @param message DeleteSchemaRevisionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.IDeleteSchemaRevisionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteSchemaRevisionRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteSchemaRevisionRequest - * @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.pubsub.v1.DeleteSchemaRevisionRequest; - - /** - * Decodes a DeleteSchemaRevisionRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteSchemaRevisionRequest - * @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.pubsub.v1.DeleteSchemaRevisionRequest; - - /** - * Verifies a DeleteSchemaRevisionRequest 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 DeleteSchemaRevisionRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteSchemaRevisionRequest - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.DeleteSchemaRevisionRequest; - - /** - * Creates a plain object from a DeleteSchemaRevisionRequest message. Also converts values to other types if specified. - * @param message DeleteSchemaRevisionRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.DeleteSchemaRevisionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteSchemaRevisionRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteSchemaRevisionRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteSchemaRequest. */ - interface IDeleteSchemaRequest { - - /** DeleteSchemaRequest name */ - name?: (string|null); - } - - /** Represents a DeleteSchemaRequest. */ - class DeleteSchemaRequest implements IDeleteSchemaRequest { - - /** - * Constructs a new DeleteSchemaRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.IDeleteSchemaRequest); - - /** DeleteSchemaRequest name. */ - public name: string; - - /** - * Creates a new DeleteSchemaRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteSchemaRequest instance - */ - public static create(properties?: google.pubsub.v1.IDeleteSchemaRequest): google.pubsub.v1.DeleteSchemaRequest; - - /** - * Encodes the specified DeleteSchemaRequest message. Does not implicitly {@link google.pubsub.v1.DeleteSchemaRequest.verify|verify} messages. - * @param message DeleteSchemaRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.IDeleteSchemaRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteSchemaRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.DeleteSchemaRequest.verify|verify} messages. - * @param message DeleteSchemaRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.IDeleteSchemaRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteSchemaRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteSchemaRequest - * @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.pubsub.v1.DeleteSchemaRequest; - - /** - * Decodes a DeleteSchemaRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteSchemaRequest - * @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.pubsub.v1.DeleteSchemaRequest; - - /** - * Verifies a DeleteSchemaRequest 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 DeleteSchemaRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteSchemaRequest - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.DeleteSchemaRequest; - - /** - * Creates a plain object from a DeleteSchemaRequest message. Also converts values to other types if specified. - * @param message DeleteSchemaRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.DeleteSchemaRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteSchemaRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteSchemaRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ValidateSchemaRequest. */ - interface IValidateSchemaRequest { - - /** ValidateSchemaRequest parent */ - parent?: (string|null); - - /** ValidateSchemaRequest schema */ - schema?: (google.pubsub.v1.ISchema|null); - } - - /** Represents a ValidateSchemaRequest. */ - class ValidateSchemaRequest implements IValidateSchemaRequest { - - /** - * Constructs a new ValidateSchemaRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.IValidateSchemaRequest); - - /** ValidateSchemaRequest parent. */ - public parent: string; - - /** ValidateSchemaRequest schema. */ - public schema?: (google.pubsub.v1.ISchema|null); - - /** - * Creates a new ValidateSchemaRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ValidateSchemaRequest instance - */ - public static create(properties?: google.pubsub.v1.IValidateSchemaRequest): google.pubsub.v1.ValidateSchemaRequest; - - /** - * Encodes the specified ValidateSchemaRequest message. Does not implicitly {@link google.pubsub.v1.ValidateSchemaRequest.verify|verify} messages. - * @param message ValidateSchemaRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.IValidateSchemaRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ValidateSchemaRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.ValidateSchemaRequest.verify|verify} messages. - * @param message ValidateSchemaRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.IValidateSchemaRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ValidateSchemaRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ValidateSchemaRequest - * @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.pubsub.v1.ValidateSchemaRequest; - - /** - * Decodes a ValidateSchemaRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ValidateSchemaRequest - * @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.pubsub.v1.ValidateSchemaRequest; - - /** - * Verifies a ValidateSchemaRequest 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 ValidateSchemaRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ValidateSchemaRequest - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.ValidateSchemaRequest; - - /** - * Creates a plain object from a ValidateSchemaRequest message. Also converts values to other types if specified. - * @param message ValidateSchemaRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.ValidateSchemaRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ValidateSchemaRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ValidateSchemaRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ValidateSchemaResponse. */ - interface IValidateSchemaResponse { - } - - /** Represents a ValidateSchemaResponse. */ - class ValidateSchemaResponse implements IValidateSchemaResponse { - - /** - * Constructs a new ValidateSchemaResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.IValidateSchemaResponse); - - /** - * Creates a new ValidateSchemaResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ValidateSchemaResponse instance - */ - public static create(properties?: google.pubsub.v1.IValidateSchemaResponse): google.pubsub.v1.ValidateSchemaResponse; - - /** - * Encodes the specified ValidateSchemaResponse message. Does not implicitly {@link google.pubsub.v1.ValidateSchemaResponse.verify|verify} messages. - * @param message ValidateSchemaResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.IValidateSchemaResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ValidateSchemaResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.ValidateSchemaResponse.verify|verify} messages. - * @param message ValidateSchemaResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.IValidateSchemaResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ValidateSchemaResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ValidateSchemaResponse - * @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.pubsub.v1.ValidateSchemaResponse; - - /** - * Decodes a ValidateSchemaResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ValidateSchemaResponse - * @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.pubsub.v1.ValidateSchemaResponse; - - /** - * Verifies a ValidateSchemaResponse 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 ValidateSchemaResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ValidateSchemaResponse - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.ValidateSchemaResponse; - - /** - * Creates a plain object from a ValidateSchemaResponse message. Also converts values to other types if specified. - * @param message ValidateSchemaResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.ValidateSchemaResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ValidateSchemaResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ValidateSchemaResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ValidateMessageRequest. */ - interface IValidateMessageRequest { - - /** ValidateMessageRequest parent */ - parent?: (string|null); - - /** ValidateMessageRequest name */ - name?: (string|null); - - /** ValidateMessageRequest schema */ - schema?: (google.pubsub.v1.ISchema|null); - - /** ValidateMessageRequest message */ - message?: (Uint8Array|string|null); - - /** ValidateMessageRequest encoding */ - encoding?: (google.pubsub.v1.Encoding|keyof typeof google.pubsub.v1.Encoding|null); - } - - /** Represents a ValidateMessageRequest. */ - class ValidateMessageRequest implements IValidateMessageRequest { - - /** - * Constructs a new ValidateMessageRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.IValidateMessageRequest); - - /** ValidateMessageRequest parent. */ - public parent: string; - - /** ValidateMessageRequest name. */ - public name?: (string|null); - - /** ValidateMessageRequest schema. */ - public schema?: (google.pubsub.v1.ISchema|null); - - /** ValidateMessageRequest message. */ - public message: (Uint8Array|string); - - /** ValidateMessageRequest encoding. */ - public encoding: (google.pubsub.v1.Encoding|keyof typeof google.pubsub.v1.Encoding); - - /** ValidateMessageRequest schemaSpec. */ - public schemaSpec?: ("name"|"schema"); - - /** - * Creates a new ValidateMessageRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ValidateMessageRequest instance - */ - public static create(properties?: google.pubsub.v1.IValidateMessageRequest): google.pubsub.v1.ValidateMessageRequest; - - /** - * Encodes the specified ValidateMessageRequest message. Does not implicitly {@link google.pubsub.v1.ValidateMessageRequest.verify|verify} messages. - * @param message ValidateMessageRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.IValidateMessageRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ValidateMessageRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.ValidateMessageRequest.verify|verify} messages. - * @param message ValidateMessageRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.IValidateMessageRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ValidateMessageRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ValidateMessageRequest - * @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.pubsub.v1.ValidateMessageRequest; - - /** - * Decodes a ValidateMessageRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ValidateMessageRequest - * @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.pubsub.v1.ValidateMessageRequest; - - /** - * Verifies a ValidateMessageRequest 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 ValidateMessageRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ValidateMessageRequest - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.ValidateMessageRequest; - - /** - * Creates a plain object from a ValidateMessageRequest message. Also converts values to other types if specified. - * @param message ValidateMessageRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.ValidateMessageRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ValidateMessageRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ValidateMessageRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ValidateMessageResponse. */ - interface IValidateMessageResponse { - } - - /** Represents a ValidateMessageResponse. */ - class ValidateMessageResponse implements IValidateMessageResponse { - - /** - * Constructs a new ValidateMessageResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.IValidateMessageResponse); - - /** - * Creates a new ValidateMessageResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ValidateMessageResponse instance - */ - public static create(properties?: google.pubsub.v1.IValidateMessageResponse): google.pubsub.v1.ValidateMessageResponse; - - /** - * Encodes the specified ValidateMessageResponse message. Does not implicitly {@link google.pubsub.v1.ValidateMessageResponse.verify|verify} messages. - * @param message ValidateMessageResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.IValidateMessageResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ValidateMessageResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.ValidateMessageResponse.verify|verify} messages. - * @param message ValidateMessageResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.IValidateMessageResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ValidateMessageResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ValidateMessageResponse - * @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.pubsub.v1.ValidateMessageResponse; - - /** - * Decodes a ValidateMessageResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ValidateMessageResponse - * @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.pubsub.v1.ValidateMessageResponse; - - /** - * Verifies a ValidateMessageResponse 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 ValidateMessageResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ValidateMessageResponse - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.ValidateMessageResponse; - - /** - * Creates a plain object from a ValidateMessageResponse message. Also converts values to other types if specified. - * @param message ValidateMessageResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.ValidateMessageResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ValidateMessageResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ValidateMessageResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Encoding enum. */ - enum Encoding { - ENCODING_UNSPECIFIED = 0, - JSON = 1, - BINARY = 2 - } - } - } - - /** Namespace api. */ - namespace api { - - /** Properties of a Http. */ - interface IHttp { - - /** Http rules */ - rules?: (google.api.IHttpRule[]|null); - - /** Http fullyDecodeReservedExpansion */ - fullyDecodeReservedExpansion?: (boolean|null); - } - - /** 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; - - /** - * 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 - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Http; - - /** - * 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. - * @param object Plain object - * @returns Http - */ - public static fromObject(object: { [k: string]: any }): google.api.Http; - - /** - * Creates a plain object from a Http message. Also converts values to other types if specified. - * @param message Http - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.Http, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Http to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Http - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a HttpRule. */ - interface IHttpRule { - - /** HttpRule selector */ - selector?: (string|null); - - /** HttpRule get */ - get?: (string|null); - - /** HttpRule put */ - put?: (string|null); - - /** HttpRule post */ - post?: (string|null); - - /** HttpRule delete */ - "delete"?: (string|null); - - /** HttpRule patch */ - patch?: (string|null); - - /** HttpRule custom */ - custom?: (google.api.ICustomHttpPattern|null); - - /** HttpRule body */ - body?: (string|null); - - /** HttpRule responseBody */ - responseBody?: (string|null); - - /** HttpRule additionalBindings */ - additionalBindings?: (google.api.IHttpRule[]|null); - } - - /** Represents a HttpRule. */ - class HttpRule implements IHttpRule { - - /** - * Constructs a new HttpRule. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IHttpRule); - - /** HttpRule selector. */ - public selector: string; - - /** HttpRule get. */ - public get?: (string|null); - - /** HttpRule put. */ - public put?: (string|null); - - /** HttpRule post. */ - public post?: (string|null); - - /** HttpRule delete. */ - public delete?: (string|null); - - /** HttpRule patch. */ - public patch?: (string|null); - - /** HttpRule custom. */ - public custom?: (google.api.ICustomHttpPattern|null); - - /** 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 - * @returns HttpRule - */ - public static fromObject(object: { [k: string]: any }): google.api.HttpRule; - - /** - * Creates a plain object from a HttpRule message. Also converts values to other types if specified. - * @param message HttpRule - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.HttpRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this HttpRule to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for HttpRule - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CustomHttpPattern. */ - interface ICustomHttpPattern { - - /** CustomHttpPattern kind */ - kind?: (string|null); - - /** CustomHttpPattern path */ - path?: (string|null); - } - - /** Represents a CustomHttpPattern. */ - class CustomHttpPattern implements ICustomHttpPattern { - - /** - * Constructs a new CustomHttpPattern. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.ICustomHttpPattern); - - /** CustomHttpPattern kind. */ - public kind: string; - - /** 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 - * @returns CustomHttpPattern - */ - public static fromObject(object: { [k: string]: any }): google.api.CustomHttpPattern; - - /** - * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. - * @param message CustomHttpPattern - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.CustomHttpPattern, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CustomHttpPattern to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CustomHttpPattern - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CommonLanguageSettings. */ - interface ICommonLanguageSettings { - - /** CommonLanguageSettings referenceDocsUri */ - referenceDocsUri?: (string|null); - - /** CommonLanguageSettings destinations */ - destinations?: (google.api.ClientLibraryDestination[]|null); - } - - /** Represents a CommonLanguageSettings. */ - class CommonLanguageSettings implements ICommonLanguageSettings { - - /** - * Constructs a new CommonLanguageSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.ICommonLanguageSettings); - - /** CommonLanguageSettings referenceDocsUri. */ - public referenceDocsUri: string; - - /** 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 - * @returns CommonLanguageSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.CommonLanguageSettings; - - /** - * Creates a plain object from a CommonLanguageSettings message. Also converts values to other types if specified. - * @param message CommonLanguageSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.CommonLanguageSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CommonLanguageSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CommonLanguageSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ClientLibrarySettings. */ - interface IClientLibrarySettings { - - /** ClientLibrarySettings version */ - version?: (string|null); - - /** ClientLibrarySettings launchStage */ - launchStage?: (google.api.LaunchStage|keyof typeof google.api.LaunchStage|null); - - /** ClientLibrarySettings restNumericEnums */ - restNumericEnums?: (boolean|null); - - /** ClientLibrarySettings javaSettings */ - javaSettings?: (google.api.IJavaSettings|null); - - /** ClientLibrarySettings cppSettings */ - cppSettings?: (google.api.ICppSettings|null); - - /** ClientLibrarySettings phpSettings */ - phpSettings?: (google.api.IPhpSettings|null); - - /** ClientLibrarySettings pythonSettings */ - pythonSettings?: (google.api.IPythonSettings|null); - - /** ClientLibrarySettings nodeSettings */ - nodeSettings?: (google.api.INodeSettings|null); - - /** ClientLibrarySettings dotnetSettings */ - dotnetSettings?: (google.api.IDotnetSettings|null); - - /** ClientLibrarySettings rubySettings */ - rubySettings?: (google.api.IRubySettings|null); - - /** ClientLibrarySettings goSettings */ - goSettings?: (google.api.IGoSettings|null); - } - - /** Represents a ClientLibrarySettings. */ - class ClientLibrarySettings implements IClientLibrarySettings { - - /** - * Constructs a new ClientLibrarySettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IClientLibrarySettings); - - /** ClientLibrarySettings version. */ - public version: string; - - /** ClientLibrarySettings launchStage. */ - public launchStage: (google.api.LaunchStage|keyof typeof google.api.LaunchStage); - - /** ClientLibrarySettings restNumericEnums. */ - public restNumericEnums: boolean; - - /** ClientLibrarySettings javaSettings. */ - public javaSettings?: (google.api.IJavaSettings|null); - - /** ClientLibrarySettings cppSettings. */ - public cppSettings?: (google.api.ICppSettings|null); - - /** ClientLibrarySettings phpSettings. */ - public phpSettings?: (google.api.IPhpSettings|null); - - /** ClientLibrarySettings pythonSettings. */ - public pythonSettings?: (google.api.IPythonSettings|null); - - /** ClientLibrarySettings nodeSettings. */ - public nodeSettings?: (google.api.INodeSettings|null); - - /** ClientLibrarySettings dotnetSettings. */ - public dotnetSettings?: (google.api.IDotnetSettings|null); - - /** ClientLibrarySettings rubySettings. */ - public rubySettings?: (google.api.IRubySettings|null); - - /** ClientLibrarySettings goSettings. */ - public goSettings?: (google.api.IGoSettings|null); - - /** - * Creates a new ClientLibrarySettings instance using the specified properties. - * @param [properties] Properties to set - * @returns ClientLibrarySettings instance - */ - public static create(properties?: google.api.IClientLibrarySettings): google.api.ClientLibrarySettings; - - /** - * 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 encode(message: google.api.IClientLibrarySettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * 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 static encodeDelimited(message: google.api.IClientLibrarySettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * 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 decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ClientLibrarySettings; - - /** - * 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 - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ClientLibrarySettings; - - /** - * 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 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|keyof typeof google.api.ClientLibraryOrganization|null); - - /** Publishing librarySettings */ - librarySettings?: (google.api.IClientLibrarySettings[]|null); - - /** Publishing protoReferenceDocumentationUri */ - protoReferenceDocumentationUri?: (string|null); - - /** Publishing restReferenceDocumentationUri */ - restReferenceDocumentationUri?: (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|keyof typeof google.api.ClientLibraryOrganization); - - /** Publishing librarySettings. */ - public librarySettings: google.api.IClientLibrarySettings[]; - - /** Publishing protoReferenceDocumentationUri. */ - public protoReferenceDocumentationUri: string; - - /** Publishing restReferenceDocumentationUri. */ - public restReferenceDocumentationUri: string; - - /** - * Creates a new Publishing instance using the specified properties. - * @param [properties] Properties to set - * @returns Publishing instance - */ - public static create(properties?: google.api.IPublishing): google.api.Publishing; - - /** - * 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 encode(message: google.api.IPublishing, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * 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 encodeDelimited(message: google.api.IPublishing, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * 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 static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Publishing; - - /** - * 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 decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Publishing; - - /** - * Verifies a Publishing 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 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); - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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 JavaSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns JavaSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.JavaSettings; - - /** - * 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.JavaSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this JavaSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * 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 CppSettings. */ - interface ICppSettings { - - /** CppSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a CppSettings. */ - class CppSettings implements ICppSettings { - - /** - * Constructs a new CppSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.ICppSettings); - - /** CppSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** - * Creates a new CppSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns CppSettings instance - */ - public static create(properties?: google.api.ICppSettings): google.api.CppSettings; - - /** - * 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 encode(message: google.api.ICppSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * 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 static encodeDelimited(message: google.api.ICppSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * 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 decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CppSettings; - - /** - * 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 - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CppSettings; - - /** - * 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 CppSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CppSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.CppSettings; - - /** - * 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.CppSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CppSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * 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 PhpSettings. */ - interface IPhpSettings { - - /** PhpSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a PhpSettings. */ - class PhpSettings implements IPhpSettings { - - /** - * Constructs a new PhpSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IPhpSettings); - - /** PhpSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** - * Creates a new PhpSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns PhpSettings instance - */ - public static create(properties?: google.api.IPhpSettings): google.api.PhpSettings; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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 PhpSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.PhpSettings; - - /** - * 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 }; - - /** - * Converts this PhpSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * 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; - } - - /** Properties of a PythonSettings. */ - interface IPythonSettings { - - /** PythonSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a PythonSettings. */ - class PythonSettings implements IPythonSettings { - - /** - * Constructs a new PythonSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IPythonSettings); - - /** PythonSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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 PythonSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PythonSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.PythonSettings; - - /** - * 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.PythonSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PythonSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * 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; - } - - /** Properties of a NodeSettings. */ - interface INodeSettings { - - /** NodeSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a NodeSettings. */ - class NodeSettings implements INodeSettings { - - /** - * Constructs a new NodeSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.INodeSettings); - - /** NodeSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** - * Creates a new NodeSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns NodeSettings instance - */ - public static create(properties?: google.api.INodeSettings): google.api.NodeSettings; - - /** - * 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 encode(message: google.api.INodeSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * 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 static encodeDelimited(message: google.api.INodeSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * 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 decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.NodeSettings; - - /** - * 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 - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.NodeSettings; - - /** - * 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 NodeSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns NodeSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.NodeSettings; - - /** - * 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.api.NodeSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this NodeSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * 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; - } - - /** 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); - - /** DotnetSettings ignoredResources */ - ignoredResources?: (string[]|null); - - /** DotnetSettings forcedNamespaceAliases */ - forcedNamespaceAliases?: (string[]|null); - - /** DotnetSettings handwrittenSignatures */ - handwrittenSignatures?: (string[]|null); - } - - /** Represents a DotnetSettings. */ - class DotnetSettings implements IDotnetSettings { - - /** - * Constructs a new DotnetSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IDotnetSettings); - - /** DotnetSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** DotnetSettings renamedServices. */ - public renamedServices: { [k: string]: string }; - - /** DotnetSettings renamedResources. */ - public renamedResources: { [k: string]: string }; - - /** DotnetSettings ignoredResources. */ - public ignoredResources: string[]; - - /** DotnetSettings forcedNamespaceAliases. */ - public forcedNamespaceAliases: string[]; - - /** DotnetSettings handwrittenSignatures. */ - public handwrittenSignatures: string[]; - - /** - * Creates a new DotnetSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns DotnetSettings instance - */ - public static create(properties?: google.api.IDotnetSettings): google.api.DotnetSettings; - - /** - * 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 - */ - public static encode(message: google.api.IDotnetSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * 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 static encodeDelimited(message: google.api.IDotnetSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * 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 static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.DotnetSettings; - - /** - * 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 static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.DotnetSettings; - - /** - * Verifies a DotnetSettings 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. - * @param object Plain object - * @returns DotnetSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.DotnetSettings; - - /** - * 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 static toObject(message: google.api.DotnetSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DotnetSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DotnetSettings - * @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 { - - /** RubySettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a RubySettings. */ - class RubySettings implements IRubySettings { - - /** - * Constructs a new RubySettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IRubySettings); - - /** RubySettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** - * Creates a new RubySettings instance using the specified properties. - * @param [properties] Properties to set - * @returns RubySettings instance - */ - public static create(properties?: google.api.IRubySettings): google.api.RubySettings; - - /** - * 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 - */ - public static encode(message: google.api.IRubySettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * 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 - */ - public static encodeDelimited(message: google.api.IRubySettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * 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 - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.RubySettings; - - /** - * 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 - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.RubySettings; - - /** - * 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 a RubySettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RubySettings - */ - public static fromObject(object: { [k: string]: any }): google.api.RubySettings; - - /** - * 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.api.RubySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RubySettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * 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 GoSettings. */ - interface IGoSettings { - - /** GoSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** 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); - - /** - * Creates a new GoSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns GoSettings instance - */ - public static create(properties?: google.api.IGoSettings): google.api.GoSettings; - - /** - * 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 encode(message: google.api.IGoSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * 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 encodeDelimited(message: google.api.IGoSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * 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 static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.GoSettings; - - /** - * 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 decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.GoSettings; - - /** - * Verifies a GoSettings 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. - * @param object Plain object - * @returns GoSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.GoSettings; - - /** - * 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.api.GoSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GoSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * 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 MethodSettings. */ - interface IMethodSettings { - - /** MethodSettings selector */ - selector?: (string|null); - - /** MethodSettings longRunning */ - longRunning?: (google.api.MethodSettings.ILongRunning|null); - - /** MethodSettings autoPopulatedFields */ - autoPopulatedFields?: (string[]|null); - } - - /** Represents a MethodSettings. */ - class MethodSettings implements IMethodSettings { - - /** - * Constructs a new MethodSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IMethodSettings); - - /** MethodSettings selector. */ - public selector: string; - - /** MethodSettings longRunning. */ - public longRunning?: (google.api.MethodSettings.ILongRunning|null); - - /** MethodSettings autoPopulatedFields. */ - public autoPopulatedFields: string[]; - - /** - * Creates a new MethodSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns MethodSettings instance - */ - public static create(properties?: google.api.IMethodSettings): google.api.MethodSettings; - - /** - * 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 encode(message: google.api.IMethodSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * 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 static encodeDelimited(message: google.api.IMethodSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * 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 decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.MethodSettings; - - /** - * 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 - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.MethodSettings; - - /** - * 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 MethodSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MethodSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.MethodSettings; - - /** - * 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.api.MethodSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MethodSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * 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; - } - - 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 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; - } - } - - /** 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 - } - - /** 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 - } - - /** 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|keyof typeof google.api.ResourceDescriptor.History|null); - - /** ResourceDescriptor plural */ - plural?: (string|null); - - /** ResourceDescriptor singular */ - singular?: (string|null); - - /** ResourceDescriptor style */ - style?: (google.api.ResourceDescriptor.Style[]|null); - } - - /** Represents a ResourceDescriptor. */ - class ResourceDescriptor implements IResourceDescriptor { - - /** - * Constructs a new ResourceDescriptor. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IResourceDescriptor); - - /** ResourceDescriptor type. */ - public type: string; - - /** ResourceDescriptor pattern. */ - public pattern: string[]; - - /** ResourceDescriptor nameField. */ - public nameField: string; - - /** ResourceDescriptor history. */ - public history: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History); - - /** ResourceDescriptor plural. */ - public plural: string; - - /** ResourceDescriptor singular. */ - public singular: string; - - /** ResourceDescriptor style. */ - public style: google.api.ResourceDescriptor.Style[]; - - /** - * Creates a new ResourceDescriptor instance using the specified properties. - * @param [properties] Properties to set - * @returns ResourceDescriptor instance - */ - public static create(properties?: google.api.IResourceDescriptor): google.api.ResourceDescriptor; - - /** - * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. - * @param message ResourceDescriptor message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. - * @param message ResourceDescriptor message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ResourceDescriptor message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ResourceDescriptor - * @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.ResourceDescriptor; - - /** - * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ResourceDescriptor - * @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.ResourceDescriptor; - - /** - * Verifies a ResourceDescriptor 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. - * @param object Plain object - * @returns ResourceDescriptor - */ - public static fromObject(object: { [k: string]: any }): google.api.ResourceDescriptor; - - /** - * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. - * @param message ResourceDescriptor - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.ResourceDescriptor, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ResourceDescriptor to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ResourceDescriptor - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ResourceDescriptor { - - /** History enum. */ - enum History { - HISTORY_UNSPECIFIED = 0, - ORIGINALLY_SINGLE_PATTERN = 1, - FUTURE_MULTI_PATTERN = 2 - } - - /** Style enum. */ - enum Style { - STYLE_UNSPECIFIED = 0, - DECLARATIVE_FRIENDLY = 1 - } - } - - /** Properties of a ResourceReference. */ - interface IResourceReference { - - /** ResourceReference type */ - type?: (string|null); - - /** ResourceReference childType */ - childType?: (string|null); - } - - /** Represents a ResourceReference. */ - class ResourceReference implements IResourceReference { - - /** - * Constructs a new ResourceReference. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IResourceReference); - - /** ResourceReference type. */ - public type: string; - - /** ResourceReference childType. */ - public childType: string; - - /** - * Creates a new ResourceReference instance using the specified properties. - * @param [properties] Properties to set - * @returns ResourceReference instance - */ - public static create(properties?: google.api.IResourceReference): google.api.ResourceReference; - - /** - * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. - * @param message ResourceReference message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. - * @param message ResourceReference message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ResourceReference message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ResourceReference - * @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.ResourceReference; - - /** - * Decodes a ResourceReference message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ResourceReference - * @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.ResourceReference; - - /** - * Verifies a ResourceReference 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 ResourceReference message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ResourceReference - */ - public static fromObject(object: { [k: string]: any }): google.api.ResourceReference; - - /** - * 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 - */ - public static toObject(message: google.api.ResourceReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ResourceReference to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ResourceReference - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Namespace protobuf. */ - namespace protobuf { - - /** Properties of a FileDescriptorSet. */ - interface IFileDescriptorSet { - - /** FileDescriptorSet file */ - file?: (google.protobuf.IFileDescriptorProto[]|null); - } - - /** Represents a FileDescriptorSet. */ - class FileDescriptorSet implements IFileDescriptorSet { - - /** - * Constructs a new FileDescriptorSet. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFileDescriptorSet); - - /** 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 - * @returns FileDescriptorSet - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorSet; - - /** - * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. - * @param message FileDescriptorSet - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FileDescriptorSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FileDescriptorSet to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FileDescriptorSet - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - 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 { - - /** FileDescriptorProto name */ - name?: (string|null); - - /** FileDescriptorProto package */ - "package"?: (string|null); - - /** FileDescriptorProto dependency */ - dependency?: (string[]|null); - - /** FileDescriptorProto publicDependency */ - publicDependency?: (number[]|null); - - /** FileDescriptorProto weakDependency */ - weakDependency?: (number[]|null); - - /** FileDescriptorProto messageType */ - messageType?: (google.protobuf.IDescriptorProto[]|null); - - /** FileDescriptorProto enumType */ - enumType?: (google.protobuf.IEnumDescriptorProto[]|null); - - /** FileDescriptorProto service */ - service?: (google.protobuf.IServiceDescriptorProto[]|null); - - /** FileDescriptorProto extension */ - extension?: (google.protobuf.IFieldDescriptorProto[]|null); - - /** FileDescriptorProto options */ - options?: (google.protobuf.IFileOptions|null); - - /** FileDescriptorProto sourceCodeInfo */ - sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); - - /** FileDescriptorProto syntax */ - syntax?: (string|null); - - /** FileDescriptorProto edition */ - edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - } - - /** Represents a FileDescriptorProto. */ - class FileDescriptorProto implements IFileDescriptorProto { - - /** - * Constructs a new FileDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFileDescriptorProto); - - /** FileDescriptorProto name. */ - public name: string; - - /** FileDescriptorProto package. */ - public package: string; - - /** FileDescriptorProto dependency. */ - public dependency: string[]; - - /** FileDescriptorProto publicDependency. */ - public publicDependency: number[]; - - /** FileDescriptorProto weakDependency. */ - public weakDependency: number[]; - - /** FileDescriptorProto messageType. */ - public messageType: google.protobuf.IDescriptorProto[]; - - /** FileDescriptorProto enumType. */ - public enumType: google.protobuf.IEnumDescriptorProto[]; - - /** FileDescriptorProto service. */ - public service: google.protobuf.IServiceDescriptorProto[]; - - /** FileDescriptorProto extension. */ - public extension: google.protobuf.IFieldDescriptorProto[]; - - /** FileDescriptorProto options. */ - public options?: (google.protobuf.IFileOptions|null); - - /** FileDescriptorProto sourceCodeInfo. */ - public sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); - - /** FileDescriptorProto syntax. */ - public syntax: string; - - /** FileDescriptorProto edition. */ - public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - - /** - * Creates a new FileDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns FileDescriptorProto instance - */ - public static create(properties?: google.protobuf.IFileDescriptorProto): google.protobuf.FileDescriptorProto; - - /** - * 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 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. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FileDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DescriptorProto. */ - interface IDescriptorProto { - - /** DescriptorProto name */ - name?: (string|null); - - /** DescriptorProto field */ - field?: (google.protobuf.IFieldDescriptorProto[]|null); - - /** DescriptorProto extension */ - extension?: (google.protobuf.IFieldDescriptorProto[]|null); - - /** DescriptorProto nestedType */ - nestedType?: (google.protobuf.IDescriptorProto[]|null); - - /** DescriptorProto enumType */ - enumType?: (google.protobuf.IEnumDescriptorProto[]|null); - - /** DescriptorProto extensionRange */ - extensionRange?: (google.protobuf.DescriptorProto.IExtensionRange[]|null); - - /** DescriptorProto oneofDecl */ - oneofDecl?: (google.protobuf.IOneofDescriptorProto[]|null); - - /** DescriptorProto options */ - options?: (google.protobuf.IMessageOptions|null); - - /** DescriptorProto reservedRange */ - reservedRange?: (google.protobuf.DescriptorProto.IReservedRange[]|null); - - /** DescriptorProto reservedName */ - reservedName?: (string[]|null); - } - - /** Represents a DescriptorProto. */ - class DescriptorProto implements IDescriptorProto { - - /** - * Constructs a new DescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IDescriptorProto); - - /** DescriptorProto name. */ - public name: string; - - /** DescriptorProto field. */ - public field: google.protobuf.IFieldDescriptorProto[]; - - /** DescriptorProto extension. */ - public extension: google.protobuf.IFieldDescriptorProto[]; - - /** DescriptorProto nestedType. */ - public nestedType: google.protobuf.IDescriptorProto[]; - - /** DescriptorProto enumType. */ - public enumType: google.protobuf.IEnumDescriptorProto[]; - - /** DescriptorProto extensionRange. */ - public extensionRange: google.protobuf.DescriptorProto.IExtensionRange[]; - - /** DescriptorProto oneofDecl. */ - public oneofDecl: google.protobuf.IOneofDescriptorProto[]; - - /** DescriptorProto options. */ - public options?: (google.protobuf.IMessageOptions|null); - - /** DescriptorProto reservedRange. */ - public reservedRange: google.protobuf.DescriptorProto.IReservedRange[]; - - /** 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 - * @returns DescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto; - - /** - * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. - * @param message DescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.DescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace DescriptorProto { - - /** Properties of an ExtensionRange. */ - interface IExtensionRange { - - /** ExtensionRange start */ - start?: (number|null); - - /** ExtensionRange end */ - end?: (number|null); - - /** ExtensionRange options */ - options?: (google.protobuf.IExtensionRangeOptions|null); - } - - /** Represents an ExtensionRange. */ - class ExtensionRange implements IExtensionRange { - - /** - * Constructs a new ExtensionRange. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.DescriptorProto.IExtensionRange); - - /** ExtensionRange start. */ - public start: number; - - /** 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 - * @returns ExtensionRange - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ExtensionRange; - - /** - * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. - * @param message ExtensionRange - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.DescriptorProto.ExtensionRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExtensionRange to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ExtensionRange - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ReservedRange. */ - interface IReservedRange { - - /** ReservedRange start */ - start?: (number|null); - - /** ReservedRange end */ - end?: (number|null); - } - - /** Represents a ReservedRange. */ - class ReservedRange implements IReservedRange { - - /** - * Constructs a new ReservedRange. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.DescriptorProto.IReservedRange); - - /** ReservedRange start. */ - public start: number; - - /** 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 - * @returns ReservedRange - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ReservedRange; - - /** - * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. - * @param message ReservedRange - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.DescriptorProto.ReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ReservedRange to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ReservedRange - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** 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 { - - /** FieldDescriptorProto name */ - name?: (string|null); - - /** FieldDescriptorProto number */ - number?: (number|null); - - /** FieldDescriptorProto label */ - label?: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label|null); - - /** FieldDescriptorProto type */ - type?: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type|null); - - /** FieldDescriptorProto typeName */ - typeName?: (string|null); - - /** FieldDescriptorProto extendee */ - extendee?: (string|null); - - /** FieldDescriptorProto defaultValue */ - defaultValue?: (string|null); - - /** FieldDescriptorProto oneofIndex */ - oneofIndex?: (number|null); - - /** FieldDescriptorProto jsonName */ - jsonName?: (string|null); - - /** FieldDescriptorProto options */ - options?: (google.protobuf.IFieldOptions|null); - - /** FieldDescriptorProto proto3Optional */ - proto3Optional?: (boolean|null); - } - - /** Represents a FieldDescriptorProto. */ - class FieldDescriptorProto implements IFieldDescriptorProto { - - /** - * Constructs a new FieldDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFieldDescriptorProto); - - /** FieldDescriptorProto name. */ - public name: string; - - /** FieldDescriptorProto number. */ - public number: number; - - /** FieldDescriptorProto label. */ - public label: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label); - - /** FieldDescriptorProto type. */ - public type: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type); - - /** FieldDescriptorProto typeName. */ - public typeName: string; - - /** FieldDescriptorProto extendee. */ - public extendee: string; - - /** FieldDescriptorProto defaultValue. */ - public defaultValue: string; - - /** FieldDescriptorProto oneofIndex. */ - public oneofIndex: number; - - /** FieldDescriptorProto jsonName. */ - public jsonName: string; - - /** 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 - * @returns FieldDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FieldDescriptorProto; - - /** - * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. - * @param message FieldDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FieldDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FieldDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FieldDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FieldDescriptorProto { - - /** Type enum. */ - 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. */ - enum Label { - LABEL_OPTIONAL = 1, - LABEL_REPEATED = 3, - LABEL_REQUIRED = 2 - } - } - - /** Properties of an OneofDescriptorProto. */ - interface IOneofDescriptorProto { - - /** OneofDescriptorProto name */ - name?: (string|null); - - /** OneofDescriptorProto options */ - options?: (google.protobuf.IOneofOptions|null); - } - - /** Represents an OneofDescriptorProto. */ - class OneofDescriptorProto implements IOneofDescriptorProto { - - /** - * Constructs a new OneofDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IOneofDescriptorProto); - - /** OneofDescriptorProto name. */ - public name: string; - - /** OneofDescriptorProto options. */ - public options?: (google.protobuf.IOneofOptions|null); - - /** - * Creates a new OneofDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns OneofDescriptorProto instance - */ - public static create(properties?: google.protobuf.IOneofDescriptorProto): google.protobuf.OneofDescriptorProto; - - /** - * 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 encode(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * 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 static encodeDelimited(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * 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 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 { - - /** EnumDescriptorProto name */ - name?: (string|null); - - /** EnumDescriptorProto value */ - value?: (google.protobuf.IEnumValueDescriptorProto[]|null); - - /** EnumDescriptorProto options */ - options?: (google.protobuf.IEnumOptions|null); - - /** EnumDescriptorProto reservedRange */ - reservedRange?: (google.protobuf.EnumDescriptorProto.IEnumReservedRange[]|null); - - /** EnumDescriptorProto reservedName */ - reservedName?: (string[]|null); - } - - /** Represents an EnumDescriptorProto. */ - class EnumDescriptorProto implements IEnumDescriptorProto { - - /** - * Constructs a new EnumDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumDescriptorProto); - - /** EnumDescriptorProto name. */ - public name: string; - - /** EnumDescriptorProto value. */ - public value: google.protobuf.IEnumValueDescriptorProto[]; - - /** 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 - * @returns EnumDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto; - - /** - * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. - * @param message EnumDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnumDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - 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 { - - /** EnumValueDescriptorProto name */ - name?: (string|null); - - /** EnumValueDescriptorProto number */ - number?: (number|null); - - /** EnumValueDescriptorProto options */ - options?: (google.protobuf.IEnumValueOptions|null); - } - - /** Represents an EnumValueDescriptorProto. */ - class EnumValueDescriptorProto implements IEnumValueDescriptorProto { - - /** - * Constructs a new EnumValueDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumValueDescriptorProto); - - /** EnumValueDescriptorProto name. */ - public name: string; - - /** EnumValueDescriptorProto number. */ - public number: number; - - /** 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 - * @returns EnumValueDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueDescriptorProto; - - /** - * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. - * @param message EnumValueDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumValueDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumValueDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnumValueDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ServiceDescriptorProto. */ - interface IServiceDescriptorProto { - - /** ServiceDescriptorProto name */ - name?: (string|null); - - /** ServiceDescriptorProto method */ - method?: (google.protobuf.IMethodDescriptorProto[]|null); - - /** ServiceDescriptorProto options */ - options?: (google.protobuf.IServiceOptions|null); - } - - /** Represents a ServiceDescriptorProto. */ - class ServiceDescriptorProto implements IServiceDescriptorProto { - - /** - * Constructs a new ServiceDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IServiceDescriptorProto); - - /** ServiceDescriptorProto name. */ - public name: string; - - /** ServiceDescriptorProto method. */ - public method: google.protobuf.IMethodDescriptorProto[]; - - /** 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 - * @returns ServiceDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceDescriptorProto; - - /** - * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. - * @param message ServiceDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.ServiceDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ServiceDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ServiceDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a MethodDescriptorProto. */ - interface IMethodDescriptorProto { - - /** MethodDescriptorProto name */ - name?: (string|null); - - /** MethodDescriptorProto inputType */ - inputType?: (string|null); - - /** MethodDescriptorProto outputType */ - outputType?: (string|null); - - /** MethodDescriptorProto options */ - options?: (google.protobuf.IMethodOptions|null); - - /** MethodDescriptorProto clientStreaming */ - clientStreaming?: (boolean|null); - - /** MethodDescriptorProto serverStreaming */ - serverStreaming?: (boolean|null); - } - - /** Represents a MethodDescriptorProto. */ - class MethodDescriptorProto implements IMethodDescriptorProto { - - /** - * Constructs a new MethodDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IMethodDescriptorProto); - - /** MethodDescriptorProto name. */ - public name: string; - - /** MethodDescriptorProto inputType. */ - public inputType: string; - - /** MethodDescriptorProto outputType. */ - public outputType: string; - - /** MethodDescriptorProto options. */ - public options?: (google.protobuf.IMethodOptions|null); - - /** MethodDescriptorProto clientStreaming. */ - public clientStreaming: boolean; - - /** 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 - * @returns MethodDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.MethodDescriptorProto; - - /** - * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. - * @param message MethodDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.MethodDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MethodDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MethodDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a FileOptions. */ - interface IFileOptions { - - /** FileOptions javaPackage */ - javaPackage?: (string|null); - - /** FileOptions javaOuterClassname */ - javaOuterClassname?: (string|null); - - /** FileOptions javaMultipleFiles */ - javaMultipleFiles?: (boolean|null); - - /** FileOptions javaGenerateEqualsAndHash */ - javaGenerateEqualsAndHash?: (boolean|null); - - /** FileOptions javaStringCheckUtf8 */ - javaStringCheckUtf8?: (boolean|null); - - /** FileOptions optimizeFor */ - optimizeFor?: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode|null); - - /** FileOptions goPackage */ - goPackage?: (string|null); - - /** FileOptions ccGenericServices */ - ccGenericServices?: (boolean|null); - - /** FileOptions javaGenericServices */ - javaGenericServices?: (boolean|null); - - /** FileOptions pyGenericServices */ - pyGenericServices?: (boolean|null); - - /** FileOptions deprecated */ - deprecated?: (boolean|null); - - /** FileOptions ccEnableArenas */ - ccEnableArenas?: (boolean|null); - - /** FileOptions objcClassPrefix */ - objcClassPrefix?: (string|null); - - /** 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. */ - class FileOptions implements IFileOptions { - - /** - * Constructs a new FileOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFileOptions); - - /** FileOptions javaPackage. */ - public javaPackage: string; - - /** FileOptions javaOuterClassname. */ - public javaOuterClassname: string; - - /** FileOptions javaMultipleFiles. */ - public javaMultipleFiles: boolean; - - /** FileOptions javaGenerateEqualsAndHash. */ - public javaGenerateEqualsAndHash: boolean; - - /** FileOptions javaStringCheckUtf8. */ - public javaStringCheckUtf8: boolean; - - /** FileOptions optimizeFor. */ - public optimizeFor: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode); - - /** FileOptions goPackage. */ - public goPackage: string; - - /** FileOptions ccGenericServices. */ - public ccGenericServices: boolean; - - /** FileOptions javaGenericServices. */ - public javaGenericServices: boolean; - - /** FileOptions pyGenericServices. */ - public pyGenericServices: boolean; - - /** FileOptions deprecated. */ - public deprecated: boolean; - - /** FileOptions ccEnableArenas. */ - public ccEnableArenas: boolean; - - /** FileOptions objcClassPrefix. */ - public objcClassPrefix: string; - - /** 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 - * @returns FileOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FileOptions; - - /** - * Creates a plain object from a FileOptions message. Also converts values to other types if specified. - * @param message FileOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FileOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FileOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FileOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FileOptions { - - /** OptimizeMode enum. */ - enum OptimizeMode { - SPEED = 1, - CODE_SIZE = 2, - LITE_RUNTIME = 3 - } - } - - /** Properties of a MessageOptions. */ - interface IMessageOptions { - - /** MessageOptions messageSetWireFormat */ - messageSetWireFormat?: (boolean|null); - - /** MessageOptions noStandardDescriptorAccessor */ - noStandardDescriptorAccessor?: (boolean|null); - - /** MessageOptions deprecated */ - deprecated?: (boolean|null); - - /** 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. */ - class MessageOptions implements IMessageOptions { - - /** - * Constructs a new MessageOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IMessageOptions); - - /** MessageOptions messageSetWireFormat. */ - public messageSetWireFormat: boolean; - - /** MessageOptions noStandardDescriptorAccessor. */ - public noStandardDescriptorAccessor: boolean; - - /** MessageOptions deprecated. */ - public deprecated: boolean; - - /** 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 - * @returns MessageOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.MessageOptions; - - /** - * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. - * @param message MessageOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.MessageOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MessageOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MessageOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a FieldOptions. */ - interface IFieldOptions { - - /** FieldOptions ctype */ - ctype?: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType|null); - - /** FieldOptions packed */ - packed?: (boolean|null); - - /** FieldOptions jstype */ - 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. */ - class FieldOptions implements IFieldOptions { - - /** - * Constructs a new FieldOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFieldOptions); - - /** 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|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 debugRedact. */ - public debugRedact: boolean; - - /** 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 - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions; - - /** - * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. - * @param message FieldOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FieldOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FieldOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FieldOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FieldOptions { - - /** CType enum. */ - enum CType { - STRING = 0, - CORD = 1, - STRING_PIECE = 2 - } - - /** JSType enum. */ - 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); - } - - /** Represents an OneofOptions. */ - class OneofOptions implements IOneofOptions { - - /** - * Constructs a new OneofOptions. - * @param [properties] Properties to set - */ - 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 - * @returns OneofOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.OneofOptions; - - /** - * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. - * @param message OneofOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.OneofOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OneofOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for OneofOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an EnumOptions. */ - interface IEnumOptions { - - /** EnumOptions allowAlias */ - allowAlias?: (boolean|null); - - /** EnumOptions deprecated */ - deprecated?: (boolean|null); - - /** EnumOptions deprecatedLegacyJsonFieldConflicts */ - deprecatedLegacyJsonFieldConflicts?: (boolean|null); - - /** EnumOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** EnumOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - } - - /** Represents an EnumOptions. */ - class EnumOptions implements IEnumOptions { - - /** - * Constructs a new EnumOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumOptions); - - /** EnumOptions allowAlias. */ - public allowAlias: boolean; - - /** 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 - * @returns EnumOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumOptions; - - /** - * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. - * @param message EnumOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnumOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an EnumValueOptions. */ - interface IEnumValueOptions { - - /** EnumValueOptions deprecated */ - deprecated?: (boolean|null); - - /** EnumValueOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** EnumValueOptions debugRedact */ - debugRedact?: (boolean|null); - - /** EnumValueOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - } - - /** Represents an EnumValueOptions. */ - class EnumValueOptions implements IEnumValueOptions { - - /** - * Constructs a new EnumValueOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumValueOptions); - - /** 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 - * @returns EnumValueOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueOptions; - - /** - * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. - * @param message EnumValueOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumValueOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumValueOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnumValueOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ServiceOptions. */ - interface IServiceOptions { - - /** ServiceOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** ServiceOptions deprecated */ - deprecated?: (boolean|null); - - /** ServiceOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** ServiceOptions .google.api.defaultHost */ - ".google.api.defaultHost"?: (string|null); - - /** ServiceOptions .google.api.oauthScopes */ - ".google.api.oauthScopes"?: (string|null); - - /** ServiceOptions .google.api.apiVersion */ - ".google.api.apiVersion"?: (string|null); - } - - /** Represents a ServiceOptions. */ - class ServiceOptions implements IServiceOptions { - - /** - * Constructs a new ServiceOptions. - * @param [properties] Properties to set - */ - 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 - * @returns ServiceOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceOptions; - - /** - * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. - * @param message ServiceOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.ServiceOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ServiceOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ServiceOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a MethodOptions. */ - interface IMethodOptions { - - /** 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); - - /** MethodOptions .google.api.http */ - ".google.api.http"?: (google.api.IHttpRule|null); - - /** MethodOptions .google.api.methodSignature */ - ".google.api.methodSignature"?: (string[]|null); - } - - /** Represents a MethodOptions. */ - class MethodOptions implements IMethodOptions { - - /** - * Constructs a new MethodOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IMethodOptions); - - /** 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 - * @returns MethodOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.MethodOptions; - - /** - * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. - * @param message MethodOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.MethodOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MethodOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MethodOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - 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 { - - /** UninterpretedOption name */ - name?: (google.protobuf.UninterpretedOption.INamePart[]|null); - - /** UninterpretedOption identifierValue */ - identifierValue?: (string|null); - - /** UninterpretedOption positiveIntValue */ - positiveIntValue?: (number|Long|string|null); - - /** UninterpretedOption negativeIntValue */ - negativeIntValue?: (number|Long|string|null); - - /** UninterpretedOption doubleValue */ - doubleValue?: (number|null); - - /** UninterpretedOption stringValue */ - stringValue?: (Uint8Array|string|null); - - /** UninterpretedOption aggregateValue */ - aggregateValue?: (string|null); - } - - /** Represents an UninterpretedOption. */ - class UninterpretedOption implements IUninterpretedOption { - - /** - * Constructs a new UninterpretedOption. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IUninterpretedOption); - - /** UninterpretedOption name. */ - public name: google.protobuf.UninterpretedOption.INamePart[]; - - /** UninterpretedOption identifierValue. */ - public identifierValue: string; - - /** UninterpretedOption positiveIntValue. */ - public positiveIntValue: (number|Long|string); - - /** UninterpretedOption negativeIntValue. */ - public negativeIntValue: (number|Long|string); - - /** UninterpretedOption doubleValue. */ - public doubleValue: number; - - /** UninterpretedOption stringValue. */ - 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 - * @returns UninterpretedOption - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption; - - /** - * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. - * @param message UninterpretedOption - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.UninterpretedOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UninterpretedOption to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UninterpretedOption - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace UninterpretedOption { - - /** Properties of a NamePart. */ - interface INamePart { - - /** NamePart namePart */ - namePart: string; - - /** NamePart isExtension */ - isExtension: boolean; - } - - /** Represents a NamePart. */ - class NamePart implements INamePart { - - /** - * Constructs a new NamePart. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.UninterpretedOption.INamePart); - - /** NamePart namePart. */ - public namePart: string; - - /** 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 - * @returns NamePart - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption.NamePart; - - /** - * Creates a plain object from a NamePart message. Also converts values to other types if specified. - * @param message NamePart - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.UninterpretedOption.NamePart, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this NamePart to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for NamePart - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** 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 */ - location?: (google.protobuf.SourceCodeInfo.ILocation[]|null); - } - - /** Represents a SourceCodeInfo. */ - class SourceCodeInfo implements ISourceCodeInfo { - - /** - * Constructs a new SourceCodeInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.ISourceCodeInfo); - - /** 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 - * @returns SourceCodeInfo - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo; - - /** - * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. - * @param message SourceCodeInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.SourceCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SourceCodeInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SourceCodeInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace SourceCodeInfo { - - /** Properties of a Location. */ - interface ILocation { - - /** Location path */ - path?: (number[]|null); - - /** Location span */ - span?: (number[]|null); - - /** Location leadingComments */ - leadingComments?: (string|null); - - /** Location trailingComments */ - trailingComments?: (string|null); - - /** Location leadingDetachedComments */ - leadingDetachedComments?: (string[]|null); - } - - /** Represents a Location. */ - class Location implements ILocation { - - /** - * Constructs a new Location. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.SourceCodeInfo.ILocation); - - /** Location path. */ - public path: number[]; - - /** Location span. */ - public span: number[]; - - /** Location leadingComments. */ - public leadingComments: string; - - /** Location trailingComments. */ - public trailingComments: string; - - /** 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 - * @returns Location - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo.Location; - - /** - * Creates a plain object from a Location message. Also converts values to other types if specified. - * @param message Location - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.SourceCodeInfo.Location, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Location to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Location - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a GeneratedCodeInfo. */ - interface IGeneratedCodeInfo { - - /** GeneratedCodeInfo annotation */ - annotation?: (google.protobuf.GeneratedCodeInfo.IAnnotation[]|null); - } - - /** Represents a GeneratedCodeInfo. */ - class GeneratedCodeInfo implements IGeneratedCodeInfo { - - /** - * Constructs a new GeneratedCodeInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IGeneratedCodeInfo); - - /** 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 - * @returns GeneratedCodeInfo - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo; - - /** - * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. - * @param message GeneratedCodeInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.GeneratedCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GeneratedCodeInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GeneratedCodeInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace GeneratedCodeInfo { - - /** Properties of an Annotation. */ - interface IAnnotation { - - /** Annotation path */ - path?: (number[]|null); - - /** Annotation sourceFile */ - sourceFile?: (string|null); - - /** Annotation begin */ - begin?: (number|null); - - /** Annotation end */ - end?: (number|null); - - /** Annotation semantic */ - semantic?: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null); - } - - /** Represents an Annotation. */ - class Annotation implements IAnnotation { - - /** - * Constructs a new Annotation. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation); - - /** Annotation path. */ - public path: number[]; - - /** Annotation sourceFile. */ - public sourceFile: string; - - /** Annotation begin. */ - public begin: number; - - /** Annotation end. */ - public end: number; - - /** Annotation semantic. */ - public semantic: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic); - - /** - * Creates a new Annotation instance using the specified properties. - * @param [properties] Properties to set - * @returns Annotation instance - */ - public static create(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation): google.protobuf.GeneratedCodeInfo.Annotation; - - /** - * 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 encode(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * 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 }; - - /** - * Gets the default type url for Annotation - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Annotation { - - /** Semantic enum. */ - enum Semantic { - NONE = 0, - SET = 1, - ALIAS = 2 - } - } - } - - /** Properties of a Duration. */ - interface IDuration { - - /** Duration seconds */ - seconds?: (number|Long|string|null); - - /** Duration nanos */ - nanos?: (number|null); - } - - /** Represents a Duration. */ - class Duration implements IDuration { - - /** - * Constructs a new Duration. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IDuration); - - /** Duration seconds. */ - public seconds: (number|Long|string); - - /** Duration nanos. */ - public nanos: number; - - /** - * 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 Duration - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Duration; - - /** - * 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.Duration, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Duration to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Duration - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an Empty. */ - interface IEmpty { - } - - /** Represents an Empty. */ - class Empty implements IEmpty { - - /** - * Constructs a new Empty. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEmpty); - - /** - * Creates a new Empty instance using the specified properties. - * @param [properties] Properties to set - * @returns Empty instance - */ - public static create(properties?: google.protobuf.IEmpty): google.protobuf.Empty; - - /** - * 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 encode(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * 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 static encodeDelimited(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * 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 decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Empty; - - /** - * 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 - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Empty; - - /** - * 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 an Empty message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Empty - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Empty; - - /** - * 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.Empty, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Empty to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * 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 FieldMask. */ - interface IFieldMask { - - /** FieldMask paths */ - paths?: (string[]|null); - } - - /** Represents a FieldMask. */ - class FieldMask implements IFieldMask { - - /** - * Constructs a new FieldMask. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFieldMask); - - /** FieldMask paths. */ - public paths: string[]; - - /** - * Creates a new FieldMask instance using the specified properties. - * @param [properties] Properties to set - * @returns FieldMask instance - */ - public static create(properties?: google.protobuf.IFieldMask): google.protobuf.FieldMask; - - /** - * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. - * @param message FieldMask message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. - * @param message FieldMask message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FieldMask message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FieldMask - * @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.FieldMask; - - /** - * Decodes a FieldMask message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FieldMask - * @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.FieldMask; - - /** - * Verifies a FieldMask 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. - * @param object Plain object - * @returns FieldMask - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FieldMask; - - /** - * Creates a plain object from a FieldMask message. Also converts values to other types if specified. - * @param message FieldMask - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FieldMask, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FieldMask to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FieldMask - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - 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; - } - } -} diff --git a/owl-bot-staging/v1/protos/protos.js b/owl-bot-staging/v1/protos/protos.js deleted file mode 100644 index b439f7b68..000000000 --- a/owl-bot-staging/v1/protos/protos.js +++ /dev/null @@ -1,38732 +0,0 @@ -// 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 */ - - /* AMD */ if (typeof define === 'function' && define.amd) - define(["protobufjs/minimal"], factory); - - /* CommonJS */ else if (typeof require === 'function' && typeof module === 'object' && module && module.exports) - module.exports = factory(require("google-gax/build/src/protobuf").protobufMinimal); - -})(this, function($protobuf) { - "use strict"; - - // Common aliases - var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; - - // Exported root namespace - var $root = $protobuf.roots._google_cloud_pubsub_protos || ($protobuf.roots._google_cloud_pubsub_protos = {}); - - $root.google = (function() { - - /** - * Namespace google. - * @exports google - * @namespace - */ - var google = {}; - - google.pubsub = (function() { - - /** - * Namespace pubsub. - * @memberof google - * @namespace - */ - var pubsub = {}; - - pubsub.v1 = (function() { - - /** - * Namespace v1. - * @memberof google.pubsub - * @namespace - */ - var v1 = {}; - - v1.Publisher = (function() { - - /** - * Constructs a new Publisher service. - * @memberof google.pubsub.v1 - * @classdesc Represents a Publisher - * @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 Publisher(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (Publisher.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Publisher; - - /** - * Creates new Publisher service using the specified rpc implementation. - * @function create - * @memberof google.pubsub.v1.Publisher - * @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 {Publisher} RPC service. Useful where requests and/or responses are streamed. - */ - Publisher.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.pubsub.v1.Publisher|createTopic}. - * @memberof google.pubsub.v1.Publisher - * @typedef CreateTopicCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.pubsub.v1.Topic} [response] Topic - */ - - /** - * Calls CreateTopic. - * @function createTopic - * @memberof google.pubsub.v1.Publisher - * @instance - * @param {google.pubsub.v1.ITopic} request Topic message or plain object - * @param {google.pubsub.v1.Publisher.CreateTopicCallback} callback Node-style callback called with the error, if any, and Topic - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Publisher.prototype.createTopic = function createTopic(request, callback) { - return this.rpcCall(createTopic, $root.google.pubsub.v1.Topic, $root.google.pubsub.v1.Topic, request, callback); - }, "name", { value: "CreateTopic" }); - - /** - * Calls CreateTopic. - * @function createTopic - * @memberof google.pubsub.v1.Publisher - * @instance - * @param {google.pubsub.v1.ITopic} request Topic message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.pubsub.v1.Publisher|updateTopic}. - * @memberof google.pubsub.v1.Publisher - * @typedef UpdateTopicCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.pubsub.v1.Topic} [response] Topic - */ - - /** - * Calls UpdateTopic. - * @function updateTopic - * @memberof google.pubsub.v1.Publisher - * @instance - * @param {google.pubsub.v1.IUpdateTopicRequest} request UpdateTopicRequest message or plain object - * @param {google.pubsub.v1.Publisher.UpdateTopicCallback} callback Node-style callback called with the error, if any, and Topic - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Publisher.prototype.updateTopic = function updateTopic(request, callback) { - return this.rpcCall(updateTopic, $root.google.pubsub.v1.UpdateTopicRequest, $root.google.pubsub.v1.Topic, request, callback); - }, "name", { value: "UpdateTopic" }); - - /** - * Calls UpdateTopic. - * @function updateTopic - * @memberof google.pubsub.v1.Publisher - * @instance - * @param {google.pubsub.v1.IUpdateTopicRequest} request UpdateTopicRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.pubsub.v1.Publisher|publish}. - * @memberof google.pubsub.v1.Publisher - * @typedef PublishCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.pubsub.v1.PublishResponse} [response] PublishResponse - */ - - /** - * Calls Publish. - * @function publish - * @memberof google.pubsub.v1.Publisher - * @instance - * @param {google.pubsub.v1.IPublishRequest} request PublishRequest message or plain object - * @param {google.pubsub.v1.Publisher.PublishCallback} callback Node-style callback called with the error, if any, and PublishResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Publisher.prototype.publish = function publish(request, callback) { - return this.rpcCall(publish, $root.google.pubsub.v1.PublishRequest, $root.google.pubsub.v1.PublishResponse, request, callback); - }, "name", { value: "Publish" }); - - /** - * Calls Publish. - * @function publish - * @memberof google.pubsub.v1.Publisher - * @instance - * @param {google.pubsub.v1.IPublishRequest} request PublishRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.pubsub.v1.Publisher|getTopic}. - * @memberof google.pubsub.v1.Publisher - * @typedef GetTopicCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.pubsub.v1.Topic} [response] Topic - */ - - /** - * Calls GetTopic. - * @function getTopic - * @memberof google.pubsub.v1.Publisher - * @instance - * @param {google.pubsub.v1.IGetTopicRequest} request GetTopicRequest message or plain object - * @param {google.pubsub.v1.Publisher.GetTopicCallback} callback Node-style callback called with the error, if any, and Topic - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Publisher.prototype.getTopic = function getTopic(request, callback) { - return this.rpcCall(getTopic, $root.google.pubsub.v1.GetTopicRequest, $root.google.pubsub.v1.Topic, request, callback); - }, "name", { value: "GetTopic" }); - - /** - * Calls GetTopic. - * @function getTopic - * @memberof google.pubsub.v1.Publisher - * @instance - * @param {google.pubsub.v1.IGetTopicRequest} request GetTopicRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.pubsub.v1.Publisher|listTopics}. - * @memberof google.pubsub.v1.Publisher - * @typedef ListTopicsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.pubsub.v1.ListTopicsResponse} [response] ListTopicsResponse - */ - - /** - * Calls ListTopics. - * @function listTopics - * @memberof google.pubsub.v1.Publisher - * @instance - * @param {google.pubsub.v1.IListTopicsRequest} request ListTopicsRequest message or plain object - * @param {google.pubsub.v1.Publisher.ListTopicsCallback} callback Node-style callback called with the error, if any, and ListTopicsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Publisher.prototype.listTopics = function listTopics(request, callback) { - return this.rpcCall(listTopics, $root.google.pubsub.v1.ListTopicsRequest, $root.google.pubsub.v1.ListTopicsResponse, request, callback); - }, "name", { value: "ListTopics" }); - - /** - * Calls ListTopics. - * @function listTopics - * @memberof google.pubsub.v1.Publisher - * @instance - * @param {google.pubsub.v1.IListTopicsRequest} request ListTopicsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.pubsub.v1.Publisher|listTopicSubscriptions}. - * @memberof google.pubsub.v1.Publisher - * @typedef ListTopicSubscriptionsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.pubsub.v1.ListTopicSubscriptionsResponse} [response] ListTopicSubscriptionsResponse - */ - - /** - * Calls ListTopicSubscriptions. - * @function listTopicSubscriptions - * @memberof google.pubsub.v1.Publisher - * @instance - * @param {google.pubsub.v1.IListTopicSubscriptionsRequest} request ListTopicSubscriptionsRequest message or plain object - * @param {google.pubsub.v1.Publisher.ListTopicSubscriptionsCallback} callback Node-style callback called with the error, if any, and ListTopicSubscriptionsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Publisher.prototype.listTopicSubscriptions = function listTopicSubscriptions(request, callback) { - return this.rpcCall(listTopicSubscriptions, $root.google.pubsub.v1.ListTopicSubscriptionsRequest, $root.google.pubsub.v1.ListTopicSubscriptionsResponse, request, callback); - }, "name", { value: "ListTopicSubscriptions" }); - - /** - * Calls ListTopicSubscriptions. - * @function listTopicSubscriptions - * @memberof google.pubsub.v1.Publisher - * @instance - * @param {google.pubsub.v1.IListTopicSubscriptionsRequest} request ListTopicSubscriptionsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.pubsub.v1.Publisher|listTopicSnapshots}. - * @memberof google.pubsub.v1.Publisher - * @typedef ListTopicSnapshotsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.pubsub.v1.ListTopicSnapshotsResponse} [response] ListTopicSnapshotsResponse - */ - - /** - * Calls ListTopicSnapshots. - * @function listTopicSnapshots - * @memberof google.pubsub.v1.Publisher - * @instance - * @param {google.pubsub.v1.IListTopicSnapshotsRequest} request ListTopicSnapshotsRequest message or plain object - * @param {google.pubsub.v1.Publisher.ListTopicSnapshotsCallback} callback Node-style callback called with the error, if any, and ListTopicSnapshotsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Publisher.prototype.listTopicSnapshots = function listTopicSnapshots(request, callback) { - return this.rpcCall(listTopicSnapshots, $root.google.pubsub.v1.ListTopicSnapshotsRequest, $root.google.pubsub.v1.ListTopicSnapshotsResponse, request, callback); - }, "name", { value: "ListTopicSnapshots" }); - - /** - * Calls ListTopicSnapshots. - * @function listTopicSnapshots - * @memberof google.pubsub.v1.Publisher - * @instance - * @param {google.pubsub.v1.IListTopicSnapshotsRequest} request ListTopicSnapshotsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.pubsub.v1.Publisher|deleteTopic}. - * @memberof google.pubsub.v1.Publisher - * @typedef DeleteTopicCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls DeleteTopic. - * @function deleteTopic - * @memberof google.pubsub.v1.Publisher - * @instance - * @param {google.pubsub.v1.IDeleteTopicRequest} request DeleteTopicRequest message or plain object - * @param {google.pubsub.v1.Publisher.DeleteTopicCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Publisher.prototype.deleteTopic = function deleteTopic(request, callback) { - return this.rpcCall(deleteTopic, $root.google.pubsub.v1.DeleteTopicRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteTopic" }); - - /** - * Calls DeleteTopic. - * @function deleteTopic - * @memberof google.pubsub.v1.Publisher - * @instance - * @param {google.pubsub.v1.IDeleteTopicRequest} request DeleteTopicRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.pubsub.v1.Publisher|detachSubscription}. - * @memberof google.pubsub.v1.Publisher - * @typedef DetachSubscriptionCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.pubsub.v1.DetachSubscriptionResponse} [response] DetachSubscriptionResponse - */ - - /** - * Calls DetachSubscription. - * @function detachSubscription - * @memberof google.pubsub.v1.Publisher - * @instance - * @param {google.pubsub.v1.IDetachSubscriptionRequest} request DetachSubscriptionRequest message or plain object - * @param {google.pubsub.v1.Publisher.DetachSubscriptionCallback} callback Node-style callback called with the error, if any, and DetachSubscriptionResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Publisher.prototype.detachSubscription = function detachSubscription(request, callback) { - return this.rpcCall(detachSubscription, $root.google.pubsub.v1.DetachSubscriptionRequest, $root.google.pubsub.v1.DetachSubscriptionResponse, request, callback); - }, "name", { value: "DetachSubscription" }); - - /** - * Calls DetachSubscription. - * @function detachSubscription - * @memberof google.pubsub.v1.Publisher - * @instance - * @param {google.pubsub.v1.IDetachSubscriptionRequest} request DetachSubscriptionRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return Publisher; - })(); - - v1.MessageStoragePolicy = (function() { - - /** - * Properties of a MessageStoragePolicy. - * @memberof google.pubsub.v1 - * @interface IMessageStoragePolicy - * @property {Array.|null} [allowedPersistenceRegions] MessageStoragePolicy allowedPersistenceRegions - * @property {boolean|null} [enforceInTransit] MessageStoragePolicy enforceInTransit - */ - - /** - * Constructs a new MessageStoragePolicy. - * @memberof google.pubsub.v1 - * @classdesc Represents a MessageStoragePolicy. - * @implements IMessageStoragePolicy - * @constructor - * @param {google.pubsub.v1.IMessageStoragePolicy=} [properties] Properties to set - */ - function MessageStoragePolicy(properties) { - this.allowedPersistenceRegions = []; - 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]]; - } - - /** - * MessageStoragePolicy allowedPersistenceRegions. - * @member {Array.} allowedPersistenceRegions - * @memberof google.pubsub.v1.MessageStoragePolicy - * @instance - */ - MessageStoragePolicy.prototype.allowedPersistenceRegions = $util.emptyArray; - - /** - * MessageStoragePolicy enforceInTransit. - * @member {boolean} enforceInTransit - * @memberof google.pubsub.v1.MessageStoragePolicy - * @instance - */ - MessageStoragePolicy.prototype.enforceInTransit = false; - - /** - * Creates a new MessageStoragePolicy instance using the specified properties. - * @function create - * @memberof google.pubsub.v1.MessageStoragePolicy - * @static - * @param {google.pubsub.v1.IMessageStoragePolicy=} [properties] Properties to set - * @returns {google.pubsub.v1.MessageStoragePolicy} MessageStoragePolicy instance - */ - MessageStoragePolicy.create = function create(properties) { - return new MessageStoragePolicy(properties); - }; - - /** - * Encodes the specified MessageStoragePolicy message. Does not implicitly {@link google.pubsub.v1.MessageStoragePolicy.verify|verify} messages. - * @function encode - * @memberof google.pubsub.v1.MessageStoragePolicy - * @static - * @param {google.pubsub.v1.IMessageStoragePolicy} message MessageStoragePolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MessageStoragePolicy.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.allowedPersistenceRegions != null && message.allowedPersistenceRegions.length) - for (var i = 0; i < message.allowedPersistenceRegions.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.allowedPersistenceRegions[i]); - if (message.enforceInTransit != null && Object.hasOwnProperty.call(message, "enforceInTransit")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.enforceInTransit); - return writer; - }; - - /** - * Encodes the specified MessageStoragePolicy message, length delimited. Does not implicitly {@link google.pubsub.v1.MessageStoragePolicy.verify|verify} messages. - * @function encodeDelimited - * @memberof google.pubsub.v1.MessageStoragePolicy - * @static - * @param {google.pubsub.v1.IMessageStoragePolicy} message MessageStoragePolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MessageStoragePolicy.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MessageStoragePolicy message from the specified reader or buffer. - * @function decode - * @memberof google.pubsub.v1.MessageStoragePolicy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.pubsub.v1.MessageStoragePolicy} MessageStoragePolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MessageStoragePolicy.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.pubsub.v1.MessageStoragePolicy(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.allowedPersistenceRegions && message.allowedPersistenceRegions.length)) - message.allowedPersistenceRegions = []; - message.allowedPersistenceRegions.push(reader.string()); - break; - } - case 2: { - message.enforceInTransit = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MessageStoragePolicy message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.pubsub.v1.MessageStoragePolicy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.pubsub.v1.MessageStoragePolicy} MessageStoragePolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MessageStoragePolicy.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MessageStoragePolicy message. - * @function verify - * @memberof google.pubsub.v1.MessageStoragePolicy - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MessageStoragePolicy.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.allowedPersistenceRegions != null && message.hasOwnProperty("allowedPersistenceRegions")) { - if (!Array.isArray(message.allowedPersistenceRegions)) - return "allowedPersistenceRegions: array expected"; - for (var i = 0; i < message.allowedPersistenceRegions.length; ++i) - if (!$util.isString(message.allowedPersistenceRegions[i])) - return "allowedPersistenceRegions: string[] expected"; - } - if (message.enforceInTransit != null && message.hasOwnProperty("enforceInTransit")) - if (typeof message.enforceInTransit !== "boolean") - return "enforceInTransit: boolean expected"; - return null; - }; - - /** - * Creates a MessageStoragePolicy message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.pubsub.v1.MessageStoragePolicy - * @static - * @param {Object.} object Plain object - * @returns {google.pubsub.v1.MessageStoragePolicy} MessageStoragePolicy - */ - MessageStoragePolicy.fromObject = function fromObject(object) { - if (object instanceof $root.google.pubsub.v1.MessageStoragePolicy) - return object; - var message = new $root.google.pubsub.v1.MessageStoragePolicy(); - if (object.allowedPersistenceRegions) { - if (!Array.isArray(object.allowedPersistenceRegions)) - throw TypeError(".google.pubsub.v1.MessageStoragePolicy.allowedPersistenceRegions: array expected"); - message.allowedPersistenceRegions = []; - for (var i = 0; i < object.allowedPersistenceRegions.length; ++i) - message.allowedPersistenceRegions[i] = String(object.allowedPersistenceRegions[i]); - } - if (object.enforceInTransit != null) - message.enforceInTransit = Boolean(object.enforceInTransit); - return message; - }; - - /** - * Creates a plain object from a MessageStoragePolicy message. Also converts values to other types if specified. - * @function toObject - * @memberof google.pubsub.v1.MessageStoragePolicy - * @static - * @param {google.pubsub.v1.MessageStoragePolicy} message MessageStoragePolicy - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MessageStoragePolicy.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.allowedPersistenceRegions = []; - if (options.defaults) - object.enforceInTransit = false; - if (message.allowedPersistenceRegions && message.allowedPersistenceRegions.length) { - object.allowedPersistenceRegions = []; - for (var j = 0; j < message.allowedPersistenceRegions.length; ++j) - object.allowedPersistenceRegions[j] = message.allowedPersistenceRegions[j]; - } - if (message.enforceInTransit != null && message.hasOwnProperty("enforceInTransit")) - object.enforceInTransit = message.enforceInTransit; - return object; - }; - - /** - * Converts this MessageStoragePolicy to JSON. - * @function toJSON - * @memberof google.pubsub.v1.MessageStoragePolicy - * @instance - * @returns {Object.} JSON object - */ - MessageStoragePolicy.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MessageStoragePolicy - * @function getTypeUrl - * @memberof google.pubsub.v1.MessageStoragePolicy - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MessageStoragePolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.pubsub.v1.MessageStoragePolicy"; - }; - - return MessageStoragePolicy; - })(); - - v1.SchemaSettings = (function() { - - /** - * Properties of a SchemaSettings. - * @memberof google.pubsub.v1 - * @interface ISchemaSettings - * @property {string|null} [schema] SchemaSettings schema - * @property {google.pubsub.v1.Encoding|null} [encoding] SchemaSettings encoding - * @property {string|null} [firstRevisionId] SchemaSettings firstRevisionId - * @property {string|null} [lastRevisionId] SchemaSettings lastRevisionId - */ - - /** - * Constructs a new SchemaSettings. - * @memberof google.pubsub.v1 - * @classdesc Represents a SchemaSettings. - * @implements ISchemaSettings - * @constructor - * @param {google.pubsub.v1.ISchemaSettings=} [properties] Properties to set - */ - function SchemaSettings(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]]; - } - - /** - * SchemaSettings schema. - * @member {string} schema - * @memberof google.pubsub.v1.SchemaSettings - * @instance - */ - SchemaSettings.prototype.schema = ""; - - /** - * SchemaSettings encoding. - * @member {google.pubsub.v1.Encoding} encoding - * @memberof google.pubsub.v1.SchemaSettings - * @instance - */ - SchemaSettings.prototype.encoding = 0; - - /** - * SchemaSettings firstRevisionId. - * @member {string} firstRevisionId - * @memberof google.pubsub.v1.SchemaSettings - * @instance - */ - SchemaSettings.prototype.firstRevisionId = ""; - - /** - * SchemaSettings lastRevisionId. - * @member {string} lastRevisionId - * @memberof google.pubsub.v1.SchemaSettings - * @instance - */ - SchemaSettings.prototype.lastRevisionId = ""; - - /** - * Creates a new SchemaSettings instance using the specified properties. - * @function create - * @memberof google.pubsub.v1.SchemaSettings - * @static - * @param {google.pubsub.v1.ISchemaSettings=} [properties] Properties to set - * @returns {google.pubsub.v1.SchemaSettings} SchemaSettings instance - */ - SchemaSettings.create = function create(properties) { - return new SchemaSettings(properties); - }; - - /** - * Encodes the specified SchemaSettings message. Does not implicitly {@link google.pubsub.v1.SchemaSettings.verify|verify} messages. - * @function encode - * @memberof google.pubsub.v1.SchemaSettings - * @static - * @param {google.pubsub.v1.ISchemaSettings} message SchemaSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SchemaSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.schema != null && Object.hasOwnProperty.call(message, "schema")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.schema); - if (message.encoding != null && Object.hasOwnProperty.call(message, "encoding")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.encoding); - if (message.firstRevisionId != null && Object.hasOwnProperty.call(message, "firstRevisionId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.firstRevisionId); - if (message.lastRevisionId != null && Object.hasOwnProperty.call(message, "lastRevisionId")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.lastRevisionId); - return writer; - }; - - /** - * Encodes the specified SchemaSettings message, length delimited. Does not implicitly {@link google.pubsub.v1.SchemaSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.pubsub.v1.SchemaSettings - * @static - * @param {google.pubsub.v1.ISchemaSettings} message SchemaSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SchemaSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SchemaSettings message from the specified reader or buffer. - * @function decode - * @memberof google.pubsub.v1.SchemaSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.pubsub.v1.SchemaSettings} SchemaSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SchemaSettings.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.pubsub.v1.SchemaSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.schema = reader.string(); - break; - } - case 2: { - message.encoding = reader.int32(); - break; - } - case 3: { - message.firstRevisionId = reader.string(); - break; - } - case 4: { - message.lastRevisionId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SchemaSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.pubsub.v1.SchemaSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.pubsub.v1.SchemaSettings} SchemaSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SchemaSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SchemaSettings message. - * @function verify - * @memberof google.pubsub.v1.SchemaSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SchemaSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.schema != null && message.hasOwnProperty("schema")) - if (!$util.isString(message.schema)) - return "schema: string expected"; - if (message.encoding != null && message.hasOwnProperty("encoding")) - switch (message.encoding) { - default: - return "encoding: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.firstRevisionId != null && message.hasOwnProperty("firstRevisionId")) - if (!$util.isString(message.firstRevisionId)) - return "firstRevisionId: string expected"; - if (message.lastRevisionId != null && message.hasOwnProperty("lastRevisionId")) - if (!$util.isString(message.lastRevisionId)) - return "lastRevisionId: string expected"; - return null; - }; - - /** - * Creates a SchemaSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.pubsub.v1.SchemaSettings - * @static - * @param {Object.} object Plain object - * @returns {google.pubsub.v1.SchemaSettings} SchemaSettings - */ - SchemaSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.pubsub.v1.SchemaSettings) - return object; - var message = new $root.google.pubsub.v1.SchemaSettings(); - if (object.schema != null) - message.schema = String(object.schema); - switch (object.encoding) { - default: - if (typeof object.encoding === "number") { - message.encoding = object.encoding; - break; - } - break; - case "ENCODING_UNSPECIFIED": - case 0: - message.encoding = 0; - break; - case "JSON": - case 1: - message.encoding = 1; - break; - case "BINARY": - case 2: - message.encoding = 2; - break; - } - if (object.firstRevisionId != null) - message.firstRevisionId = String(object.firstRevisionId); - if (object.lastRevisionId != null) - message.lastRevisionId = String(object.lastRevisionId); - return message; - }; - - /** - * Creates a plain object from a SchemaSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.pubsub.v1.SchemaSettings - * @static - * @param {google.pubsub.v1.SchemaSettings} message SchemaSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SchemaSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.schema = ""; - object.encoding = options.enums === String ? "ENCODING_UNSPECIFIED" : 0; - object.firstRevisionId = ""; - object.lastRevisionId = ""; - } - if (message.schema != null && message.hasOwnProperty("schema")) - object.schema = message.schema; - if (message.encoding != null && message.hasOwnProperty("encoding")) - object.encoding = options.enums === String ? $root.google.pubsub.v1.Encoding[message.encoding] === undefined ? message.encoding : $root.google.pubsub.v1.Encoding[message.encoding] : message.encoding; - if (message.firstRevisionId != null && message.hasOwnProperty("firstRevisionId")) - object.firstRevisionId = message.firstRevisionId; - if (message.lastRevisionId != null && message.hasOwnProperty("lastRevisionId")) - object.lastRevisionId = message.lastRevisionId; - return object; - }; - - /** - * Converts this SchemaSettings to JSON. - * @function toJSON - * @memberof google.pubsub.v1.SchemaSettings - * @instance - * @returns {Object.} JSON object - */ - SchemaSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SchemaSettings - * @function getTypeUrl - * @memberof google.pubsub.v1.SchemaSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SchemaSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.pubsub.v1.SchemaSettings"; - }; - - return SchemaSettings; - })(); - - v1.IngestionDataSourceSettings = (function() { - - /** - * Properties of an IngestionDataSourceSettings. - * @memberof google.pubsub.v1 - * @interface IIngestionDataSourceSettings - * @property {google.pubsub.v1.IngestionDataSourceSettings.IAwsKinesis|null} [awsKinesis] IngestionDataSourceSettings awsKinesis - */ - - /** - * Constructs a new IngestionDataSourceSettings. - * @memberof google.pubsub.v1 - * @classdesc Represents an IngestionDataSourceSettings. - * @implements IIngestionDataSourceSettings - * @constructor - * @param {google.pubsub.v1.IIngestionDataSourceSettings=} [properties] Properties to set - */ - function IngestionDataSourceSettings(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]]; - } - - /** - * IngestionDataSourceSettings awsKinesis. - * @member {google.pubsub.v1.IngestionDataSourceSettings.IAwsKinesis|null|undefined} awsKinesis - * @memberof google.pubsub.v1.IngestionDataSourceSettings - * @instance - */ - IngestionDataSourceSettings.prototype.awsKinesis = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * IngestionDataSourceSettings source. - * @member {"awsKinesis"|undefined} source - * @memberof google.pubsub.v1.IngestionDataSourceSettings - * @instance - */ - Object.defineProperty(IngestionDataSourceSettings.prototype, "source", { - get: $util.oneOfGetter($oneOfFields = ["awsKinesis"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new IngestionDataSourceSettings instance using the specified properties. - * @function create - * @memberof google.pubsub.v1.IngestionDataSourceSettings - * @static - * @param {google.pubsub.v1.IIngestionDataSourceSettings=} [properties] Properties to set - * @returns {google.pubsub.v1.IngestionDataSourceSettings} IngestionDataSourceSettings instance - */ - IngestionDataSourceSettings.create = function create(properties) { - return new IngestionDataSourceSettings(properties); - }; - - /** - * Encodes the specified IngestionDataSourceSettings message. Does not implicitly {@link google.pubsub.v1.IngestionDataSourceSettings.verify|verify} messages. - * @function encode - * @memberof google.pubsub.v1.IngestionDataSourceSettings - * @static - * @param {google.pubsub.v1.IIngestionDataSourceSettings} message IngestionDataSourceSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IngestionDataSourceSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.awsKinesis != null && Object.hasOwnProperty.call(message, "awsKinesis")) - $root.google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis.encode(message.awsKinesis, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified IngestionDataSourceSettings message, length delimited. Does not implicitly {@link google.pubsub.v1.IngestionDataSourceSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.pubsub.v1.IngestionDataSourceSettings - * @static - * @param {google.pubsub.v1.IIngestionDataSourceSettings} message IngestionDataSourceSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IngestionDataSourceSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an IngestionDataSourceSettings message from the specified reader or buffer. - * @function decode - * @memberof google.pubsub.v1.IngestionDataSourceSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.pubsub.v1.IngestionDataSourceSettings} IngestionDataSourceSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IngestionDataSourceSettings.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.pubsub.v1.IngestionDataSourceSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.awsKinesis = $root.google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an IngestionDataSourceSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.pubsub.v1.IngestionDataSourceSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.pubsub.v1.IngestionDataSourceSettings} IngestionDataSourceSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IngestionDataSourceSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an IngestionDataSourceSettings message. - * @function verify - * @memberof google.pubsub.v1.IngestionDataSourceSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - IngestionDataSourceSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.awsKinesis != null && message.hasOwnProperty("awsKinesis")) { - properties.source = 1; - { - var error = $root.google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis.verify(message.awsKinesis); - if (error) - return "awsKinesis." + error; - } - } - return null; - }; - - /** - * Creates an IngestionDataSourceSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.pubsub.v1.IngestionDataSourceSettings - * @static - * @param {Object.} object Plain object - * @returns {google.pubsub.v1.IngestionDataSourceSettings} IngestionDataSourceSettings - */ - IngestionDataSourceSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.pubsub.v1.IngestionDataSourceSettings) - return object; - var message = new $root.google.pubsub.v1.IngestionDataSourceSettings(); - if (object.awsKinesis != null) { - if (typeof object.awsKinesis !== "object") - throw TypeError(".google.pubsub.v1.IngestionDataSourceSettings.awsKinesis: object expected"); - message.awsKinesis = $root.google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis.fromObject(object.awsKinesis); - } - return message; - }; - - /** - * Creates a plain object from an IngestionDataSourceSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.pubsub.v1.IngestionDataSourceSettings - * @static - * @param {google.pubsub.v1.IngestionDataSourceSettings} message IngestionDataSourceSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - IngestionDataSourceSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.awsKinesis != null && message.hasOwnProperty("awsKinesis")) { - object.awsKinesis = $root.google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis.toObject(message.awsKinesis, options); - if (options.oneofs) - object.source = "awsKinesis"; - } - return object; - }; - - /** - * Converts this IngestionDataSourceSettings to JSON. - * @function toJSON - * @memberof google.pubsub.v1.IngestionDataSourceSettings - * @instance - * @returns {Object.} JSON object - */ - IngestionDataSourceSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for IngestionDataSourceSettings - * @function getTypeUrl - * @memberof google.pubsub.v1.IngestionDataSourceSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - IngestionDataSourceSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.pubsub.v1.IngestionDataSourceSettings"; - }; - - IngestionDataSourceSettings.AwsKinesis = (function() { - - /** - * Properties of an AwsKinesis. - * @memberof google.pubsub.v1.IngestionDataSourceSettings - * @interface IAwsKinesis - * @property {google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis.State|null} [state] AwsKinesis state - * @property {string|null} [streamArn] AwsKinesis streamArn - * @property {string|null} [consumerArn] AwsKinesis consumerArn - * @property {string|null} [awsRoleArn] AwsKinesis awsRoleArn - * @property {string|null} [gcpServiceAccount] AwsKinesis gcpServiceAccount - */ - - /** - * Constructs a new AwsKinesis. - * @memberof google.pubsub.v1.IngestionDataSourceSettings - * @classdesc Represents an AwsKinesis. - * @implements IAwsKinesis - * @constructor - * @param {google.pubsub.v1.IngestionDataSourceSettings.IAwsKinesis=} [properties] Properties to set - */ - function AwsKinesis(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]]; - } - - /** - * AwsKinesis state. - * @member {google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis.State} state - * @memberof google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis - * @instance - */ - AwsKinesis.prototype.state = 0; - - /** - * AwsKinesis streamArn. - * @member {string} streamArn - * @memberof google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis - * @instance - */ - AwsKinesis.prototype.streamArn = ""; - - /** - * AwsKinesis consumerArn. - * @member {string} consumerArn - * @memberof google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis - * @instance - */ - AwsKinesis.prototype.consumerArn = ""; - - /** - * AwsKinesis awsRoleArn. - * @member {string} awsRoleArn - * @memberof google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis - * @instance - */ - AwsKinesis.prototype.awsRoleArn = ""; - - /** - * AwsKinesis gcpServiceAccount. - * @member {string} gcpServiceAccount - * @memberof google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis - * @instance - */ - AwsKinesis.prototype.gcpServiceAccount = ""; - - /** - * Creates a new AwsKinesis instance using the specified properties. - * @function create - * @memberof google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis - * @static - * @param {google.pubsub.v1.IngestionDataSourceSettings.IAwsKinesis=} [properties] Properties to set - * @returns {google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis} AwsKinesis instance - */ - AwsKinesis.create = function create(properties) { - return new AwsKinesis(properties); - }; - - /** - * Encodes the specified AwsKinesis message. Does not implicitly {@link google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis.verify|verify} messages. - * @function encode - * @memberof google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis - * @static - * @param {google.pubsub.v1.IngestionDataSourceSettings.IAwsKinesis} message AwsKinesis message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AwsKinesis.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); - if (message.streamArn != null && Object.hasOwnProperty.call(message, "streamArn")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.streamArn); - if (message.consumerArn != null && Object.hasOwnProperty.call(message, "consumerArn")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.consumerArn); - if (message.awsRoleArn != null && Object.hasOwnProperty.call(message, "awsRoleArn")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.awsRoleArn); - if (message.gcpServiceAccount != null && Object.hasOwnProperty.call(message, "gcpServiceAccount")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.gcpServiceAccount); - return writer; - }; - - /** - * Encodes the specified AwsKinesis message, length delimited. Does not implicitly {@link google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis.verify|verify} messages. - * @function encodeDelimited - * @memberof google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis - * @static - * @param {google.pubsub.v1.IngestionDataSourceSettings.IAwsKinesis} message AwsKinesis message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AwsKinesis.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AwsKinesis message from the specified reader or buffer. - * @function decode - * @memberof google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis} AwsKinesis - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AwsKinesis.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.pubsub.v1.IngestionDataSourceSettings.AwsKinesis(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.state = reader.int32(); - break; - } - case 2: { - message.streamArn = reader.string(); - break; - } - case 3: { - message.consumerArn = reader.string(); - break; - } - case 4: { - message.awsRoleArn = reader.string(); - break; - } - case 5: { - message.gcpServiceAccount = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AwsKinesis message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis} AwsKinesis - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AwsKinesis.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AwsKinesis message. - * @function verify - * @memberof google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AwsKinesis.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - break; - } - if (message.streamArn != null && message.hasOwnProperty("streamArn")) - if (!$util.isString(message.streamArn)) - return "streamArn: string expected"; - if (message.consumerArn != null && message.hasOwnProperty("consumerArn")) - if (!$util.isString(message.consumerArn)) - return "consumerArn: string expected"; - if (message.awsRoleArn != null && message.hasOwnProperty("awsRoleArn")) - if (!$util.isString(message.awsRoleArn)) - return "awsRoleArn: string expected"; - if (message.gcpServiceAccount != null && message.hasOwnProperty("gcpServiceAccount")) - if (!$util.isString(message.gcpServiceAccount)) - return "gcpServiceAccount: string expected"; - return null; - }; - - /** - * Creates an AwsKinesis message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis - * @static - * @param {Object.} object Plain object - * @returns {google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis} AwsKinesis - */ - AwsKinesis.fromObject = function fromObject(object) { - if (object instanceof $root.google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis) - return object; - var message = new $root.google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis(); - switch (object.state) { - default: - if (typeof object.state === "number") { - message.state = object.state; - break; - } - break; - case "STATE_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "ACTIVE": - case 1: - message.state = 1; - break; - case "KINESIS_PERMISSION_DENIED": - case 2: - message.state = 2; - break; - case "PUBLISH_PERMISSION_DENIED": - case 3: - message.state = 3; - break; - case "STREAM_NOT_FOUND": - case 4: - message.state = 4; - break; - case "CONSUMER_NOT_FOUND": - case 5: - message.state = 5; - break; - } - if (object.streamArn != null) - message.streamArn = String(object.streamArn); - if (object.consumerArn != null) - message.consumerArn = String(object.consumerArn); - if (object.awsRoleArn != null) - message.awsRoleArn = String(object.awsRoleArn); - if (object.gcpServiceAccount != null) - message.gcpServiceAccount = String(object.gcpServiceAccount); - return message; - }; - - /** - * Creates a plain object from an AwsKinesis message. Also converts values to other types if specified. - * @function toObject - * @memberof google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis - * @static - * @param {google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis} message AwsKinesis - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AwsKinesis.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.streamArn = ""; - object.consumerArn = ""; - object.awsRoleArn = ""; - object.gcpServiceAccount = ""; - } - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis.State[message.state] === undefined ? message.state : $root.google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis.State[message.state] : message.state; - if (message.streamArn != null && message.hasOwnProperty("streamArn")) - object.streamArn = message.streamArn; - if (message.consumerArn != null && message.hasOwnProperty("consumerArn")) - object.consumerArn = message.consumerArn; - if (message.awsRoleArn != null && message.hasOwnProperty("awsRoleArn")) - object.awsRoleArn = message.awsRoleArn; - if (message.gcpServiceAccount != null && message.hasOwnProperty("gcpServiceAccount")) - object.gcpServiceAccount = message.gcpServiceAccount; - return object; - }; - - /** - * Converts this AwsKinesis to JSON. - * @function toJSON - * @memberof google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis - * @instance - * @returns {Object.} JSON object - */ - AwsKinesis.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AwsKinesis - * @function getTypeUrl - * @memberof google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AwsKinesis.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis"; - }; - - /** - * State enum. - * @name google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} ACTIVE=1 ACTIVE value - * @property {number} KINESIS_PERMISSION_DENIED=2 KINESIS_PERMISSION_DENIED value - * @property {number} PUBLISH_PERMISSION_DENIED=3 PUBLISH_PERMISSION_DENIED value - * @property {number} STREAM_NOT_FOUND=4 STREAM_NOT_FOUND value - * @property {number} CONSUMER_NOT_FOUND=5 CONSUMER_NOT_FOUND value - */ - AwsKinesis.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "ACTIVE"] = 1; - values[valuesById[2] = "KINESIS_PERMISSION_DENIED"] = 2; - values[valuesById[3] = "PUBLISH_PERMISSION_DENIED"] = 3; - values[valuesById[4] = "STREAM_NOT_FOUND"] = 4; - values[valuesById[5] = "CONSUMER_NOT_FOUND"] = 5; - return values; - })(); - - return AwsKinesis; - })(); - - return IngestionDataSourceSettings; - })(); - - v1.Topic = (function() { - - /** - * Properties of a Topic. - * @memberof google.pubsub.v1 - * @interface ITopic - * @property {string|null} [name] Topic name - * @property {Object.|null} [labels] Topic labels - * @property {google.pubsub.v1.IMessageStoragePolicy|null} [messageStoragePolicy] Topic messageStoragePolicy - * @property {string|null} [kmsKeyName] Topic kmsKeyName - * @property {google.pubsub.v1.ISchemaSettings|null} [schemaSettings] Topic schemaSettings - * @property {boolean|null} [satisfiesPzs] Topic satisfiesPzs - * @property {google.protobuf.IDuration|null} [messageRetentionDuration] Topic messageRetentionDuration - * @property {google.pubsub.v1.Topic.State|null} [state] Topic state - * @property {google.pubsub.v1.IIngestionDataSourceSettings|null} [ingestionDataSourceSettings] Topic ingestionDataSourceSettings - */ - - /** - * Constructs a new Topic. - * @memberof google.pubsub.v1 - * @classdesc Represents a Topic. - * @implements ITopic - * @constructor - * @param {google.pubsub.v1.ITopic=} [properties] Properties to set - */ - function Topic(properties) { - this.labels = {}; - 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]]; - } - - /** - * Topic name. - * @member {string} name - * @memberof google.pubsub.v1.Topic - * @instance - */ - Topic.prototype.name = ""; - - /** - * Topic labels. - * @member {Object.} labels - * @memberof google.pubsub.v1.Topic - * @instance - */ - Topic.prototype.labels = $util.emptyObject; - - /** - * Topic messageStoragePolicy. - * @member {google.pubsub.v1.IMessageStoragePolicy|null|undefined} messageStoragePolicy - * @memberof google.pubsub.v1.Topic - * @instance - */ - Topic.prototype.messageStoragePolicy = null; - - /** - * Topic kmsKeyName. - * @member {string} kmsKeyName - * @memberof google.pubsub.v1.Topic - * @instance - */ - Topic.prototype.kmsKeyName = ""; - - /** - * Topic schemaSettings. - * @member {google.pubsub.v1.ISchemaSettings|null|undefined} schemaSettings - * @memberof google.pubsub.v1.Topic - * @instance - */ - Topic.prototype.schemaSettings = null; - - /** - * Topic satisfiesPzs. - * @member {boolean} satisfiesPzs - * @memberof google.pubsub.v1.Topic - * @instance - */ - Topic.prototype.satisfiesPzs = false; - - /** - * Topic messageRetentionDuration. - * @member {google.protobuf.IDuration|null|undefined} messageRetentionDuration - * @memberof google.pubsub.v1.Topic - * @instance - */ - Topic.prototype.messageRetentionDuration = null; - - /** - * Topic state. - * @member {google.pubsub.v1.Topic.State} state - * @memberof google.pubsub.v1.Topic - * @instance - */ - Topic.prototype.state = 0; - - /** - * Topic ingestionDataSourceSettings. - * @member {google.pubsub.v1.IIngestionDataSourceSettings|null|undefined} ingestionDataSourceSettings - * @memberof google.pubsub.v1.Topic - * @instance - */ - Topic.prototype.ingestionDataSourceSettings = null; - - /** - * Creates a new Topic instance using the specified properties. - * @function create - * @memberof google.pubsub.v1.Topic - * @static - * @param {google.pubsub.v1.ITopic=} [properties] Properties to set - * @returns {google.pubsub.v1.Topic} Topic instance - */ - Topic.create = function create(properties) { - return new Topic(properties); - }; - - /** - * Encodes the specified Topic message. Does not implicitly {@link google.pubsub.v1.Topic.verify|verify} messages. - * @function encode - * @memberof google.pubsub.v1.Topic - * @static - * @param {google.pubsub.v1.ITopic} message Topic message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Topic.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.labels != null && Object.hasOwnProperty.call(message, "labels")) - for (var keys = Object.keys(message.labels), 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.labels[keys[i]]).ldelim(); - if (message.messageStoragePolicy != null && Object.hasOwnProperty.call(message, "messageStoragePolicy")) - $root.google.pubsub.v1.MessageStoragePolicy.encode(message.messageStoragePolicy, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.kmsKeyName != null && Object.hasOwnProperty.call(message, "kmsKeyName")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.kmsKeyName); - if (message.schemaSettings != null && Object.hasOwnProperty.call(message, "schemaSettings")) - $root.google.pubsub.v1.SchemaSettings.encode(message.schemaSettings, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.satisfiesPzs != null && Object.hasOwnProperty.call(message, "satisfiesPzs")) - writer.uint32(/* id 7, wireType 0 =*/56).bool(message.satisfiesPzs); - if (message.messageRetentionDuration != null && Object.hasOwnProperty.call(message, "messageRetentionDuration")) - $root.google.protobuf.Duration.encode(message.messageRetentionDuration, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.state); - if (message.ingestionDataSourceSettings != null && Object.hasOwnProperty.call(message, "ingestionDataSourceSettings")) - $root.google.pubsub.v1.IngestionDataSourceSettings.encode(message.ingestionDataSourceSettings, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Topic message, length delimited. Does not implicitly {@link google.pubsub.v1.Topic.verify|verify} messages. - * @function encodeDelimited - * @memberof google.pubsub.v1.Topic - * @static - * @param {google.pubsub.v1.ITopic} message Topic message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Topic.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Topic message from the specified reader or buffer. - * @function decode - * @memberof google.pubsub.v1.Topic - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.pubsub.v1.Topic} Topic - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Topic.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.pubsub.v1.Topic(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - 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; - } - case 3: { - message.messageStoragePolicy = $root.google.pubsub.v1.MessageStoragePolicy.decode(reader, reader.uint32()); - break; - } - case 5: { - message.kmsKeyName = reader.string(); - break; - } - case 6: { - message.schemaSettings = $root.google.pubsub.v1.SchemaSettings.decode(reader, reader.uint32()); - break; - } - case 7: { - message.satisfiesPzs = reader.bool(); - break; - } - case 8: { - message.messageRetentionDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 9: { - message.state = reader.int32(); - break; - } - case 10: { - message.ingestionDataSourceSettings = $root.google.pubsub.v1.IngestionDataSourceSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Topic message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.pubsub.v1.Topic - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.pubsub.v1.Topic} Topic - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Topic.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Topic message. - * @function verify - * @memberof google.pubsub.v1.Topic - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Topic.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.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"; - } - if (message.messageStoragePolicy != null && message.hasOwnProperty("messageStoragePolicy")) { - var error = $root.google.pubsub.v1.MessageStoragePolicy.verify(message.messageStoragePolicy); - if (error) - return "messageStoragePolicy." + error; - } - if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) - if (!$util.isString(message.kmsKeyName)) - return "kmsKeyName: string expected"; - if (message.schemaSettings != null && message.hasOwnProperty("schemaSettings")) { - var error = $root.google.pubsub.v1.SchemaSettings.verify(message.schemaSettings); - if (error) - return "schemaSettings." + error; - } - if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) - if (typeof message.satisfiesPzs !== "boolean") - return "satisfiesPzs: boolean expected"; - if (message.messageRetentionDuration != null && message.hasOwnProperty("messageRetentionDuration")) { - var error = $root.google.protobuf.Duration.verify(message.messageRetentionDuration); - if (error) - return "messageRetentionDuration." + error; - } - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.ingestionDataSourceSettings != null && message.hasOwnProperty("ingestionDataSourceSettings")) { - var error = $root.google.pubsub.v1.IngestionDataSourceSettings.verify(message.ingestionDataSourceSettings); - if (error) - return "ingestionDataSourceSettings." + error; - } - return null; - }; - - /** - * Creates a Topic message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.pubsub.v1.Topic - * @static - * @param {Object.} object Plain object - * @returns {google.pubsub.v1.Topic} Topic - */ - Topic.fromObject = function fromObject(object) { - if (object instanceof $root.google.pubsub.v1.Topic) - return object; - var message = new $root.google.pubsub.v1.Topic(); - if (object.name != null) - message.name = String(object.name); - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.pubsub.v1.Topic.labels: object expected"); - message.labels = {}; - for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) - message.labels[keys[i]] = String(object.labels[keys[i]]); - } - if (object.messageStoragePolicy != null) { - if (typeof object.messageStoragePolicy !== "object") - throw TypeError(".google.pubsub.v1.Topic.messageStoragePolicy: object expected"); - message.messageStoragePolicy = $root.google.pubsub.v1.MessageStoragePolicy.fromObject(object.messageStoragePolicy); - } - if (object.kmsKeyName != null) - message.kmsKeyName = String(object.kmsKeyName); - if (object.schemaSettings != null) { - if (typeof object.schemaSettings !== "object") - throw TypeError(".google.pubsub.v1.Topic.schemaSettings: object expected"); - message.schemaSettings = $root.google.pubsub.v1.SchemaSettings.fromObject(object.schemaSettings); - } - if (object.satisfiesPzs != null) - message.satisfiesPzs = Boolean(object.satisfiesPzs); - if (object.messageRetentionDuration != null) { - if (typeof object.messageRetentionDuration !== "object") - throw TypeError(".google.pubsub.v1.Topic.messageRetentionDuration: object expected"); - message.messageRetentionDuration = $root.google.protobuf.Duration.fromObject(object.messageRetentionDuration); - } - switch (object.state) { - default: - if (typeof object.state === "number") { - message.state = object.state; - break; - } - break; - case "STATE_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "ACTIVE": - case 1: - message.state = 1; - break; - case "INGESTION_RESOURCE_ERROR": - case 2: - message.state = 2; - break; - } - if (object.ingestionDataSourceSettings != null) { - if (typeof object.ingestionDataSourceSettings !== "object") - throw TypeError(".google.pubsub.v1.Topic.ingestionDataSourceSettings: object expected"); - message.ingestionDataSourceSettings = $root.google.pubsub.v1.IngestionDataSourceSettings.fromObject(object.ingestionDataSourceSettings); - } - return message; - }; - - /** - * Creates a plain object from a Topic message. Also converts values to other types if specified. - * @function toObject - * @memberof google.pubsub.v1.Topic - * @static - * @param {google.pubsub.v1.Topic} message Topic - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Topic.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.labels = {}; - if (options.defaults) { - object.name = ""; - object.messageStoragePolicy = null; - object.kmsKeyName = ""; - object.schemaSettings = null; - object.satisfiesPzs = false; - object.messageRetentionDuration = null; - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.ingestionDataSourceSettings = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - var keys2; - if (message.labels && (keys2 = Object.keys(message.labels)).length) { - object.labels = {}; - for (var j = 0; j < keys2.length; ++j) - object.labels[keys2[j]] = message.labels[keys2[j]]; - } - if (message.messageStoragePolicy != null && message.hasOwnProperty("messageStoragePolicy")) - object.messageStoragePolicy = $root.google.pubsub.v1.MessageStoragePolicy.toObject(message.messageStoragePolicy, options); - if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) - object.kmsKeyName = message.kmsKeyName; - if (message.schemaSettings != null && message.hasOwnProperty("schemaSettings")) - object.schemaSettings = $root.google.pubsub.v1.SchemaSettings.toObject(message.schemaSettings, options); - if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) - object.satisfiesPzs = message.satisfiesPzs; - if (message.messageRetentionDuration != null && message.hasOwnProperty("messageRetentionDuration")) - object.messageRetentionDuration = $root.google.protobuf.Duration.toObject(message.messageRetentionDuration, options); - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.pubsub.v1.Topic.State[message.state] === undefined ? message.state : $root.google.pubsub.v1.Topic.State[message.state] : message.state; - if (message.ingestionDataSourceSettings != null && message.hasOwnProperty("ingestionDataSourceSettings")) - object.ingestionDataSourceSettings = $root.google.pubsub.v1.IngestionDataSourceSettings.toObject(message.ingestionDataSourceSettings, options); - return object; - }; - - /** - * Converts this Topic to JSON. - * @function toJSON - * @memberof google.pubsub.v1.Topic - * @instance - * @returns {Object.} JSON object - */ - Topic.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Topic - * @function getTypeUrl - * @memberof google.pubsub.v1.Topic - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Topic.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.pubsub.v1.Topic"; - }; - - /** - * State enum. - * @name google.pubsub.v1.Topic.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} ACTIVE=1 ACTIVE value - * @property {number} INGESTION_RESOURCE_ERROR=2 INGESTION_RESOURCE_ERROR value - */ - Topic.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "ACTIVE"] = 1; - values[valuesById[2] = "INGESTION_RESOURCE_ERROR"] = 2; - return values; - })(); - - return Topic; - })(); - - v1.PubsubMessage = (function() { - - /** - * Properties of a PubsubMessage. - * @memberof google.pubsub.v1 - * @interface IPubsubMessage - * @property {Uint8Array|null} [data] PubsubMessage data - * @property {Object.|null} [attributes] PubsubMessage attributes - * @property {string|null} [messageId] PubsubMessage messageId - * @property {google.protobuf.ITimestamp|null} [publishTime] PubsubMessage publishTime - * @property {string|null} [orderingKey] PubsubMessage orderingKey - */ - - /** - * Constructs a new PubsubMessage. - * @memberof google.pubsub.v1 - * @classdesc Represents a PubsubMessage. - * @implements IPubsubMessage - * @constructor - * @param {google.pubsub.v1.IPubsubMessage=} [properties] Properties to set - */ - function PubsubMessage(properties) { - this.attributes = {}; - 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]]; - } - - /** - * PubsubMessage data. - * @member {Uint8Array} data - * @memberof google.pubsub.v1.PubsubMessage - * @instance - */ - PubsubMessage.prototype.data = $util.newBuffer([]); - - /** - * PubsubMessage attributes. - * @member {Object.} attributes - * @memberof google.pubsub.v1.PubsubMessage - * @instance - */ - PubsubMessage.prototype.attributes = $util.emptyObject; - - /** - * PubsubMessage messageId. - * @member {string} messageId - * @memberof google.pubsub.v1.PubsubMessage - * @instance - */ - PubsubMessage.prototype.messageId = ""; - - /** - * PubsubMessage publishTime. - * @member {google.protobuf.ITimestamp|null|undefined} publishTime - * @memberof google.pubsub.v1.PubsubMessage - * @instance - */ - PubsubMessage.prototype.publishTime = null; - - /** - * PubsubMessage orderingKey. - * @member {string} orderingKey - * @memberof google.pubsub.v1.PubsubMessage - * @instance - */ - PubsubMessage.prototype.orderingKey = ""; - - /** - * Creates a new PubsubMessage instance using the specified properties. - * @function create - * @memberof google.pubsub.v1.PubsubMessage - * @static - * @param {google.pubsub.v1.IPubsubMessage=} [properties] Properties to set - * @returns {google.pubsub.v1.PubsubMessage} PubsubMessage instance - */ - PubsubMessage.create = function create(properties) { - return new PubsubMessage(properties); - }; - - /** - * Encodes the specified PubsubMessage message. Does not implicitly {@link google.pubsub.v1.PubsubMessage.verify|verify} messages. - * @function encode - * @memberof google.pubsub.v1.PubsubMessage - * @static - * @param {google.pubsub.v1.IPubsubMessage} message PubsubMessage message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PubsubMessage.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.data != null && Object.hasOwnProperty.call(message, "data")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.data); - if (message.attributes != null && Object.hasOwnProperty.call(message, "attributes")) - for (var keys = Object.keys(message.attributes), 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.attributes[keys[i]]).ldelim(); - if (message.messageId != null && Object.hasOwnProperty.call(message, "messageId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.messageId); - if (message.publishTime != null && Object.hasOwnProperty.call(message, "publishTime")) - $root.google.protobuf.Timestamp.encode(message.publishTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.orderingKey != null && Object.hasOwnProperty.call(message, "orderingKey")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderingKey); - return writer; - }; - - /** - * Encodes the specified PubsubMessage message, length delimited. Does not implicitly {@link google.pubsub.v1.PubsubMessage.verify|verify} messages. - * @function encodeDelimited - * @memberof google.pubsub.v1.PubsubMessage - * @static - * @param {google.pubsub.v1.IPubsubMessage} message PubsubMessage message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PubsubMessage.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PubsubMessage message from the specified reader or buffer. - * @function decode - * @memberof google.pubsub.v1.PubsubMessage - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.pubsub.v1.PubsubMessage} PubsubMessage - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PubsubMessage.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.pubsub.v1.PubsubMessage(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.data = reader.bytes(); - break; - } - case 2: { - if (message.attributes === $util.emptyObject) - message.attributes = {}; - 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.attributes[key] = value; - break; - } - case 3: { - message.messageId = reader.string(); - break; - } - case 4: { - message.publishTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 5: { - message.orderingKey = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PubsubMessage message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.pubsub.v1.PubsubMessage - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.pubsub.v1.PubsubMessage} PubsubMessage - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PubsubMessage.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PubsubMessage message. - * @function verify - * @memberof google.pubsub.v1.PubsubMessage - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PubsubMessage.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.data != null && message.hasOwnProperty("data")) - if (!(message.data && typeof message.data.length === "number" || $util.isString(message.data))) - return "data: buffer expected"; - if (message.attributes != null && message.hasOwnProperty("attributes")) { - if (!$util.isObject(message.attributes)) - return "attributes: object expected"; - var key = Object.keys(message.attributes); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.attributes[key[i]])) - return "attributes: string{k:string} expected"; - } - if (message.messageId != null && message.hasOwnProperty("messageId")) - if (!$util.isString(message.messageId)) - return "messageId: string expected"; - if (message.publishTime != null && message.hasOwnProperty("publishTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.publishTime); - if (error) - return "publishTime." + error; - } - if (message.orderingKey != null && message.hasOwnProperty("orderingKey")) - if (!$util.isString(message.orderingKey)) - return "orderingKey: string expected"; - return null; - }; - - /** - * Creates a PubsubMessage message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.pubsub.v1.PubsubMessage - * @static - * @param {Object.} object Plain object - * @returns {google.pubsub.v1.PubsubMessage} PubsubMessage - */ - PubsubMessage.fromObject = function fromObject(object) { - if (object instanceof $root.google.pubsub.v1.PubsubMessage) - return object; - var message = new $root.google.pubsub.v1.PubsubMessage(); - if (object.data != null) - if (typeof object.data === "string") - $util.base64.decode(object.data, message.data = $util.newBuffer($util.base64.length(object.data)), 0); - else if (object.data.length >= 0) - message.data = object.data; - if (object.attributes) { - if (typeof object.attributes !== "object") - throw TypeError(".google.pubsub.v1.PubsubMessage.attributes: object expected"); - message.attributes = {}; - for (var keys = Object.keys(object.attributes), i = 0; i < keys.length; ++i) - message.attributes[keys[i]] = String(object.attributes[keys[i]]); - } - if (object.messageId != null) - message.messageId = String(object.messageId); - if (object.publishTime != null) { - if (typeof object.publishTime !== "object") - throw TypeError(".google.pubsub.v1.PubsubMessage.publishTime: object expected"); - message.publishTime = $root.google.protobuf.Timestamp.fromObject(object.publishTime); - } - if (object.orderingKey != null) - message.orderingKey = String(object.orderingKey); - return message; - }; - - /** - * Creates a plain object from a PubsubMessage message. Also converts values to other types if specified. - * @function toObject - * @memberof google.pubsub.v1.PubsubMessage - * @static - * @param {google.pubsub.v1.PubsubMessage} message PubsubMessage - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PubsubMessage.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.attributes = {}; - if (options.defaults) { - if (options.bytes === String) - object.data = ""; - else { - object.data = []; - if (options.bytes !== Array) - object.data = $util.newBuffer(object.data); - } - object.messageId = ""; - object.publishTime = null; - object.orderingKey = ""; - } - if (message.data != null && message.hasOwnProperty("data")) - object.data = options.bytes === String ? $util.base64.encode(message.data, 0, message.data.length) : options.bytes === Array ? Array.prototype.slice.call(message.data) : message.data; - var keys2; - if (message.attributes && (keys2 = Object.keys(message.attributes)).length) { - object.attributes = {}; - for (var j = 0; j < keys2.length; ++j) - object.attributes[keys2[j]] = message.attributes[keys2[j]]; - } - if (message.messageId != null && message.hasOwnProperty("messageId")) - object.messageId = message.messageId; - if (message.publishTime != null && message.hasOwnProperty("publishTime")) - object.publishTime = $root.google.protobuf.Timestamp.toObject(message.publishTime, options); - if (message.orderingKey != null && message.hasOwnProperty("orderingKey")) - object.orderingKey = message.orderingKey; - return object; - }; - - /** - * Converts this PubsubMessage to JSON. - * @function toJSON - * @memberof google.pubsub.v1.PubsubMessage - * @instance - * @returns {Object.} JSON object - */ - PubsubMessage.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PubsubMessage - * @function getTypeUrl - * @memberof google.pubsub.v1.PubsubMessage - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PubsubMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.pubsub.v1.PubsubMessage"; - }; - - return PubsubMessage; - })(); - - v1.GetTopicRequest = (function() { - - /** - * Properties of a GetTopicRequest. - * @memberof google.pubsub.v1 - * @interface IGetTopicRequest - * @property {string|null} [topic] GetTopicRequest topic - */ - - /** - * Constructs a new GetTopicRequest. - * @memberof google.pubsub.v1 - * @classdesc Represents a GetTopicRequest. - * @implements IGetTopicRequest - * @constructor - * @param {google.pubsub.v1.IGetTopicRequest=} [properties] Properties to set - */ - function GetTopicRequest(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]]; - } - - /** - * GetTopicRequest topic. - * @member {string} topic - * @memberof google.pubsub.v1.GetTopicRequest - * @instance - */ - GetTopicRequest.prototype.topic = ""; - - /** - * Creates a new GetTopicRequest instance using the specified properties. - * @function create - * @memberof google.pubsub.v1.GetTopicRequest - * @static - * @param {google.pubsub.v1.IGetTopicRequest=} [properties] Properties to set - * @returns {google.pubsub.v1.GetTopicRequest} GetTopicRequest instance - */ - GetTopicRequest.create = function create(properties) { - return new GetTopicRequest(properties); - }; - - /** - * Encodes the specified GetTopicRequest message. Does not implicitly {@link google.pubsub.v1.GetTopicRequest.verify|verify} messages. - * @function encode - * @memberof google.pubsub.v1.GetTopicRequest - * @static - * @param {google.pubsub.v1.IGetTopicRequest} message GetTopicRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetTopicRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.topic != null && Object.hasOwnProperty.call(message, "topic")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.topic); - return writer; - }; - - /** - * Encodes the specified GetTopicRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.GetTopicRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.pubsub.v1.GetTopicRequest - * @static - * @param {google.pubsub.v1.IGetTopicRequest} message GetTopicRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetTopicRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetTopicRequest message from the specified reader or buffer. - * @function decode - * @memberof google.pubsub.v1.GetTopicRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.pubsub.v1.GetTopicRequest} GetTopicRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetTopicRequest.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.pubsub.v1.GetTopicRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.topic = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetTopicRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.pubsub.v1.GetTopicRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.pubsub.v1.GetTopicRequest} GetTopicRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetTopicRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetTopicRequest message. - * @function verify - * @memberof google.pubsub.v1.GetTopicRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetTopicRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.topic != null && message.hasOwnProperty("topic")) - if (!$util.isString(message.topic)) - return "topic: string expected"; - return null; - }; - - /** - * Creates a GetTopicRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.pubsub.v1.GetTopicRequest - * @static - * @param {Object.} object Plain object - * @returns {google.pubsub.v1.GetTopicRequest} GetTopicRequest - */ - GetTopicRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.pubsub.v1.GetTopicRequest) - return object; - var message = new $root.google.pubsub.v1.GetTopicRequest(); - if (object.topic != null) - message.topic = String(object.topic); - return message; - }; - - /** - * Creates a plain object from a GetTopicRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.pubsub.v1.GetTopicRequest - * @static - * @param {google.pubsub.v1.GetTopicRequest} message GetTopicRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetTopicRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.topic = ""; - if (message.topic != null && message.hasOwnProperty("topic")) - object.topic = message.topic; - return object; - }; - - /** - * Converts this GetTopicRequest to JSON. - * @function toJSON - * @memberof google.pubsub.v1.GetTopicRequest - * @instance - * @returns {Object.} JSON object - */ - GetTopicRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetTopicRequest - * @function getTypeUrl - * @memberof google.pubsub.v1.GetTopicRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetTopicRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.pubsub.v1.GetTopicRequest"; - }; - - return GetTopicRequest; - })(); - - v1.UpdateTopicRequest = (function() { - - /** - * Properties of an UpdateTopicRequest. - * @memberof google.pubsub.v1 - * @interface IUpdateTopicRequest - * @property {google.pubsub.v1.ITopic|null} [topic] UpdateTopicRequest topic - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateTopicRequest updateMask - */ - - /** - * Constructs a new UpdateTopicRequest. - * @memberof google.pubsub.v1 - * @classdesc Represents an UpdateTopicRequest. - * @implements IUpdateTopicRequest - * @constructor - * @param {google.pubsub.v1.IUpdateTopicRequest=} [properties] Properties to set - */ - function UpdateTopicRequest(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]]; - } - - /** - * UpdateTopicRequest topic. - * @member {google.pubsub.v1.ITopic|null|undefined} topic - * @memberof google.pubsub.v1.UpdateTopicRequest - * @instance - */ - UpdateTopicRequest.prototype.topic = null; - - /** - * UpdateTopicRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.pubsub.v1.UpdateTopicRequest - * @instance - */ - UpdateTopicRequest.prototype.updateMask = null; - - /** - * Creates a new UpdateTopicRequest instance using the specified properties. - * @function create - * @memberof google.pubsub.v1.UpdateTopicRequest - * @static - * @param {google.pubsub.v1.IUpdateTopicRequest=} [properties] Properties to set - * @returns {google.pubsub.v1.UpdateTopicRequest} UpdateTopicRequest instance - */ - UpdateTopicRequest.create = function create(properties) { - return new UpdateTopicRequest(properties); - }; - - /** - * Encodes the specified UpdateTopicRequest message. Does not implicitly {@link google.pubsub.v1.UpdateTopicRequest.verify|verify} messages. - * @function encode - * @memberof google.pubsub.v1.UpdateTopicRequest - * @static - * @param {google.pubsub.v1.IUpdateTopicRequest} message UpdateTopicRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateTopicRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.topic != null && Object.hasOwnProperty.call(message, "topic")) - $root.google.pubsub.v1.Topic.encode(message.topic, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified UpdateTopicRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.UpdateTopicRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.pubsub.v1.UpdateTopicRequest - * @static - * @param {google.pubsub.v1.IUpdateTopicRequest} message UpdateTopicRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateTopicRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateTopicRequest message from the specified reader or buffer. - * @function decode - * @memberof google.pubsub.v1.UpdateTopicRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.pubsub.v1.UpdateTopicRequest} UpdateTopicRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateTopicRequest.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.pubsub.v1.UpdateTopicRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.topic = $root.google.pubsub.v1.Topic.decode(reader, reader.uint32()); - break; - } - case 2: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpdateTopicRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.pubsub.v1.UpdateTopicRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.pubsub.v1.UpdateTopicRequest} UpdateTopicRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateTopicRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateTopicRequest message. - * @function verify - * @memberof google.pubsub.v1.UpdateTopicRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateTopicRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.topic != null && message.hasOwnProperty("topic")) { - var error = $root.google.pubsub.v1.Topic.verify(message.topic); - if (error) - return "topic." + error; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } - return null; - }; - - /** - * Creates an UpdateTopicRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.pubsub.v1.UpdateTopicRequest - * @static - * @param {Object.} object Plain object - * @returns {google.pubsub.v1.UpdateTopicRequest} UpdateTopicRequest - */ - UpdateTopicRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.pubsub.v1.UpdateTopicRequest) - return object; - var message = new $root.google.pubsub.v1.UpdateTopicRequest(); - if (object.topic != null) { - if (typeof object.topic !== "object") - throw TypeError(".google.pubsub.v1.UpdateTopicRequest.topic: object expected"); - message.topic = $root.google.pubsub.v1.Topic.fromObject(object.topic); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.pubsub.v1.UpdateTopicRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - return message; - }; - - /** - * Creates a plain object from an UpdateTopicRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.pubsub.v1.UpdateTopicRequest - * @static - * @param {google.pubsub.v1.UpdateTopicRequest} message UpdateTopicRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateTopicRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.topic = null; - object.updateMask = null; - } - if (message.topic != null && message.hasOwnProperty("topic")) - object.topic = $root.google.pubsub.v1.Topic.toObject(message.topic, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - return object; - }; - - /** - * Converts this UpdateTopicRequest to JSON. - * @function toJSON - * @memberof google.pubsub.v1.UpdateTopicRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateTopicRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateTopicRequest - * @function getTypeUrl - * @memberof google.pubsub.v1.UpdateTopicRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateTopicRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.pubsub.v1.UpdateTopicRequest"; - }; - - return UpdateTopicRequest; - })(); - - v1.PublishRequest = (function() { - - /** - * Properties of a PublishRequest. - * @memberof google.pubsub.v1 - * @interface IPublishRequest - * @property {string|null} [topic] PublishRequest topic - * @property {Array.|null} [messages] PublishRequest messages - */ - - /** - * Constructs a new PublishRequest. - * @memberof google.pubsub.v1 - * @classdesc Represents a PublishRequest. - * @implements IPublishRequest - * @constructor - * @param {google.pubsub.v1.IPublishRequest=} [properties] Properties to set - */ - function PublishRequest(properties) { - this.messages = []; - 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]]; - } - - /** - * PublishRequest topic. - * @member {string} topic - * @memberof google.pubsub.v1.PublishRequest - * @instance - */ - PublishRequest.prototype.topic = ""; - - /** - * PublishRequest messages. - * @member {Array.} messages - * @memberof google.pubsub.v1.PublishRequest - * @instance - */ - PublishRequest.prototype.messages = $util.emptyArray; - - /** - * Creates a new PublishRequest instance using the specified properties. - * @function create - * @memberof google.pubsub.v1.PublishRequest - * @static - * @param {google.pubsub.v1.IPublishRequest=} [properties] Properties to set - * @returns {google.pubsub.v1.PublishRequest} PublishRequest instance - */ - PublishRequest.create = function create(properties) { - return new PublishRequest(properties); - }; - - /** - * Encodes the specified PublishRequest message. Does not implicitly {@link google.pubsub.v1.PublishRequest.verify|verify} messages. - * @function encode - * @memberof google.pubsub.v1.PublishRequest - * @static - * @param {google.pubsub.v1.IPublishRequest} message PublishRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PublishRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.topic != null && Object.hasOwnProperty.call(message, "topic")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.topic); - if (message.messages != null && message.messages.length) - for (var i = 0; i < message.messages.length; ++i) - $root.google.pubsub.v1.PubsubMessage.encode(message.messages[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified PublishRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.PublishRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.pubsub.v1.PublishRequest - * @static - * @param {google.pubsub.v1.IPublishRequest} message PublishRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PublishRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PublishRequest message from the specified reader or buffer. - * @function decode - * @memberof google.pubsub.v1.PublishRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.pubsub.v1.PublishRequest} PublishRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PublishRequest.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.pubsub.v1.PublishRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.topic = reader.string(); - break; - } - case 2: { - if (!(message.messages && message.messages.length)) - message.messages = []; - message.messages.push($root.google.pubsub.v1.PubsubMessage.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PublishRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.pubsub.v1.PublishRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.pubsub.v1.PublishRequest} PublishRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PublishRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PublishRequest message. - * @function verify - * @memberof google.pubsub.v1.PublishRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PublishRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.topic != null && message.hasOwnProperty("topic")) - if (!$util.isString(message.topic)) - return "topic: string expected"; - if (message.messages != null && message.hasOwnProperty("messages")) { - if (!Array.isArray(message.messages)) - return "messages: array expected"; - for (var i = 0; i < message.messages.length; ++i) { - var error = $root.google.pubsub.v1.PubsubMessage.verify(message.messages[i]); - if (error) - return "messages." + error; - } - } - return null; - }; - - /** - * Creates a PublishRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.pubsub.v1.PublishRequest - * @static - * @param {Object.} object Plain object - * @returns {google.pubsub.v1.PublishRequest} PublishRequest - */ - PublishRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.pubsub.v1.PublishRequest) - return object; - var message = new $root.google.pubsub.v1.PublishRequest(); - if (object.topic != null) - message.topic = String(object.topic); - if (object.messages) { - if (!Array.isArray(object.messages)) - throw TypeError(".google.pubsub.v1.PublishRequest.messages: array expected"); - message.messages = []; - for (var i = 0; i < object.messages.length; ++i) { - if (typeof object.messages[i] !== "object") - throw TypeError(".google.pubsub.v1.PublishRequest.messages: object expected"); - message.messages[i] = $root.google.pubsub.v1.PubsubMessage.fromObject(object.messages[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a PublishRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.pubsub.v1.PublishRequest - * @static - * @param {google.pubsub.v1.PublishRequest} message PublishRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PublishRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.messages = []; - if (options.defaults) - object.topic = ""; - if (message.topic != null && message.hasOwnProperty("topic")) - object.topic = message.topic; - if (message.messages && message.messages.length) { - object.messages = []; - for (var j = 0; j < message.messages.length; ++j) - object.messages[j] = $root.google.pubsub.v1.PubsubMessage.toObject(message.messages[j], options); - } - return object; - }; - - /** - * Converts this PublishRequest to JSON. - * @function toJSON - * @memberof google.pubsub.v1.PublishRequest - * @instance - * @returns {Object.} JSON object - */ - PublishRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PublishRequest - * @function getTypeUrl - * @memberof google.pubsub.v1.PublishRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PublishRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.pubsub.v1.PublishRequest"; - }; - - return PublishRequest; - })(); - - v1.PublishResponse = (function() { - - /** - * Properties of a PublishResponse. - * @memberof google.pubsub.v1 - * @interface IPublishResponse - * @property {Array.|null} [messageIds] PublishResponse messageIds - */ - - /** - * Constructs a new PublishResponse. - * @memberof google.pubsub.v1 - * @classdesc Represents a PublishResponse. - * @implements IPublishResponse - * @constructor - * @param {google.pubsub.v1.IPublishResponse=} [properties] Properties to set - */ - function PublishResponse(properties) { - this.messageIds = []; - 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]]; - } - - /** - * PublishResponse messageIds. - * @member {Array.} messageIds - * @memberof google.pubsub.v1.PublishResponse - * @instance - */ - PublishResponse.prototype.messageIds = $util.emptyArray; - - /** - * Creates a new PublishResponse instance using the specified properties. - * @function create - * @memberof google.pubsub.v1.PublishResponse - * @static - * @param {google.pubsub.v1.IPublishResponse=} [properties] Properties to set - * @returns {google.pubsub.v1.PublishResponse} PublishResponse instance - */ - PublishResponse.create = function create(properties) { - return new PublishResponse(properties); - }; - - /** - * Encodes the specified PublishResponse message. Does not implicitly {@link google.pubsub.v1.PublishResponse.verify|verify} messages. - * @function encode - * @memberof google.pubsub.v1.PublishResponse - * @static - * @param {google.pubsub.v1.IPublishResponse} message PublishResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PublishResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.messageIds != null && message.messageIds.length) - for (var i = 0; i < message.messageIds.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.messageIds[i]); - return writer; - }; - - /** - * Encodes the specified PublishResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.PublishResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.pubsub.v1.PublishResponse - * @static - * @param {google.pubsub.v1.IPublishResponse} message PublishResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PublishResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PublishResponse message from the specified reader or buffer. - * @function decode - * @memberof google.pubsub.v1.PublishResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.pubsub.v1.PublishResponse} PublishResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PublishResponse.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.pubsub.v1.PublishResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.messageIds && message.messageIds.length)) - message.messageIds = []; - message.messageIds.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PublishResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.pubsub.v1.PublishResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.pubsub.v1.PublishResponse} PublishResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PublishResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PublishResponse message. - * @function verify - * @memberof google.pubsub.v1.PublishResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PublishResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.messageIds != null && message.hasOwnProperty("messageIds")) { - if (!Array.isArray(message.messageIds)) - return "messageIds: array expected"; - for (var i = 0; i < message.messageIds.length; ++i) - if (!$util.isString(message.messageIds[i])) - return "messageIds: string[] expected"; - } - return null; - }; - - /** - * Creates a PublishResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.pubsub.v1.PublishResponse - * @static - * @param {Object.} object Plain object - * @returns {google.pubsub.v1.PublishResponse} PublishResponse - */ - PublishResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.pubsub.v1.PublishResponse) - return object; - var message = new $root.google.pubsub.v1.PublishResponse(); - if (object.messageIds) { - if (!Array.isArray(object.messageIds)) - throw TypeError(".google.pubsub.v1.PublishResponse.messageIds: array expected"); - message.messageIds = []; - for (var i = 0; i < object.messageIds.length; ++i) - message.messageIds[i] = String(object.messageIds[i]); - } - return message; - }; - - /** - * Creates a plain object from a PublishResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.pubsub.v1.PublishResponse - * @static - * @param {google.pubsub.v1.PublishResponse} message PublishResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PublishResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.messageIds = []; - if (message.messageIds && message.messageIds.length) { - object.messageIds = []; - for (var j = 0; j < message.messageIds.length; ++j) - object.messageIds[j] = message.messageIds[j]; - } - return object; - }; - - /** - * Converts this PublishResponse to JSON. - * @function toJSON - * @memberof google.pubsub.v1.PublishResponse - * @instance - * @returns {Object.} JSON object - */ - PublishResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PublishResponse - * @function getTypeUrl - * @memberof google.pubsub.v1.PublishResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PublishResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.pubsub.v1.PublishResponse"; - }; - - return PublishResponse; - })(); - - v1.ListTopicsRequest = (function() { - - /** - * Properties of a ListTopicsRequest. - * @memberof google.pubsub.v1 - * @interface IListTopicsRequest - * @property {string|null} [project] ListTopicsRequest project - * @property {number|null} [pageSize] ListTopicsRequest pageSize - * @property {string|null} [pageToken] ListTopicsRequest pageToken - */ - - /** - * Constructs a new ListTopicsRequest. - * @memberof google.pubsub.v1 - * @classdesc Represents a ListTopicsRequest. - * @implements IListTopicsRequest - * @constructor - * @param {google.pubsub.v1.IListTopicsRequest=} [properties] Properties to set - */ - function ListTopicsRequest(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]]; - } - - /** - * ListTopicsRequest project. - * @member {string} project - * @memberof google.pubsub.v1.ListTopicsRequest - * @instance - */ - ListTopicsRequest.prototype.project = ""; - - /** - * ListTopicsRequest pageSize. - * @member {number} pageSize - * @memberof google.pubsub.v1.ListTopicsRequest - * @instance - */ - ListTopicsRequest.prototype.pageSize = 0; - - /** - * ListTopicsRequest pageToken. - * @member {string} pageToken - * @memberof google.pubsub.v1.ListTopicsRequest - * @instance - */ - ListTopicsRequest.prototype.pageToken = ""; - - /** - * Creates a new ListTopicsRequest instance using the specified properties. - * @function create - * @memberof google.pubsub.v1.ListTopicsRequest - * @static - * @param {google.pubsub.v1.IListTopicsRequest=} [properties] Properties to set - * @returns {google.pubsub.v1.ListTopicsRequest} ListTopicsRequest instance - */ - ListTopicsRequest.create = function create(properties) { - return new ListTopicsRequest(properties); - }; - - /** - * Encodes the specified ListTopicsRequest message. Does not implicitly {@link google.pubsub.v1.ListTopicsRequest.verify|verify} messages. - * @function encode - * @memberof google.pubsub.v1.ListTopicsRequest - * @static - * @param {google.pubsub.v1.IListTopicsRequest} message ListTopicsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListTopicsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.project != null && Object.hasOwnProperty.call(message, "project")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.project); - 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); - return writer; - }; - - /** - * Encodes the specified ListTopicsRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.ListTopicsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.pubsub.v1.ListTopicsRequest - * @static - * @param {google.pubsub.v1.IListTopicsRequest} message ListTopicsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListTopicsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListTopicsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.pubsub.v1.ListTopicsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.pubsub.v1.ListTopicsRequest} ListTopicsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListTopicsRequest.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.pubsub.v1.ListTopicsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.project = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListTopicsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.pubsub.v1.ListTopicsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.pubsub.v1.ListTopicsRequest} ListTopicsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListTopicsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListTopicsRequest message. - * @function verify - * @memberof google.pubsub.v1.ListTopicsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListTopicsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.project != null && message.hasOwnProperty("project")) - if (!$util.isString(message.project)) - return "project: 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"; - return null; - }; - - /** - * Creates a ListTopicsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.pubsub.v1.ListTopicsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.pubsub.v1.ListTopicsRequest} ListTopicsRequest - */ - ListTopicsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.pubsub.v1.ListTopicsRequest) - return object; - var message = new $root.google.pubsub.v1.ListTopicsRequest(); - if (object.project != null) - message.project = String(object.project); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - return message; - }; - - /** - * Creates a plain object from a ListTopicsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.pubsub.v1.ListTopicsRequest - * @static - * @param {google.pubsub.v1.ListTopicsRequest} message ListTopicsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListTopicsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.project = ""; - object.pageSize = 0; - object.pageToken = ""; - } - if (message.project != null && message.hasOwnProperty("project")) - object.project = message.project; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - return object; - }; - - /** - * Converts this ListTopicsRequest to JSON. - * @function toJSON - * @memberof google.pubsub.v1.ListTopicsRequest - * @instance - * @returns {Object.} JSON object - */ - ListTopicsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListTopicsRequest - * @function getTypeUrl - * @memberof google.pubsub.v1.ListTopicsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListTopicsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.pubsub.v1.ListTopicsRequest"; - }; - - return ListTopicsRequest; - })(); - - v1.ListTopicsResponse = (function() { - - /** - * Properties of a ListTopicsResponse. - * @memberof google.pubsub.v1 - * @interface IListTopicsResponse - * @property {Array.|null} [topics] ListTopicsResponse topics - * @property {string|null} [nextPageToken] ListTopicsResponse nextPageToken - */ - - /** - * Constructs a new ListTopicsResponse. - * @memberof google.pubsub.v1 - * @classdesc Represents a ListTopicsResponse. - * @implements IListTopicsResponse - * @constructor - * @param {google.pubsub.v1.IListTopicsResponse=} [properties] Properties to set - */ - function ListTopicsResponse(properties) { - this.topics = []; - 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]]; - } - - /** - * ListTopicsResponse topics. - * @member {Array.} topics - * @memberof google.pubsub.v1.ListTopicsResponse - * @instance - */ - ListTopicsResponse.prototype.topics = $util.emptyArray; - - /** - * ListTopicsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.pubsub.v1.ListTopicsResponse - * @instance - */ - ListTopicsResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListTopicsResponse instance using the specified properties. - * @function create - * @memberof google.pubsub.v1.ListTopicsResponse - * @static - * @param {google.pubsub.v1.IListTopicsResponse=} [properties] Properties to set - * @returns {google.pubsub.v1.ListTopicsResponse} ListTopicsResponse instance - */ - ListTopicsResponse.create = function create(properties) { - return new ListTopicsResponse(properties); - }; - - /** - * Encodes the specified ListTopicsResponse message. Does not implicitly {@link google.pubsub.v1.ListTopicsResponse.verify|verify} messages. - * @function encode - * @memberof google.pubsub.v1.ListTopicsResponse - * @static - * @param {google.pubsub.v1.IListTopicsResponse} message ListTopicsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListTopicsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.topics != null && message.topics.length) - for (var i = 0; i < message.topics.length; ++i) - $root.google.pubsub.v1.Topic.encode(message.topics[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 ListTopicsResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.ListTopicsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.pubsub.v1.ListTopicsResponse - * @static - * @param {google.pubsub.v1.IListTopicsResponse} message ListTopicsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListTopicsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListTopicsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.pubsub.v1.ListTopicsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.pubsub.v1.ListTopicsResponse} ListTopicsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListTopicsResponse.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.pubsub.v1.ListTopicsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.topics && message.topics.length)) - message.topics = []; - message.topics.push($root.google.pubsub.v1.Topic.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListTopicsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.pubsub.v1.ListTopicsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.pubsub.v1.ListTopicsResponse} ListTopicsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListTopicsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListTopicsResponse message. - * @function verify - * @memberof google.pubsub.v1.ListTopicsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListTopicsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.topics != null && message.hasOwnProperty("topics")) { - if (!Array.isArray(message.topics)) - return "topics: array expected"; - for (var i = 0; i < message.topics.length; ++i) { - var error = $root.google.pubsub.v1.Topic.verify(message.topics[i]); - if (error) - return "topics." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListTopicsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.pubsub.v1.ListTopicsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.pubsub.v1.ListTopicsResponse} ListTopicsResponse - */ - ListTopicsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.pubsub.v1.ListTopicsResponse) - return object; - var message = new $root.google.pubsub.v1.ListTopicsResponse(); - if (object.topics) { - if (!Array.isArray(object.topics)) - throw TypeError(".google.pubsub.v1.ListTopicsResponse.topics: array expected"); - message.topics = []; - for (var i = 0; i < object.topics.length; ++i) { - if (typeof object.topics[i] !== "object") - throw TypeError(".google.pubsub.v1.ListTopicsResponse.topics: object expected"); - message.topics[i] = $root.google.pubsub.v1.Topic.fromObject(object.topics[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListTopicsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.pubsub.v1.ListTopicsResponse - * @static - * @param {google.pubsub.v1.ListTopicsResponse} message ListTopicsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListTopicsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.topics = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.topics && message.topics.length) { - object.topics = []; - for (var j = 0; j < message.topics.length; ++j) - object.topics[j] = $root.google.pubsub.v1.Topic.toObject(message.topics[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListTopicsResponse to JSON. - * @function toJSON - * @memberof google.pubsub.v1.ListTopicsResponse - * @instance - * @returns {Object.} JSON object - */ - ListTopicsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListTopicsResponse - * @function getTypeUrl - * @memberof google.pubsub.v1.ListTopicsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListTopicsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.pubsub.v1.ListTopicsResponse"; - }; - - return ListTopicsResponse; - })(); - - v1.ListTopicSubscriptionsRequest = (function() { - - /** - * Properties of a ListTopicSubscriptionsRequest. - * @memberof google.pubsub.v1 - * @interface IListTopicSubscriptionsRequest - * @property {string|null} [topic] ListTopicSubscriptionsRequest topic - * @property {number|null} [pageSize] ListTopicSubscriptionsRequest pageSize - * @property {string|null} [pageToken] ListTopicSubscriptionsRequest pageToken - */ - - /** - * Constructs a new ListTopicSubscriptionsRequest. - * @memberof google.pubsub.v1 - * @classdesc Represents a ListTopicSubscriptionsRequest. - * @implements IListTopicSubscriptionsRequest - * @constructor - * @param {google.pubsub.v1.IListTopicSubscriptionsRequest=} [properties] Properties to set - */ - function ListTopicSubscriptionsRequest(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]]; - } - - /** - * ListTopicSubscriptionsRequest topic. - * @member {string} topic - * @memberof google.pubsub.v1.ListTopicSubscriptionsRequest - * @instance - */ - ListTopicSubscriptionsRequest.prototype.topic = ""; - - /** - * ListTopicSubscriptionsRequest pageSize. - * @member {number} pageSize - * @memberof google.pubsub.v1.ListTopicSubscriptionsRequest - * @instance - */ - ListTopicSubscriptionsRequest.prototype.pageSize = 0; - - /** - * ListTopicSubscriptionsRequest pageToken. - * @member {string} pageToken - * @memberof google.pubsub.v1.ListTopicSubscriptionsRequest - * @instance - */ - ListTopicSubscriptionsRequest.prototype.pageToken = ""; - - /** - * Creates a new ListTopicSubscriptionsRequest instance using the specified properties. - * @function create - * @memberof google.pubsub.v1.ListTopicSubscriptionsRequest - * @static - * @param {google.pubsub.v1.IListTopicSubscriptionsRequest=} [properties] Properties to set - * @returns {google.pubsub.v1.ListTopicSubscriptionsRequest} ListTopicSubscriptionsRequest instance - */ - ListTopicSubscriptionsRequest.create = function create(properties) { - return new ListTopicSubscriptionsRequest(properties); - }; - - /** - * Encodes the specified ListTopicSubscriptionsRequest message. Does not implicitly {@link google.pubsub.v1.ListTopicSubscriptionsRequest.verify|verify} messages. - * @function encode - * @memberof google.pubsub.v1.ListTopicSubscriptionsRequest - * @static - * @param {google.pubsub.v1.IListTopicSubscriptionsRequest} message ListTopicSubscriptionsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListTopicSubscriptionsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.topic != null && Object.hasOwnProperty.call(message, "topic")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.topic); - 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); - return writer; - }; - - /** - * Encodes the specified ListTopicSubscriptionsRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.ListTopicSubscriptionsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.pubsub.v1.ListTopicSubscriptionsRequest - * @static - * @param {google.pubsub.v1.IListTopicSubscriptionsRequest} message ListTopicSubscriptionsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListTopicSubscriptionsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListTopicSubscriptionsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.pubsub.v1.ListTopicSubscriptionsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.pubsub.v1.ListTopicSubscriptionsRequest} ListTopicSubscriptionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListTopicSubscriptionsRequest.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.pubsub.v1.ListTopicSubscriptionsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.topic = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListTopicSubscriptionsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.pubsub.v1.ListTopicSubscriptionsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.pubsub.v1.ListTopicSubscriptionsRequest} ListTopicSubscriptionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListTopicSubscriptionsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListTopicSubscriptionsRequest message. - * @function verify - * @memberof google.pubsub.v1.ListTopicSubscriptionsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListTopicSubscriptionsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.topic != null && message.hasOwnProperty("topic")) - if (!$util.isString(message.topic)) - return "topic: 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"; - return null; - }; - - /** - * Creates a ListTopicSubscriptionsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.pubsub.v1.ListTopicSubscriptionsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.pubsub.v1.ListTopicSubscriptionsRequest} ListTopicSubscriptionsRequest - */ - ListTopicSubscriptionsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.pubsub.v1.ListTopicSubscriptionsRequest) - return object; - var message = new $root.google.pubsub.v1.ListTopicSubscriptionsRequest(); - if (object.topic != null) - message.topic = String(object.topic); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - return message; - }; - - /** - * Creates a plain object from a ListTopicSubscriptionsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.pubsub.v1.ListTopicSubscriptionsRequest - * @static - * @param {google.pubsub.v1.ListTopicSubscriptionsRequest} message ListTopicSubscriptionsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListTopicSubscriptionsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.topic = ""; - object.pageSize = 0; - object.pageToken = ""; - } - if (message.topic != null && message.hasOwnProperty("topic")) - object.topic = message.topic; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - return object; - }; - - /** - * Converts this ListTopicSubscriptionsRequest to JSON. - * @function toJSON - * @memberof google.pubsub.v1.ListTopicSubscriptionsRequest - * @instance - * @returns {Object.} JSON object - */ - ListTopicSubscriptionsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListTopicSubscriptionsRequest - * @function getTypeUrl - * @memberof google.pubsub.v1.ListTopicSubscriptionsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListTopicSubscriptionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.pubsub.v1.ListTopicSubscriptionsRequest"; - }; - - return ListTopicSubscriptionsRequest; - })(); - - v1.ListTopicSubscriptionsResponse = (function() { - - /** - * Properties of a ListTopicSubscriptionsResponse. - * @memberof google.pubsub.v1 - * @interface IListTopicSubscriptionsResponse - * @property {Array.|null} [subscriptions] ListTopicSubscriptionsResponse subscriptions - * @property {string|null} [nextPageToken] ListTopicSubscriptionsResponse nextPageToken - */ - - /** - * Constructs a new ListTopicSubscriptionsResponse. - * @memberof google.pubsub.v1 - * @classdesc Represents a ListTopicSubscriptionsResponse. - * @implements IListTopicSubscriptionsResponse - * @constructor - * @param {google.pubsub.v1.IListTopicSubscriptionsResponse=} [properties] Properties to set - */ - function ListTopicSubscriptionsResponse(properties) { - this.subscriptions = []; - 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]]; - } - - /** - * ListTopicSubscriptionsResponse subscriptions. - * @member {Array.} subscriptions - * @memberof google.pubsub.v1.ListTopicSubscriptionsResponse - * @instance - */ - ListTopicSubscriptionsResponse.prototype.subscriptions = $util.emptyArray; - - /** - * ListTopicSubscriptionsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.pubsub.v1.ListTopicSubscriptionsResponse - * @instance - */ - ListTopicSubscriptionsResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListTopicSubscriptionsResponse instance using the specified properties. - * @function create - * @memberof google.pubsub.v1.ListTopicSubscriptionsResponse - * @static - * @param {google.pubsub.v1.IListTopicSubscriptionsResponse=} [properties] Properties to set - * @returns {google.pubsub.v1.ListTopicSubscriptionsResponse} ListTopicSubscriptionsResponse instance - */ - ListTopicSubscriptionsResponse.create = function create(properties) { - return new ListTopicSubscriptionsResponse(properties); - }; - - /** - * Encodes the specified ListTopicSubscriptionsResponse message. Does not implicitly {@link google.pubsub.v1.ListTopicSubscriptionsResponse.verify|verify} messages. - * @function encode - * @memberof google.pubsub.v1.ListTopicSubscriptionsResponse - * @static - * @param {google.pubsub.v1.IListTopicSubscriptionsResponse} message ListTopicSubscriptionsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListTopicSubscriptionsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.subscriptions != null && message.subscriptions.length) - for (var i = 0; i < message.subscriptions.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.subscriptions[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 ListTopicSubscriptionsResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.ListTopicSubscriptionsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.pubsub.v1.ListTopicSubscriptionsResponse - * @static - * @param {google.pubsub.v1.IListTopicSubscriptionsResponse} message ListTopicSubscriptionsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListTopicSubscriptionsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListTopicSubscriptionsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.pubsub.v1.ListTopicSubscriptionsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.pubsub.v1.ListTopicSubscriptionsResponse} ListTopicSubscriptionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListTopicSubscriptionsResponse.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.pubsub.v1.ListTopicSubscriptionsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.subscriptions && message.subscriptions.length)) - message.subscriptions = []; - message.subscriptions.push(reader.string()); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListTopicSubscriptionsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.pubsub.v1.ListTopicSubscriptionsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.pubsub.v1.ListTopicSubscriptionsResponse} ListTopicSubscriptionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListTopicSubscriptionsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListTopicSubscriptionsResponse message. - * @function verify - * @memberof google.pubsub.v1.ListTopicSubscriptionsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListTopicSubscriptionsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.subscriptions != null && message.hasOwnProperty("subscriptions")) { - if (!Array.isArray(message.subscriptions)) - return "subscriptions: array expected"; - for (var i = 0; i < message.subscriptions.length; ++i) - if (!$util.isString(message.subscriptions[i])) - return "subscriptions: string[] expected"; - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListTopicSubscriptionsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.pubsub.v1.ListTopicSubscriptionsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.pubsub.v1.ListTopicSubscriptionsResponse} ListTopicSubscriptionsResponse - */ - ListTopicSubscriptionsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.pubsub.v1.ListTopicSubscriptionsResponse) - return object; - var message = new $root.google.pubsub.v1.ListTopicSubscriptionsResponse(); - if (object.subscriptions) { - if (!Array.isArray(object.subscriptions)) - throw TypeError(".google.pubsub.v1.ListTopicSubscriptionsResponse.subscriptions: array expected"); - message.subscriptions = []; - for (var i = 0; i < object.subscriptions.length; ++i) - message.subscriptions[i] = String(object.subscriptions[i]); - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListTopicSubscriptionsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.pubsub.v1.ListTopicSubscriptionsResponse - * @static - * @param {google.pubsub.v1.ListTopicSubscriptionsResponse} message ListTopicSubscriptionsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListTopicSubscriptionsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.subscriptions = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.subscriptions && message.subscriptions.length) { - object.subscriptions = []; - for (var j = 0; j < message.subscriptions.length; ++j) - object.subscriptions[j] = message.subscriptions[j]; - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListTopicSubscriptionsResponse to JSON. - * @function toJSON - * @memberof google.pubsub.v1.ListTopicSubscriptionsResponse - * @instance - * @returns {Object.} JSON object - */ - ListTopicSubscriptionsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListTopicSubscriptionsResponse - * @function getTypeUrl - * @memberof google.pubsub.v1.ListTopicSubscriptionsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListTopicSubscriptionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.pubsub.v1.ListTopicSubscriptionsResponse"; - }; - - return ListTopicSubscriptionsResponse; - })(); - - v1.ListTopicSnapshotsRequest = (function() { - - /** - * Properties of a ListTopicSnapshotsRequest. - * @memberof google.pubsub.v1 - * @interface IListTopicSnapshotsRequest - * @property {string|null} [topic] ListTopicSnapshotsRequest topic - * @property {number|null} [pageSize] ListTopicSnapshotsRequest pageSize - * @property {string|null} [pageToken] ListTopicSnapshotsRequest pageToken - */ - - /** - * Constructs a new ListTopicSnapshotsRequest. - * @memberof google.pubsub.v1 - * @classdesc Represents a ListTopicSnapshotsRequest. - * @implements IListTopicSnapshotsRequest - * @constructor - * @param {google.pubsub.v1.IListTopicSnapshotsRequest=} [properties] Properties to set - */ - function ListTopicSnapshotsRequest(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]]; - } - - /** - * ListTopicSnapshotsRequest topic. - * @member {string} topic - * @memberof google.pubsub.v1.ListTopicSnapshotsRequest - * @instance - */ - ListTopicSnapshotsRequest.prototype.topic = ""; - - /** - * ListTopicSnapshotsRequest pageSize. - * @member {number} pageSize - * @memberof google.pubsub.v1.ListTopicSnapshotsRequest - * @instance - */ - ListTopicSnapshotsRequest.prototype.pageSize = 0; - - /** - * ListTopicSnapshotsRequest pageToken. - * @member {string} pageToken - * @memberof google.pubsub.v1.ListTopicSnapshotsRequest - * @instance - */ - ListTopicSnapshotsRequest.prototype.pageToken = ""; - - /** - * Creates a new ListTopicSnapshotsRequest instance using the specified properties. - * @function create - * @memberof google.pubsub.v1.ListTopicSnapshotsRequest - * @static - * @param {google.pubsub.v1.IListTopicSnapshotsRequest=} [properties] Properties to set - * @returns {google.pubsub.v1.ListTopicSnapshotsRequest} ListTopicSnapshotsRequest instance - */ - ListTopicSnapshotsRequest.create = function create(properties) { - return new ListTopicSnapshotsRequest(properties); - }; - - /** - * Encodes the specified ListTopicSnapshotsRequest message. Does not implicitly {@link google.pubsub.v1.ListTopicSnapshotsRequest.verify|verify} messages. - * @function encode - * @memberof google.pubsub.v1.ListTopicSnapshotsRequest - * @static - * @param {google.pubsub.v1.IListTopicSnapshotsRequest} message ListTopicSnapshotsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListTopicSnapshotsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.topic != null && Object.hasOwnProperty.call(message, "topic")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.topic); - 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); - return writer; - }; - - /** - * Encodes the specified ListTopicSnapshotsRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.ListTopicSnapshotsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.pubsub.v1.ListTopicSnapshotsRequest - * @static - * @param {google.pubsub.v1.IListTopicSnapshotsRequest} message ListTopicSnapshotsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListTopicSnapshotsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListTopicSnapshotsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.pubsub.v1.ListTopicSnapshotsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.pubsub.v1.ListTopicSnapshotsRequest} ListTopicSnapshotsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListTopicSnapshotsRequest.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.pubsub.v1.ListTopicSnapshotsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.topic = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListTopicSnapshotsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.pubsub.v1.ListTopicSnapshotsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.pubsub.v1.ListTopicSnapshotsRequest} ListTopicSnapshotsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListTopicSnapshotsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListTopicSnapshotsRequest message. - * @function verify - * @memberof google.pubsub.v1.ListTopicSnapshotsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListTopicSnapshotsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.topic != null && message.hasOwnProperty("topic")) - if (!$util.isString(message.topic)) - return "topic: 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"; - return null; - }; - - /** - * Creates a ListTopicSnapshotsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.pubsub.v1.ListTopicSnapshotsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.pubsub.v1.ListTopicSnapshotsRequest} ListTopicSnapshotsRequest - */ - ListTopicSnapshotsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.pubsub.v1.ListTopicSnapshotsRequest) - return object; - var message = new $root.google.pubsub.v1.ListTopicSnapshotsRequest(); - if (object.topic != null) - message.topic = String(object.topic); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - return message; - }; - - /** - * Creates a plain object from a ListTopicSnapshotsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.pubsub.v1.ListTopicSnapshotsRequest - * @static - * @param {google.pubsub.v1.ListTopicSnapshotsRequest} message ListTopicSnapshotsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListTopicSnapshotsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.topic = ""; - object.pageSize = 0; - object.pageToken = ""; - } - if (message.topic != null && message.hasOwnProperty("topic")) - object.topic = message.topic; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - return object; - }; - - /** - * Converts this ListTopicSnapshotsRequest to JSON. - * @function toJSON - * @memberof google.pubsub.v1.ListTopicSnapshotsRequest - * @instance - * @returns {Object.} JSON object - */ - ListTopicSnapshotsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListTopicSnapshotsRequest - * @function getTypeUrl - * @memberof google.pubsub.v1.ListTopicSnapshotsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListTopicSnapshotsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.pubsub.v1.ListTopicSnapshotsRequest"; - }; - - return ListTopicSnapshotsRequest; - })(); - - v1.ListTopicSnapshotsResponse = (function() { - - /** - * Properties of a ListTopicSnapshotsResponse. - * @memberof google.pubsub.v1 - * @interface IListTopicSnapshotsResponse - * @property {Array.|null} [snapshots] ListTopicSnapshotsResponse snapshots - * @property {string|null} [nextPageToken] ListTopicSnapshotsResponse nextPageToken - */ - - /** - * Constructs a new ListTopicSnapshotsResponse. - * @memberof google.pubsub.v1 - * @classdesc Represents a ListTopicSnapshotsResponse. - * @implements IListTopicSnapshotsResponse - * @constructor - * @param {google.pubsub.v1.IListTopicSnapshotsResponse=} [properties] Properties to set - */ - function ListTopicSnapshotsResponse(properties) { - this.snapshots = []; - 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]]; - } - - /** - * ListTopicSnapshotsResponse snapshots. - * @member {Array.} snapshots - * @memberof google.pubsub.v1.ListTopicSnapshotsResponse - * @instance - */ - ListTopicSnapshotsResponse.prototype.snapshots = $util.emptyArray; - - /** - * ListTopicSnapshotsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.pubsub.v1.ListTopicSnapshotsResponse - * @instance - */ - ListTopicSnapshotsResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListTopicSnapshotsResponse instance using the specified properties. - * @function create - * @memberof google.pubsub.v1.ListTopicSnapshotsResponse - * @static - * @param {google.pubsub.v1.IListTopicSnapshotsResponse=} [properties] Properties to set - * @returns {google.pubsub.v1.ListTopicSnapshotsResponse} ListTopicSnapshotsResponse instance - */ - ListTopicSnapshotsResponse.create = function create(properties) { - return new ListTopicSnapshotsResponse(properties); - }; - - /** - * Encodes the specified ListTopicSnapshotsResponse message. Does not implicitly {@link google.pubsub.v1.ListTopicSnapshotsResponse.verify|verify} messages. - * @function encode - * @memberof google.pubsub.v1.ListTopicSnapshotsResponse - * @static - * @param {google.pubsub.v1.IListTopicSnapshotsResponse} message ListTopicSnapshotsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListTopicSnapshotsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.snapshots != null && message.snapshots.length) - for (var i = 0; i < message.snapshots.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.snapshots[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 ListTopicSnapshotsResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.ListTopicSnapshotsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.pubsub.v1.ListTopicSnapshotsResponse - * @static - * @param {google.pubsub.v1.IListTopicSnapshotsResponse} message ListTopicSnapshotsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListTopicSnapshotsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListTopicSnapshotsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.pubsub.v1.ListTopicSnapshotsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.pubsub.v1.ListTopicSnapshotsResponse} ListTopicSnapshotsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListTopicSnapshotsResponse.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.pubsub.v1.ListTopicSnapshotsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.snapshots && message.snapshots.length)) - message.snapshots = []; - message.snapshots.push(reader.string()); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListTopicSnapshotsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.pubsub.v1.ListTopicSnapshotsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.pubsub.v1.ListTopicSnapshotsResponse} ListTopicSnapshotsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListTopicSnapshotsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListTopicSnapshotsResponse message. - * @function verify - * @memberof google.pubsub.v1.ListTopicSnapshotsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListTopicSnapshotsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.snapshots != null && message.hasOwnProperty("snapshots")) { - if (!Array.isArray(message.snapshots)) - return "snapshots: array expected"; - for (var i = 0; i < message.snapshots.length; ++i) - if (!$util.isString(message.snapshots[i])) - return "snapshots: string[] expected"; - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListTopicSnapshotsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.pubsub.v1.ListTopicSnapshotsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.pubsub.v1.ListTopicSnapshotsResponse} ListTopicSnapshotsResponse - */ - ListTopicSnapshotsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.pubsub.v1.ListTopicSnapshotsResponse) - return object; - var message = new $root.google.pubsub.v1.ListTopicSnapshotsResponse(); - if (object.snapshots) { - if (!Array.isArray(object.snapshots)) - throw TypeError(".google.pubsub.v1.ListTopicSnapshotsResponse.snapshots: array expected"); - message.snapshots = []; - for (var i = 0; i < object.snapshots.length; ++i) - message.snapshots[i] = String(object.snapshots[i]); - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListTopicSnapshotsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.pubsub.v1.ListTopicSnapshotsResponse - * @static - * @param {google.pubsub.v1.ListTopicSnapshotsResponse} message ListTopicSnapshotsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListTopicSnapshotsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.snapshots = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.snapshots && message.snapshots.length) { - object.snapshots = []; - for (var j = 0; j < message.snapshots.length; ++j) - object.snapshots[j] = message.snapshots[j]; - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListTopicSnapshotsResponse to JSON. - * @function toJSON - * @memberof google.pubsub.v1.ListTopicSnapshotsResponse - * @instance - * @returns {Object.} JSON object - */ - ListTopicSnapshotsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListTopicSnapshotsResponse - * @function getTypeUrl - * @memberof google.pubsub.v1.ListTopicSnapshotsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListTopicSnapshotsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.pubsub.v1.ListTopicSnapshotsResponse"; - }; - - return ListTopicSnapshotsResponse; - })(); - - v1.DeleteTopicRequest = (function() { - - /** - * Properties of a DeleteTopicRequest. - * @memberof google.pubsub.v1 - * @interface IDeleteTopicRequest - * @property {string|null} [topic] DeleteTopicRequest topic - */ - - /** - * Constructs a new DeleteTopicRequest. - * @memberof google.pubsub.v1 - * @classdesc Represents a DeleteTopicRequest. - * @implements IDeleteTopicRequest - * @constructor - * @param {google.pubsub.v1.IDeleteTopicRequest=} [properties] Properties to set - */ - function DeleteTopicRequest(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]]; - } - - /** - * DeleteTopicRequest topic. - * @member {string} topic - * @memberof google.pubsub.v1.DeleteTopicRequest - * @instance - */ - DeleteTopicRequest.prototype.topic = ""; - - /** - * Creates a new DeleteTopicRequest instance using the specified properties. - * @function create - * @memberof google.pubsub.v1.DeleteTopicRequest - * @static - * @param {google.pubsub.v1.IDeleteTopicRequest=} [properties] Properties to set - * @returns {google.pubsub.v1.DeleteTopicRequest} DeleteTopicRequest instance - */ - DeleteTopicRequest.create = function create(properties) { - return new DeleteTopicRequest(properties); - }; - - /** - * Encodes the specified DeleteTopicRequest message. Does not implicitly {@link google.pubsub.v1.DeleteTopicRequest.verify|verify} messages. - * @function encode - * @memberof google.pubsub.v1.DeleteTopicRequest - * @static - * @param {google.pubsub.v1.IDeleteTopicRequest} message DeleteTopicRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteTopicRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.topic != null && Object.hasOwnProperty.call(message, "topic")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.topic); - return writer; - }; - - /** - * Encodes the specified DeleteTopicRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.DeleteTopicRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.pubsub.v1.DeleteTopicRequest - * @static - * @param {google.pubsub.v1.IDeleteTopicRequest} message DeleteTopicRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteTopicRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteTopicRequest message from the specified reader or buffer. - * @function decode - * @memberof google.pubsub.v1.DeleteTopicRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.pubsub.v1.DeleteTopicRequest} DeleteTopicRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteTopicRequest.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.pubsub.v1.DeleteTopicRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.topic = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteTopicRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.pubsub.v1.DeleteTopicRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.pubsub.v1.DeleteTopicRequest} DeleteTopicRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteTopicRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteTopicRequest message. - * @function verify - * @memberof google.pubsub.v1.DeleteTopicRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteTopicRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.topic != null && message.hasOwnProperty("topic")) - if (!$util.isString(message.topic)) - return "topic: string expected"; - return null; - }; - - /** - * Creates a DeleteTopicRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.pubsub.v1.DeleteTopicRequest - * @static - * @param {Object.} object Plain object - * @returns {google.pubsub.v1.DeleteTopicRequest} DeleteTopicRequest - */ - DeleteTopicRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.pubsub.v1.DeleteTopicRequest) - return object; - var message = new $root.google.pubsub.v1.DeleteTopicRequest(); - if (object.topic != null) - message.topic = String(object.topic); - return message; - }; - - /** - * Creates a plain object from a DeleteTopicRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.pubsub.v1.DeleteTopicRequest - * @static - * @param {google.pubsub.v1.DeleteTopicRequest} message DeleteTopicRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteTopicRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.topic = ""; - if (message.topic != null && message.hasOwnProperty("topic")) - object.topic = message.topic; - return object; - }; - - /** - * Converts this DeleteTopicRequest to JSON. - * @function toJSON - * @memberof google.pubsub.v1.DeleteTopicRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteTopicRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteTopicRequest - * @function getTypeUrl - * @memberof google.pubsub.v1.DeleteTopicRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteTopicRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.pubsub.v1.DeleteTopicRequest"; - }; - - return DeleteTopicRequest; - })(); - - v1.DetachSubscriptionRequest = (function() { - - /** - * Properties of a DetachSubscriptionRequest. - * @memberof google.pubsub.v1 - * @interface IDetachSubscriptionRequest - * @property {string|null} [subscription] DetachSubscriptionRequest subscription - */ - - /** - * Constructs a new DetachSubscriptionRequest. - * @memberof google.pubsub.v1 - * @classdesc Represents a DetachSubscriptionRequest. - * @implements IDetachSubscriptionRequest - * @constructor - * @param {google.pubsub.v1.IDetachSubscriptionRequest=} [properties] Properties to set - */ - function DetachSubscriptionRequest(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]]; - } - - /** - * DetachSubscriptionRequest subscription. - * @member {string} subscription - * @memberof google.pubsub.v1.DetachSubscriptionRequest - * @instance - */ - DetachSubscriptionRequest.prototype.subscription = ""; - - /** - * Creates a new DetachSubscriptionRequest instance using the specified properties. - * @function create - * @memberof google.pubsub.v1.DetachSubscriptionRequest - * @static - * @param {google.pubsub.v1.IDetachSubscriptionRequest=} [properties] Properties to set - * @returns {google.pubsub.v1.DetachSubscriptionRequest} DetachSubscriptionRequest instance - */ - DetachSubscriptionRequest.create = function create(properties) { - return new DetachSubscriptionRequest(properties); - }; - - /** - * Encodes the specified DetachSubscriptionRequest message. Does not implicitly {@link google.pubsub.v1.DetachSubscriptionRequest.verify|verify} messages. - * @function encode - * @memberof google.pubsub.v1.DetachSubscriptionRequest - * @static - * @param {google.pubsub.v1.IDetachSubscriptionRequest} message DetachSubscriptionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DetachSubscriptionRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.subscription != null && Object.hasOwnProperty.call(message, "subscription")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.subscription); - return writer; - }; - - /** - * Encodes the specified DetachSubscriptionRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.DetachSubscriptionRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.pubsub.v1.DetachSubscriptionRequest - * @static - * @param {google.pubsub.v1.IDetachSubscriptionRequest} message DetachSubscriptionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DetachSubscriptionRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DetachSubscriptionRequest message from the specified reader or buffer. - * @function decode - * @memberof google.pubsub.v1.DetachSubscriptionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.pubsub.v1.DetachSubscriptionRequest} DetachSubscriptionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DetachSubscriptionRequest.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.pubsub.v1.DetachSubscriptionRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.subscription = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DetachSubscriptionRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.pubsub.v1.DetachSubscriptionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.pubsub.v1.DetachSubscriptionRequest} DetachSubscriptionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DetachSubscriptionRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DetachSubscriptionRequest message. - * @function verify - * @memberof google.pubsub.v1.DetachSubscriptionRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DetachSubscriptionRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.subscription != null && message.hasOwnProperty("subscription")) - if (!$util.isString(message.subscription)) - return "subscription: string expected"; - return null; - }; - - /** - * Creates a DetachSubscriptionRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.pubsub.v1.DetachSubscriptionRequest - * @static - * @param {Object.} object Plain object - * @returns {google.pubsub.v1.DetachSubscriptionRequest} DetachSubscriptionRequest - */ - DetachSubscriptionRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.pubsub.v1.DetachSubscriptionRequest) - return object; - var message = new $root.google.pubsub.v1.DetachSubscriptionRequest(); - if (object.subscription != null) - message.subscription = String(object.subscription); - return message; - }; - - /** - * Creates a plain object from a DetachSubscriptionRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.pubsub.v1.DetachSubscriptionRequest - * @static - * @param {google.pubsub.v1.DetachSubscriptionRequest} message DetachSubscriptionRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DetachSubscriptionRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.subscription = ""; - if (message.subscription != null && message.hasOwnProperty("subscription")) - object.subscription = message.subscription; - return object; - }; - - /** - * Converts this DetachSubscriptionRequest to JSON. - * @function toJSON - * @memberof google.pubsub.v1.DetachSubscriptionRequest - * @instance - * @returns {Object.} JSON object - */ - DetachSubscriptionRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DetachSubscriptionRequest - * @function getTypeUrl - * @memberof google.pubsub.v1.DetachSubscriptionRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DetachSubscriptionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.pubsub.v1.DetachSubscriptionRequest"; - }; - - return DetachSubscriptionRequest; - })(); - - v1.DetachSubscriptionResponse = (function() { - - /** - * Properties of a DetachSubscriptionResponse. - * @memberof google.pubsub.v1 - * @interface IDetachSubscriptionResponse - */ - - /** - * Constructs a new DetachSubscriptionResponse. - * @memberof google.pubsub.v1 - * @classdesc Represents a DetachSubscriptionResponse. - * @implements IDetachSubscriptionResponse - * @constructor - * @param {google.pubsub.v1.IDetachSubscriptionResponse=} [properties] Properties to set - */ - function DetachSubscriptionResponse(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 DetachSubscriptionResponse instance using the specified properties. - * @function create - * @memberof google.pubsub.v1.DetachSubscriptionResponse - * @static - * @param {google.pubsub.v1.IDetachSubscriptionResponse=} [properties] Properties to set - * @returns {google.pubsub.v1.DetachSubscriptionResponse} DetachSubscriptionResponse instance - */ - DetachSubscriptionResponse.create = function create(properties) { - return new DetachSubscriptionResponse(properties); - }; - - /** - * Encodes the specified DetachSubscriptionResponse message. Does not implicitly {@link google.pubsub.v1.DetachSubscriptionResponse.verify|verify} messages. - * @function encode - * @memberof google.pubsub.v1.DetachSubscriptionResponse - * @static - * @param {google.pubsub.v1.IDetachSubscriptionResponse} message DetachSubscriptionResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DetachSubscriptionResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified DetachSubscriptionResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.DetachSubscriptionResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.pubsub.v1.DetachSubscriptionResponse - * @static - * @param {google.pubsub.v1.IDetachSubscriptionResponse} message DetachSubscriptionResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DetachSubscriptionResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DetachSubscriptionResponse message from the specified reader or buffer. - * @function decode - * @memberof google.pubsub.v1.DetachSubscriptionResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.pubsub.v1.DetachSubscriptionResponse} DetachSubscriptionResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DetachSubscriptionResponse.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.pubsub.v1.DetachSubscriptionResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DetachSubscriptionResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.pubsub.v1.DetachSubscriptionResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.pubsub.v1.DetachSubscriptionResponse} DetachSubscriptionResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DetachSubscriptionResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DetachSubscriptionResponse message. - * @function verify - * @memberof google.pubsub.v1.DetachSubscriptionResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DetachSubscriptionResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a DetachSubscriptionResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.pubsub.v1.DetachSubscriptionResponse - * @static - * @param {Object.} object Plain object - * @returns {google.pubsub.v1.DetachSubscriptionResponse} DetachSubscriptionResponse - */ - DetachSubscriptionResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.pubsub.v1.DetachSubscriptionResponse) - return object; - return new $root.google.pubsub.v1.DetachSubscriptionResponse(); - }; - - /** - * Creates a plain object from a DetachSubscriptionResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.pubsub.v1.DetachSubscriptionResponse - * @static - * @param {google.pubsub.v1.DetachSubscriptionResponse} message DetachSubscriptionResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DetachSubscriptionResponse.toObject = function toObject() { - return {}; - }; - - /** - * Converts this DetachSubscriptionResponse to JSON. - * @function toJSON - * @memberof google.pubsub.v1.DetachSubscriptionResponse - * @instance - * @returns {Object.} JSON object - */ - DetachSubscriptionResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DetachSubscriptionResponse - * @function getTypeUrl - * @memberof google.pubsub.v1.DetachSubscriptionResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DetachSubscriptionResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.pubsub.v1.DetachSubscriptionResponse"; - }; - - return DetachSubscriptionResponse; - })(); - - v1.Subscriber = (function() { - - /** - * Constructs a new Subscriber service. - * @memberof google.pubsub.v1 - * @classdesc Represents a Subscriber - * @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 Subscriber(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (Subscriber.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Subscriber; - - /** - * Creates new Subscriber service using the specified rpc implementation. - * @function create - * @memberof google.pubsub.v1.Subscriber - * @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 {Subscriber} RPC service. Useful where requests and/or responses are streamed. - */ - Subscriber.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.pubsub.v1.Subscriber|createSubscription}. - * @memberof google.pubsub.v1.Subscriber - * @typedef CreateSubscriptionCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.pubsub.v1.Subscription} [response] Subscription - */ - - /** - * Calls CreateSubscription. - * @function createSubscription - * @memberof google.pubsub.v1.Subscriber - * @instance - * @param {google.pubsub.v1.ISubscription} request Subscription message or plain object - * @param {google.pubsub.v1.Subscriber.CreateSubscriptionCallback} callback Node-style callback called with the error, if any, and Subscription - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Subscriber.prototype.createSubscription = function createSubscription(request, callback) { - return this.rpcCall(createSubscription, $root.google.pubsub.v1.Subscription, $root.google.pubsub.v1.Subscription, request, callback); - }, "name", { value: "CreateSubscription" }); - - /** - * Calls CreateSubscription. - * @function createSubscription - * @memberof google.pubsub.v1.Subscriber - * @instance - * @param {google.pubsub.v1.ISubscription} request Subscription message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.pubsub.v1.Subscriber|getSubscription}. - * @memberof google.pubsub.v1.Subscriber - * @typedef GetSubscriptionCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.pubsub.v1.Subscription} [response] Subscription - */ - - /** - * Calls GetSubscription. - * @function getSubscription - * @memberof google.pubsub.v1.Subscriber - * @instance - * @param {google.pubsub.v1.IGetSubscriptionRequest} request GetSubscriptionRequest message or plain object - * @param {google.pubsub.v1.Subscriber.GetSubscriptionCallback} callback Node-style callback called with the error, if any, and Subscription - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Subscriber.prototype.getSubscription = function getSubscription(request, callback) { - return this.rpcCall(getSubscription, $root.google.pubsub.v1.GetSubscriptionRequest, $root.google.pubsub.v1.Subscription, request, callback); - }, "name", { value: "GetSubscription" }); - - /** - * Calls GetSubscription. - * @function getSubscription - * @memberof google.pubsub.v1.Subscriber - * @instance - * @param {google.pubsub.v1.IGetSubscriptionRequest} request GetSubscriptionRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.pubsub.v1.Subscriber|updateSubscription}. - * @memberof google.pubsub.v1.Subscriber - * @typedef UpdateSubscriptionCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.pubsub.v1.Subscription} [response] Subscription - */ - - /** - * Calls UpdateSubscription. - * @function updateSubscription - * @memberof google.pubsub.v1.Subscriber - * @instance - * @param {google.pubsub.v1.IUpdateSubscriptionRequest} request UpdateSubscriptionRequest message or plain object - * @param {google.pubsub.v1.Subscriber.UpdateSubscriptionCallback} callback Node-style callback called with the error, if any, and Subscription - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Subscriber.prototype.updateSubscription = function updateSubscription(request, callback) { - return this.rpcCall(updateSubscription, $root.google.pubsub.v1.UpdateSubscriptionRequest, $root.google.pubsub.v1.Subscription, request, callback); - }, "name", { value: "UpdateSubscription" }); - - /** - * Calls UpdateSubscription. - * @function updateSubscription - * @memberof google.pubsub.v1.Subscriber - * @instance - * @param {google.pubsub.v1.IUpdateSubscriptionRequest} request UpdateSubscriptionRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.pubsub.v1.Subscriber|listSubscriptions}. - * @memberof google.pubsub.v1.Subscriber - * @typedef ListSubscriptionsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.pubsub.v1.ListSubscriptionsResponse} [response] ListSubscriptionsResponse - */ - - /** - * Calls ListSubscriptions. - * @function listSubscriptions - * @memberof google.pubsub.v1.Subscriber - * @instance - * @param {google.pubsub.v1.IListSubscriptionsRequest} request ListSubscriptionsRequest message or plain object - * @param {google.pubsub.v1.Subscriber.ListSubscriptionsCallback} callback Node-style callback called with the error, if any, and ListSubscriptionsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Subscriber.prototype.listSubscriptions = function listSubscriptions(request, callback) { - return this.rpcCall(listSubscriptions, $root.google.pubsub.v1.ListSubscriptionsRequest, $root.google.pubsub.v1.ListSubscriptionsResponse, request, callback); - }, "name", { value: "ListSubscriptions" }); - - /** - * Calls ListSubscriptions. - * @function listSubscriptions - * @memberof google.pubsub.v1.Subscriber - * @instance - * @param {google.pubsub.v1.IListSubscriptionsRequest} request ListSubscriptionsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.pubsub.v1.Subscriber|deleteSubscription}. - * @memberof google.pubsub.v1.Subscriber - * @typedef DeleteSubscriptionCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls DeleteSubscription. - * @function deleteSubscription - * @memberof google.pubsub.v1.Subscriber - * @instance - * @param {google.pubsub.v1.IDeleteSubscriptionRequest} request DeleteSubscriptionRequest message or plain object - * @param {google.pubsub.v1.Subscriber.DeleteSubscriptionCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Subscriber.prototype.deleteSubscription = function deleteSubscription(request, callback) { - return this.rpcCall(deleteSubscription, $root.google.pubsub.v1.DeleteSubscriptionRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteSubscription" }); - - /** - * Calls DeleteSubscription. - * @function deleteSubscription - * @memberof google.pubsub.v1.Subscriber - * @instance - * @param {google.pubsub.v1.IDeleteSubscriptionRequest} request DeleteSubscriptionRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.pubsub.v1.Subscriber|modifyAckDeadline}. - * @memberof google.pubsub.v1.Subscriber - * @typedef ModifyAckDeadlineCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls ModifyAckDeadline. - * @function modifyAckDeadline - * @memberof google.pubsub.v1.Subscriber - * @instance - * @param {google.pubsub.v1.IModifyAckDeadlineRequest} request ModifyAckDeadlineRequest message or plain object - * @param {google.pubsub.v1.Subscriber.ModifyAckDeadlineCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Subscriber.prototype.modifyAckDeadline = function modifyAckDeadline(request, callback) { - return this.rpcCall(modifyAckDeadline, $root.google.pubsub.v1.ModifyAckDeadlineRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "ModifyAckDeadline" }); - - /** - * Calls ModifyAckDeadline. - * @function modifyAckDeadline - * @memberof google.pubsub.v1.Subscriber - * @instance - * @param {google.pubsub.v1.IModifyAckDeadlineRequest} request ModifyAckDeadlineRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.pubsub.v1.Subscriber|acknowledge}. - * @memberof google.pubsub.v1.Subscriber - * @typedef AcknowledgeCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls Acknowledge. - * @function acknowledge - * @memberof google.pubsub.v1.Subscriber - * @instance - * @param {google.pubsub.v1.IAcknowledgeRequest} request AcknowledgeRequest message or plain object - * @param {google.pubsub.v1.Subscriber.AcknowledgeCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Subscriber.prototype.acknowledge = function acknowledge(request, callback) { - return this.rpcCall(acknowledge, $root.google.pubsub.v1.AcknowledgeRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "Acknowledge" }); - - /** - * Calls Acknowledge. - * @function acknowledge - * @memberof google.pubsub.v1.Subscriber - * @instance - * @param {google.pubsub.v1.IAcknowledgeRequest} request AcknowledgeRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.pubsub.v1.Subscriber|pull}. - * @memberof google.pubsub.v1.Subscriber - * @typedef PullCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.pubsub.v1.PullResponse} [response] PullResponse - */ - - /** - * Calls Pull. - * @function pull - * @memberof google.pubsub.v1.Subscriber - * @instance - * @param {google.pubsub.v1.IPullRequest} request PullRequest message or plain object - * @param {google.pubsub.v1.Subscriber.PullCallback} callback Node-style callback called with the error, if any, and PullResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Subscriber.prototype.pull = function pull(request, callback) { - return this.rpcCall(pull, $root.google.pubsub.v1.PullRequest, $root.google.pubsub.v1.PullResponse, request, callback); - }, "name", { value: "Pull" }); - - /** - * Calls Pull. - * @function pull - * @memberof google.pubsub.v1.Subscriber - * @instance - * @param {google.pubsub.v1.IPullRequest} request PullRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.pubsub.v1.Subscriber|streamingPull}. - * @memberof google.pubsub.v1.Subscriber - * @typedef StreamingPullCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.pubsub.v1.StreamingPullResponse} [response] StreamingPullResponse - */ - - /** - * Calls StreamingPull. - * @function streamingPull - * @memberof google.pubsub.v1.Subscriber - * @instance - * @param {google.pubsub.v1.IStreamingPullRequest} request StreamingPullRequest message or plain object - * @param {google.pubsub.v1.Subscriber.StreamingPullCallback} callback Node-style callback called with the error, if any, and StreamingPullResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Subscriber.prototype.streamingPull = function streamingPull(request, callback) { - return this.rpcCall(streamingPull, $root.google.pubsub.v1.StreamingPullRequest, $root.google.pubsub.v1.StreamingPullResponse, request, callback); - }, "name", { value: "StreamingPull" }); - - /** - * Calls StreamingPull. - * @function streamingPull - * @memberof google.pubsub.v1.Subscriber - * @instance - * @param {google.pubsub.v1.IStreamingPullRequest} request StreamingPullRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.pubsub.v1.Subscriber|modifyPushConfig}. - * @memberof google.pubsub.v1.Subscriber - * @typedef ModifyPushConfigCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls ModifyPushConfig. - * @function modifyPushConfig - * @memberof google.pubsub.v1.Subscriber - * @instance - * @param {google.pubsub.v1.IModifyPushConfigRequest} request ModifyPushConfigRequest message or plain object - * @param {google.pubsub.v1.Subscriber.ModifyPushConfigCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Subscriber.prototype.modifyPushConfig = function modifyPushConfig(request, callback) { - return this.rpcCall(modifyPushConfig, $root.google.pubsub.v1.ModifyPushConfigRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "ModifyPushConfig" }); - - /** - * Calls ModifyPushConfig. - * @function modifyPushConfig - * @memberof google.pubsub.v1.Subscriber - * @instance - * @param {google.pubsub.v1.IModifyPushConfigRequest} request ModifyPushConfigRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.pubsub.v1.Subscriber|getSnapshot}. - * @memberof google.pubsub.v1.Subscriber - * @typedef GetSnapshotCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.pubsub.v1.Snapshot} [response] Snapshot - */ - - /** - * Calls GetSnapshot. - * @function getSnapshot - * @memberof google.pubsub.v1.Subscriber - * @instance - * @param {google.pubsub.v1.IGetSnapshotRequest} request GetSnapshotRequest message or plain object - * @param {google.pubsub.v1.Subscriber.GetSnapshotCallback} callback Node-style callback called with the error, if any, and Snapshot - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Subscriber.prototype.getSnapshot = function getSnapshot(request, callback) { - return this.rpcCall(getSnapshot, $root.google.pubsub.v1.GetSnapshotRequest, $root.google.pubsub.v1.Snapshot, request, callback); - }, "name", { value: "GetSnapshot" }); - - /** - * Calls GetSnapshot. - * @function getSnapshot - * @memberof google.pubsub.v1.Subscriber - * @instance - * @param {google.pubsub.v1.IGetSnapshotRequest} request GetSnapshotRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.pubsub.v1.Subscriber|listSnapshots}. - * @memberof google.pubsub.v1.Subscriber - * @typedef ListSnapshotsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.pubsub.v1.ListSnapshotsResponse} [response] ListSnapshotsResponse - */ - - /** - * Calls ListSnapshots. - * @function listSnapshots - * @memberof google.pubsub.v1.Subscriber - * @instance - * @param {google.pubsub.v1.IListSnapshotsRequest} request ListSnapshotsRequest message or plain object - * @param {google.pubsub.v1.Subscriber.ListSnapshotsCallback} callback Node-style callback called with the error, if any, and ListSnapshotsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Subscriber.prototype.listSnapshots = function listSnapshots(request, callback) { - return this.rpcCall(listSnapshots, $root.google.pubsub.v1.ListSnapshotsRequest, $root.google.pubsub.v1.ListSnapshotsResponse, request, callback); - }, "name", { value: "ListSnapshots" }); - - /** - * Calls ListSnapshots. - * @function listSnapshots - * @memberof google.pubsub.v1.Subscriber - * @instance - * @param {google.pubsub.v1.IListSnapshotsRequest} request ListSnapshotsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.pubsub.v1.Subscriber|createSnapshot}. - * @memberof google.pubsub.v1.Subscriber - * @typedef CreateSnapshotCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.pubsub.v1.Snapshot} [response] Snapshot - */ - - /** - * Calls CreateSnapshot. - * @function createSnapshot - * @memberof google.pubsub.v1.Subscriber - * @instance - * @param {google.pubsub.v1.ICreateSnapshotRequest} request CreateSnapshotRequest message or plain object - * @param {google.pubsub.v1.Subscriber.CreateSnapshotCallback} callback Node-style callback called with the error, if any, and Snapshot - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Subscriber.prototype.createSnapshot = function createSnapshot(request, callback) { - return this.rpcCall(createSnapshot, $root.google.pubsub.v1.CreateSnapshotRequest, $root.google.pubsub.v1.Snapshot, request, callback); - }, "name", { value: "CreateSnapshot" }); - - /** - * Calls CreateSnapshot. - * @function createSnapshot - * @memberof google.pubsub.v1.Subscriber - * @instance - * @param {google.pubsub.v1.ICreateSnapshotRequest} request CreateSnapshotRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.pubsub.v1.Subscriber|updateSnapshot}. - * @memberof google.pubsub.v1.Subscriber - * @typedef UpdateSnapshotCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.pubsub.v1.Snapshot} [response] Snapshot - */ - - /** - * Calls UpdateSnapshot. - * @function updateSnapshot - * @memberof google.pubsub.v1.Subscriber - * @instance - * @param {google.pubsub.v1.IUpdateSnapshotRequest} request UpdateSnapshotRequest message or plain object - * @param {google.pubsub.v1.Subscriber.UpdateSnapshotCallback} callback Node-style callback called with the error, if any, and Snapshot - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Subscriber.prototype.updateSnapshot = function updateSnapshot(request, callback) { - return this.rpcCall(updateSnapshot, $root.google.pubsub.v1.UpdateSnapshotRequest, $root.google.pubsub.v1.Snapshot, request, callback); - }, "name", { value: "UpdateSnapshot" }); - - /** - * Calls UpdateSnapshot. - * @function updateSnapshot - * @memberof google.pubsub.v1.Subscriber - * @instance - * @param {google.pubsub.v1.IUpdateSnapshotRequest} request UpdateSnapshotRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.pubsub.v1.Subscriber|deleteSnapshot}. - * @memberof google.pubsub.v1.Subscriber - * @typedef DeleteSnapshotCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls DeleteSnapshot. - * @function deleteSnapshot - * @memberof google.pubsub.v1.Subscriber - * @instance - * @param {google.pubsub.v1.IDeleteSnapshotRequest} request DeleteSnapshotRequest message or plain object - * @param {google.pubsub.v1.Subscriber.DeleteSnapshotCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Subscriber.prototype.deleteSnapshot = function deleteSnapshot(request, callback) { - return this.rpcCall(deleteSnapshot, $root.google.pubsub.v1.DeleteSnapshotRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteSnapshot" }); - - /** - * Calls DeleteSnapshot. - * @function deleteSnapshot - * @memberof google.pubsub.v1.Subscriber - * @instance - * @param {google.pubsub.v1.IDeleteSnapshotRequest} request DeleteSnapshotRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.pubsub.v1.Subscriber|seek}. - * @memberof google.pubsub.v1.Subscriber - * @typedef SeekCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.pubsub.v1.SeekResponse} [response] SeekResponse - */ - - /** - * Calls Seek. - * @function seek - * @memberof google.pubsub.v1.Subscriber - * @instance - * @param {google.pubsub.v1.ISeekRequest} request SeekRequest message or plain object - * @param {google.pubsub.v1.Subscriber.SeekCallback} callback Node-style callback called with the error, if any, and SeekResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Subscriber.prototype.seek = function seek(request, callback) { - return this.rpcCall(seek, $root.google.pubsub.v1.SeekRequest, $root.google.pubsub.v1.SeekResponse, request, callback); - }, "name", { value: "Seek" }); - - /** - * Calls Seek. - * @function seek - * @memberof google.pubsub.v1.Subscriber - * @instance - * @param {google.pubsub.v1.ISeekRequest} request SeekRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return Subscriber; - })(); - - v1.Subscription = (function() { - - /** - * Properties of a Subscription. - * @memberof google.pubsub.v1 - * @interface ISubscription - * @property {string|null} [name] Subscription name - * @property {string|null} [topic] Subscription topic - * @property {google.pubsub.v1.IPushConfig|null} [pushConfig] Subscription pushConfig - * @property {google.pubsub.v1.IBigQueryConfig|null} [bigqueryConfig] Subscription bigqueryConfig - * @property {google.pubsub.v1.ICloudStorageConfig|null} [cloudStorageConfig] Subscription cloudStorageConfig - * @property {number|null} [ackDeadlineSeconds] Subscription ackDeadlineSeconds - * @property {boolean|null} [retainAckedMessages] Subscription retainAckedMessages - * @property {google.protobuf.IDuration|null} [messageRetentionDuration] Subscription messageRetentionDuration - * @property {Object.|null} [labels] Subscription labels - * @property {boolean|null} [enableMessageOrdering] Subscription enableMessageOrdering - * @property {google.pubsub.v1.IExpirationPolicy|null} [expirationPolicy] Subscription expirationPolicy - * @property {string|null} [filter] Subscription filter - * @property {google.pubsub.v1.IDeadLetterPolicy|null} [deadLetterPolicy] Subscription deadLetterPolicy - * @property {google.pubsub.v1.IRetryPolicy|null} [retryPolicy] Subscription retryPolicy - * @property {boolean|null} [detached] Subscription detached - * @property {boolean|null} [enableExactlyOnceDelivery] Subscription enableExactlyOnceDelivery - * @property {google.protobuf.IDuration|null} [topicMessageRetentionDuration] Subscription topicMessageRetentionDuration - * @property {google.pubsub.v1.Subscription.State|null} [state] Subscription state - */ - - /** - * Constructs a new Subscription. - * @memberof google.pubsub.v1 - * @classdesc Represents a Subscription. - * @implements ISubscription - * @constructor - * @param {google.pubsub.v1.ISubscription=} [properties] Properties to set - */ - function Subscription(properties) { - this.labels = {}; - 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]]; - } - - /** - * Subscription name. - * @member {string} name - * @memberof google.pubsub.v1.Subscription - * @instance - */ - Subscription.prototype.name = ""; - - /** - * Subscription topic. - * @member {string} topic - * @memberof google.pubsub.v1.Subscription - * @instance - */ - Subscription.prototype.topic = ""; - - /** - * Subscription pushConfig. - * @member {google.pubsub.v1.IPushConfig|null|undefined} pushConfig - * @memberof google.pubsub.v1.Subscription - * @instance - */ - Subscription.prototype.pushConfig = null; - - /** - * Subscription bigqueryConfig. - * @member {google.pubsub.v1.IBigQueryConfig|null|undefined} bigqueryConfig - * @memberof google.pubsub.v1.Subscription - * @instance - */ - Subscription.prototype.bigqueryConfig = null; - - /** - * Subscription cloudStorageConfig. - * @member {google.pubsub.v1.ICloudStorageConfig|null|undefined} cloudStorageConfig - * @memberof google.pubsub.v1.Subscription - * @instance - */ - Subscription.prototype.cloudStorageConfig = null; - - /** - * Subscription ackDeadlineSeconds. - * @member {number} ackDeadlineSeconds - * @memberof google.pubsub.v1.Subscription - * @instance - */ - Subscription.prototype.ackDeadlineSeconds = 0; - - /** - * Subscription retainAckedMessages. - * @member {boolean} retainAckedMessages - * @memberof google.pubsub.v1.Subscription - * @instance - */ - Subscription.prototype.retainAckedMessages = false; - - /** - * Subscription messageRetentionDuration. - * @member {google.protobuf.IDuration|null|undefined} messageRetentionDuration - * @memberof google.pubsub.v1.Subscription - * @instance - */ - Subscription.prototype.messageRetentionDuration = null; - - /** - * Subscription labels. - * @member {Object.} labels - * @memberof google.pubsub.v1.Subscription - * @instance - */ - Subscription.prototype.labels = $util.emptyObject; - - /** - * Subscription enableMessageOrdering. - * @member {boolean} enableMessageOrdering - * @memberof google.pubsub.v1.Subscription - * @instance - */ - Subscription.prototype.enableMessageOrdering = false; - - /** - * Subscription expirationPolicy. - * @member {google.pubsub.v1.IExpirationPolicy|null|undefined} expirationPolicy - * @memberof google.pubsub.v1.Subscription - * @instance - */ - Subscription.prototype.expirationPolicy = null; - - /** - * Subscription filter. - * @member {string} filter - * @memberof google.pubsub.v1.Subscription - * @instance - */ - Subscription.prototype.filter = ""; - - /** - * Subscription deadLetterPolicy. - * @member {google.pubsub.v1.IDeadLetterPolicy|null|undefined} deadLetterPolicy - * @memberof google.pubsub.v1.Subscription - * @instance - */ - Subscription.prototype.deadLetterPolicy = null; - - /** - * Subscription retryPolicy. - * @member {google.pubsub.v1.IRetryPolicy|null|undefined} retryPolicy - * @memberof google.pubsub.v1.Subscription - * @instance - */ - Subscription.prototype.retryPolicy = null; - - /** - * Subscription detached. - * @member {boolean} detached - * @memberof google.pubsub.v1.Subscription - * @instance - */ - Subscription.prototype.detached = false; - - /** - * Subscription enableExactlyOnceDelivery. - * @member {boolean} enableExactlyOnceDelivery - * @memberof google.pubsub.v1.Subscription - * @instance - */ - Subscription.prototype.enableExactlyOnceDelivery = false; - - /** - * Subscription topicMessageRetentionDuration. - * @member {google.protobuf.IDuration|null|undefined} topicMessageRetentionDuration - * @memberof google.pubsub.v1.Subscription - * @instance - */ - Subscription.prototype.topicMessageRetentionDuration = null; - - /** - * Subscription state. - * @member {google.pubsub.v1.Subscription.State} state - * @memberof google.pubsub.v1.Subscription - * @instance - */ - Subscription.prototype.state = 0; - - /** - * Creates a new Subscription instance using the specified properties. - * @function create - * @memberof google.pubsub.v1.Subscription - * @static - * @param {google.pubsub.v1.ISubscription=} [properties] Properties to set - * @returns {google.pubsub.v1.Subscription} Subscription instance - */ - Subscription.create = function create(properties) { - return new Subscription(properties); - }; - - /** - * Encodes the specified Subscription message. Does not implicitly {@link google.pubsub.v1.Subscription.verify|verify} messages. - * @function encode - * @memberof google.pubsub.v1.Subscription - * @static - * @param {google.pubsub.v1.ISubscription} message Subscription message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Subscription.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.topic != null && Object.hasOwnProperty.call(message, "topic")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.topic); - if (message.pushConfig != null && Object.hasOwnProperty.call(message, "pushConfig")) - $root.google.pubsub.v1.PushConfig.encode(message.pushConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.ackDeadlineSeconds != null && Object.hasOwnProperty.call(message, "ackDeadlineSeconds")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.ackDeadlineSeconds); - if (message.retainAckedMessages != null && Object.hasOwnProperty.call(message, "retainAckedMessages")) - writer.uint32(/* id 7, wireType 0 =*/56).bool(message.retainAckedMessages); - if (message.messageRetentionDuration != null && Object.hasOwnProperty.call(message, "messageRetentionDuration")) - $root.google.protobuf.Duration.encode(message.messageRetentionDuration, writer.uint32(/* id 8, wireType 2 =*/66).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 9, wireType 2 =*/74).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); - if (message.enableMessageOrdering != null && Object.hasOwnProperty.call(message, "enableMessageOrdering")) - writer.uint32(/* id 10, wireType 0 =*/80).bool(message.enableMessageOrdering); - if (message.expirationPolicy != null && Object.hasOwnProperty.call(message, "expirationPolicy")) - $root.google.pubsub.v1.ExpirationPolicy.encode(message.expirationPolicy, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.filter); - if (message.deadLetterPolicy != null && Object.hasOwnProperty.call(message, "deadLetterPolicy")) - $root.google.pubsub.v1.DeadLetterPolicy.encode(message.deadLetterPolicy, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); - if (message.retryPolicy != null && Object.hasOwnProperty.call(message, "retryPolicy")) - $root.google.pubsub.v1.RetryPolicy.encode(message.retryPolicy, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); - if (message.detached != null && Object.hasOwnProperty.call(message, "detached")) - writer.uint32(/* id 15, wireType 0 =*/120).bool(message.detached); - if (message.enableExactlyOnceDelivery != null && Object.hasOwnProperty.call(message, "enableExactlyOnceDelivery")) - writer.uint32(/* id 16, wireType 0 =*/128).bool(message.enableExactlyOnceDelivery); - if (message.topicMessageRetentionDuration != null && Object.hasOwnProperty.call(message, "topicMessageRetentionDuration")) - $root.google.protobuf.Duration.encode(message.topicMessageRetentionDuration, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); - if (message.bigqueryConfig != null && Object.hasOwnProperty.call(message, "bigqueryConfig")) - $root.google.pubsub.v1.BigQueryConfig.encode(message.bigqueryConfig, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 19, wireType 0 =*/152).int32(message.state); - if (message.cloudStorageConfig != null && Object.hasOwnProperty.call(message, "cloudStorageConfig")) - $root.google.pubsub.v1.CloudStorageConfig.encode(message.cloudStorageConfig, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Subscription message, length delimited. Does not implicitly {@link google.pubsub.v1.Subscription.verify|verify} messages. - * @function encodeDelimited - * @memberof google.pubsub.v1.Subscription - * @static - * @param {google.pubsub.v1.ISubscription} message Subscription message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Subscription.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Subscription message from the specified reader or buffer. - * @function decode - * @memberof google.pubsub.v1.Subscription - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.pubsub.v1.Subscription} Subscription - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Subscription.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.pubsub.v1.Subscription(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.topic = reader.string(); - break; - } - case 4: { - message.pushConfig = $root.google.pubsub.v1.PushConfig.decode(reader, reader.uint32()); - break; - } - case 18: { - message.bigqueryConfig = $root.google.pubsub.v1.BigQueryConfig.decode(reader, reader.uint32()); - break; - } - case 22: { - message.cloudStorageConfig = $root.google.pubsub.v1.CloudStorageConfig.decode(reader, reader.uint32()); - break; - } - case 5: { - message.ackDeadlineSeconds = reader.int32(); - break; - } - case 7: { - message.retainAckedMessages = reader.bool(); - break; - } - case 8: { - message.messageRetentionDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 9: { - 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; - } - case 10: { - message.enableMessageOrdering = reader.bool(); - break; - } - case 11: { - message.expirationPolicy = $root.google.pubsub.v1.ExpirationPolicy.decode(reader, reader.uint32()); - break; - } - case 12: { - message.filter = reader.string(); - break; - } - case 13: { - message.deadLetterPolicy = $root.google.pubsub.v1.DeadLetterPolicy.decode(reader, reader.uint32()); - break; - } - case 14: { - message.retryPolicy = $root.google.pubsub.v1.RetryPolicy.decode(reader, reader.uint32()); - break; - } - case 15: { - message.detached = reader.bool(); - break; - } - case 16: { - message.enableExactlyOnceDelivery = reader.bool(); - break; - } - case 17: { - message.topicMessageRetentionDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 19: { - message.state = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Subscription message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.pubsub.v1.Subscription - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.pubsub.v1.Subscription} Subscription - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Subscription.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Subscription message. - * @function verify - * @memberof google.pubsub.v1.Subscription - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Subscription.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.topic != null && message.hasOwnProperty("topic")) - if (!$util.isString(message.topic)) - return "topic: string expected"; - if (message.pushConfig != null && message.hasOwnProperty("pushConfig")) { - var error = $root.google.pubsub.v1.PushConfig.verify(message.pushConfig); - if (error) - return "pushConfig." + error; - } - if (message.bigqueryConfig != null && message.hasOwnProperty("bigqueryConfig")) { - var error = $root.google.pubsub.v1.BigQueryConfig.verify(message.bigqueryConfig); - if (error) - return "bigqueryConfig." + error; - } - if (message.cloudStorageConfig != null && message.hasOwnProperty("cloudStorageConfig")) { - var error = $root.google.pubsub.v1.CloudStorageConfig.verify(message.cloudStorageConfig); - if (error) - return "cloudStorageConfig." + error; - } - if (message.ackDeadlineSeconds != null && message.hasOwnProperty("ackDeadlineSeconds")) - if (!$util.isInteger(message.ackDeadlineSeconds)) - return "ackDeadlineSeconds: integer expected"; - if (message.retainAckedMessages != null && message.hasOwnProperty("retainAckedMessages")) - if (typeof message.retainAckedMessages !== "boolean") - return "retainAckedMessages: boolean expected"; - if (message.messageRetentionDuration != null && message.hasOwnProperty("messageRetentionDuration")) { - var error = $root.google.protobuf.Duration.verify(message.messageRetentionDuration); - if (error) - return "messageRetentionDuration." + 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"; - } - if (message.enableMessageOrdering != null && message.hasOwnProperty("enableMessageOrdering")) - if (typeof message.enableMessageOrdering !== "boolean") - return "enableMessageOrdering: boolean expected"; - if (message.expirationPolicy != null && message.hasOwnProperty("expirationPolicy")) { - var error = $root.google.pubsub.v1.ExpirationPolicy.verify(message.expirationPolicy); - if (error) - return "expirationPolicy." + error; - } - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.deadLetterPolicy != null && message.hasOwnProperty("deadLetterPolicy")) { - var error = $root.google.pubsub.v1.DeadLetterPolicy.verify(message.deadLetterPolicy); - if (error) - return "deadLetterPolicy." + error; - } - if (message.retryPolicy != null && message.hasOwnProperty("retryPolicy")) { - var error = $root.google.pubsub.v1.RetryPolicy.verify(message.retryPolicy); - if (error) - return "retryPolicy." + error; - } - if (message.detached != null && message.hasOwnProperty("detached")) - if (typeof message.detached !== "boolean") - return "detached: boolean expected"; - if (message.enableExactlyOnceDelivery != null && message.hasOwnProperty("enableExactlyOnceDelivery")) - if (typeof message.enableExactlyOnceDelivery !== "boolean") - return "enableExactlyOnceDelivery: boolean expected"; - if (message.topicMessageRetentionDuration != null && message.hasOwnProperty("topicMessageRetentionDuration")) { - var error = $root.google.protobuf.Duration.verify(message.topicMessageRetentionDuration); - if (error) - return "topicMessageRetentionDuration." + error; - } - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates a Subscription message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.pubsub.v1.Subscription - * @static - * @param {Object.} object Plain object - * @returns {google.pubsub.v1.Subscription} Subscription - */ - Subscription.fromObject = function fromObject(object) { - if (object instanceof $root.google.pubsub.v1.Subscription) - return object; - var message = new $root.google.pubsub.v1.Subscription(); - if (object.name != null) - message.name = String(object.name); - if (object.topic != null) - message.topic = String(object.topic); - if (object.pushConfig != null) { - if (typeof object.pushConfig !== "object") - throw TypeError(".google.pubsub.v1.Subscription.pushConfig: object expected"); - message.pushConfig = $root.google.pubsub.v1.PushConfig.fromObject(object.pushConfig); - } - if (object.bigqueryConfig != null) { - if (typeof object.bigqueryConfig !== "object") - throw TypeError(".google.pubsub.v1.Subscription.bigqueryConfig: object expected"); - message.bigqueryConfig = $root.google.pubsub.v1.BigQueryConfig.fromObject(object.bigqueryConfig); - } - if (object.cloudStorageConfig != null) { - if (typeof object.cloudStorageConfig !== "object") - throw TypeError(".google.pubsub.v1.Subscription.cloudStorageConfig: object expected"); - message.cloudStorageConfig = $root.google.pubsub.v1.CloudStorageConfig.fromObject(object.cloudStorageConfig); - } - if (object.ackDeadlineSeconds != null) - message.ackDeadlineSeconds = object.ackDeadlineSeconds | 0; - if (object.retainAckedMessages != null) - message.retainAckedMessages = Boolean(object.retainAckedMessages); - if (object.messageRetentionDuration != null) { - if (typeof object.messageRetentionDuration !== "object") - throw TypeError(".google.pubsub.v1.Subscription.messageRetentionDuration: object expected"); - message.messageRetentionDuration = $root.google.protobuf.Duration.fromObject(object.messageRetentionDuration); - } - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.pubsub.v1.Subscription.labels: object expected"); - message.labels = {}; - for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) - message.labels[keys[i]] = String(object.labels[keys[i]]); - } - if (object.enableMessageOrdering != null) - message.enableMessageOrdering = Boolean(object.enableMessageOrdering); - if (object.expirationPolicy != null) { - if (typeof object.expirationPolicy !== "object") - throw TypeError(".google.pubsub.v1.Subscription.expirationPolicy: object expected"); - message.expirationPolicy = $root.google.pubsub.v1.ExpirationPolicy.fromObject(object.expirationPolicy); - } - if (object.filter != null) - message.filter = String(object.filter); - if (object.deadLetterPolicy != null) { - if (typeof object.deadLetterPolicy !== "object") - throw TypeError(".google.pubsub.v1.Subscription.deadLetterPolicy: object expected"); - message.deadLetterPolicy = $root.google.pubsub.v1.DeadLetterPolicy.fromObject(object.deadLetterPolicy); - } - if (object.retryPolicy != null) { - if (typeof object.retryPolicy !== "object") - throw TypeError(".google.pubsub.v1.Subscription.retryPolicy: object expected"); - message.retryPolicy = $root.google.pubsub.v1.RetryPolicy.fromObject(object.retryPolicy); - } - if (object.detached != null) - message.detached = Boolean(object.detached); - if (object.enableExactlyOnceDelivery != null) - message.enableExactlyOnceDelivery = Boolean(object.enableExactlyOnceDelivery); - if (object.topicMessageRetentionDuration != null) { - if (typeof object.topicMessageRetentionDuration !== "object") - throw TypeError(".google.pubsub.v1.Subscription.topicMessageRetentionDuration: object expected"); - message.topicMessageRetentionDuration = $root.google.protobuf.Duration.fromObject(object.topicMessageRetentionDuration); - } - switch (object.state) { - default: - if (typeof object.state === "number") { - message.state = object.state; - break; - } - break; - case "STATE_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "ACTIVE": - case 1: - message.state = 1; - break; - case "RESOURCE_ERROR": - case 2: - message.state = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from a Subscription message. Also converts values to other types if specified. - * @function toObject - * @memberof google.pubsub.v1.Subscription - * @static - * @param {google.pubsub.v1.Subscription} message Subscription - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Subscription.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.labels = {}; - if (options.defaults) { - object.name = ""; - object.topic = ""; - object.pushConfig = null; - object.ackDeadlineSeconds = 0; - object.retainAckedMessages = false; - object.messageRetentionDuration = null; - object.enableMessageOrdering = false; - object.expirationPolicy = null; - object.filter = ""; - object.deadLetterPolicy = null; - object.retryPolicy = null; - object.detached = false; - object.enableExactlyOnceDelivery = false; - object.topicMessageRetentionDuration = null; - object.bigqueryConfig = null; - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.cloudStorageConfig = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.topic != null && message.hasOwnProperty("topic")) - object.topic = message.topic; - if (message.pushConfig != null && message.hasOwnProperty("pushConfig")) - object.pushConfig = $root.google.pubsub.v1.PushConfig.toObject(message.pushConfig, options); - if (message.ackDeadlineSeconds != null && message.hasOwnProperty("ackDeadlineSeconds")) - object.ackDeadlineSeconds = message.ackDeadlineSeconds; - if (message.retainAckedMessages != null && message.hasOwnProperty("retainAckedMessages")) - object.retainAckedMessages = message.retainAckedMessages; - if (message.messageRetentionDuration != null && message.hasOwnProperty("messageRetentionDuration")) - object.messageRetentionDuration = $root.google.protobuf.Duration.toObject(message.messageRetentionDuration, options); - var keys2; - if (message.labels && (keys2 = Object.keys(message.labels)).length) { - object.labels = {}; - for (var j = 0; j < keys2.length; ++j) - object.labels[keys2[j]] = message.labels[keys2[j]]; - } - if (message.enableMessageOrdering != null && message.hasOwnProperty("enableMessageOrdering")) - object.enableMessageOrdering = message.enableMessageOrdering; - if (message.expirationPolicy != null && message.hasOwnProperty("expirationPolicy")) - object.expirationPolicy = $root.google.pubsub.v1.ExpirationPolicy.toObject(message.expirationPolicy, options); - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.deadLetterPolicy != null && message.hasOwnProperty("deadLetterPolicy")) - object.deadLetterPolicy = $root.google.pubsub.v1.DeadLetterPolicy.toObject(message.deadLetterPolicy, options); - if (message.retryPolicy != null && message.hasOwnProperty("retryPolicy")) - object.retryPolicy = $root.google.pubsub.v1.RetryPolicy.toObject(message.retryPolicy, options); - if (message.detached != null && message.hasOwnProperty("detached")) - object.detached = message.detached; - if (message.enableExactlyOnceDelivery != null && message.hasOwnProperty("enableExactlyOnceDelivery")) - object.enableExactlyOnceDelivery = message.enableExactlyOnceDelivery; - if (message.topicMessageRetentionDuration != null && message.hasOwnProperty("topicMessageRetentionDuration")) - object.topicMessageRetentionDuration = $root.google.protobuf.Duration.toObject(message.topicMessageRetentionDuration, options); - if (message.bigqueryConfig != null && message.hasOwnProperty("bigqueryConfig")) - object.bigqueryConfig = $root.google.pubsub.v1.BigQueryConfig.toObject(message.bigqueryConfig, options); - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.pubsub.v1.Subscription.State[message.state] === undefined ? message.state : $root.google.pubsub.v1.Subscription.State[message.state] : message.state; - if (message.cloudStorageConfig != null && message.hasOwnProperty("cloudStorageConfig")) - object.cloudStorageConfig = $root.google.pubsub.v1.CloudStorageConfig.toObject(message.cloudStorageConfig, options); - return object; - }; - - /** - * Converts this Subscription to JSON. - * @function toJSON - * @memberof google.pubsub.v1.Subscription - * @instance - * @returns {Object.} JSON object - */ - Subscription.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Subscription - * @function getTypeUrl - * @memberof google.pubsub.v1.Subscription - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Subscription.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.pubsub.v1.Subscription"; - }; - - /** - * State enum. - * @name google.pubsub.v1.Subscription.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} ACTIVE=1 ACTIVE value - * @property {number} RESOURCE_ERROR=2 RESOURCE_ERROR value - */ - Subscription.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "ACTIVE"] = 1; - values[valuesById[2] = "RESOURCE_ERROR"] = 2; - return values; - })(); - - return Subscription; - })(); - - v1.RetryPolicy = (function() { - - /** - * Properties of a RetryPolicy. - * @memberof google.pubsub.v1 - * @interface IRetryPolicy - * @property {google.protobuf.IDuration|null} [minimumBackoff] RetryPolicy minimumBackoff - * @property {google.protobuf.IDuration|null} [maximumBackoff] RetryPolicy maximumBackoff - */ - - /** - * Constructs a new RetryPolicy. - * @memberof google.pubsub.v1 - * @classdesc Represents a RetryPolicy. - * @implements IRetryPolicy - * @constructor - * @param {google.pubsub.v1.IRetryPolicy=} [properties] Properties to set - */ - function RetryPolicy(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]]; - } - - /** - * RetryPolicy minimumBackoff. - * @member {google.protobuf.IDuration|null|undefined} minimumBackoff - * @memberof google.pubsub.v1.RetryPolicy - * @instance - */ - RetryPolicy.prototype.minimumBackoff = null; - - /** - * RetryPolicy maximumBackoff. - * @member {google.protobuf.IDuration|null|undefined} maximumBackoff - * @memberof google.pubsub.v1.RetryPolicy - * @instance - */ - RetryPolicy.prototype.maximumBackoff = null; - - /** - * Creates a new RetryPolicy instance using the specified properties. - * @function create - * @memberof google.pubsub.v1.RetryPolicy - * @static - * @param {google.pubsub.v1.IRetryPolicy=} [properties] Properties to set - * @returns {google.pubsub.v1.RetryPolicy} RetryPolicy instance - */ - RetryPolicy.create = function create(properties) { - return new RetryPolicy(properties); - }; - - /** - * Encodes the specified RetryPolicy message. Does not implicitly {@link google.pubsub.v1.RetryPolicy.verify|verify} messages. - * @function encode - * @memberof google.pubsub.v1.RetryPolicy - * @static - * @param {google.pubsub.v1.IRetryPolicy} message RetryPolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RetryPolicy.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.minimumBackoff != null && Object.hasOwnProperty.call(message, "minimumBackoff")) - $root.google.protobuf.Duration.encode(message.minimumBackoff, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.maximumBackoff != null && Object.hasOwnProperty.call(message, "maximumBackoff")) - $root.google.protobuf.Duration.encode(message.maximumBackoff, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified RetryPolicy message, length delimited. Does not implicitly {@link google.pubsub.v1.RetryPolicy.verify|verify} messages. - * @function encodeDelimited - * @memberof google.pubsub.v1.RetryPolicy - * @static - * @param {google.pubsub.v1.IRetryPolicy} message RetryPolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RetryPolicy.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RetryPolicy message from the specified reader or buffer. - * @function decode - * @memberof google.pubsub.v1.RetryPolicy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.pubsub.v1.RetryPolicy} RetryPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RetryPolicy.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.pubsub.v1.RetryPolicy(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.minimumBackoff = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 2: { - message.maximumBackoff = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RetryPolicy message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.pubsub.v1.RetryPolicy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.pubsub.v1.RetryPolicy} RetryPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RetryPolicy.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RetryPolicy message. - * @function verify - * @memberof google.pubsub.v1.RetryPolicy - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RetryPolicy.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.minimumBackoff != null && message.hasOwnProperty("minimumBackoff")) { - var error = $root.google.protobuf.Duration.verify(message.minimumBackoff); - if (error) - return "minimumBackoff." + error; - } - if (message.maximumBackoff != null && message.hasOwnProperty("maximumBackoff")) { - var error = $root.google.protobuf.Duration.verify(message.maximumBackoff); - if (error) - return "maximumBackoff." + error; - } - return null; - }; - - /** - * Creates a RetryPolicy message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.pubsub.v1.RetryPolicy - * @static - * @param {Object.} object Plain object - * @returns {google.pubsub.v1.RetryPolicy} RetryPolicy - */ - RetryPolicy.fromObject = function fromObject(object) { - if (object instanceof $root.google.pubsub.v1.RetryPolicy) - return object; - var message = new $root.google.pubsub.v1.RetryPolicy(); - if (object.minimumBackoff != null) { - if (typeof object.minimumBackoff !== "object") - throw TypeError(".google.pubsub.v1.RetryPolicy.minimumBackoff: object expected"); - message.minimumBackoff = $root.google.protobuf.Duration.fromObject(object.minimumBackoff); - } - if (object.maximumBackoff != null) { - if (typeof object.maximumBackoff !== "object") - throw TypeError(".google.pubsub.v1.RetryPolicy.maximumBackoff: object expected"); - message.maximumBackoff = $root.google.protobuf.Duration.fromObject(object.maximumBackoff); - } - return message; - }; - - /** - * Creates a plain object from a RetryPolicy message. Also converts values to other types if specified. - * @function toObject - * @memberof google.pubsub.v1.RetryPolicy - * @static - * @param {google.pubsub.v1.RetryPolicy} message RetryPolicy - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RetryPolicy.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.minimumBackoff = null; - object.maximumBackoff = null; - } - if (message.minimumBackoff != null && message.hasOwnProperty("minimumBackoff")) - object.minimumBackoff = $root.google.protobuf.Duration.toObject(message.minimumBackoff, options); - if (message.maximumBackoff != null && message.hasOwnProperty("maximumBackoff")) - object.maximumBackoff = $root.google.protobuf.Duration.toObject(message.maximumBackoff, options); - return object; - }; - - /** - * Converts this RetryPolicy to JSON. - * @function toJSON - * @memberof google.pubsub.v1.RetryPolicy - * @instance - * @returns {Object.} JSON object - */ - RetryPolicy.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RetryPolicy - * @function getTypeUrl - * @memberof google.pubsub.v1.RetryPolicy - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RetryPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.pubsub.v1.RetryPolicy"; - }; - - return RetryPolicy; - })(); - - v1.DeadLetterPolicy = (function() { - - /** - * Properties of a DeadLetterPolicy. - * @memberof google.pubsub.v1 - * @interface IDeadLetterPolicy - * @property {string|null} [deadLetterTopic] DeadLetterPolicy deadLetterTopic - * @property {number|null} [maxDeliveryAttempts] DeadLetterPolicy maxDeliveryAttempts - */ - - /** - * Constructs a new DeadLetterPolicy. - * @memberof google.pubsub.v1 - * @classdesc Represents a DeadLetterPolicy. - * @implements IDeadLetterPolicy - * @constructor - * @param {google.pubsub.v1.IDeadLetterPolicy=} [properties] Properties to set - */ - function DeadLetterPolicy(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]]; - } - - /** - * DeadLetterPolicy deadLetterTopic. - * @member {string} deadLetterTopic - * @memberof google.pubsub.v1.DeadLetterPolicy - * @instance - */ - DeadLetterPolicy.prototype.deadLetterTopic = ""; - - /** - * DeadLetterPolicy maxDeliveryAttempts. - * @member {number} maxDeliveryAttempts - * @memberof google.pubsub.v1.DeadLetterPolicy - * @instance - */ - DeadLetterPolicy.prototype.maxDeliveryAttempts = 0; - - /** - * Creates a new DeadLetterPolicy instance using the specified properties. - * @function create - * @memberof google.pubsub.v1.DeadLetterPolicy - * @static - * @param {google.pubsub.v1.IDeadLetterPolicy=} [properties] Properties to set - * @returns {google.pubsub.v1.DeadLetterPolicy} DeadLetterPolicy instance - */ - DeadLetterPolicy.create = function create(properties) { - return new DeadLetterPolicy(properties); - }; - - /** - * Encodes the specified DeadLetterPolicy message. Does not implicitly {@link google.pubsub.v1.DeadLetterPolicy.verify|verify} messages. - * @function encode - * @memberof google.pubsub.v1.DeadLetterPolicy - * @static - * @param {google.pubsub.v1.IDeadLetterPolicy} message DeadLetterPolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeadLetterPolicy.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.deadLetterTopic != null && Object.hasOwnProperty.call(message, "deadLetterTopic")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.deadLetterTopic); - if (message.maxDeliveryAttempts != null && Object.hasOwnProperty.call(message, "maxDeliveryAttempts")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.maxDeliveryAttempts); - return writer; - }; - - /** - * Encodes the specified DeadLetterPolicy message, length delimited. Does not implicitly {@link google.pubsub.v1.DeadLetterPolicy.verify|verify} messages. - * @function encodeDelimited - * @memberof google.pubsub.v1.DeadLetterPolicy - * @static - * @param {google.pubsub.v1.IDeadLetterPolicy} message DeadLetterPolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeadLetterPolicy.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeadLetterPolicy message from the specified reader or buffer. - * @function decode - * @memberof google.pubsub.v1.DeadLetterPolicy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.pubsub.v1.DeadLetterPolicy} DeadLetterPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeadLetterPolicy.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.pubsub.v1.DeadLetterPolicy(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.deadLetterTopic = reader.string(); - break; - } - case 2: { - message.maxDeliveryAttempts = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeadLetterPolicy message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.pubsub.v1.DeadLetterPolicy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.pubsub.v1.DeadLetterPolicy} DeadLetterPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeadLetterPolicy.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeadLetterPolicy message. - * @function verify - * @memberof google.pubsub.v1.DeadLetterPolicy - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeadLetterPolicy.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.deadLetterTopic != null && message.hasOwnProperty("deadLetterTopic")) - if (!$util.isString(message.deadLetterTopic)) - return "deadLetterTopic: string expected"; - if (message.maxDeliveryAttempts != null && message.hasOwnProperty("maxDeliveryAttempts")) - if (!$util.isInteger(message.maxDeliveryAttempts)) - return "maxDeliveryAttempts: integer expected"; - return null; - }; - - /** - * Creates a DeadLetterPolicy message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.pubsub.v1.DeadLetterPolicy - * @static - * @param {Object.} object Plain object - * @returns {google.pubsub.v1.DeadLetterPolicy} DeadLetterPolicy - */ - DeadLetterPolicy.fromObject = function fromObject(object) { - if (object instanceof $root.google.pubsub.v1.DeadLetterPolicy) - return object; - var message = new $root.google.pubsub.v1.DeadLetterPolicy(); - if (object.deadLetterTopic != null) - message.deadLetterTopic = String(object.deadLetterTopic); - if (object.maxDeliveryAttempts != null) - message.maxDeliveryAttempts = object.maxDeliveryAttempts | 0; - return message; - }; - - /** - * Creates a plain object from a DeadLetterPolicy message. Also converts values to other types if specified. - * @function toObject - * @memberof google.pubsub.v1.DeadLetterPolicy - * @static - * @param {google.pubsub.v1.DeadLetterPolicy} message DeadLetterPolicy - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeadLetterPolicy.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.deadLetterTopic = ""; - object.maxDeliveryAttempts = 0; - } - if (message.deadLetterTopic != null && message.hasOwnProperty("deadLetterTopic")) - object.deadLetterTopic = message.deadLetterTopic; - if (message.maxDeliveryAttempts != null && message.hasOwnProperty("maxDeliveryAttempts")) - object.maxDeliveryAttempts = message.maxDeliveryAttempts; - return object; - }; - - /** - * Converts this DeadLetterPolicy to JSON. - * @function toJSON - * @memberof google.pubsub.v1.DeadLetterPolicy - * @instance - * @returns {Object.} JSON object - */ - DeadLetterPolicy.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeadLetterPolicy - * @function getTypeUrl - * @memberof google.pubsub.v1.DeadLetterPolicy - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeadLetterPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.pubsub.v1.DeadLetterPolicy"; - }; - - return DeadLetterPolicy; - })(); - - v1.ExpirationPolicy = (function() { - - /** - * Properties of an ExpirationPolicy. - * @memberof google.pubsub.v1 - * @interface IExpirationPolicy - * @property {google.protobuf.IDuration|null} [ttl] ExpirationPolicy ttl - */ - - /** - * Constructs a new ExpirationPolicy. - * @memberof google.pubsub.v1 - * @classdesc Represents an ExpirationPolicy. - * @implements IExpirationPolicy - * @constructor - * @param {google.pubsub.v1.IExpirationPolicy=} [properties] Properties to set - */ - function ExpirationPolicy(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]]; - } - - /** - * ExpirationPolicy ttl. - * @member {google.protobuf.IDuration|null|undefined} ttl - * @memberof google.pubsub.v1.ExpirationPolicy - * @instance - */ - ExpirationPolicy.prototype.ttl = null; - - /** - * Creates a new ExpirationPolicy instance using the specified properties. - * @function create - * @memberof google.pubsub.v1.ExpirationPolicy - * @static - * @param {google.pubsub.v1.IExpirationPolicy=} [properties] Properties to set - * @returns {google.pubsub.v1.ExpirationPolicy} ExpirationPolicy instance - */ - ExpirationPolicy.create = function create(properties) { - return new ExpirationPolicy(properties); - }; - - /** - * Encodes the specified ExpirationPolicy message. Does not implicitly {@link google.pubsub.v1.ExpirationPolicy.verify|verify} messages. - * @function encode - * @memberof google.pubsub.v1.ExpirationPolicy - * @static - * @param {google.pubsub.v1.IExpirationPolicy} message ExpirationPolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExpirationPolicy.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.ttl != null && Object.hasOwnProperty.call(message, "ttl")) - $root.google.protobuf.Duration.encode(message.ttl, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ExpirationPolicy message, length delimited. Does not implicitly {@link google.pubsub.v1.ExpirationPolicy.verify|verify} messages. - * @function encodeDelimited - * @memberof google.pubsub.v1.ExpirationPolicy - * @static - * @param {google.pubsub.v1.IExpirationPolicy} message ExpirationPolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExpirationPolicy.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ExpirationPolicy message from the specified reader or buffer. - * @function decode - * @memberof google.pubsub.v1.ExpirationPolicy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.pubsub.v1.ExpirationPolicy} ExpirationPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExpirationPolicy.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.pubsub.v1.ExpirationPolicy(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.ttl = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ExpirationPolicy message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.pubsub.v1.ExpirationPolicy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.pubsub.v1.ExpirationPolicy} ExpirationPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExpirationPolicy.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ExpirationPolicy message. - * @function verify - * @memberof google.pubsub.v1.ExpirationPolicy - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExpirationPolicy.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.ttl != null && message.hasOwnProperty("ttl")) { - var error = $root.google.protobuf.Duration.verify(message.ttl); - if (error) - return "ttl." + error; - } - return null; - }; - - /** - * Creates an ExpirationPolicy message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.pubsub.v1.ExpirationPolicy - * @static - * @param {Object.} object Plain object - * @returns {google.pubsub.v1.ExpirationPolicy} ExpirationPolicy - */ - ExpirationPolicy.fromObject = function fromObject(object) { - if (object instanceof $root.google.pubsub.v1.ExpirationPolicy) - return object; - var message = new $root.google.pubsub.v1.ExpirationPolicy(); - if (object.ttl != null) { - if (typeof object.ttl !== "object") - throw TypeError(".google.pubsub.v1.ExpirationPolicy.ttl: object expected"); - message.ttl = $root.google.protobuf.Duration.fromObject(object.ttl); - } - return message; - }; - - /** - * Creates a plain object from an ExpirationPolicy message. Also converts values to other types if specified. - * @function toObject - * @memberof google.pubsub.v1.ExpirationPolicy - * @static - * @param {google.pubsub.v1.ExpirationPolicy} message ExpirationPolicy - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExpirationPolicy.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.ttl = null; - if (message.ttl != null && message.hasOwnProperty("ttl")) - object.ttl = $root.google.protobuf.Duration.toObject(message.ttl, options); - return object; - }; - - /** - * Converts this ExpirationPolicy to JSON. - * @function toJSON - * @memberof google.pubsub.v1.ExpirationPolicy - * @instance - * @returns {Object.} JSON object - */ - ExpirationPolicy.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ExpirationPolicy - * @function getTypeUrl - * @memberof google.pubsub.v1.ExpirationPolicy - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExpirationPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.pubsub.v1.ExpirationPolicy"; - }; - - return ExpirationPolicy; - })(); - - v1.PushConfig = (function() { - - /** - * Properties of a PushConfig. - * @memberof google.pubsub.v1 - * @interface IPushConfig - * @property {string|null} [pushEndpoint] PushConfig pushEndpoint - * @property {Object.|null} [attributes] PushConfig attributes - * @property {google.pubsub.v1.PushConfig.IOidcToken|null} [oidcToken] PushConfig oidcToken - * @property {google.pubsub.v1.PushConfig.IPubsubWrapper|null} [pubsubWrapper] PushConfig pubsubWrapper - * @property {google.pubsub.v1.PushConfig.INoWrapper|null} [noWrapper] PushConfig noWrapper - */ - - /** - * Constructs a new PushConfig. - * @memberof google.pubsub.v1 - * @classdesc Represents a PushConfig. - * @implements IPushConfig - * @constructor - * @param {google.pubsub.v1.IPushConfig=} [properties] Properties to set - */ - function PushConfig(properties) { - this.attributes = {}; - 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]]; - } - - /** - * PushConfig pushEndpoint. - * @member {string} pushEndpoint - * @memberof google.pubsub.v1.PushConfig - * @instance - */ - PushConfig.prototype.pushEndpoint = ""; - - /** - * PushConfig attributes. - * @member {Object.} attributes - * @memberof google.pubsub.v1.PushConfig - * @instance - */ - PushConfig.prototype.attributes = $util.emptyObject; - - /** - * PushConfig oidcToken. - * @member {google.pubsub.v1.PushConfig.IOidcToken|null|undefined} oidcToken - * @memberof google.pubsub.v1.PushConfig - * @instance - */ - PushConfig.prototype.oidcToken = null; - - /** - * PushConfig pubsubWrapper. - * @member {google.pubsub.v1.PushConfig.IPubsubWrapper|null|undefined} pubsubWrapper - * @memberof google.pubsub.v1.PushConfig - * @instance - */ - PushConfig.prototype.pubsubWrapper = null; - - /** - * PushConfig noWrapper. - * @member {google.pubsub.v1.PushConfig.INoWrapper|null|undefined} noWrapper - * @memberof google.pubsub.v1.PushConfig - * @instance - */ - PushConfig.prototype.noWrapper = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * PushConfig authenticationMethod. - * @member {"oidcToken"|undefined} authenticationMethod - * @memberof google.pubsub.v1.PushConfig - * @instance - */ - Object.defineProperty(PushConfig.prototype, "authenticationMethod", { - get: $util.oneOfGetter($oneOfFields = ["oidcToken"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * PushConfig wrapper. - * @member {"pubsubWrapper"|"noWrapper"|undefined} wrapper - * @memberof google.pubsub.v1.PushConfig - * @instance - */ - Object.defineProperty(PushConfig.prototype, "wrapper", { - get: $util.oneOfGetter($oneOfFields = ["pubsubWrapper", "noWrapper"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new PushConfig instance using the specified properties. - * @function create - * @memberof google.pubsub.v1.PushConfig - * @static - * @param {google.pubsub.v1.IPushConfig=} [properties] Properties to set - * @returns {google.pubsub.v1.PushConfig} PushConfig instance - */ - PushConfig.create = function create(properties) { - return new PushConfig(properties); - }; - - /** - * Encodes the specified PushConfig message. Does not implicitly {@link google.pubsub.v1.PushConfig.verify|verify} messages. - * @function encode - * @memberof google.pubsub.v1.PushConfig - * @static - * @param {google.pubsub.v1.IPushConfig} message PushConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PushConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.pushEndpoint != null && Object.hasOwnProperty.call(message, "pushEndpoint")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.pushEndpoint); - if (message.attributes != null && Object.hasOwnProperty.call(message, "attributes")) - for (var keys = Object.keys(message.attributes), 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.attributes[keys[i]]).ldelim(); - if (message.oidcToken != null && Object.hasOwnProperty.call(message, "oidcToken")) - $root.google.pubsub.v1.PushConfig.OidcToken.encode(message.oidcToken, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.pubsubWrapper != null && Object.hasOwnProperty.call(message, "pubsubWrapper")) - $root.google.pubsub.v1.PushConfig.PubsubWrapper.encode(message.pubsubWrapper, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.noWrapper != null && Object.hasOwnProperty.call(message, "noWrapper")) - $root.google.pubsub.v1.PushConfig.NoWrapper.encode(message.noWrapper, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified PushConfig message, length delimited. Does not implicitly {@link google.pubsub.v1.PushConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.pubsub.v1.PushConfig - * @static - * @param {google.pubsub.v1.IPushConfig} message PushConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PushConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PushConfig message from the specified reader or buffer. - * @function decode - * @memberof google.pubsub.v1.PushConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.pubsub.v1.PushConfig} PushConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PushConfig.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.pubsub.v1.PushConfig(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.pushEndpoint = reader.string(); - break; - } - case 2: { - if (message.attributes === $util.emptyObject) - message.attributes = {}; - 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.attributes[key] = value; - break; - } - case 3: { - message.oidcToken = $root.google.pubsub.v1.PushConfig.OidcToken.decode(reader, reader.uint32()); - break; - } - case 4: { - message.pubsubWrapper = $root.google.pubsub.v1.PushConfig.PubsubWrapper.decode(reader, reader.uint32()); - break; - } - case 5: { - message.noWrapper = $root.google.pubsub.v1.PushConfig.NoWrapper.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PushConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.pubsub.v1.PushConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.pubsub.v1.PushConfig} PushConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PushConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PushConfig message. - * @function verify - * @memberof google.pubsub.v1.PushConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PushConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.pushEndpoint != null && message.hasOwnProperty("pushEndpoint")) - if (!$util.isString(message.pushEndpoint)) - return "pushEndpoint: string expected"; - if (message.attributes != null && message.hasOwnProperty("attributes")) { - if (!$util.isObject(message.attributes)) - return "attributes: object expected"; - var key = Object.keys(message.attributes); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.attributes[key[i]])) - return "attributes: string{k:string} expected"; - } - if (message.oidcToken != null && message.hasOwnProperty("oidcToken")) { - properties.authenticationMethod = 1; - { - var error = $root.google.pubsub.v1.PushConfig.OidcToken.verify(message.oidcToken); - if (error) - return "oidcToken." + error; - } - } - if (message.pubsubWrapper != null && message.hasOwnProperty("pubsubWrapper")) { - properties.wrapper = 1; - { - var error = $root.google.pubsub.v1.PushConfig.PubsubWrapper.verify(message.pubsubWrapper); - if (error) - return "pubsubWrapper." + error; - } - } - if (message.noWrapper != null && message.hasOwnProperty("noWrapper")) { - if (properties.wrapper === 1) - return "wrapper: multiple values"; - properties.wrapper = 1; - { - var error = $root.google.pubsub.v1.PushConfig.NoWrapper.verify(message.noWrapper); - if (error) - return "noWrapper." + error; - } - } - return null; - }; - - /** - * Creates a PushConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.pubsub.v1.PushConfig - * @static - * @param {Object.} object Plain object - * @returns {google.pubsub.v1.PushConfig} PushConfig - */ - PushConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.pubsub.v1.PushConfig) - return object; - var message = new $root.google.pubsub.v1.PushConfig(); - if (object.pushEndpoint != null) - message.pushEndpoint = String(object.pushEndpoint); - if (object.attributes) { - if (typeof object.attributes !== "object") - throw TypeError(".google.pubsub.v1.PushConfig.attributes: object expected"); - message.attributes = {}; - for (var keys = Object.keys(object.attributes), i = 0; i < keys.length; ++i) - message.attributes[keys[i]] = String(object.attributes[keys[i]]); - } - if (object.oidcToken != null) { - if (typeof object.oidcToken !== "object") - throw TypeError(".google.pubsub.v1.PushConfig.oidcToken: object expected"); - message.oidcToken = $root.google.pubsub.v1.PushConfig.OidcToken.fromObject(object.oidcToken); - } - if (object.pubsubWrapper != null) { - if (typeof object.pubsubWrapper !== "object") - throw TypeError(".google.pubsub.v1.PushConfig.pubsubWrapper: object expected"); - message.pubsubWrapper = $root.google.pubsub.v1.PushConfig.PubsubWrapper.fromObject(object.pubsubWrapper); - } - if (object.noWrapper != null) { - if (typeof object.noWrapper !== "object") - throw TypeError(".google.pubsub.v1.PushConfig.noWrapper: object expected"); - message.noWrapper = $root.google.pubsub.v1.PushConfig.NoWrapper.fromObject(object.noWrapper); - } - return message; - }; - - /** - * Creates a plain object from a PushConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.pubsub.v1.PushConfig - * @static - * @param {google.pubsub.v1.PushConfig} message PushConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PushConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.attributes = {}; - if (options.defaults) - object.pushEndpoint = ""; - if (message.pushEndpoint != null && message.hasOwnProperty("pushEndpoint")) - object.pushEndpoint = message.pushEndpoint; - var keys2; - if (message.attributes && (keys2 = Object.keys(message.attributes)).length) { - object.attributes = {}; - for (var j = 0; j < keys2.length; ++j) - object.attributes[keys2[j]] = message.attributes[keys2[j]]; - } - if (message.oidcToken != null && message.hasOwnProperty("oidcToken")) { - object.oidcToken = $root.google.pubsub.v1.PushConfig.OidcToken.toObject(message.oidcToken, options); - if (options.oneofs) - object.authenticationMethod = "oidcToken"; - } - if (message.pubsubWrapper != null && message.hasOwnProperty("pubsubWrapper")) { - object.pubsubWrapper = $root.google.pubsub.v1.PushConfig.PubsubWrapper.toObject(message.pubsubWrapper, options); - if (options.oneofs) - object.wrapper = "pubsubWrapper"; - } - if (message.noWrapper != null && message.hasOwnProperty("noWrapper")) { - object.noWrapper = $root.google.pubsub.v1.PushConfig.NoWrapper.toObject(message.noWrapper, options); - if (options.oneofs) - object.wrapper = "noWrapper"; - } - return object; - }; - - /** - * Converts this PushConfig to JSON. - * @function toJSON - * @memberof google.pubsub.v1.PushConfig - * @instance - * @returns {Object.} JSON object - */ - PushConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PushConfig - * @function getTypeUrl - * @memberof google.pubsub.v1.PushConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PushConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.pubsub.v1.PushConfig"; - }; - - PushConfig.OidcToken = (function() { - - /** - * Properties of an OidcToken. - * @memberof google.pubsub.v1.PushConfig - * @interface IOidcToken - * @property {string|null} [serviceAccountEmail] OidcToken serviceAccountEmail - * @property {string|null} [audience] OidcToken audience - */ - - /** - * Constructs a new OidcToken. - * @memberof google.pubsub.v1.PushConfig - * @classdesc Represents an OidcToken. - * @implements IOidcToken - * @constructor - * @param {google.pubsub.v1.PushConfig.IOidcToken=} [properties] Properties to set - */ - function OidcToken(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]]; - } - - /** - * OidcToken serviceAccountEmail. - * @member {string} serviceAccountEmail - * @memberof google.pubsub.v1.PushConfig.OidcToken - * @instance - */ - OidcToken.prototype.serviceAccountEmail = ""; - - /** - * OidcToken audience. - * @member {string} audience - * @memberof google.pubsub.v1.PushConfig.OidcToken - * @instance - */ - OidcToken.prototype.audience = ""; - - /** - * Creates a new OidcToken instance using the specified properties. - * @function create - * @memberof google.pubsub.v1.PushConfig.OidcToken - * @static - * @param {google.pubsub.v1.PushConfig.IOidcToken=} [properties] Properties to set - * @returns {google.pubsub.v1.PushConfig.OidcToken} OidcToken instance - */ - OidcToken.create = function create(properties) { - return new OidcToken(properties); - }; - - /** - * Encodes the specified OidcToken message. Does not implicitly {@link google.pubsub.v1.PushConfig.OidcToken.verify|verify} messages. - * @function encode - * @memberof google.pubsub.v1.PushConfig.OidcToken - * @static - * @param {google.pubsub.v1.PushConfig.IOidcToken} message OidcToken message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OidcToken.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.serviceAccountEmail != null && Object.hasOwnProperty.call(message, "serviceAccountEmail")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.serviceAccountEmail); - if (message.audience != null && Object.hasOwnProperty.call(message, "audience")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.audience); - return writer; - }; - - /** - * Encodes the specified OidcToken message, length delimited. Does not implicitly {@link google.pubsub.v1.PushConfig.OidcToken.verify|verify} messages. - * @function encodeDelimited - * @memberof google.pubsub.v1.PushConfig.OidcToken - * @static - * @param {google.pubsub.v1.PushConfig.IOidcToken} message OidcToken message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OidcToken.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an OidcToken message from the specified reader or buffer. - * @function decode - * @memberof google.pubsub.v1.PushConfig.OidcToken - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.pubsub.v1.PushConfig.OidcToken} OidcToken - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OidcToken.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.pubsub.v1.PushConfig.OidcToken(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.serviceAccountEmail = reader.string(); - break; - } - case 2: { - message.audience = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an OidcToken message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.pubsub.v1.PushConfig.OidcToken - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.pubsub.v1.PushConfig.OidcToken} OidcToken - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OidcToken.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an OidcToken message. - * @function verify - * @memberof google.pubsub.v1.PushConfig.OidcToken - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OidcToken.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.serviceAccountEmail != null && message.hasOwnProperty("serviceAccountEmail")) - if (!$util.isString(message.serviceAccountEmail)) - return "serviceAccountEmail: string expected"; - if (message.audience != null && message.hasOwnProperty("audience")) - if (!$util.isString(message.audience)) - return "audience: string expected"; - return null; - }; - - /** - * Creates an OidcToken message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.pubsub.v1.PushConfig.OidcToken - * @static - * @param {Object.} object Plain object - * @returns {google.pubsub.v1.PushConfig.OidcToken} OidcToken - */ - OidcToken.fromObject = function fromObject(object) { - if (object instanceof $root.google.pubsub.v1.PushConfig.OidcToken) - return object; - var message = new $root.google.pubsub.v1.PushConfig.OidcToken(); - if (object.serviceAccountEmail != null) - message.serviceAccountEmail = String(object.serviceAccountEmail); - if (object.audience != null) - message.audience = String(object.audience); - return message; - }; - - /** - * Creates a plain object from an OidcToken message. Also converts values to other types if specified. - * @function toObject - * @memberof google.pubsub.v1.PushConfig.OidcToken - * @static - * @param {google.pubsub.v1.PushConfig.OidcToken} message OidcToken - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OidcToken.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.serviceAccountEmail = ""; - object.audience = ""; - } - if (message.serviceAccountEmail != null && message.hasOwnProperty("serviceAccountEmail")) - object.serviceAccountEmail = message.serviceAccountEmail; - if (message.audience != null && message.hasOwnProperty("audience")) - object.audience = message.audience; - return object; - }; - - /** - * Converts this OidcToken to JSON. - * @function toJSON - * @memberof google.pubsub.v1.PushConfig.OidcToken - * @instance - * @returns {Object.} JSON object - */ - OidcToken.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for OidcToken - * @function getTypeUrl - * @memberof google.pubsub.v1.PushConfig.OidcToken - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - OidcToken.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.pubsub.v1.PushConfig.OidcToken"; - }; - - return OidcToken; - })(); - - PushConfig.PubsubWrapper = (function() { - - /** - * Properties of a PubsubWrapper. - * @memberof google.pubsub.v1.PushConfig - * @interface IPubsubWrapper - */ - - /** - * Constructs a new PubsubWrapper. - * @memberof google.pubsub.v1.PushConfig - * @classdesc Represents a PubsubWrapper. - * @implements IPubsubWrapper - * @constructor - * @param {google.pubsub.v1.PushConfig.IPubsubWrapper=} [properties] Properties to set - */ - function PubsubWrapper(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 PubsubWrapper instance using the specified properties. - * @function create - * @memberof google.pubsub.v1.PushConfig.PubsubWrapper - * @static - * @param {google.pubsub.v1.PushConfig.IPubsubWrapper=} [properties] Properties to set - * @returns {google.pubsub.v1.PushConfig.PubsubWrapper} PubsubWrapper instance - */ - PubsubWrapper.create = function create(properties) { - return new PubsubWrapper(properties); - }; - - /** - * Encodes the specified PubsubWrapper message. Does not implicitly {@link google.pubsub.v1.PushConfig.PubsubWrapper.verify|verify} messages. - * @function encode - * @memberof google.pubsub.v1.PushConfig.PubsubWrapper - * @static - * @param {google.pubsub.v1.PushConfig.IPubsubWrapper} message PubsubWrapper message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PubsubWrapper.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified PubsubWrapper message, length delimited. Does not implicitly {@link google.pubsub.v1.PushConfig.PubsubWrapper.verify|verify} messages. - * @function encodeDelimited - * @memberof google.pubsub.v1.PushConfig.PubsubWrapper - * @static - * @param {google.pubsub.v1.PushConfig.IPubsubWrapper} message PubsubWrapper message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PubsubWrapper.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PubsubWrapper message from the specified reader or buffer. - * @function decode - * @memberof google.pubsub.v1.PushConfig.PubsubWrapper - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.pubsub.v1.PushConfig.PubsubWrapper} PubsubWrapper - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PubsubWrapper.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.pubsub.v1.PushConfig.PubsubWrapper(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PubsubWrapper message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.pubsub.v1.PushConfig.PubsubWrapper - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.pubsub.v1.PushConfig.PubsubWrapper} PubsubWrapper - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PubsubWrapper.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PubsubWrapper message. - * @function verify - * @memberof google.pubsub.v1.PushConfig.PubsubWrapper - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PubsubWrapper.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a PubsubWrapper message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.pubsub.v1.PushConfig.PubsubWrapper - * @static - * @param {Object.} object Plain object - * @returns {google.pubsub.v1.PushConfig.PubsubWrapper} PubsubWrapper - */ - PubsubWrapper.fromObject = function fromObject(object) { - if (object instanceof $root.google.pubsub.v1.PushConfig.PubsubWrapper) - return object; - return new $root.google.pubsub.v1.PushConfig.PubsubWrapper(); - }; - - /** - * Creates a plain object from a PubsubWrapper message. Also converts values to other types if specified. - * @function toObject - * @memberof google.pubsub.v1.PushConfig.PubsubWrapper - * @static - * @param {google.pubsub.v1.PushConfig.PubsubWrapper} message PubsubWrapper - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PubsubWrapper.toObject = function toObject() { - return {}; - }; - - /** - * Converts this PubsubWrapper to JSON. - * @function toJSON - * @memberof google.pubsub.v1.PushConfig.PubsubWrapper - * @instance - * @returns {Object.} JSON object - */ - PubsubWrapper.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PubsubWrapper - * @function getTypeUrl - * @memberof google.pubsub.v1.PushConfig.PubsubWrapper - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PubsubWrapper.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.pubsub.v1.PushConfig.PubsubWrapper"; - }; - - return PubsubWrapper; - })(); - - PushConfig.NoWrapper = (function() { - - /** - * Properties of a NoWrapper. - * @memberof google.pubsub.v1.PushConfig - * @interface INoWrapper - * @property {boolean|null} [writeMetadata] NoWrapper writeMetadata - */ - - /** - * Constructs a new NoWrapper. - * @memberof google.pubsub.v1.PushConfig - * @classdesc Represents a NoWrapper. - * @implements INoWrapper - * @constructor - * @param {google.pubsub.v1.PushConfig.INoWrapper=} [properties] Properties to set - */ - function NoWrapper(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]]; - } - - /** - * NoWrapper writeMetadata. - * @member {boolean} writeMetadata - * @memberof google.pubsub.v1.PushConfig.NoWrapper - * @instance - */ - NoWrapper.prototype.writeMetadata = false; - - /** - * Creates a new NoWrapper instance using the specified properties. - * @function create - * @memberof google.pubsub.v1.PushConfig.NoWrapper - * @static - * @param {google.pubsub.v1.PushConfig.INoWrapper=} [properties] Properties to set - * @returns {google.pubsub.v1.PushConfig.NoWrapper} NoWrapper instance - */ - NoWrapper.create = function create(properties) { - return new NoWrapper(properties); - }; - - /** - * Encodes the specified NoWrapper message. Does not implicitly {@link google.pubsub.v1.PushConfig.NoWrapper.verify|verify} messages. - * @function encode - * @memberof google.pubsub.v1.PushConfig.NoWrapper - * @static - * @param {google.pubsub.v1.PushConfig.INoWrapper} message NoWrapper message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NoWrapper.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.writeMetadata != null && Object.hasOwnProperty.call(message, "writeMetadata")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.writeMetadata); - return writer; - }; - - /** - * Encodes the specified NoWrapper message, length delimited. Does not implicitly {@link google.pubsub.v1.PushConfig.NoWrapper.verify|verify} messages. - * @function encodeDelimited - * @memberof google.pubsub.v1.PushConfig.NoWrapper - * @static - * @param {google.pubsub.v1.PushConfig.INoWrapper} message NoWrapper message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NoWrapper.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a NoWrapper message from the specified reader or buffer. - * @function decode - * @memberof google.pubsub.v1.PushConfig.NoWrapper - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.pubsub.v1.PushConfig.NoWrapper} NoWrapper - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NoWrapper.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.pubsub.v1.PushConfig.NoWrapper(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.writeMetadata = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a NoWrapper message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.pubsub.v1.PushConfig.NoWrapper - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.pubsub.v1.PushConfig.NoWrapper} NoWrapper - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NoWrapper.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a NoWrapper message. - * @function verify - * @memberof google.pubsub.v1.PushConfig.NoWrapper - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - NoWrapper.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.writeMetadata != null && message.hasOwnProperty("writeMetadata")) - if (typeof message.writeMetadata !== "boolean") - return "writeMetadata: boolean expected"; - return null; - }; - - /** - * Creates a NoWrapper message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.pubsub.v1.PushConfig.NoWrapper - * @static - * @param {Object.} object Plain object - * @returns {google.pubsub.v1.PushConfig.NoWrapper} NoWrapper - */ - NoWrapper.fromObject = function fromObject(object) { - if (object instanceof $root.google.pubsub.v1.PushConfig.NoWrapper) - return object; - var message = new $root.google.pubsub.v1.PushConfig.NoWrapper(); - if (object.writeMetadata != null) - message.writeMetadata = Boolean(object.writeMetadata); - return message; - }; - - /** - * Creates a plain object from a NoWrapper message. Also converts values to other types if specified. - * @function toObject - * @memberof google.pubsub.v1.PushConfig.NoWrapper - * @static - * @param {google.pubsub.v1.PushConfig.NoWrapper} message NoWrapper - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - NoWrapper.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.writeMetadata = false; - if (message.writeMetadata != null && message.hasOwnProperty("writeMetadata")) - object.writeMetadata = message.writeMetadata; - return object; - }; - - /** - * Converts this NoWrapper to JSON. - * @function toJSON - * @memberof google.pubsub.v1.PushConfig.NoWrapper - * @instance - * @returns {Object.} JSON object - */ - NoWrapper.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for NoWrapper - * @function getTypeUrl - * @memberof google.pubsub.v1.PushConfig.NoWrapper - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - NoWrapper.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.pubsub.v1.PushConfig.NoWrapper"; - }; - - return NoWrapper; - })(); - - return PushConfig; - })(); - - v1.BigQueryConfig = (function() { - - /** - * Properties of a BigQueryConfig. - * @memberof google.pubsub.v1 - * @interface IBigQueryConfig - * @property {string|null} [table] BigQueryConfig table - * @property {boolean|null} [useTopicSchema] BigQueryConfig useTopicSchema - * @property {boolean|null} [writeMetadata] BigQueryConfig writeMetadata - * @property {boolean|null} [dropUnknownFields] BigQueryConfig dropUnknownFields - * @property {google.pubsub.v1.BigQueryConfig.State|null} [state] BigQueryConfig state - * @property {boolean|null} [useTableSchema] BigQueryConfig useTableSchema - * @property {string|null} [serviceAccountEmail] BigQueryConfig serviceAccountEmail - */ - - /** - * Constructs a new BigQueryConfig. - * @memberof google.pubsub.v1 - * @classdesc Represents a BigQueryConfig. - * @implements IBigQueryConfig - * @constructor - * @param {google.pubsub.v1.IBigQueryConfig=} [properties] Properties to set - */ - function BigQueryConfig(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]]; - } - - /** - * BigQueryConfig table. - * @member {string} table - * @memberof google.pubsub.v1.BigQueryConfig - * @instance - */ - BigQueryConfig.prototype.table = ""; - - /** - * BigQueryConfig useTopicSchema. - * @member {boolean} useTopicSchema - * @memberof google.pubsub.v1.BigQueryConfig - * @instance - */ - BigQueryConfig.prototype.useTopicSchema = false; - - /** - * BigQueryConfig writeMetadata. - * @member {boolean} writeMetadata - * @memberof google.pubsub.v1.BigQueryConfig - * @instance - */ - BigQueryConfig.prototype.writeMetadata = false; - - /** - * BigQueryConfig dropUnknownFields. - * @member {boolean} dropUnknownFields - * @memberof google.pubsub.v1.BigQueryConfig - * @instance - */ - BigQueryConfig.prototype.dropUnknownFields = false; - - /** - * BigQueryConfig state. - * @member {google.pubsub.v1.BigQueryConfig.State} state - * @memberof google.pubsub.v1.BigQueryConfig - * @instance - */ - BigQueryConfig.prototype.state = 0; - - /** - * BigQueryConfig useTableSchema. - * @member {boolean} useTableSchema - * @memberof google.pubsub.v1.BigQueryConfig - * @instance - */ - BigQueryConfig.prototype.useTableSchema = false; - - /** - * BigQueryConfig serviceAccountEmail. - * @member {string} serviceAccountEmail - * @memberof google.pubsub.v1.BigQueryConfig - * @instance - */ - BigQueryConfig.prototype.serviceAccountEmail = ""; - - /** - * Creates a new BigQueryConfig instance using the specified properties. - * @function create - * @memberof google.pubsub.v1.BigQueryConfig - * @static - * @param {google.pubsub.v1.IBigQueryConfig=} [properties] Properties to set - * @returns {google.pubsub.v1.BigQueryConfig} BigQueryConfig instance - */ - BigQueryConfig.create = function create(properties) { - return new BigQueryConfig(properties); - }; - - /** - * Encodes the specified BigQueryConfig message. Does not implicitly {@link google.pubsub.v1.BigQueryConfig.verify|verify} messages. - * @function encode - * @memberof google.pubsub.v1.BigQueryConfig - * @static - * @param {google.pubsub.v1.IBigQueryConfig} message BigQueryConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BigQueryConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.table != null && Object.hasOwnProperty.call(message, "table")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.table); - if (message.useTopicSchema != null && Object.hasOwnProperty.call(message, "useTopicSchema")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.useTopicSchema); - if (message.writeMetadata != null && Object.hasOwnProperty.call(message, "writeMetadata")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.writeMetadata); - if (message.dropUnknownFields != null && Object.hasOwnProperty.call(message, "dropUnknownFields")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.dropUnknownFields); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.state); - if (message.useTableSchema != null && Object.hasOwnProperty.call(message, "useTableSchema")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.useTableSchema); - if (message.serviceAccountEmail != null && Object.hasOwnProperty.call(message, "serviceAccountEmail")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.serviceAccountEmail); - return writer; - }; - - /** - * Encodes the specified BigQueryConfig message, length delimited. Does not implicitly {@link google.pubsub.v1.BigQueryConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.pubsub.v1.BigQueryConfig - * @static - * @param {google.pubsub.v1.IBigQueryConfig} message BigQueryConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BigQueryConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BigQueryConfig message from the specified reader or buffer. - * @function decode - * @memberof google.pubsub.v1.BigQueryConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.pubsub.v1.BigQueryConfig} BigQueryConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BigQueryConfig.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.pubsub.v1.BigQueryConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.table = reader.string(); - break; - } - case 2: { - message.useTopicSchema = reader.bool(); - break; - } - case 3: { - message.writeMetadata = reader.bool(); - break; - } - case 4: { - message.dropUnknownFields = reader.bool(); - break; - } - case 5: { - message.state = reader.int32(); - break; - } - case 6: { - message.useTableSchema = reader.bool(); - break; - } - case 7: { - message.serviceAccountEmail = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BigQueryConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.pubsub.v1.BigQueryConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.pubsub.v1.BigQueryConfig} BigQueryConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BigQueryConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BigQueryConfig message. - * @function verify - * @memberof google.pubsub.v1.BigQueryConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BigQueryConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.table != null && message.hasOwnProperty("table")) - if (!$util.isString(message.table)) - return "table: string expected"; - if (message.useTopicSchema != null && message.hasOwnProperty("useTopicSchema")) - if (typeof message.useTopicSchema !== "boolean") - return "useTopicSchema: boolean expected"; - if (message.writeMetadata != null && message.hasOwnProperty("writeMetadata")) - if (typeof message.writeMetadata !== "boolean") - return "writeMetadata: boolean expected"; - if (message.dropUnknownFields != null && message.hasOwnProperty("dropUnknownFields")) - if (typeof message.dropUnknownFields !== "boolean") - return "dropUnknownFields: boolean expected"; - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - break; - } - if (message.useTableSchema != null && message.hasOwnProperty("useTableSchema")) - if (typeof message.useTableSchema !== "boolean") - return "useTableSchema: boolean expected"; - if (message.serviceAccountEmail != null && message.hasOwnProperty("serviceAccountEmail")) - if (!$util.isString(message.serviceAccountEmail)) - return "serviceAccountEmail: string expected"; - return null; - }; - - /** - * Creates a BigQueryConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.pubsub.v1.BigQueryConfig - * @static - * @param {Object.} object Plain object - * @returns {google.pubsub.v1.BigQueryConfig} BigQueryConfig - */ - BigQueryConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.pubsub.v1.BigQueryConfig) - return object; - var message = new $root.google.pubsub.v1.BigQueryConfig(); - if (object.table != null) - message.table = String(object.table); - if (object.useTopicSchema != null) - message.useTopicSchema = Boolean(object.useTopicSchema); - if (object.writeMetadata != null) - message.writeMetadata = Boolean(object.writeMetadata); - if (object.dropUnknownFields != null) - message.dropUnknownFields = Boolean(object.dropUnknownFields); - switch (object.state) { - default: - if (typeof object.state === "number") { - message.state = object.state; - break; - } - break; - case "STATE_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "ACTIVE": - case 1: - message.state = 1; - break; - case "PERMISSION_DENIED": - case 2: - message.state = 2; - break; - case "NOT_FOUND": - case 3: - message.state = 3; - break; - case "SCHEMA_MISMATCH": - case 4: - message.state = 4; - break; - case "IN_TRANSIT_LOCATION_RESTRICTION": - case 5: - message.state = 5; - break; - } - if (object.useTableSchema != null) - message.useTableSchema = Boolean(object.useTableSchema); - if (object.serviceAccountEmail != null) - message.serviceAccountEmail = String(object.serviceAccountEmail); - return message; - }; - - /** - * Creates a plain object from a BigQueryConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.pubsub.v1.BigQueryConfig - * @static - * @param {google.pubsub.v1.BigQueryConfig} message BigQueryConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BigQueryConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.table = ""; - object.useTopicSchema = false; - object.writeMetadata = false; - object.dropUnknownFields = false; - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.useTableSchema = false; - object.serviceAccountEmail = ""; - } - if (message.table != null && message.hasOwnProperty("table")) - object.table = message.table; - if (message.useTopicSchema != null && message.hasOwnProperty("useTopicSchema")) - object.useTopicSchema = message.useTopicSchema; - if (message.writeMetadata != null && message.hasOwnProperty("writeMetadata")) - object.writeMetadata = message.writeMetadata; - if (message.dropUnknownFields != null && message.hasOwnProperty("dropUnknownFields")) - object.dropUnknownFields = message.dropUnknownFields; - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.pubsub.v1.BigQueryConfig.State[message.state] === undefined ? message.state : $root.google.pubsub.v1.BigQueryConfig.State[message.state] : message.state; - if (message.useTableSchema != null && message.hasOwnProperty("useTableSchema")) - object.useTableSchema = message.useTableSchema; - if (message.serviceAccountEmail != null && message.hasOwnProperty("serviceAccountEmail")) - object.serviceAccountEmail = message.serviceAccountEmail; - return object; - }; - - /** - * Converts this BigQueryConfig to JSON. - * @function toJSON - * @memberof google.pubsub.v1.BigQueryConfig - * @instance - * @returns {Object.} JSON object - */ - BigQueryConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BigQueryConfig - * @function getTypeUrl - * @memberof google.pubsub.v1.BigQueryConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BigQueryConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.pubsub.v1.BigQueryConfig"; - }; - - /** - * State enum. - * @name google.pubsub.v1.BigQueryConfig.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} ACTIVE=1 ACTIVE value - * @property {number} PERMISSION_DENIED=2 PERMISSION_DENIED value - * @property {number} NOT_FOUND=3 NOT_FOUND value - * @property {number} SCHEMA_MISMATCH=4 SCHEMA_MISMATCH value - * @property {number} IN_TRANSIT_LOCATION_RESTRICTION=5 IN_TRANSIT_LOCATION_RESTRICTION value - */ - BigQueryConfig.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "ACTIVE"] = 1; - values[valuesById[2] = "PERMISSION_DENIED"] = 2; - values[valuesById[3] = "NOT_FOUND"] = 3; - values[valuesById[4] = "SCHEMA_MISMATCH"] = 4; - values[valuesById[5] = "IN_TRANSIT_LOCATION_RESTRICTION"] = 5; - return values; - })(); - - return BigQueryConfig; - })(); - - v1.CloudStorageConfig = (function() { - - /** - * Properties of a CloudStorageConfig. - * @memberof google.pubsub.v1 - * @interface ICloudStorageConfig - * @property {string|null} [bucket] CloudStorageConfig bucket - * @property {string|null} [filenamePrefix] CloudStorageConfig filenamePrefix - * @property {string|null} [filenameSuffix] CloudStorageConfig filenameSuffix - * @property {string|null} [filenameDatetimeFormat] CloudStorageConfig filenameDatetimeFormat - * @property {google.pubsub.v1.CloudStorageConfig.ITextConfig|null} [textConfig] CloudStorageConfig textConfig - * @property {google.pubsub.v1.CloudStorageConfig.IAvroConfig|null} [avroConfig] CloudStorageConfig avroConfig - * @property {google.protobuf.IDuration|null} [maxDuration] CloudStorageConfig maxDuration - * @property {number|Long|null} [maxBytes] CloudStorageConfig maxBytes - * @property {google.pubsub.v1.CloudStorageConfig.State|null} [state] CloudStorageConfig state - * @property {string|null} [serviceAccountEmail] CloudStorageConfig serviceAccountEmail - */ - - /** - * Constructs a new CloudStorageConfig. - * @memberof google.pubsub.v1 - * @classdesc Represents a CloudStorageConfig. - * @implements ICloudStorageConfig - * @constructor - * @param {google.pubsub.v1.ICloudStorageConfig=} [properties] Properties to set - */ - function CloudStorageConfig(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]]; - } - - /** - * CloudStorageConfig bucket. - * @member {string} bucket - * @memberof google.pubsub.v1.CloudStorageConfig - * @instance - */ - CloudStorageConfig.prototype.bucket = ""; - - /** - * CloudStorageConfig filenamePrefix. - * @member {string} filenamePrefix - * @memberof google.pubsub.v1.CloudStorageConfig - * @instance - */ - CloudStorageConfig.prototype.filenamePrefix = ""; - - /** - * CloudStorageConfig filenameSuffix. - * @member {string} filenameSuffix - * @memberof google.pubsub.v1.CloudStorageConfig - * @instance - */ - CloudStorageConfig.prototype.filenameSuffix = ""; - - /** - * CloudStorageConfig filenameDatetimeFormat. - * @member {string} filenameDatetimeFormat - * @memberof google.pubsub.v1.CloudStorageConfig - * @instance - */ - CloudStorageConfig.prototype.filenameDatetimeFormat = ""; - - /** - * CloudStorageConfig textConfig. - * @member {google.pubsub.v1.CloudStorageConfig.ITextConfig|null|undefined} textConfig - * @memberof google.pubsub.v1.CloudStorageConfig - * @instance - */ - CloudStorageConfig.prototype.textConfig = null; - - /** - * CloudStorageConfig avroConfig. - * @member {google.pubsub.v1.CloudStorageConfig.IAvroConfig|null|undefined} avroConfig - * @memberof google.pubsub.v1.CloudStorageConfig - * @instance - */ - CloudStorageConfig.prototype.avroConfig = null; - - /** - * CloudStorageConfig maxDuration. - * @member {google.protobuf.IDuration|null|undefined} maxDuration - * @memberof google.pubsub.v1.CloudStorageConfig - * @instance - */ - CloudStorageConfig.prototype.maxDuration = null; - - /** - * CloudStorageConfig maxBytes. - * @member {number|Long} maxBytes - * @memberof google.pubsub.v1.CloudStorageConfig - * @instance - */ - CloudStorageConfig.prototype.maxBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * CloudStorageConfig state. - * @member {google.pubsub.v1.CloudStorageConfig.State} state - * @memberof google.pubsub.v1.CloudStorageConfig - * @instance - */ - CloudStorageConfig.prototype.state = 0; - - /** - * CloudStorageConfig serviceAccountEmail. - * @member {string} serviceAccountEmail - * @memberof google.pubsub.v1.CloudStorageConfig - * @instance - */ - CloudStorageConfig.prototype.serviceAccountEmail = ""; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * CloudStorageConfig outputFormat. - * @member {"textConfig"|"avroConfig"|undefined} outputFormat - * @memberof google.pubsub.v1.CloudStorageConfig - * @instance - */ - Object.defineProperty(CloudStorageConfig.prototype, "outputFormat", { - get: $util.oneOfGetter($oneOfFields = ["textConfig", "avroConfig"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new CloudStorageConfig instance using the specified properties. - * @function create - * @memberof google.pubsub.v1.CloudStorageConfig - * @static - * @param {google.pubsub.v1.ICloudStorageConfig=} [properties] Properties to set - * @returns {google.pubsub.v1.CloudStorageConfig} CloudStorageConfig instance - */ - CloudStorageConfig.create = function create(properties) { - return new CloudStorageConfig(properties); - }; - - /** - * Encodes the specified CloudStorageConfig message. Does not implicitly {@link google.pubsub.v1.CloudStorageConfig.verify|verify} messages. - * @function encode - * @memberof google.pubsub.v1.CloudStorageConfig - * @static - * @param {google.pubsub.v1.ICloudStorageConfig} message CloudStorageConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CloudStorageConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.bucket != null && Object.hasOwnProperty.call(message, "bucket")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.bucket); - if (message.filenamePrefix != null && Object.hasOwnProperty.call(message, "filenamePrefix")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.filenamePrefix); - if (message.filenameSuffix != null && Object.hasOwnProperty.call(message, "filenameSuffix")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.filenameSuffix); - if (message.textConfig != null && Object.hasOwnProperty.call(message, "textConfig")) - $root.google.pubsub.v1.CloudStorageConfig.TextConfig.encode(message.textConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.avroConfig != null && Object.hasOwnProperty.call(message, "avroConfig")) - $root.google.pubsub.v1.CloudStorageConfig.AvroConfig.encode(message.avroConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.maxDuration != null && Object.hasOwnProperty.call(message, "maxDuration")) - $root.google.protobuf.Duration.encode(message.maxDuration, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.maxBytes != null && Object.hasOwnProperty.call(message, "maxBytes")) - writer.uint32(/* id 7, wireType 0 =*/56).int64(message.maxBytes); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.state); - if (message.filenameDatetimeFormat != null && Object.hasOwnProperty.call(message, "filenameDatetimeFormat")) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.filenameDatetimeFormat); - if (message.serviceAccountEmail != null && Object.hasOwnProperty.call(message, "serviceAccountEmail")) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.serviceAccountEmail); - return writer; - }; - - /** - * Encodes the specified CloudStorageConfig message, length delimited. Does not implicitly {@link google.pubsub.v1.CloudStorageConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.pubsub.v1.CloudStorageConfig - * @static - * @param {google.pubsub.v1.ICloudStorageConfig} message CloudStorageConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CloudStorageConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CloudStorageConfig message from the specified reader or buffer. - * @function decode - * @memberof google.pubsub.v1.CloudStorageConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.pubsub.v1.CloudStorageConfig} CloudStorageConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CloudStorageConfig.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.pubsub.v1.CloudStorageConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.bucket = reader.string(); - break; - } - case 2: { - message.filenamePrefix = reader.string(); - break; - } - case 3: { - message.filenameSuffix = reader.string(); - break; - } - case 10: { - message.filenameDatetimeFormat = reader.string(); - break; - } - case 4: { - message.textConfig = $root.google.pubsub.v1.CloudStorageConfig.TextConfig.decode(reader, reader.uint32()); - break; - } - case 5: { - message.avroConfig = $root.google.pubsub.v1.CloudStorageConfig.AvroConfig.decode(reader, reader.uint32()); - break; - } - case 6: { - message.maxDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 7: { - message.maxBytes = reader.int64(); - break; - } - case 9: { - message.state = reader.int32(); - break; - } - case 11: { - message.serviceAccountEmail = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CloudStorageConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.pubsub.v1.CloudStorageConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.pubsub.v1.CloudStorageConfig} CloudStorageConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CloudStorageConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CloudStorageConfig message. - * @function verify - * @memberof google.pubsub.v1.CloudStorageConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CloudStorageConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.bucket != null && message.hasOwnProperty("bucket")) - if (!$util.isString(message.bucket)) - return "bucket: string expected"; - if (message.filenamePrefix != null && message.hasOwnProperty("filenamePrefix")) - if (!$util.isString(message.filenamePrefix)) - return "filenamePrefix: string expected"; - if (message.filenameSuffix != null && message.hasOwnProperty("filenameSuffix")) - if (!$util.isString(message.filenameSuffix)) - return "filenameSuffix: string expected"; - if (message.filenameDatetimeFormat != null && message.hasOwnProperty("filenameDatetimeFormat")) - if (!$util.isString(message.filenameDatetimeFormat)) - return "filenameDatetimeFormat: string expected"; - if (message.textConfig != null && message.hasOwnProperty("textConfig")) { - properties.outputFormat = 1; - { - var error = $root.google.pubsub.v1.CloudStorageConfig.TextConfig.verify(message.textConfig); - if (error) - return "textConfig." + error; - } - } - if (message.avroConfig != null && message.hasOwnProperty("avroConfig")) { - if (properties.outputFormat === 1) - return "outputFormat: multiple values"; - properties.outputFormat = 1; - { - var error = $root.google.pubsub.v1.CloudStorageConfig.AvroConfig.verify(message.avroConfig); - if (error) - return "avroConfig." + error; - } - } - if (message.maxDuration != null && message.hasOwnProperty("maxDuration")) { - var error = $root.google.protobuf.Duration.verify(message.maxDuration); - if (error) - return "maxDuration." + error; - } - if (message.maxBytes != null && message.hasOwnProperty("maxBytes")) - if (!$util.isInteger(message.maxBytes) && !(message.maxBytes && $util.isInteger(message.maxBytes.low) && $util.isInteger(message.maxBytes.high))) - return "maxBytes: integer|Long expected"; - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - break; - } - if (message.serviceAccountEmail != null && message.hasOwnProperty("serviceAccountEmail")) - if (!$util.isString(message.serviceAccountEmail)) - return "serviceAccountEmail: string expected"; - return null; - }; - - /** - * Creates a CloudStorageConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.pubsub.v1.CloudStorageConfig - * @static - * @param {Object.} object Plain object - * @returns {google.pubsub.v1.CloudStorageConfig} CloudStorageConfig - */ - CloudStorageConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.pubsub.v1.CloudStorageConfig) - return object; - var message = new $root.google.pubsub.v1.CloudStorageConfig(); - if (object.bucket != null) - message.bucket = String(object.bucket); - if (object.filenamePrefix != null) - message.filenamePrefix = String(object.filenamePrefix); - if (object.filenameSuffix != null) - message.filenameSuffix = String(object.filenameSuffix); - if (object.filenameDatetimeFormat != null) - message.filenameDatetimeFormat = String(object.filenameDatetimeFormat); - if (object.textConfig != null) { - if (typeof object.textConfig !== "object") - throw TypeError(".google.pubsub.v1.CloudStorageConfig.textConfig: object expected"); - message.textConfig = $root.google.pubsub.v1.CloudStorageConfig.TextConfig.fromObject(object.textConfig); - } - if (object.avroConfig != null) { - if (typeof object.avroConfig !== "object") - throw TypeError(".google.pubsub.v1.CloudStorageConfig.avroConfig: object expected"); - message.avroConfig = $root.google.pubsub.v1.CloudStorageConfig.AvroConfig.fromObject(object.avroConfig); - } - if (object.maxDuration != null) { - if (typeof object.maxDuration !== "object") - throw TypeError(".google.pubsub.v1.CloudStorageConfig.maxDuration: object expected"); - message.maxDuration = $root.google.protobuf.Duration.fromObject(object.maxDuration); - } - if (object.maxBytes != null) - if ($util.Long) - (message.maxBytes = $util.Long.fromValue(object.maxBytes)).unsigned = false; - else if (typeof object.maxBytes === "string") - message.maxBytes = parseInt(object.maxBytes, 10); - else if (typeof object.maxBytes === "number") - message.maxBytes = object.maxBytes; - else if (typeof object.maxBytes === "object") - message.maxBytes = new $util.LongBits(object.maxBytes.low >>> 0, object.maxBytes.high >>> 0).toNumber(); - switch (object.state) { - default: - if (typeof object.state === "number") { - message.state = object.state; - break; - } - break; - case "STATE_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "ACTIVE": - case 1: - message.state = 1; - break; - case "PERMISSION_DENIED": - case 2: - message.state = 2; - break; - case "NOT_FOUND": - case 3: - message.state = 3; - break; - case "IN_TRANSIT_LOCATION_RESTRICTION": - case 4: - message.state = 4; - break; - case "SCHEMA_MISMATCH": - case 5: - message.state = 5; - break; - } - if (object.serviceAccountEmail != null) - message.serviceAccountEmail = String(object.serviceAccountEmail); - return message; - }; - - /** - * Creates a plain object from a CloudStorageConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.pubsub.v1.CloudStorageConfig - * @static - * @param {google.pubsub.v1.CloudStorageConfig} message CloudStorageConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CloudStorageConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.bucket = ""; - object.filenamePrefix = ""; - object.filenameSuffix = ""; - object.maxDuration = null; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.maxBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.maxBytes = options.longs === String ? "0" : 0; - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.filenameDatetimeFormat = ""; - object.serviceAccountEmail = ""; - } - if (message.bucket != null && message.hasOwnProperty("bucket")) - object.bucket = message.bucket; - if (message.filenamePrefix != null && message.hasOwnProperty("filenamePrefix")) - object.filenamePrefix = message.filenamePrefix; - if (message.filenameSuffix != null && message.hasOwnProperty("filenameSuffix")) - object.filenameSuffix = message.filenameSuffix; - if (message.textConfig != null && message.hasOwnProperty("textConfig")) { - object.textConfig = $root.google.pubsub.v1.CloudStorageConfig.TextConfig.toObject(message.textConfig, options); - if (options.oneofs) - object.outputFormat = "textConfig"; - } - if (message.avroConfig != null && message.hasOwnProperty("avroConfig")) { - object.avroConfig = $root.google.pubsub.v1.CloudStorageConfig.AvroConfig.toObject(message.avroConfig, options); - if (options.oneofs) - object.outputFormat = "avroConfig"; - } - if (message.maxDuration != null && message.hasOwnProperty("maxDuration")) - object.maxDuration = $root.google.protobuf.Duration.toObject(message.maxDuration, options); - if (message.maxBytes != null && message.hasOwnProperty("maxBytes")) - if (typeof message.maxBytes === "number") - object.maxBytes = options.longs === String ? String(message.maxBytes) : message.maxBytes; - else - object.maxBytes = options.longs === String ? $util.Long.prototype.toString.call(message.maxBytes) : options.longs === Number ? new $util.LongBits(message.maxBytes.low >>> 0, message.maxBytes.high >>> 0).toNumber() : message.maxBytes; - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.pubsub.v1.CloudStorageConfig.State[message.state] === undefined ? message.state : $root.google.pubsub.v1.CloudStorageConfig.State[message.state] : message.state; - if (message.filenameDatetimeFormat != null && message.hasOwnProperty("filenameDatetimeFormat")) - object.filenameDatetimeFormat = message.filenameDatetimeFormat; - if (message.serviceAccountEmail != null && message.hasOwnProperty("serviceAccountEmail")) - object.serviceAccountEmail = message.serviceAccountEmail; - return object; - }; - - /** - * Converts this CloudStorageConfig to JSON. - * @function toJSON - * @memberof google.pubsub.v1.CloudStorageConfig - * @instance - * @returns {Object.} JSON object - */ - CloudStorageConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CloudStorageConfig - * @function getTypeUrl - * @memberof google.pubsub.v1.CloudStorageConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CloudStorageConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.pubsub.v1.CloudStorageConfig"; - }; - - CloudStorageConfig.TextConfig = (function() { - - /** - * Properties of a TextConfig. - * @memberof google.pubsub.v1.CloudStorageConfig - * @interface ITextConfig - */ - - /** - * Constructs a new TextConfig. - * @memberof google.pubsub.v1.CloudStorageConfig - * @classdesc Represents a TextConfig. - * @implements ITextConfig - * @constructor - * @param {google.pubsub.v1.CloudStorageConfig.ITextConfig=} [properties] Properties to set - */ - function TextConfig(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 TextConfig instance using the specified properties. - * @function create - * @memberof google.pubsub.v1.CloudStorageConfig.TextConfig - * @static - * @param {google.pubsub.v1.CloudStorageConfig.ITextConfig=} [properties] Properties to set - * @returns {google.pubsub.v1.CloudStorageConfig.TextConfig} TextConfig instance - */ - TextConfig.create = function create(properties) { - return new TextConfig(properties); - }; - - /** - * Encodes the specified TextConfig message. Does not implicitly {@link google.pubsub.v1.CloudStorageConfig.TextConfig.verify|verify} messages. - * @function encode - * @memberof google.pubsub.v1.CloudStorageConfig.TextConfig - * @static - * @param {google.pubsub.v1.CloudStorageConfig.ITextConfig} message TextConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TextConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified TextConfig message, length delimited. Does not implicitly {@link google.pubsub.v1.CloudStorageConfig.TextConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.pubsub.v1.CloudStorageConfig.TextConfig - * @static - * @param {google.pubsub.v1.CloudStorageConfig.ITextConfig} message TextConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TextConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TextConfig message from the specified reader or buffer. - * @function decode - * @memberof google.pubsub.v1.CloudStorageConfig.TextConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.pubsub.v1.CloudStorageConfig.TextConfig} TextConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TextConfig.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.pubsub.v1.CloudStorageConfig.TextConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TextConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.pubsub.v1.CloudStorageConfig.TextConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.pubsub.v1.CloudStorageConfig.TextConfig} TextConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TextConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TextConfig message. - * @function verify - * @memberof google.pubsub.v1.CloudStorageConfig.TextConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TextConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a TextConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.pubsub.v1.CloudStorageConfig.TextConfig - * @static - * @param {Object.} object Plain object - * @returns {google.pubsub.v1.CloudStorageConfig.TextConfig} TextConfig - */ - TextConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.pubsub.v1.CloudStorageConfig.TextConfig) - return object; - return new $root.google.pubsub.v1.CloudStorageConfig.TextConfig(); - }; - - /** - * Creates a plain object from a TextConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.pubsub.v1.CloudStorageConfig.TextConfig - * @static - * @param {google.pubsub.v1.CloudStorageConfig.TextConfig} message TextConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TextConfig.toObject = function toObject() { - return {}; - }; - - /** - * Converts this TextConfig to JSON. - * @function toJSON - * @memberof google.pubsub.v1.CloudStorageConfig.TextConfig - * @instance - * @returns {Object.} JSON object - */ - TextConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TextConfig - * @function getTypeUrl - * @memberof google.pubsub.v1.CloudStorageConfig.TextConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TextConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.pubsub.v1.CloudStorageConfig.TextConfig"; - }; - - return TextConfig; - })(); - - CloudStorageConfig.AvroConfig = (function() { - - /** - * Properties of an AvroConfig. - * @memberof google.pubsub.v1.CloudStorageConfig - * @interface IAvroConfig - * @property {boolean|null} [writeMetadata] AvroConfig writeMetadata - * @property {boolean|null} [useTopicSchema] AvroConfig useTopicSchema - */ - - /** - * Constructs a new AvroConfig. - * @memberof google.pubsub.v1.CloudStorageConfig - * @classdesc Represents an AvroConfig. - * @implements IAvroConfig - * @constructor - * @param {google.pubsub.v1.CloudStorageConfig.IAvroConfig=} [properties] Properties to set - */ - function AvroConfig(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]]; - } - - /** - * AvroConfig writeMetadata. - * @member {boolean} writeMetadata - * @memberof google.pubsub.v1.CloudStorageConfig.AvroConfig - * @instance - */ - AvroConfig.prototype.writeMetadata = false; - - /** - * AvroConfig useTopicSchema. - * @member {boolean} useTopicSchema - * @memberof google.pubsub.v1.CloudStorageConfig.AvroConfig - * @instance - */ - AvroConfig.prototype.useTopicSchema = false; - - /** - * Creates a new AvroConfig instance using the specified properties. - * @function create - * @memberof google.pubsub.v1.CloudStorageConfig.AvroConfig - * @static - * @param {google.pubsub.v1.CloudStorageConfig.IAvroConfig=} [properties] Properties to set - * @returns {google.pubsub.v1.CloudStorageConfig.AvroConfig} AvroConfig instance - */ - AvroConfig.create = function create(properties) { - return new AvroConfig(properties); - }; - - /** - * Encodes the specified AvroConfig message. Does not implicitly {@link google.pubsub.v1.CloudStorageConfig.AvroConfig.verify|verify} messages. - * @function encode - * @memberof google.pubsub.v1.CloudStorageConfig.AvroConfig - * @static - * @param {google.pubsub.v1.CloudStorageConfig.IAvroConfig} message AvroConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AvroConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.writeMetadata != null && Object.hasOwnProperty.call(message, "writeMetadata")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.writeMetadata); - if (message.useTopicSchema != null && Object.hasOwnProperty.call(message, "useTopicSchema")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.useTopicSchema); - return writer; - }; - - /** - * Encodes the specified AvroConfig message, length delimited. Does not implicitly {@link google.pubsub.v1.CloudStorageConfig.AvroConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.pubsub.v1.CloudStorageConfig.AvroConfig - * @static - * @param {google.pubsub.v1.CloudStorageConfig.IAvroConfig} message AvroConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AvroConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AvroConfig message from the specified reader or buffer. - * @function decode - * @memberof google.pubsub.v1.CloudStorageConfig.AvroConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.pubsub.v1.CloudStorageConfig.AvroConfig} AvroConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AvroConfig.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.pubsub.v1.CloudStorageConfig.AvroConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.writeMetadata = reader.bool(); - break; - } - case 2: { - message.useTopicSchema = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AvroConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.pubsub.v1.CloudStorageConfig.AvroConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.pubsub.v1.CloudStorageConfig.AvroConfig} AvroConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AvroConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AvroConfig message. - * @function verify - * @memberof google.pubsub.v1.CloudStorageConfig.AvroConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AvroConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.writeMetadata != null && message.hasOwnProperty("writeMetadata")) - if (typeof message.writeMetadata !== "boolean") - return "writeMetadata: boolean expected"; - if (message.useTopicSchema != null && message.hasOwnProperty("useTopicSchema")) - if (typeof message.useTopicSchema !== "boolean") - return "useTopicSchema: boolean expected"; - return null; - }; - - /** - * Creates an AvroConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.pubsub.v1.CloudStorageConfig.AvroConfig - * @static - * @param {Object.} object Plain object - * @returns {google.pubsub.v1.CloudStorageConfig.AvroConfig} AvroConfig - */ - AvroConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.pubsub.v1.CloudStorageConfig.AvroConfig) - return object; - var message = new $root.google.pubsub.v1.CloudStorageConfig.AvroConfig(); - if (object.writeMetadata != null) - message.writeMetadata = Boolean(object.writeMetadata); - if (object.useTopicSchema != null) - message.useTopicSchema = Boolean(object.useTopicSchema); - return message; - }; - - /** - * Creates a plain object from an AvroConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.pubsub.v1.CloudStorageConfig.AvroConfig - * @static - * @param {google.pubsub.v1.CloudStorageConfig.AvroConfig} message AvroConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AvroConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.writeMetadata = false; - object.useTopicSchema = false; - } - if (message.writeMetadata != null && message.hasOwnProperty("writeMetadata")) - object.writeMetadata = message.writeMetadata; - if (message.useTopicSchema != null && message.hasOwnProperty("useTopicSchema")) - object.useTopicSchema = message.useTopicSchema; - return object; - }; - - /** - * Converts this AvroConfig to JSON. - * @function toJSON - * @memberof google.pubsub.v1.CloudStorageConfig.AvroConfig - * @instance - * @returns {Object.} JSON object - */ - AvroConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AvroConfig - * @function getTypeUrl - * @memberof google.pubsub.v1.CloudStorageConfig.AvroConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AvroConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.pubsub.v1.CloudStorageConfig.AvroConfig"; - }; - - return AvroConfig; - })(); - - /** - * State enum. - * @name google.pubsub.v1.CloudStorageConfig.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} ACTIVE=1 ACTIVE value - * @property {number} PERMISSION_DENIED=2 PERMISSION_DENIED value - * @property {number} NOT_FOUND=3 NOT_FOUND value - * @property {number} IN_TRANSIT_LOCATION_RESTRICTION=4 IN_TRANSIT_LOCATION_RESTRICTION value - * @property {number} SCHEMA_MISMATCH=5 SCHEMA_MISMATCH value - */ - CloudStorageConfig.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "ACTIVE"] = 1; - values[valuesById[2] = "PERMISSION_DENIED"] = 2; - values[valuesById[3] = "NOT_FOUND"] = 3; - values[valuesById[4] = "IN_TRANSIT_LOCATION_RESTRICTION"] = 4; - values[valuesById[5] = "SCHEMA_MISMATCH"] = 5; - return values; - })(); - - return CloudStorageConfig; - })(); - - v1.ReceivedMessage = (function() { - - /** - * Properties of a ReceivedMessage. - * @memberof google.pubsub.v1 - * @interface IReceivedMessage - * @property {string|null} [ackId] ReceivedMessage ackId - * @property {google.pubsub.v1.IPubsubMessage|null} [message] ReceivedMessage message - * @property {number|null} [deliveryAttempt] ReceivedMessage deliveryAttempt - */ - - /** - * Constructs a new ReceivedMessage. - * @memberof google.pubsub.v1 - * @classdesc Represents a ReceivedMessage. - * @implements IReceivedMessage - * @constructor - * @param {google.pubsub.v1.IReceivedMessage=} [properties] Properties to set - */ - function ReceivedMessage(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]]; - } - - /** - * ReceivedMessage ackId. - * @member {string} ackId - * @memberof google.pubsub.v1.ReceivedMessage - * @instance - */ - ReceivedMessage.prototype.ackId = ""; - - /** - * ReceivedMessage message. - * @member {google.pubsub.v1.IPubsubMessage|null|undefined} message - * @memberof google.pubsub.v1.ReceivedMessage - * @instance - */ - ReceivedMessage.prototype.message = null; - - /** - * ReceivedMessage deliveryAttempt. - * @member {number} deliveryAttempt - * @memberof google.pubsub.v1.ReceivedMessage - * @instance - */ - ReceivedMessage.prototype.deliveryAttempt = 0; - - /** - * Creates a new ReceivedMessage instance using the specified properties. - * @function create - * @memberof google.pubsub.v1.ReceivedMessage - * @static - * @param {google.pubsub.v1.IReceivedMessage=} [properties] Properties to set - * @returns {google.pubsub.v1.ReceivedMessage} ReceivedMessage instance - */ - ReceivedMessage.create = function create(properties) { - return new ReceivedMessage(properties); - }; - - /** - * Encodes the specified ReceivedMessage message. Does not implicitly {@link google.pubsub.v1.ReceivedMessage.verify|verify} messages. - * @function encode - * @memberof google.pubsub.v1.ReceivedMessage - * @static - * @param {google.pubsub.v1.IReceivedMessage} message ReceivedMessage message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReceivedMessage.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.ackId != null && Object.hasOwnProperty.call(message, "ackId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.ackId); - if (message.message != null && Object.hasOwnProperty.call(message, "message")) - $root.google.pubsub.v1.PubsubMessage.encode(message.message, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.deliveryAttempt != null && Object.hasOwnProperty.call(message, "deliveryAttempt")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.deliveryAttempt); - return writer; - }; - - /** - * Encodes the specified ReceivedMessage message, length delimited. Does not implicitly {@link google.pubsub.v1.ReceivedMessage.verify|verify} messages. - * @function encodeDelimited - * @memberof google.pubsub.v1.ReceivedMessage - * @static - * @param {google.pubsub.v1.IReceivedMessage} message ReceivedMessage message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReceivedMessage.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ReceivedMessage message from the specified reader or buffer. - * @function decode - * @memberof google.pubsub.v1.ReceivedMessage - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.pubsub.v1.ReceivedMessage} ReceivedMessage - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReceivedMessage.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.pubsub.v1.ReceivedMessage(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.ackId = reader.string(); - break; - } - case 2: { - message.message = $root.google.pubsub.v1.PubsubMessage.decode(reader, reader.uint32()); - break; - } - case 3: { - message.deliveryAttempt = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ReceivedMessage message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.pubsub.v1.ReceivedMessage - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.pubsub.v1.ReceivedMessage} ReceivedMessage - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReceivedMessage.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ReceivedMessage message. - * @function verify - * @memberof google.pubsub.v1.ReceivedMessage - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ReceivedMessage.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.ackId != null && message.hasOwnProperty("ackId")) - if (!$util.isString(message.ackId)) - return "ackId: string expected"; - if (message.message != null && message.hasOwnProperty("message")) { - var error = $root.google.pubsub.v1.PubsubMessage.verify(message.message); - if (error) - return "message." + error; - } - if (message.deliveryAttempt != null && message.hasOwnProperty("deliveryAttempt")) - if (!$util.isInteger(message.deliveryAttempt)) - return "deliveryAttempt: integer expected"; - return null; - }; - - /** - * Creates a ReceivedMessage message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.pubsub.v1.ReceivedMessage - * @static - * @param {Object.} object Plain object - * @returns {google.pubsub.v1.ReceivedMessage} ReceivedMessage - */ - ReceivedMessage.fromObject = function fromObject(object) { - if (object instanceof $root.google.pubsub.v1.ReceivedMessage) - return object; - var message = new $root.google.pubsub.v1.ReceivedMessage(); - if (object.ackId != null) - message.ackId = String(object.ackId); - if (object.message != null) { - if (typeof object.message !== "object") - throw TypeError(".google.pubsub.v1.ReceivedMessage.message: object expected"); - message.message = $root.google.pubsub.v1.PubsubMessage.fromObject(object.message); - } - if (object.deliveryAttempt != null) - message.deliveryAttempt = object.deliveryAttempt | 0; - return message; - }; - - /** - * Creates a plain object from a ReceivedMessage message. Also converts values to other types if specified. - * @function toObject - * @memberof google.pubsub.v1.ReceivedMessage - * @static - * @param {google.pubsub.v1.ReceivedMessage} message ReceivedMessage - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ReceivedMessage.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.ackId = ""; - object.message = null; - object.deliveryAttempt = 0; - } - if (message.ackId != null && message.hasOwnProperty("ackId")) - object.ackId = message.ackId; - if (message.message != null && message.hasOwnProperty("message")) - object.message = $root.google.pubsub.v1.PubsubMessage.toObject(message.message, options); - if (message.deliveryAttempt != null && message.hasOwnProperty("deliveryAttempt")) - object.deliveryAttempt = message.deliveryAttempt; - return object; - }; - - /** - * Converts this ReceivedMessage to JSON. - * @function toJSON - * @memberof google.pubsub.v1.ReceivedMessage - * @instance - * @returns {Object.} JSON object - */ - ReceivedMessage.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ReceivedMessage - * @function getTypeUrl - * @memberof google.pubsub.v1.ReceivedMessage - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ReceivedMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.pubsub.v1.ReceivedMessage"; - }; - - return ReceivedMessage; - })(); - - v1.GetSubscriptionRequest = (function() { - - /** - * Properties of a GetSubscriptionRequest. - * @memberof google.pubsub.v1 - * @interface IGetSubscriptionRequest - * @property {string|null} [subscription] GetSubscriptionRequest subscription - */ - - /** - * Constructs a new GetSubscriptionRequest. - * @memberof google.pubsub.v1 - * @classdesc Represents a GetSubscriptionRequest. - * @implements IGetSubscriptionRequest - * @constructor - * @param {google.pubsub.v1.IGetSubscriptionRequest=} [properties] Properties to set - */ - function GetSubscriptionRequest(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]]; - } - - /** - * GetSubscriptionRequest subscription. - * @member {string} subscription - * @memberof google.pubsub.v1.GetSubscriptionRequest - * @instance - */ - GetSubscriptionRequest.prototype.subscription = ""; - - /** - * Creates a new GetSubscriptionRequest instance using the specified properties. - * @function create - * @memberof google.pubsub.v1.GetSubscriptionRequest - * @static - * @param {google.pubsub.v1.IGetSubscriptionRequest=} [properties] Properties to set - * @returns {google.pubsub.v1.GetSubscriptionRequest} GetSubscriptionRequest instance - */ - GetSubscriptionRequest.create = function create(properties) { - return new GetSubscriptionRequest(properties); - }; - - /** - * Encodes the specified GetSubscriptionRequest message. Does not implicitly {@link google.pubsub.v1.GetSubscriptionRequest.verify|verify} messages. - * @function encode - * @memberof google.pubsub.v1.GetSubscriptionRequest - * @static - * @param {google.pubsub.v1.IGetSubscriptionRequest} message GetSubscriptionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetSubscriptionRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.subscription != null && Object.hasOwnProperty.call(message, "subscription")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.subscription); - return writer; - }; - - /** - * Encodes the specified GetSubscriptionRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.GetSubscriptionRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.pubsub.v1.GetSubscriptionRequest - * @static - * @param {google.pubsub.v1.IGetSubscriptionRequest} message GetSubscriptionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetSubscriptionRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetSubscriptionRequest message from the specified reader or buffer. - * @function decode - * @memberof google.pubsub.v1.GetSubscriptionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.pubsub.v1.GetSubscriptionRequest} GetSubscriptionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetSubscriptionRequest.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.pubsub.v1.GetSubscriptionRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.subscription = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetSubscriptionRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.pubsub.v1.GetSubscriptionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.pubsub.v1.GetSubscriptionRequest} GetSubscriptionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetSubscriptionRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetSubscriptionRequest message. - * @function verify - * @memberof google.pubsub.v1.GetSubscriptionRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetSubscriptionRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.subscription != null && message.hasOwnProperty("subscription")) - if (!$util.isString(message.subscription)) - return "subscription: string expected"; - return null; - }; - - /** - * Creates a GetSubscriptionRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.pubsub.v1.GetSubscriptionRequest - * @static - * @param {Object.} object Plain object - * @returns {google.pubsub.v1.GetSubscriptionRequest} GetSubscriptionRequest - */ - GetSubscriptionRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.pubsub.v1.GetSubscriptionRequest) - return object; - var message = new $root.google.pubsub.v1.GetSubscriptionRequest(); - if (object.subscription != null) - message.subscription = String(object.subscription); - return message; - }; - - /** - * Creates a plain object from a GetSubscriptionRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.pubsub.v1.GetSubscriptionRequest - * @static - * @param {google.pubsub.v1.GetSubscriptionRequest} message GetSubscriptionRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetSubscriptionRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.subscription = ""; - if (message.subscription != null && message.hasOwnProperty("subscription")) - object.subscription = message.subscription; - return object; - }; - - /** - * Converts this GetSubscriptionRequest to JSON. - * @function toJSON - * @memberof google.pubsub.v1.GetSubscriptionRequest - * @instance - * @returns {Object.} JSON object - */ - GetSubscriptionRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetSubscriptionRequest - * @function getTypeUrl - * @memberof google.pubsub.v1.GetSubscriptionRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetSubscriptionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.pubsub.v1.GetSubscriptionRequest"; - }; - - return GetSubscriptionRequest; - })(); - - v1.UpdateSubscriptionRequest = (function() { - - /** - * Properties of an UpdateSubscriptionRequest. - * @memberof google.pubsub.v1 - * @interface IUpdateSubscriptionRequest - * @property {google.pubsub.v1.ISubscription|null} [subscription] UpdateSubscriptionRequest subscription - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateSubscriptionRequest updateMask - */ - - /** - * Constructs a new UpdateSubscriptionRequest. - * @memberof google.pubsub.v1 - * @classdesc Represents an UpdateSubscriptionRequest. - * @implements IUpdateSubscriptionRequest - * @constructor - * @param {google.pubsub.v1.IUpdateSubscriptionRequest=} [properties] Properties to set - */ - function UpdateSubscriptionRequest(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]]; - } - - /** - * UpdateSubscriptionRequest subscription. - * @member {google.pubsub.v1.ISubscription|null|undefined} subscription - * @memberof google.pubsub.v1.UpdateSubscriptionRequest - * @instance - */ - UpdateSubscriptionRequest.prototype.subscription = null; - - /** - * UpdateSubscriptionRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.pubsub.v1.UpdateSubscriptionRequest - * @instance - */ - UpdateSubscriptionRequest.prototype.updateMask = null; - - /** - * Creates a new UpdateSubscriptionRequest instance using the specified properties. - * @function create - * @memberof google.pubsub.v1.UpdateSubscriptionRequest - * @static - * @param {google.pubsub.v1.IUpdateSubscriptionRequest=} [properties] Properties to set - * @returns {google.pubsub.v1.UpdateSubscriptionRequest} UpdateSubscriptionRequest instance - */ - UpdateSubscriptionRequest.create = function create(properties) { - return new UpdateSubscriptionRequest(properties); - }; - - /** - * Encodes the specified UpdateSubscriptionRequest message. Does not implicitly {@link google.pubsub.v1.UpdateSubscriptionRequest.verify|verify} messages. - * @function encode - * @memberof google.pubsub.v1.UpdateSubscriptionRequest - * @static - * @param {google.pubsub.v1.IUpdateSubscriptionRequest} message UpdateSubscriptionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateSubscriptionRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.subscription != null && Object.hasOwnProperty.call(message, "subscription")) - $root.google.pubsub.v1.Subscription.encode(message.subscription, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified UpdateSubscriptionRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.UpdateSubscriptionRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.pubsub.v1.UpdateSubscriptionRequest - * @static - * @param {google.pubsub.v1.IUpdateSubscriptionRequest} message UpdateSubscriptionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateSubscriptionRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateSubscriptionRequest message from the specified reader or buffer. - * @function decode - * @memberof google.pubsub.v1.UpdateSubscriptionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.pubsub.v1.UpdateSubscriptionRequest} UpdateSubscriptionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateSubscriptionRequest.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.pubsub.v1.UpdateSubscriptionRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.subscription = $root.google.pubsub.v1.Subscription.decode(reader, reader.uint32()); - break; - } - case 2: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpdateSubscriptionRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.pubsub.v1.UpdateSubscriptionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.pubsub.v1.UpdateSubscriptionRequest} UpdateSubscriptionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateSubscriptionRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateSubscriptionRequest message. - * @function verify - * @memberof google.pubsub.v1.UpdateSubscriptionRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateSubscriptionRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.subscription != null && message.hasOwnProperty("subscription")) { - var error = $root.google.pubsub.v1.Subscription.verify(message.subscription); - if (error) - return "subscription." + error; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } - return null; - }; - - /** - * Creates an UpdateSubscriptionRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.pubsub.v1.UpdateSubscriptionRequest - * @static - * @param {Object.} object Plain object - * @returns {google.pubsub.v1.UpdateSubscriptionRequest} UpdateSubscriptionRequest - */ - UpdateSubscriptionRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.pubsub.v1.UpdateSubscriptionRequest) - return object; - var message = new $root.google.pubsub.v1.UpdateSubscriptionRequest(); - if (object.subscription != null) { - if (typeof object.subscription !== "object") - throw TypeError(".google.pubsub.v1.UpdateSubscriptionRequest.subscription: object expected"); - message.subscription = $root.google.pubsub.v1.Subscription.fromObject(object.subscription); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.pubsub.v1.UpdateSubscriptionRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - return message; - }; - - /** - * Creates a plain object from an UpdateSubscriptionRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.pubsub.v1.UpdateSubscriptionRequest - * @static - * @param {google.pubsub.v1.UpdateSubscriptionRequest} message UpdateSubscriptionRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateSubscriptionRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.subscription = null; - object.updateMask = null; - } - if (message.subscription != null && message.hasOwnProperty("subscription")) - object.subscription = $root.google.pubsub.v1.Subscription.toObject(message.subscription, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - return object; - }; - - /** - * Converts this UpdateSubscriptionRequest to JSON. - * @function toJSON - * @memberof google.pubsub.v1.UpdateSubscriptionRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateSubscriptionRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateSubscriptionRequest - * @function getTypeUrl - * @memberof google.pubsub.v1.UpdateSubscriptionRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateSubscriptionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.pubsub.v1.UpdateSubscriptionRequest"; - }; - - return UpdateSubscriptionRequest; - })(); - - v1.ListSubscriptionsRequest = (function() { - - /** - * Properties of a ListSubscriptionsRequest. - * @memberof google.pubsub.v1 - * @interface IListSubscriptionsRequest - * @property {string|null} [project] ListSubscriptionsRequest project - * @property {number|null} [pageSize] ListSubscriptionsRequest pageSize - * @property {string|null} [pageToken] ListSubscriptionsRequest pageToken - */ - - /** - * Constructs a new ListSubscriptionsRequest. - * @memberof google.pubsub.v1 - * @classdesc Represents a ListSubscriptionsRequest. - * @implements IListSubscriptionsRequest - * @constructor - * @param {google.pubsub.v1.IListSubscriptionsRequest=} [properties] Properties to set - */ - function ListSubscriptionsRequest(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]]; - } - - /** - * ListSubscriptionsRequest project. - * @member {string} project - * @memberof google.pubsub.v1.ListSubscriptionsRequest - * @instance - */ - ListSubscriptionsRequest.prototype.project = ""; - - /** - * ListSubscriptionsRequest pageSize. - * @member {number} pageSize - * @memberof google.pubsub.v1.ListSubscriptionsRequest - * @instance - */ - ListSubscriptionsRequest.prototype.pageSize = 0; - - /** - * ListSubscriptionsRequest pageToken. - * @member {string} pageToken - * @memberof google.pubsub.v1.ListSubscriptionsRequest - * @instance - */ - ListSubscriptionsRequest.prototype.pageToken = ""; - - /** - * Creates a new ListSubscriptionsRequest instance using the specified properties. - * @function create - * @memberof google.pubsub.v1.ListSubscriptionsRequest - * @static - * @param {google.pubsub.v1.IListSubscriptionsRequest=} [properties] Properties to set - * @returns {google.pubsub.v1.ListSubscriptionsRequest} ListSubscriptionsRequest instance - */ - ListSubscriptionsRequest.create = function create(properties) { - return new ListSubscriptionsRequest(properties); - }; - - /** - * Encodes the specified ListSubscriptionsRequest message. Does not implicitly {@link google.pubsub.v1.ListSubscriptionsRequest.verify|verify} messages. - * @function encode - * @memberof google.pubsub.v1.ListSubscriptionsRequest - * @static - * @param {google.pubsub.v1.IListSubscriptionsRequest} message ListSubscriptionsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListSubscriptionsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.project != null && Object.hasOwnProperty.call(message, "project")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.project); - 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); - return writer; - }; - - /** - * Encodes the specified ListSubscriptionsRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.ListSubscriptionsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.pubsub.v1.ListSubscriptionsRequest - * @static - * @param {google.pubsub.v1.IListSubscriptionsRequest} message ListSubscriptionsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListSubscriptionsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListSubscriptionsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.pubsub.v1.ListSubscriptionsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.pubsub.v1.ListSubscriptionsRequest} ListSubscriptionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListSubscriptionsRequest.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.pubsub.v1.ListSubscriptionsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.project = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListSubscriptionsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.pubsub.v1.ListSubscriptionsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.pubsub.v1.ListSubscriptionsRequest} ListSubscriptionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListSubscriptionsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListSubscriptionsRequest message. - * @function verify - * @memberof google.pubsub.v1.ListSubscriptionsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListSubscriptionsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.project != null && message.hasOwnProperty("project")) - if (!$util.isString(message.project)) - return "project: 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"; - return null; - }; - - /** - * Creates a ListSubscriptionsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.pubsub.v1.ListSubscriptionsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.pubsub.v1.ListSubscriptionsRequest} ListSubscriptionsRequest - */ - ListSubscriptionsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.pubsub.v1.ListSubscriptionsRequest) - return object; - var message = new $root.google.pubsub.v1.ListSubscriptionsRequest(); - if (object.project != null) - message.project = String(object.project); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - return message; - }; - - /** - * Creates a plain object from a ListSubscriptionsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.pubsub.v1.ListSubscriptionsRequest - * @static - * @param {google.pubsub.v1.ListSubscriptionsRequest} message ListSubscriptionsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListSubscriptionsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.project = ""; - object.pageSize = 0; - object.pageToken = ""; - } - if (message.project != null && message.hasOwnProperty("project")) - object.project = message.project; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - return object; - }; - - /** - * Converts this ListSubscriptionsRequest to JSON. - * @function toJSON - * @memberof google.pubsub.v1.ListSubscriptionsRequest - * @instance - * @returns {Object.} JSON object - */ - ListSubscriptionsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListSubscriptionsRequest - * @function getTypeUrl - * @memberof google.pubsub.v1.ListSubscriptionsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListSubscriptionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.pubsub.v1.ListSubscriptionsRequest"; - }; - - return ListSubscriptionsRequest; - })(); - - v1.ListSubscriptionsResponse = (function() { - - /** - * Properties of a ListSubscriptionsResponse. - * @memberof google.pubsub.v1 - * @interface IListSubscriptionsResponse - * @property {Array.|null} [subscriptions] ListSubscriptionsResponse subscriptions - * @property {string|null} [nextPageToken] ListSubscriptionsResponse nextPageToken - */ - - /** - * Constructs a new ListSubscriptionsResponse. - * @memberof google.pubsub.v1 - * @classdesc Represents a ListSubscriptionsResponse. - * @implements IListSubscriptionsResponse - * @constructor - * @param {google.pubsub.v1.IListSubscriptionsResponse=} [properties] Properties to set - */ - function ListSubscriptionsResponse(properties) { - this.subscriptions = []; - 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]]; - } - - /** - * ListSubscriptionsResponse subscriptions. - * @member {Array.} subscriptions - * @memberof google.pubsub.v1.ListSubscriptionsResponse - * @instance - */ - ListSubscriptionsResponse.prototype.subscriptions = $util.emptyArray; - - /** - * ListSubscriptionsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.pubsub.v1.ListSubscriptionsResponse - * @instance - */ - ListSubscriptionsResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListSubscriptionsResponse instance using the specified properties. - * @function create - * @memberof google.pubsub.v1.ListSubscriptionsResponse - * @static - * @param {google.pubsub.v1.IListSubscriptionsResponse=} [properties] Properties to set - * @returns {google.pubsub.v1.ListSubscriptionsResponse} ListSubscriptionsResponse instance - */ - ListSubscriptionsResponse.create = function create(properties) { - return new ListSubscriptionsResponse(properties); - }; - - /** - * Encodes the specified ListSubscriptionsResponse message. Does not implicitly {@link google.pubsub.v1.ListSubscriptionsResponse.verify|verify} messages. - * @function encode - * @memberof google.pubsub.v1.ListSubscriptionsResponse - * @static - * @param {google.pubsub.v1.IListSubscriptionsResponse} message ListSubscriptionsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListSubscriptionsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.subscriptions != null && message.subscriptions.length) - for (var i = 0; i < message.subscriptions.length; ++i) - $root.google.pubsub.v1.Subscription.encode(message.subscriptions[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 ListSubscriptionsResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.ListSubscriptionsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.pubsub.v1.ListSubscriptionsResponse - * @static - * @param {google.pubsub.v1.IListSubscriptionsResponse} message ListSubscriptionsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListSubscriptionsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListSubscriptionsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.pubsub.v1.ListSubscriptionsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.pubsub.v1.ListSubscriptionsResponse} ListSubscriptionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListSubscriptionsResponse.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.pubsub.v1.ListSubscriptionsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.subscriptions && message.subscriptions.length)) - message.subscriptions = []; - message.subscriptions.push($root.google.pubsub.v1.Subscription.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListSubscriptionsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.pubsub.v1.ListSubscriptionsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.pubsub.v1.ListSubscriptionsResponse} ListSubscriptionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListSubscriptionsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListSubscriptionsResponse message. - * @function verify - * @memberof google.pubsub.v1.ListSubscriptionsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListSubscriptionsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.subscriptions != null && message.hasOwnProperty("subscriptions")) { - if (!Array.isArray(message.subscriptions)) - return "subscriptions: array expected"; - for (var i = 0; i < message.subscriptions.length; ++i) { - var error = $root.google.pubsub.v1.Subscription.verify(message.subscriptions[i]); - if (error) - return "subscriptions." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListSubscriptionsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.pubsub.v1.ListSubscriptionsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.pubsub.v1.ListSubscriptionsResponse} ListSubscriptionsResponse - */ - ListSubscriptionsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.pubsub.v1.ListSubscriptionsResponse) - return object; - var message = new $root.google.pubsub.v1.ListSubscriptionsResponse(); - if (object.subscriptions) { - if (!Array.isArray(object.subscriptions)) - throw TypeError(".google.pubsub.v1.ListSubscriptionsResponse.subscriptions: array expected"); - message.subscriptions = []; - for (var i = 0; i < object.subscriptions.length; ++i) { - if (typeof object.subscriptions[i] !== "object") - throw TypeError(".google.pubsub.v1.ListSubscriptionsResponse.subscriptions: object expected"); - message.subscriptions[i] = $root.google.pubsub.v1.Subscription.fromObject(object.subscriptions[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListSubscriptionsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.pubsub.v1.ListSubscriptionsResponse - * @static - * @param {google.pubsub.v1.ListSubscriptionsResponse} message ListSubscriptionsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListSubscriptionsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.subscriptions = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.subscriptions && message.subscriptions.length) { - object.subscriptions = []; - for (var j = 0; j < message.subscriptions.length; ++j) - object.subscriptions[j] = $root.google.pubsub.v1.Subscription.toObject(message.subscriptions[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListSubscriptionsResponse to JSON. - * @function toJSON - * @memberof google.pubsub.v1.ListSubscriptionsResponse - * @instance - * @returns {Object.} JSON object - */ - ListSubscriptionsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListSubscriptionsResponse - * @function getTypeUrl - * @memberof google.pubsub.v1.ListSubscriptionsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListSubscriptionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.pubsub.v1.ListSubscriptionsResponse"; - }; - - return ListSubscriptionsResponse; - })(); - - v1.DeleteSubscriptionRequest = (function() { - - /** - * Properties of a DeleteSubscriptionRequest. - * @memberof google.pubsub.v1 - * @interface IDeleteSubscriptionRequest - * @property {string|null} [subscription] DeleteSubscriptionRequest subscription - */ - - /** - * Constructs a new DeleteSubscriptionRequest. - * @memberof google.pubsub.v1 - * @classdesc Represents a DeleteSubscriptionRequest. - * @implements IDeleteSubscriptionRequest - * @constructor - * @param {google.pubsub.v1.IDeleteSubscriptionRequest=} [properties] Properties to set - */ - function DeleteSubscriptionRequest(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]]; - } - - /** - * DeleteSubscriptionRequest subscription. - * @member {string} subscription - * @memberof google.pubsub.v1.DeleteSubscriptionRequest - * @instance - */ - DeleteSubscriptionRequest.prototype.subscription = ""; - - /** - * Creates a new DeleteSubscriptionRequest instance using the specified properties. - * @function create - * @memberof google.pubsub.v1.DeleteSubscriptionRequest - * @static - * @param {google.pubsub.v1.IDeleteSubscriptionRequest=} [properties] Properties to set - * @returns {google.pubsub.v1.DeleteSubscriptionRequest} DeleteSubscriptionRequest instance - */ - DeleteSubscriptionRequest.create = function create(properties) { - return new DeleteSubscriptionRequest(properties); - }; - - /** - * Encodes the specified DeleteSubscriptionRequest message. Does not implicitly {@link google.pubsub.v1.DeleteSubscriptionRequest.verify|verify} messages. - * @function encode - * @memberof google.pubsub.v1.DeleteSubscriptionRequest - * @static - * @param {google.pubsub.v1.IDeleteSubscriptionRequest} message DeleteSubscriptionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteSubscriptionRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.subscription != null && Object.hasOwnProperty.call(message, "subscription")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.subscription); - return writer; - }; - - /** - * Encodes the specified DeleteSubscriptionRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.DeleteSubscriptionRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.pubsub.v1.DeleteSubscriptionRequest - * @static - * @param {google.pubsub.v1.IDeleteSubscriptionRequest} message DeleteSubscriptionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteSubscriptionRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteSubscriptionRequest message from the specified reader or buffer. - * @function decode - * @memberof google.pubsub.v1.DeleteSubscriptionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.pubsub.v1.DeleteSubscriptionRequest} DeleteSubscriptionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteSubscriptionRequest.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.pubsub.v1.DeleteSubscriptionRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.subscription = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteSubscriptionRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.pubsub.v1.DeleteSubscriptionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.pubsub.v1.DeleteSubscriptionRequest} DeleteSubscriptionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteSubscriptionRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteSubscriptionRequest message. - * @function verify - * @memberof google.pubsub.v1.DeleteSubscriptionRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteSubscriptionRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.subscription != null && message.hasOwnProperty("subscription")) - if (!$util.isString(message.subscription)) - return "subscription: string expected"; - return null; - }; - - /** - * Creates a DeleteSubscriptionRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.pubsub.v1.DeleteSubscriptionRequest - * @static - * @param {Object.} object Plain object - * @returns {google.pubsub.v1.DeleteSubscriptionRequest} DeleteSubscriptionRequest - */ - DeleteSubscriptionRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.pubsub.v1.DeleteSubscriptionRequest) - return object; - var message = new $root.google.pubsub.v1.DeleteSubscriptionRequest(); - if (object.subscription != null) - message.subscription = String(object.subscription); - return message; - }; - - /** - * Creates a plain object from a DeleteSubscriptionRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.pubsub.v1.DeleteSubscriptionRequest - * @static - * @param {google.pubsub.v1.DeleteSubscriptionRequest} message DeleteSubscriptionRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteSubscriptionRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.subscription = ""; - if (message.subscription != null && message.hasOwnProperty("subscription")) - object.subscription = message.subscription; - return object; - }; - - /** - * Converts this DeleteSubscriptionRequest to JSON. - * @function toJSON - * @memberof google.pubsub.v1.DeleteSubscriptionRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteSubscriptionRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteSubscriptionRequest - * @function getTypeUrl - * @memberof google.pubsub.v1.DeleteSubscriptionRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteSubscriptionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.pubsub.v1.DeleteSubscriptionRequest"; - }; - - return DeleteSubscriptionRequest; - })(); - - v1.ModifyPushConfigRequest = (function() { - - /** - * Properties of a ModifyPushConfigRequest. - * @memberof google.pubsub.v1 - * @interface IModifyPushConfigRequest - * @property {string|null} [subscription] ModifyPushConfigRequest subscription - * @property {google.pubsub.v1.IPushConfig|null} [pushConfig] ModifyPushConfigRequest pushConfig - */ - - /** - * Constructs a new ModifyPushConfigRequest. - * @memberof google.pubsub.v1 - * @classdesc Represents a ModifyPushConfigRequest. - * @implements IModifyPushConfigRequest - * @constructor - * @param {google.pubsub.v1.IModifyPushConfigRequest=} [properties] Properties to set - */ - function ModifyPushConfigRequest(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]]; - } - - /** - * ModifyPushConfigRequest subscription. - * @member {string} subscription - * @memberof google.pubsub.v1.ModifyPushConfigRequest - * @instance - */ - ModifyPushConfigRequest.prototype.subscription = ""; - - /** - * ModifyPushConfigRequest pushConfig. - * @member {google.pubsub.v1.IPushConfig|null|undefined} pushConfig - * @memberof google.pubsub.v1.ModifyPushConfigRequest - * @instance - */ - ModifyPushConfigRequest.prototype.pushConfig = null; - - /** - * Creates a new ModifyPushConfigRequest instance using the specified properties. - * @function create - * @memberof google.pubsub.v1.ModifyPushConfigRequest - * @static - * @param {google.pubsub.v1.IModifyPushConfigRequest=} [properties] Properties to set - * @returns {google.pubsub.v1.ModifyPushConfigRequest} ModifyPushConfigRequest instance - */ - ModifyPushConfigRequest.create = function create(properties) { - return new ModifyPushConfigRequest(properties); - }; - - /** - * Encodes the specified ModifyPushConfigRequest message. Does not implicitly {@link google.pubsub.v1.ModifyPushConfigRequest.verify|verify} messages. - * @function encode - * @memberof google.pubsub.v1.ModifyPushConfigRequest - * @static - * @param {google.pubsub.v1.IModifyPushConfigRequest} message ModifyPushConfigRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ModifyPushConfigRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.subscription != null && Object.hasOwnProperty.call(message, "subscription")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.subscription); - if (message.pushConfig != null && Object.hasOwnProperty.call(message, "pushConfig")) - $root.google.pubsub.v1.PushConfig.encode(message.pushConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ModifyPushConfigRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.ModifyPushConfigRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.pubsub.v1.ModifyPushConfigRequest - * @static - * @param {google.pubsub.v1.IModifyPushConfigRequest} message ModifyPushConfigRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ModifyPushConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ModifyPushConfigRequest message from the specified reader or buffer. - * @function decode - * @memberof google.pubsub.v1.ModifyPushConfigRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.pubsub.v1.ModifyPushConfigRequest} ModifyPushConfigRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ModifyPushConfigRequest.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.pubsub.v1.ModifyPushConfigRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.subscription = reader.string(); - break; - } - case 2: { - message.pushConfig = $root.google.pubsub.v1.PushConfig.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ModifyPushConfigRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.pubsub.v1.ModifyPushConfigRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.pubsub.v1.ModifyPushConfigRequest} ModifyPushConfigRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ModifyPushConfigRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ModifyPushConfigRequest message. - * @function verify - * @memberof google.pubsub.v1.ModifyPushConfigRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ModifyPushConfigRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.subscription != null && message.hasOwnProperty("subscription")) - if (!$util.isString(message.subscription)) - return "subscription: string expected"; - if (message.pushConfig != null && message.hasOwnProperty("pushConfig")) { - var error = $root.google.pubsub.v1.PushConfig.verify(message.pushConfig); - if (error) - return "pushConfig." + error; - } - return null; - }; - - /** - * Creates a ModifyPushConfigRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.pubsub.v1.ModifyPushConfigRequest - * @static - * @param {Object.} object Plain object - * @returns {google.pubsub.v1.ModifyPushConfigRequest} ModifyPushConfigRequest - */ - ModifyPushConfigRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.pubsub.v1.ModifyPushConfigRequest) - return object; - var message = new $root.google.pubsub.v1.ModifyPushConfigRequest(); - if (object.subscription != null) - message.subscription = String(object.subscription); - if (object.pushConfig != null) { - if (typeof object.pushConfig !== "object") - throw TypeError(".google.pubsub.v1.ModifyPushConfigRequest.pushConfig: object expected"); - message.pushConfig = $root.google.pubsub.v1.PushConfig.fromObject(object.pushConfig); - } - return message; - }; - - /** - * Creates a plain object from a ModifyPushConfigRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.pubsub.v1.ModifyPushConfigRequest - * @static - * @param {google.pubsub.v1.ModifyPushConfigRequest} message ModifyPushConfigRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ModifyPushConfigRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.subscription = ""; - object.pushConfig = null; - } - if (message.subscription != null && message.hasOwnProperty("subscription")) - object.subscription = message.subscription; - if (message.pushConfig != null && message.hasOwnProperty("pushConfig")) - object.pushConfig = $root.google.pubsub.v1.PushConfig.toObject(message.pushConfig, options); - return object; - }; - - /** - * Converts this ModifyPushConfigRequest to JSON. - * @function toJSON - * @memberof google.pubsub.v1.ModifyPushConfigRequest - * @instance - * @returns {Object.} JSON object - */ - ModifyPushConfigRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ModifyPushConfigRequest - * @function getTypeUrl - * @memberof google.pubsub.v1.ModifyPushConfigRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ModifyPushConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.pubsub.v1.ModifyPushConfigRequest"; - }; - - return ModifyPushConfigRequest; - })(); - - v1.PullRequest = (function() { - - /** - * Properties of a PullRequest. - * @memberof google.pubsub.v1 - * @interface IPullRequest - * @property {string|null} [subscription] PullRequest subscription - * @property {boolean|null} [returnImmediately] PullRequest returnImmediately - * @property {number|null} [maxMessages] PullRequest maxMessages - */ - - /** - * Constructs a new PullRequest. - * @memberof google.pubsub.v1 - * @classdesc Represents a PullRequest. - * @implements IPullRequest - * @constructor - * @param {google.pubsub.v1.IPullRequest=} [properties] Properties to set - */ - function PullRequest(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]]; - } - - /** - * PullRequest subscription. - * @member {string} subscription - * @memberof google.pubsub.v1.PullRequest - * @instance - */ - PullRequest.prototype.subscription = ""; - - /** - * PullRequest returnImmediately. - * @member {boolean} returnImmediately - * @memberof google.pubsub.v1.PullRequest - * @instance - */ - PullRequest.prototype.returnImmediately = false; - - /** - * PullRequest maxMessages. - * @member {number} maxMessages - * @memberof google.pubsub.v1.PullRequest - * @instance - */ - PullRequest.prototype.maxMessages = 0; - - /** - * Creates a new PullRequest instance using the specified properties. - * @function create - * @memberof google.pubsub.v1.PullRequest - * @static - * @param {google.pubsub.v1.IPullRequest=} [properties] Properties to set - * @returns {google.pubsub.v1.PullRequest} PullRequest instance - */ - PullRequest.create = function create(properties) { - return new PullRequest(properties); - }; - - /** - * Encodes the specified PullRequest message. Does not implicitly {@link google.pubsub.v1.PullRequest.verify|verify} messages. - * @function encode - * @memberof google.pubsub.v1.PullRequest - * @static - * @param {google.pubsub.v1.IPullRequest} message PullRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PullRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.subscription != null && Object.hasOwnProperty.call(message, "subscription")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.subscription); - if (message.returnImmediately != null && Object.hasOwnProperty.call(message, "returnImmediately")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.returnImmediately); - if (message.maxMessages != null && Object.hasOwnProperty.call(message, "maxMessages")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.maxMessages); - return writer; - }; - - /** - * Encodes the specified PullRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.PullRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.pubsub.v1.PullRequest - * @static - * @param {google.pubsub.v1.IPullRequest} message PullRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PullRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PullRequest message from the specified reader or buffer. - * @function decode - * @memberof google.pubsub.v1.PullRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.pubsub.v1.PullRequest} PullRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PullRequest.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.pubsub.v1.PullRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.subscription = reader.string(); - break; - } - case 2: { - message.returnImmediately = reader.bool(); - break; - } - case 3: { - message.maxMessages = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PullRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.pubsub.v1.PullRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.pubsub.v1.PullRequest} PullRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PullRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PullRequest message. - * @function verify - * @memberof google.pubsub.v1.PullRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PullRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.subscription != null && message.hasOwnProperty("subscription")) - if (!$util.isString(message.subscription)) - return "subscription: string expected"; - if (message.returnImmediately != null && message.hasOwnProperty("returnImmediately")) - if (typeof message.returnImmediately !== "boolean") - return "returnImmediately: boolean expected"; - if (message.maxMessages != null && message.hasOwnProperty("maxMessages")) - if (!$util.isInteger(message.maxMessages)) - return "maxMessages: integer expected"; - return null; - }; - - /** - * Creates a PullRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.pubsub.v1.PullRequest - * @static - * @param {Object.} object Plain object - * @returns {google.pubsub.v1.PullRequest} PullRequest - */ - PullRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.pubsub.v1.PullRequest) - return object; - var message = new $root.google.pubsub.v1.PullRequest(); - if (object.subscription != null) - message.subscription = String(object.subscription); - if (object.returnImmediately != null) - message.returnImmediately = Boolean(object.returnImmediately); - if (object.maxMessages != null) - message.maxMessages = object.maxMessages | 0; - return message; - }; - - /** - * Creates a plain object from a PullRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.pubsub.v1.PullRequest - * @static - * @param {google.pubsub.v1.PullRequest} message PullRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PullRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.subscription = ""; - object.returnImmediately = false; - object.maxMessages = 0; - } - if (message.subscription != null && message.hasOwnProperty("subscription")) - object.subscription = message.subscription; - if (message.returnImmediately != null && message.hasOwnProperty("returnImmediately")) - object.returnImmediately = message.returnImmediately; - if (message.maxMessages != null && message.hasOwnProperty("maxMessages")) - object.maxMessages = message.maxMessages; - return object; - }; - - /** - * Converts this PullRequest to JSON. - * @function toJSON - * @memberof google.pubsub.v1.PullRequest - * @instance - * @returns {Object.} JSON object - */ - PullRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PullRequest - * @function getTypeUrl - * @memberof google.pubsub.v1.PullRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PullRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.pubsub.v1.PullRequest"; - }; - - return PullRequest; - })(); - - v1.PullResponse = (function() { - - /** - * Properties of a PullResponse. - * @memberof google.pubsub.v1 - * @interface IPullResponse - * @property {Array.|null} [receivedMessages] PullResponse receivedMessages - */ - - /** - * Constructs a new PullResponse. - * @memberof google.pubsub.v1 - * @classdesc Represents a PullResponse. - * @implements IPullResponse - * @constructor - * @param {google.pubsub.v1.IPullResponse=} [properties] Properties to set - */ - function PullResponse(properties) { - this.receivedMessages = []; - 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]]; - } - - /** - * PullResponse receivedMessages. - * @member {Array.} receivedMessages - * @memberof google.pubsub.v1.PullResponse - * @instance - */ - PullResponse.prototype.receivedMessages = $util.emptyArray; - - /** - * Creates a new PullResponse instance using the specified properties. - * @function create - * @memberof google.pubsub.v1.PullResponse - * @static - * @param {google.pubsub.v1.IPullResponse=} [properties] Properties to set - * @returns {google.pubsub.v1.PullResponse} PullResponse instance - */ - PullResponse.create = function create(properties) { - return new PullResponse(properties); - }; - - /** - * Encodes the specified PullResponse message. Does not implicitly {@link google.pubsub.v1.PullResponse.verify|verify} messages. - * @function encode - * @memberof google.pubsub.v1.PullResponse - * @static - * @param {google.pubsub.v1.IPullResponse} message PullResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PullResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.receivedMessages != null && message.receivedMessages.length) - for (var i = 0; i < message.receivedMessages.length; ++i) - $root.google.pubsub.v1.ReceivedMessage.encode(message.receivedMessages[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified PullResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.PullResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.pubsub.v1.PullResponse - * @static - * @param {google.pubsub.v1.IPullResponse} message PullResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PullResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PullResponse message from the specified reader or buffer. - * @function decode - * @memberof google.pubsub.v1.PullResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.pubsub.v1.PullResponse} PullResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PullResponse.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.pubsub.v1.PullResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.receivedMessages && message.receivedMessages.length)) - message.receivedMessages = []; - message.receivedMessages.push($root.google.pubsub.v1.ReceivedMessage.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PullResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.pubsub.v1.PullResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.pubsub.v1.PullResponse} PullResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PullResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PullResponse message. - * @function verify - * @memberof google.pubsub.v1.PullResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PullResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.receivedMessages != null && message.hasOwnProperty("receivedMessages")) { - if (!Array.isArray(message.receivedMessages)) - return "receivedMessages: array expected"; - for (var i = 0; i < message.receivedMessages.length; ++i) { - var error = $root.google.pubsub.v1.ReceivedMessage.verify(message.receivedMessages[i]); - if (error) - return "receivedMessages." + error; - } - } - return null; - }; - - /** - * Creates a PullResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.pubsub.v1.PullResponse - * @static - * @param {Object.} object Plain object - * @returns {google.pubsub.v1.PullResponse} PullResponse - */ - PullResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.pubsub.v1.PullResponse) - return object; - var message = new $root.google.pubsub.v1.PullResponse(); - if (object.receivedMessages) { - if (!Array.isArray(object.receivedMessages)) - throw TypeError(".google.pubsub.v1.PullResponse.receivedMessages: array expected"); - message.receivedMessages = []; - for (var i = 0; i < object.receivedMessages.length; ++i) { - if (typeof object.receivedMessages[i] !== "object") - throw TypeError(".google.pubsub.v1.PullResponse.receivedMessages: object expected"); - message.receivedMessages[i] = $root.google.pubsub.v1.ReceivedMessage.fromObject(object.receivedMessages[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a PullResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.pubsub.v1.PullResponse - * @static - * @param {google.pubsub.v1.PullResponse} message PullResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PullResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.receivedMessages = []; - if (message.receivedMessages && message.receivedMessages.length) { - object.receivedMessages = []; - for (var j = 0; j < message.receivedMessages.length; ++j) - object.receivedMessages[j] = $root.google.pubsub.v1.ReceivedMessage.toObject(message.receivedMessages[j], options); - } - return object; - }; - - /** - * Converts this PullResponse to JSON. - * @function toJSON - * @memberof google.pubsub.v1.PullResponse - * @instance - * @returns {Object.} JSON object - */ - PullResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PullResponse - * @function getTypeUrl - * @memberof google.pubsub.v1.PullResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PullResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.pubsub.v1.PullResponse"; - }; - - return PullResponse; - })(); - - v1.ModifyAckDeadlineRequest = (function() { - - /** - * Properties of a ModifyAckDeadlineRequest. - * @memberof google.pubsub.v1 - * @interface IModifyAckDeadlineRequest - * @property {string|null} [subscription] ModifyAckDeadlineRequest subscription - * @property {Array.|null} [ackIds] ModifyAckDeadlineRequest ackIds - * @property {number|null} [ackDeadlineSeconds] ModifyAckDeadlineRequest ackDeadlineSeconds - */ - - /** - * Constructs a new ModifyAckDeadlineRequest. - * @memberof google.pubsub.v1 - * @classdesc Represents a ModifyAckDeadlineRequest. - * @implements IModifyAckDeadlineRequest - * @constructor - * @param {google.pubsub.v1.IModifyAckDeadlineRequest=} [properties] Properties to set - */ - function ModifyAckDeadlineRequest(properties) { - this.ackIds = []; - 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]]; - } - - /** - * ModifyAckDeadlineRequest subscription. - * @member {string} subscription - * @memberof google.pubsub.v1.ModifyAckDeadlineRequest - * @instance - */ - ModifyAckDeadlineRequest.prototype.subscription = ""; - - /** - * ModifyAckDeadlineRequest ackIds. - * @member {Array.} ackIds - * @memberof google.pubsub.v1.ModifyAckDeadlineRequest - * @instance - */ - ModifyAckDeadlineRequest.prototype.ackIds = $util.emptyArray; - - /** - * ModifyAckDeadlineRequest ackDeadlineSeconds. - * @member {number} ackDeadlineSeconds - * @memberof google.pubsub.v1.ModifyAckDeadlineRequest - * @instance - */ - ModifyAckDeadlineRequest.prototype.ackDeadlineSeconds = 0; - - /** - * Creates a new ModifyAckDeadlineRequest instance using the specified properties. - * @function create - * @memberof google.pubsub.v1.ModifyAckDeadlineRequest - * @static - * @param {google.pubsub.v1.IModifyAckDeadlineRequest=} [properties] Properties to set - * @returns {google.pubsub.v1.ModifyAckDeadlineRequest} ModifyAckDeadlineRequest instance - */ - ModifyAckDeadlineRequest.create = function create(properties) { - return new ModifyAckDeadlineRequest(properties); - }; - - /** - * Encodes the specified ModifyAckDeadlineRequest message. Does not implicitly {@link google.pubsub.v1.ModifyAckDeadlineRequest.verify|verify} messages. - * @function encode - * @memberof google.pubsub.v1.ModifyAckDeadlineRequest - * @static - * @param {google.pubsub.v1.IModifyAckDeadlineRequest} message ModifyAckDeadlineRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ModifyAckDeadlineRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.subscription != null && Object.hasOwnProperty.call(message, "subscription")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.subscription); - if (message.ackDeadlineSeconds != null && Object.hasOwnProperty.call(message, "ackDeadlineSeconds")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.ackDeadlineSeconds); - if (message.ackIds != null && message.ackIds.length) - for (var i = 0; i < message.ackIds.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.ackIds[i]); - return writer; - }; - - /** - * Encodes the specified ModifyAckDeadlineRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.ModifyAckDeadlineRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.pubsub.v1.ModifyAckDeadlineRequest - * @static - * @param {google.pubsub.v1.IModifyAckDeadlineRequest} message ModifyAckDeadlineRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ModifyAckDeadlineRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ModifyAckDeadlineRequest message from the specified reader or buffer. - * @function decode - * @memberof google.pubsub.v1.ModifyAckDeadlineRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.pubsub.v1.ModifyAckDeadlineRequest} ModifyAckDeadlineRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ModifyAckDeadlineRequest.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.pubsub.v1.ModifyAckDeadlineRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.subscription = reader.string(); - break; - } - case 4: { - if (!(message.ackIds && message.ackIds.length)) - message.ackIds = []; - message.ackIds.push(reader.string()); - break; - } - case 3: { - message.ackDeadlineSeconds = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ModifyAckDeadlineRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.pubsub.v1.ModifyAckDeadlineRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.pubsub.v1.ModifyAckDeadlineRequest} ModifyAckDeadlineRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ModifyAckDeadlineRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ModifyAckDeadlineRequest message. - * @function verify - * @memberof google.pubsub.v1.ModifyAckDeadlineRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ModifyAckDeadlineRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.subscription != null && message.hasOwnProperty("subscription")) - if (!$util.isString(message.subscription)) - return "subscription: string expected"; - if (message.ackIds != null && message.hasOwnProperty("ackIds")) { - if (!Array.isArray(message.ackIds)) - return "ackIds: array expected"; - for (var i = 0; i < message.ackIds.length; ++i) - if (!$util.isString(message.ackIds[i])) - return "ackIds: string[] expected"; - } - if (message.ackDeadlineSeconds != null && message.hasOwnProperty("ackDeadlineSeconds")) - if (!$util.isInteger(message.ackDeadlineSeconds)) - return "ackDeadlineSeconds: integer expected"; - return null; - }; - - /** - * Creates a ModifyAckDeadlineRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.pubsub.v1.ModifyAckDeadlineRequest - * @static - * @param {Object.} object Plain object - * @returns {google.pubsub.v1.ModifyAckDeadlineRequest} ModifyAckDeadlineRequest - */ - ModifyAckDeadlineRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.pubsub.v1.ModifyAckDeadlineRequest) - return object; - var message = new $root.google.pubsub.v1.ModifyAckDeadlineRequest(); - if (object.subscription != null) - message.subscription = String(object.subscription); - if (object.ackIds) { - if (!Array.isArray(object.ackIds)) - throw TypeError(".google.pubsub.v1.ModifyAckDeadlineRequest.ackIds: array expected"); - message.ackIds = []; - for (var i = 0; i < object.ackIds.length; ++i) - message.ackIds[i] = String(object.ackIds[i]); - } - if (object.ackDeadlineSeconds != null) - message.ackDeadlineSeconds = object.ackDeadlineSeconds | 0; - return message; - }; - - /** - * Creates a plain object from a ModifyAckDeadlineRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.pubsub.v1.ModifyAckDeadlineRequest - * @static - * @param {google.pubsub.v1.ModifyAckDeadlineRequest} message ModifyAckDeadlineRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ModifyAckDeadlineRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.ackIds = []; - if (options.defaults) { - object.subscription = ""; - object.ackDeadlineSeconds = 0; - } - if (message.subscription != null && message.hasOwnProperty("subscription")) - object.subscription = message.subscription; - if (message.ackDeadlineSeconds != null && message.hasOwnProperty("ackDeadlineSeconds")) - object.ackDeadlineSeconds = message.ackDeadlineSeconds; - if (message.ackIds && message.ackIds.length) { - object.ackIds = []; - for (var j = 0; j < message.ackIds.length; ++j) - object.ackIds[j] = message.ackIds[j]; - } - return object; - }; - - /** - * Converts this ModifyAckDeadlineRequest to JSON. - * @function toJSON - * @memberof google.pubsub.v1.ModifyAckDeadlineRequest - * @instance - * @returns {Object.} JSON object - */ - ModifyAckDeadlineRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ModifyAckDeadlineRequest - * @function getTypeUrl - * @memberof google.pubsub.v1.ModifyAckDeadlineRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ModifyAckDeadlineRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.pubsub.v1.ModifyAckDeadlineRequest"; - }; - - return ModifyAckDeadlineRequest; - })(); - - v1.AcknowledgeRequest = (function() { - - /** - * Properties of an AcknowledgeRequest. - * @memberof google.pubsub.v1 - * @interface IAcknowledgeRequest - * @property {string|null} [subscription] AcknowledgeRequest subscription - * @property {Array.|null} [ackIds] AcknowledgeRequest ackIds - */ - - /** - * Constructs a new AcknowledgeRequest. - * @memberof google.pubsub.v1 - * @classdesc Represents an AcknowledgeRequest. - * @implements IAcknowledgeRequest - * @constructor - * @param {google.pubsub.v1.IAcknowledgeRequest=} [properties] Properties to set - */ - function AcknowledgeRequest(properties) { - this.ackIds = []; - 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]]; - } - - /** - * AcknowledgeRequest subscription. - * @member {string} subscription - * @memberof google.pubsub.v1.AcknowledgeRequest - * @instance - */ - AcknowledgeRequest.prototype.subscription = ""; - - /** - * AcknowledgeRequest ackIds. - * @member {Array.} ackIds - * @memberof google.pubsub.v1.AcknowledgeRequest - * @instance - */ - AcknowledgeRequest.prototype.ackIds = $util.emptyArray; - - /** - * Creates a new AcknowledgeRequest instance using the specified properties. - * @function create - * @memberof google.pubsub.v1.AcknowledgeRequest - * @static - * @param {google.pubsub.v1.IAcknowledgeRequest=} [properties] Properties to set - * @returns {google.pubsub.v1.AcknowledgeRequest} AcknowledgeRequest instance - */ - AcknowledgeRequest.create = function create(properties) { - return new AcknowledgeRequest(properties); - }; - - /** - * Encodes the specified AcknowledgeRequest message. Does not implicitly {@link google.pubsub.v1.AcknowledgeRequest.verify|verify} messages. - * @function encode - * @memberof google.pubsub.v1.AcknowledgeRequest - * @static - * @param {google.pubsub.v1.IAcknowledgeRequest} message AcknowledgeRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AcknowledgeRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.subscription != null && Object.hasOwnProperty.call(message, "subscription")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.subscription); - if (message.ackIds != null && message.ackIds.length) - for (var i = 0; i < message.ackIds.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.ackIds[i]); - return writer; - }; - - /** - * Encodes the specified AcknowledgeRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.AcknowledgeRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.pubsub.v1.AcknowledgeRequest - * @static - * @param {google.pubsub.v1.IAcknowledgeRequest} message AcknowledgeRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AcknowledgeRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AcknowledgeRequest message from the specified reader or buffer. - * @function decode - * @memberof google.pubsub.v1.AcknowledgeRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.pubsub.v1.AcknowledgeRequest} AcknowledgeRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AcknowledgeRequest.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.pubsub.v1.AcknowledgeRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.subscription = reader.string(); - break; - } - case 2: { - if (!(message.ackIds && message.ackIds.length)) - message.ackIds = []; - message.ackIds.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AcknowledgeRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.pubsub.v1.AcknowledgeRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.pubsub.v1.AcknowledgeRequest} AcknowledgeRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AcknowledgeRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AcknowledgeRequest message. - * @function verify - * @memberof google.pubsub.v1.AcknowledgeRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AcknowledgeRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.subscription != null && message.hasOwnProperty("subscription")) - if (!$util.isString(message.subscription)) - return "subscription: string expected"; - if (message.ackIds != null && message.hasOwnProperty("ackIds")) { - if (!Array.isArray(message.ackIds)) - return "ackIds: array expected"; - for (var i = 0; i < message.ackIds.length; ++i) - if (!$util.isString(message.ackIds[i])) - return "ackIds: string[] expected"; - } - return null; - }; - - /** - * Creates an AcknowledgeRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.pubsub.v1.AcknowledgeRequest - * @static - * @param {Object.} object Plain object - * @returns {google.pubsub.v1.AcknowledgeRequest} AcknowledgeRequest - */ - AcknowledgeRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.pubsub.v1.AcknowledgeRequest) - return object; - var message = new $root.google.pubsub.v1.AcknowledgeRequest(); - if (object.subscription != null) - message.subscription = String(object.subscription); - if (object.ackIds) { - if (!Array.isArray(object.ackIds)) - throw TypeError(".google.pubsub.v1.AcknowledgeRequest.ackIds: array expected"); - message.ackIds = []; - for (var i = 0; i < object.ackIds.length; ++i) - message.ackIds[i] = String(object.ackIds[i]); - } - return message; - }; - - /** - * Creates a plain object from an AcknowledgeRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.pubsub.v1.AcknowledgeRequest - * @static - * @param {google.pubsub.v1.AcknowledgeRequest} message AcknowledgeRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AcknowledgeRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.ackIds = []; - if (options.defaults) - object.subscription = ""; - if (message.subscription != null && message.hasOwnProperty("subscription")) - object.subscription = message.subscription; - if (message.ackIds && message.ackIds.length) { - object.ackIds = []; - for (var j = 0; j < message.ackIds.length; ++j) - object.ackIds[j] = message.ackIds[j]; - } - return object; - }; - - /** - * Converts this AcknowledgeRequest to JSON. - * @function toJSON - * @memberof google.pubsub.v1.AcknowledgeRequest - * @instance - * @returns {Object.} JSON object - */ - AcknowledgeRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AcknowledgeRequest - * @function getTypeUrl - * @memberof google.pubsub.v1.AcknowledgeRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AcknowledgeRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.pubsub.v1.AcknowledgeRequest"; - }; - - return AcknowledgeRequest; - })(); - - v1.StreamingPullRequest = (function() { - - /** - * Properties of a StreamingPullRequest. - * @memberof google.pubsub.v1 - * @interface IStreamingPullRequest - * @property {string|null} [subscription] StreamingPullRequest subscription - * @property {Array.|null} [ackIds] StreamingPullRequest ackIds - * @property {Array.|null} [modifyDeadlineSeconds] StreamingPullRequest modifyDeadlineSeconds - * @property {Array.|null} [modifyDeadlineAckIds] StreamingPullRequest modifyDeadlineAckIds - * @property {number|null} [streamAckDeadlineSeconds] StreamingPullRequest streamAckDeadlineSeconds - * @property {string|null} [clientId] StreamingPullRequest clientId - * @property {number|Long|null} [maxOutstandingMessages] StreamingPullRequest maxOutstandingMessages - * @property {number|Long|null} [maxOutstandingBytes] StreamingPullRequest maxOutstandingBytes - */ - - /** - * Constructs a new StreamingPullRequest. - * @memberof google.pubsub.v1 - * @classdesc Represents a StreamingPullRequest. - * @implements IStreamingPullRequest - * @constructor - * @param {google.pubsub.v1.IStreamingPullRequest=} [properties] Properties to set - */ - function StreamingPullRequest(properties) { - this.ackIds = []; - this.modifyDeadlineSeconds = []; - this.modifyDeadlineAckIds = []; - 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]]; - } - - /** - * StreamingPullRequest subscription. - * @member {string} subscription - * @memberof google.pubsub.v1.StreamingPullRequest - * @instance - */ - StreamingPullRequest.prototype.subscription = ""; - - /** - * StreamingPullRequest ackIds. - * @member {Array.} ackIds - * @memberof google.pubsub.v1.StreamingPullRequest - * @instance - */ - StreamingPullRequest.prototype.ackIds = $util.emptyArray; - - /** - * StreamingPullRequest modifyDeadlineSeconds. - * @member {Array.} modifyDeadlineSeconds - * @memberof google.pubsub.v1.StreamingPullRequest - * @instance - */ - StreamingPullRequest.prototype.modifyDeadlineSeconds = $util.emptyArray; - - /** - * StreamingPullRequest modifyDeadlineAckIds. - * @member {Array.} modifyDeadlineAckIds - * @memberof google.pubsub.v1.StreamingPullRequest - * @instance - */ - StreamingPullRequest.prototype.modifyDeadlineAckIds = $util.emptyArray; - - /** - * StreamingPullRequest streamAckDeadlineSeconds. - * @member {number} streamAckDeadlineSeconds - * @memberof google.pubsub.v1.StreamingPullRequest - * @instance - */ - StreamingPullRequest.prototype.streamAckDeadlineSeconds = 0; - - /** - * StreamingPullRequest clientId. - * @member {string} clientId - * @memberof google.pubsub.v1.StreamingPullRequest - * @instance - */ - StreamingPullRequest.prototype.clientId = ""; - - /** - * StreamingPullRequest maxOutstandingMessages. - * @member {number|Long} maxOutstandingMessages - * @memberof google.pubsub.v1.StreamingPullRequest - * @instance - */ - StreamingPullRequest.prototype.maxOutstandingMessages = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * StreamingPullRequest maxOutstandingBytes. - * @member {number|Long} maxOutstandingBytes - * @memberof google.pubsub.v1.StreamingPullRequest - * @instance - */ - StreamingPullRequest.prototype.maxOutstandingBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Creates a new StreamingPullRequest instance using the specified properties. - * @function create - * @memberof google.pubsub.v1.StreamingPullRequest - * @static - * @param {google.pubsub.v1.IStreamingPullRequest=} [properties] Properties to set - * @returns {google.pubsub.v1.StreamingPullRequest} StreamingPullRequest instance - */ - StreamingPullRequest.create = function create(properties) { - return new StreamingPullRequest(properties); - }; - - /** - * Encodes the specified StreamingPullRequest message. Does not implicitly {@link google.pubsub.v1.StreamingPullRequest.verify|verify} messages. - * @function encode - * @memberof google.pubsub.v1.StreamingPullRequest - * @static - * @param {google.pubsub.v1.IStreamingPullRequest} message StreamingPullRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StreamingPullRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.subscription != null && Object.hasOwnProperty.call(message, "subscription")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.subscription); - if (message.ackIds != null && message.ackIds.length) - for (var i = 0; i < message.ackIds.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.ackIds[i]); - if (message.modifyDeadlineSeconds != null && message.modifyDeadlineSeconds.length) { - writer.uint32(/* id 3, wireType 2 =*/26).fork(); - for (var i = 0; i < message.modifyDeadlineSeconds.length; ++i) - writer.int32(message.modifyDeadlineSeconds[i]); - writer.ldelim(); - } - if (message.modifyDeadlineAckIds != null && message.modifyDeadlineAckIds.length) - for (var i = 0; i < message.modifyDeadlineAckIds.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.modifyDeadlineAckIds[i]); - if (message.streamAckDeadlineSeconds != null && Object.hasOwnProperty.call(message, "streamAckDeadlineSeconds")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.streamAckDeadlineSeconds); - if (message.clientId != null && Object.hasOwnProperty.call(message, "clientId")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.clientId); - if (message.maxOutstandingMessages != null && Object.hasOwnProperty.call(message, "maxOutstandingMessages")) - writer.uint32(/* id 7, wireType 0 =*/56).int64(message.maxOutstandingMessages); - if (message.maxOutstandingBytes != null && Object.hasOwnProperty.call(message, "maxOutstandingBytes")) - writer.uint32(/* id 8, wireType 0 =*/64).int64(message.maxOutstandingBytes); - return writer; - }; - - /** - * Encodes the specified StreamingPullRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.StreamingPullRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.pubsub.v1.StreamingPullRequest - * @static - * @param {google.pubsub.v1.IStreamingPullRequest} message StreamingPullRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StreamingPullRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a StreamingPullRequest message from the specified reader or buffer. - * @function decode - * @memberof google.pubsub.v1.StreamingPullRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.pubsub.v1.StreamingPullRequest} StreamingPullRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StreamingPullRequest.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.pubsub.v1.StreamingPullRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.subscription = reader.string(); - break; - } - case 2: { - if (!(message.ackIds && message.ackIds.length)) - message.ackIds = []; - message.ackIds.push(reader.string()); - break; - } - case 3: { - if (!(message.modifyDeadlineSeconds && message.modifyDeadlineSeconds.length)) - message.modifyDeadlineSeconds = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.modifyDeadlineSeconds.push(reader.int32()); - } else - message.modifyDeadlineSeconds.push(reader.int32()); - break; - } - case 4: { - if (!(message.modifyDeadlineAckIds && message.modifyDeadlineAckIds.length)) - message.modifyDeadlineAckIds = []; - message.modifyDeadlineAckIds.push(reader.string()); - break; - } - case 5: { - message.streamAckDeadlineSeconds = reader.int32(); - break; - } - case 6: { - message.clientId = reader.string(); - break; - } - case 7: { - message.maxOutstandingMessages = reader.int64(); - break; - } - case 8: { - message.maxOutstandingBytes = reader.int64(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a StreamingPullRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.pubsub.v1.StreamingPullRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.pubsub.v1.StreamingPullRequest} StreamingPullRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StreamingPullRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a StreamingPullRequest message. - * @function verify - * @memberof google.pubsub.v1.StreamingPullRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - StreamingPullRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.subscription != null && message.hasOwnProperty("subscription")) - if (!$util.isString(message.subscription)) - return "subscription: string expected"; - if (message.ackIds != null && message.hasOwnProperty("ackIds")) { - if (!Array.isArray(message.ackIds)) - return "ackIds: array expected"; - for (var i = 0; i < message.ackIds.length; ++i) - if (!$util.isString(message.ackIds[i])) - return "ackIds: string[] expected"; - } - if (message.modifyDeadlineSeconds != null && message.hasOwnProperty("modifyDeadlineSeconds")) { - if (!Array.isArray(message.modifyDeadlineSeconds)) - return "modifyDeadlineSeconds: array expected"; - for (var i = 0; i < message.modifyDeadlineSeconds.length; ++i) - if (!$util.isInteger(message.modifyDeadlineSeconds[i])) - return "modifyDeadlineSeconds: integer[] expected"; - } - if (message.modifyDeadlineAckIds != null && message.hasOwnProperty("modifyDeadlineAckIds")) { - if (!Array.isArray(message.modifyDeadlineAckIds)) - return "modifyDeadlineAckIds: array expected"; - for (var i = 0; i < message.modifyDeadlineAckIds.length; ++i) - if (!$util.isString(message.modifyDeadlineAckIds[i])) - return "modifyDeadlineAckIds: string[] expected"; - } - if (message.streamAckDeadlineSeconds != null && message.hasOwnProperty("streamAckDeadlineSeconds")) - if (!$util.isInteger(message.streamAckDeadlineSeconds)) - return "streamAckDeadlineSeconds: integer expected"; - if (message.clientId != null && message.hasOwnProperty("clientId")) - if (!$util.isString(message.clientId)) - return "clientId: string expected"; - if (message.maxOutstandingMessages != null && message.hasOwnProperty("maxOutstandingMessages")) - if (!$util.isInteger(message.maxOutstandingMessages) && !(message.maxOutstandingMessages && $util.isInteger(message.maxOutstandingMessages.low) && $util.isInteger(message.maxOutstandingMessages.high))) - return "maxOutstandingMessages: integer|Long expected"; - if (message.maxOutstandingBytes != null && message.hasOwnProperty("maxOutstandingBytes")) - if (!$util.isInteger(message.maxOutstandingBytes) && !(message.maxOutstandingBytes && $util.isInteger(message.maxOutstandingBytes.low) && $util.isInteger(message.maxOutstandingBytes.high))) - return "maxOutstandingBytes: integer|Long expected"; - return null; - }; - - /** - * Creates a StreamingPullRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.pubsub.v1.StreamingPullRequest - * @static - * @param {Object.} object Plain object - * @returns {google.pubsub.v1.StreamingPullRequest} StreamingPullRequest - */ - StreamingPullRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.pubsub.v1.StreamingPullRequest) - return object; - var message = new $root.google.pubsub.v1.StreamingPullRequest(); - if (object.subscription != null) - message.subscription = String(object.subscription); - if (object.ackIds) { - if (!Array.isArray(object.ackIds)) - throw TypeError(".google.pubsub.v1.StreamingPullRequest.ackIds: array expected"); - message.ackIds = []; - for (var i = 0; i < object.ackIds.length; ++i) - message.ackIds[i] = String(object.ackIds[i]); - } - if (object.modifyDeadlineSeconds) { - if (!Array.isArray(object.modifyDeadlineSeconds)) - throw TypeError(".google.pubsub.v1.StreamingPullRequest.modifyDeadlineSeconds: array expected"); - message.modifyDeadlineSeconds = []; - for (var i = 0; i < object.modifyDeadlineSeconds.length; ++i) - message.modifyDeadlineSeconds[i] = object.modifyDeadlineSeconds[i] | 0; - } - if (object.modifyDeadlineAckIds) { - if (!Array.isArray(object.modifyDeadlineAckIds)) - throw TypeError(".google.pubsub.v1.StreamingPullRequest.modifyDeadlineAckIds: array expected"); - message.modifyDeadlineAckIds = []; - for (var i = 0; i < object.modifyDeadlineAckIds.length; ++i) - message.modifyDeadlineAckIds[i] = String(object.modifyDeadlineAckIds[i]); - } - if (object.streamAckDeadlineSeconds != null) - message.streamAckDeadlineSeconds = object.streamAckDeadlineSeconds | 0; - if (object.clientId != null) - message.clientId = String(object.clientId); - if (object.maxOutstandingMessages != null) - if ($util.Long) - (message.maxOutstandingMessages = $util.Long.fromValue(object.maxOutstandingMessages)).unsigned = false; - else if (typeof object.maxOutstandingMessages === "string") - message.maxOutstandingMessages = parseInt(object.maxOutstandingMessages, 10); - else if (typeof object.maxOutstandingMessages === "number") - message.maxOutstandingMessages = object.maxOutstandingMessages; - else if (typeof object.maxOutstandingMessages === "object") - message.maxOutstandingMessages = new $util.LongBits(object.maxOutstandingMessages.low >>> 0, object.maxOutstandingMessages.high >>> 0).toNumber(); - if (object.maxOutstandingBytes != null) - if ($util.Long) - (message.maxOutstandingBytes = $util.Long.fromValue(object.maxOutstandingBytes)).unsigned = false; - else if (typeof object.maxOutstandingBytes === "string") - message.maxOutstandingBytes = parseInt(object.maxOutstandingBytes, 10); - else if (typeof object.maxOutstandingBytes === "number") - message.maxOutstandingBytes = object.maxOutstandingBytes; - else if (typeof object.maxOutstandingBytes === "object") - message.maxOutstandingBytes = new $util.LongBits(object.maxOutstandingBytes.low >>> 0, object.maxOutstandingBytes.high >>> 0).toNumber(); - return message; - }; - - /** - * Creates a plain object from a StreamingPullRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.pubsub.v1.StreamingPullRequest - * @static - * @param {google.pubsub.v1.StreamingPullRequest} message StreamingPullRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - StreamingPullRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.ackIds = []; - object.modifyDeadlineSeconds = []; - object.modifyDeadlineAckIds = []; - } - if (options.defaults) { - object.subscription = ""; - object.streamAckDeadlineSeconds = 0; - object.clientId = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.maxOutstandingMessages = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.maxOutstandingMessages = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.maxOutstandingBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.maxOutstandingBytes = options.longs === String ? "0" : 0; - } - if (message.subscription != null && message.hasOwnProperty("subscription")) - object.subscription = message.subscription; - if (message.ackIds && message.ackIds.length) { - object.ackIds = []; - for (var j = 0; j < message.ackIds.length; ++j) - object.ackIds[j] = message.ackIds[j]; - } - if (message.modifyDeadlineSeconds && message.modifyDeadlineSeconds.length) { - object.modifyDeadlineSeconds = []; - for (var j = 0; j < message.modifyDeadlineSeconds.length; ++j) - object.modifyDeadlineSeconds[j] = message.modifyDeadlineSeconds[j]; - } - if (message.modifyDeadlineAckIds && message.modifyDeadlineAckIds.length) { - object.modifyDeadlineAckIds = []; - for (var j = 0; j < message.modifyDeadlineAckIds.length; ++j) - object.modifyDeadlineAckIds[j] = message.modifyDeadlineAckIds[j]; - } - if (message.streamAckDeadlineSeconds != null && message.hasOwnProperty("streamAckDeadlineSeconds")) - object.streamAckDeadlineSeconds = message.streamAckDeadlineSeconds; - if (message.clientId != null && message.hasOwnProperty("clientId")) - object.clientId = message.clientId; - if (message.maxOutstandingMessages != null && message.hasOwnProperty("maxOutstandingMessages")) - if (typeof message.maxOutstandingMessages === "number") - object.maxOutstandingMessages = options.longs === String ? String(message.maxOutstandingMessages) : message.maxOutstandingMessages; - else - object.maxOutstandingMessages = options.longs === String ? $util.Long.prototype.toString.call(message.maxOutstandingMessages) : options.longs === Number ? new $util.LongBits(message.maxOutstandingMessages.low >>> 0, message.maxOutstandingMessages.high >>> 0).toNumber() : message.maxOutstandingMessages; - if (message.maxOutstandingBytes != null && message.hasOwnProperty("maxOutstandingBytes")) - if (typeof message.maxOutstandingBytes === "number") - object.maxOutstandingBytes = options.longs === String ? String(message.maxOutstandingBytes) : message.maxOutstandingBytes; - else - object.maxOutstandingBytes = options.longs === String ? $util.Long.prototype.toString.call(message.maxOutstandingBytes) : options.longs === Number ? new $util.LongBits(message.maxOutstandingBytes.low >>> 0, message.maxOutstandingBytes.high >>> 0).toNumber() : message.maxOutstandingBytes; - return object; - }; - - /** - * Converts this StreamingPullRequest to JSON. - * @function toJSON - * @memberof google.pubsub.v1.StreamingPullRequest - * @instance - * @returns {Object.} JSON object - */ - StreamingPullRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for StreamingPullRequest - * @function getTypeUrl - * @memberof google.pubsub.v1.StreamingPullRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - StreamingPullRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.pubsub.v1.StreamingPullRequest"; - }; - - return StreamingPullRequest; - })(); - - v1.StreamingPullResponse = (function() { - - /** - * Properties of a StreamingPullResponse. - * @memberof google.pubsub.v1 - * @interface IStreamingPullResponse - * @property {Array.|null} [receivedMessages] StreamingPullResponse receivedMessages - * @property {google.pubsub.v1.StreamingPullResponse.IAcknowledgeConfirmation|null} [acknowledgeConfirmation] StreamingPullResponse acknowledgeConfirmation - * @property {google.pubsub.v1.StreamingPullResponse.IModifyAckDeadlineConfirmation|null} [modifyAckDeadlineConfirmation] StreamingPullResponse modifyAckDeadlineConfirmation - * @property {google.pubsub.v1.StreamingPullResponse.ISubscriptionProperties|null} [subscriptionProperties] StreamingPullResponse subscriptionProperties - */ - - /** - * Constructs a new StreamingPullResponse. - * @memberof google.pubsub.v1 - * @classdesc Represents a StreamingPullResponse. - * @implements IStreamingPullResponse - * @constructor - * @param {google.pubsub.v1.IStreamingPullResponse=} [properties] Properties to set - */ - function StreamingPullResponse(properties) { - this.receivedMessages = []; - 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]]; - } - - /** - * StreamingPullResponse receivedMessages. - * @member {Array.} receivedMessages - * @memberof google.pubsub.v1.StreamingPullResponse - * @instance - */ - StreamingPullResponse.prototype.receivedMessages = $util.emptyArray; - - /** - * StreamingPullResponse acknowledgeConfirmation. - * @member {google.pubsub.v1.StreamingPullResponse.IAcknowledgeConfirmation|null|undefined} acknowledgeConfirmation - * @memberof google.pubsub.v1.StreamingPullResponse - * @instance - */ - StreamingPullResponse.prototype.acknowledgeConfirmation = null; - - /** - * StreamingPullResponse modifyAckDeadlineConfirmation. - * @member {google.pubsub.v1.StreamingPullResponse.IModifyAckDeadlineConfirmation|null|undefined} modifyAckDeadlineConfirmation - * @memberof google.pubsub.v1.StreamingPullResponse - * @instance - */ - StreamingPullResponse.prototype.modifyAckDeadlineConfirmation = null; - - /** - * StreamingPullResponse subscriptionProperties. - * @member {google.pubsub.v1.StreamingPullResponse.ISubscriptionProperties|null|undefined} subscriptionProperties - * @memberof google.pubsub.v1.StreamingPullResponse - * @instance - */ - StreamingPullResponse.prototype.subscriptionProperties = null; - - /** - * Creates a new StreamingPullResponse instance using the specified properties. - * @function create - * @memberof google.pubsub.v1.StreamingPullResponse - * @static - * @param {google.pubsub.v1.IStreamingPullResponse=} [properties] Properties to set - * @returns {google.pubsub.v1.StreamingPullResponse} StreamingPullResponse instance - */ - StreamingPullResponse.create = function create(properties) { - return new StreamingPullResponse(properties); - }; - - /** - * Encodes the specified StreamingPullResponse message. Does not implicitly {@link google.pubsub.v1.StreamingPullResponse.verify|verify} messages. - * @function encode - * @memberof google.pubsub.v1.StreamingPullResponse - * @static - * @param {google.pubsub.v1.IStreamingPullResponse} message StreamingPullResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StreamingPullResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.receivedMessages != null && message.receivedMessages.length) - for (var i = 0; i < message.receivedMessages.length; ++i) - $root.google.pubsub.v1.ReceivedMessage.encode(message.receivedMessages[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.modifyAckDeadlineConfirmation != null && Object.hasOwnProperty.call(message, "modifyAckDeadlineConfirmation")) - $root.google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation.encode(message.modifyAckDeadlineConfirmation, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.subscriptionProperties != null && Object.hasOwnProperty.call(message, "subscriptionProperties")) - $root.google.pubsub.v1.StreamingPullResponse.SubscriptionProperties.encode(message.subscriptionProperties, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.acknowledgeConfirmation != null && Object.hasOwnProperty.call(message, "acknowledgeConfirmation")) - $root.google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation.encode(message.acknowledgeConfirmation, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified StreamingPullResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.StreamingPullResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.pubsub.v1.StreamingPullResponse - * @static - * @param {google.pubsub.v1.IStreamingPullResponse} message StreamingPullResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StreamingPullResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a StreamingPullResponse message from the specified reader or buffer. - * @function decode - * @memberof google.pubsub.v1.StreamingPullResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.pubsub.v1.StreamingPullResponse} StreamingPullResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StreamingPullResponse.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.pubsub.v1.StreamingPullResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.receivedMessages && message.receivedMessages.length)) - message.receivedMessages = []; - message.receivedMessages.push($root.google.pubsub.v1.ReceivedMessage.decode(reader, reader.uint32())); - break; - } - case 5: { - message.acknowledgeConfirmation = $root.google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation.decode(reader, reader.uint32()); - break; - } - case 3: { - message.modifyAckDeadlineConfirmation = $root.google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation.decode(reader, reader.uint32()); - break; - } - case 4: { - message.subscriptionProperties = $root.google.pubsub.v1.StreamingPullResponse.SubscriptionProperties.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a StreamingPullResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.pubsub.v1.StreamingPullResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.pubsub.v1.StreamingPullResponse} StreamingPullResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StreamingPullResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a StreamingPullResponse message. - * @function verify - * @memberof google.pubsub.v1.StreamingPullResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - StreamingPullResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.receivedMessages != null && message.hasOwnProperty("receivedMessages")) { - if (!Array.isArray(message.receivedMessages)) - return "receivedMessages: array expected"; - for (var i = 0; i < message.receivedMessages.length; ++i) { - var error = $root.google.pubsub.v1.ReceivedMessage.verify(message.receivedMessages[i]); - if (error) - return "receivedMessages." + error; - } - } - if (message.acknowledgeConfirmation != null && message.hasOwnProperty("acknowledgeConfirmation")) { - var error = $root.google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation.verify(message.acknowledgeConfirmation); - if (error) - return "acknowledgeConfirmation." + error; - } - if (message.modifyAckDeadlineConfirmation != null && message.hasOwnProperty("modifyAckDeadlineConfirmation")) { - var error = $root.google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation.verify(message.modifyAckDeadlineConfirmation); - if (error) - return "modifyAckDeadlineConfirmation." + error; - } - if (message.subscriptionProperties != null && message.hasOwnProperty("subscriptionProperties")) { - var error = $root.google.pubsub.v1.StreamingPullResponse.SubscriptionProperties.verify(message.subscriptionProperties); - if (error) - return "subscriptionProperties." + error; - } - return null; - }; - - /** - * Creates a StreamingPullResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.pubsub.v1.StreamingPullResponse - * @static - * @param {Object.} object Plain object - * @returns {google.pubsub.v1.StreamingPullResponse} StreamingPullResponse - */ - StreamingPullResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.pubsub.v1.StreamingPullResponse) - return object; - var message = new $root.google.pubsub.v1.StreamingPullResponse(); - if (object.receivedMessages) { - if (!Array.isArray(object.receivedMessages)) - throw TypeError(".google.pubsub.v1.StreamingPullResponse.receivedMessages: array expected"); - message.receivedMessages = []; - for (var i = 0; i < object.receivedMessages.length; ++i) { - if (typeof object.receivedMessages[i] !== "object") - throw TypeError(".google.pubsub.v1.StreamingPullResponse.receivedMessages: object expected"); - message.receivedMessages[i] = $root.google.pubsub.v1.ReceivedMessage.fromObject(object.receivedMessages[i]); - } - } - if (object.acknowledgeConfirmation != null) { - if (typeof object.acknowledgeConfirmation !== "object") - throw TypeError(".google.pubsub.v1.StreamingPullResponse.acknowledgeConfirmation: object expected"); - message.acknowledgeConfirmation = $root.google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation.fromObject(object.acknowledgeConfirmation); - } - if (object.modifyAckDeadlineConfirmation != null) { - if (typeof object.modifyAckDeadlineConfirmation !== "object") - throw TypeError(".google.pubsub.v1.StreamingPullResponse.modifyAckDeadlineConfirmation: object expected"); - message.modifyAckDeadlineConfirmation = $root.google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation.fromObject(object.modifyAckDeadlineConfirmation); - } - if (object.subscriptionProperties != null) { - if (typeof object.subscriptionProperties !== "object") - throw TypeError(".google.pubsub.v1.StreamingPullResponse.subscriptionProperties: object expected"); - message.subscriptionProperties = $root.google.pubsub.v1.StreamingPullResponse.SubscriptionProperties.fromObject(object.subscriptionProperties); - } - return message; - }; - - /** - * Creates a plain object from a StreamingPullResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.pubsub.v1.StreamingPullResponse - * @static - * @param {google.pubsub.v1.StreamingPullResponse} message StreamingPullResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - StreamingPullResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.receivedMessages = []; - if (options.defaults) { - object.modifyAckDeadlineConfirmation = null; - object.subscriptionProperties = null; - object.acknowledgeConfirmation = null; - } - if (message.receivedMessages && message.receivedMessages.length) { - object.receivedMessages = []; - for (var j = 0; j < message.receivedMessages.length; ++j) - object.receivedMessages[j] = $root.google.pubsub.v1.ReceivedMessage.toObject(message.receivedMessages[j], options); - } - if (message.modifyAckDeadlineConfirmation != null && message.hasOwnProperty("modifyAckDeadlineConfirmation")) - object.modifyAckDeadlineConfirmation = $root.google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation.toObject(message.modifyAckDeadlineConfirmation, options); - if (message.subscriptionProperties != null && message.hasOwnProperty("subscriptionProperties")) - object.subscriptionProperties = $root.google.pubsub.v1.StreamingPullResponse.SubscriptionProperties.toObject(message.subscriptionProperties, options); - if (message.acknowledgeConfirmation != null && message.hasOwnProperty("acknowledgeConfirmation")) - object.acknowledgeConfirmation = $root.google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation.toObject(message.acknowledgeConfirmation, options); - return object; - }; - - /** - * Converts this StreamingPullResponse to JSON. - * @function toJSON - * @memberof google.pubsub.v1.StreamingPullResponse - * @instance - * @returns {Object.} JSON object - */ - StreamingPullResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for StreamingPullResponse - * @function getTypeUrl - * @memberof google.pubsub.v1.StreamingPullResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - StreamingPullResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.pubsub.v1.StreamingPullResponse"; - }; - - StreamingPullResponse.AcknowledgeConfirmation = (function() { - - /** - * Properties of an AcknowledgeConfirmation. - * @memberof google.pubsub.v1.StreamingPullResponse - * @interface IAcknowledgeConfirmation - * @property {Array.|null} [ackIds] AcknowledgeConfirmation ackIds - * @property {Array.|null} [invalidAckIds] AcknowledgeConfirmation invalidAckIds - * @property {Array.|null} [unorderedAckIds] AcknowledgeConfirmation unorderedAckIds - * @property {Array.|null} [temporaryFailedAckIds] AcknowledgeConfirmation temporaryFailedAckIds - */ - - /** - * Constructs a new AcknowledgeConfirmation. - * @memberof google.pubsub.v1.StreamingPullResponse - * @classdesc Represents an AcknowledgeConfirmation. - * @implements IAcknowledgeConfirmation - * @constructor - * @param {google.pubsub.v1.StreamingPullResponse.IAcknowledgeConfirmation=} [properties] Properties to set - */ - function AcknowledgeConfirmation(properties) { - this.ackIds = []; - this.invalidAckIds = []; - this.unorderedAckIds = []; - this.temporaryFailedAckIds = []; - 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]]; - } - - /** - * AcknowledgeConfirmation ackIds. - * @member {Array.} ackIds - * @memberof google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation - * @instance - */ - AcknowledgeConfirmation.prototype.ackIds = $util.emptyArray; - - /** - * AcknowledgeConfirmation invalidAckIds. - * @member {Array.} invalidAckIds - * @memberof google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation - * @instance - */ - AcknowledgeConfirmation.prototype.invalidAckIds = $util.emptyArray; - - /** - * AcknowledgeConfirmation unorderedAckIds. - * @member {Array.} unorderedAckIds - * @memberof google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation - * @instance - */ - AcknowledgeConfirmation.prototype.unorderedAckIds = $util.emptyArray; - - /** - * AcknowledgeConfirmation temporaryFailedAckIds. - * @member {Array.} temporaryFailedAckIds - * @memberof google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation - * @instance - */ - AcknowledgeConfirmation.prototype.temporaryFailedAckIds = $util.emptyArray; - - /** - * Creates a new AcknowledgeConfirmation instance using the specified properties. - * @function create - * @memberof google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation - * @static - * @param {google.pubsub.v1.StreamingPullResponse.IAcknowledgeConfirmation=} [properties] Properties to set - * @returns {google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation} AcknowledgeConfirmation instance - */ - AcknowledgeConfirmation.create = function create(properties) { - return new AcknowledgeConfirmation(properties); - }; - - /** - * Encodes the specified AcknowledgeConfirmation message. Does not implicitly {@link google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation.verify|verify} messages. - * @function encode - * @memberof google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation - * @static - * @param {google.pubsub.v1.StreamingPullResponse.IAcknowledgeConfirmation} message AcknowledgeConfirmation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AcknowledgeConfirmation.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.ackIds != null && message.ackIds.length) - for (var i = 0; i < message.ackIds.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.ackIds[i]); - if (message.invalidAckIds != null && message.invalidAckIds.length) - for (var i = 0; i < message.invalidAckIds.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.invalidAckIds[i]); - if (message.unorderedAckIds != null && message.unorderedAckIds.length) - for (var i = 0; i < message.unorderedAckIds.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.unorderedAckIds[i]); - if (message.temporaryFailedAckIds != null && message.temporaryFailedAckIds.length) - for (var i = 0; i < message.temporaryFailedAckIds.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.temporaryFailedAckIds[i]); - return writer; - }; - - /** - * Encodes the specified AcknowledgeConfirmation message, length delimited. Does not implicitly {@link google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation.verify|verify} messages. - * @function encodeDelimited - * @memberof google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation - * @static - * @param {google.pubsub.v1.StreamingPullResponse.IAcknowledgeConfirmation} message AcknowledgeConfirmation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AcknowledgeConfirmation.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AcknowledgeConfirmation message from the specified reader or buffer. - * @function decode - * @memberof google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation} AcknowledgeConfirmation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AcknowledgeConfirmation.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.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.ackIds && message.ackIds.length)) - message.ackIds = []; - message.ackIds.push(reader.string()); - break; - } - case 2: { - if (!(message.invalidAckIds && message.invalidAckIds.length)) - message.invalidAckIds = []; - message.invalidAckIds.push(reader.string()); - break; - } - case 3: { - if (!(message.unorderedAckIds && message.unorderedAckIds.length)) - message.unorderedAckIds = []; - message.unorderedAckIds.push(reader.string()); - break; - } - case 4: { - if (!(message.temporaryFailedAckIds && message.temporaryFailedAckIds.length)) - message.temporaryFailedAckIds = []; - message.temporaryFailedAckIds.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AcknowledgeConfirmation message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation} AcknowledgeConfirmation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AcknowledgeConfirmation.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AcknowledgeConfirmation message. - * @function verify - * @memberof google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AcknowledgeConfirmation.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.ackIds != null && message.hasOwnProperty("ackIds")) { - if (!Array.isArray(message.ackIds)) - return "ackIds: array expected"; - for (var i = 0; i < message.ackIds.length; ++i) - if (!$util.isString(message.ackIds[i])) - return "ackIds: string[] expected"; - } - if (message.invalidAckIds != null && message.hasOwnProperty("invalidAckIds")) { - if (!Array.isArray(message.invalidAckIds)) - return "invalidAckIds: array expected"; - for (var i = 0; i < message.invalidAckIds.length; ++i) - if (!$util.isString(message.invalidAckIds[i])) - return "invalidAckIds: string[] expected"; - } - if (message.unorderedAckIds != null && message.hasOwnProperty("unorderedAckIds")) { - if (!Array.isArray(message.unorderedAckIds)) - return "unorderedAckIds: array expected"; - for (var i = 0; i < message.unorderedAckIds.length; ++i) - if (!$util.isString(message.unorderedAckIds[i])) - return "unorderedAckIds: string[] expected"; - } - if (message.temporaryFailedAckIds != null && message.hasOwnProperty("temporaryFailedAckIds")) { - if (!Array.isArray(message.temporaryFailedAckIds)) - return "temporaryFailedAckIds: array expected"; - for (var i = 0; i < message.temporaryFailedAckIds.length; ++i) - if (!$util.isString(message.temporaryFailedAckIds[i])) - return "temporaryFailedAckIds: string[] expected"; - } - return null; - }; - - /** - * Creates an AcknowledgeConfirmation message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation - * @static - * @param {Object.} object Plain object - * @returns {google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation} AcknowledgeConfirmation - */ - AcknowledgeConfirmation.fromObject = function fromObject(object) { - if (object instanceof $root.google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation) - return object; - var message = new $root.google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation(); - if (object.ackIds) { - if (!Array.isArray(object.ackIds)) - throw TypeError(".google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation.ackIds: array expected"); - message.ackIds = []; - for (var i = 0; i < object.ackIds.length; ++i) - message.ackIds[i] = String(object.ackIds[i]); - } - if (object.invalidAckIds) { - if (!Array.isArray(object.invalidAckIds)) - throw TypeError(".google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation.invalidAckIds: array expected"); - message.invalidAckIds = []; - for (var i = 0; i < object.invalidAckIds.length; ++i) - message.invalidAckIds[i] = String(object.invalidAckIds[i]); - } - if (object.unorderedAckIds) { - if (!Array.isArray(object.unorderedAckIds)) - throw TypeError(".google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation.unorderedAckIds: array expected"); - message.unorderedAckIds = []; - for (var i = 0; i < object.unorderedAckIds.length; ++i) - message.unorderedAckIds[i] = String(object.unorderedAckIds[i]); - } - if (object.temporaryFailedAckIds) { - if (!Array.isArray(object.temporaryFailedAckIds)) - throw TypeError(".google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation.temporaryFailedAckIds: array expected"); - message.temporaryFailedAckIds = []; - for (var i = 0; i < object.temporaryFailedAckIds.length; ++i) - message.temporaryFailedAckIds[i] = String(object.temporaryFailedAckIds[i]); - } - return message; - }; - - /** - * Creates a plain object from an AcknowledgeConfirmation message. Also converts values to other types if specified. - * @function toObject - * @memberof google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation - * @static - * @param {google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation} message AcknowledgeConfirmation - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AcknowledgeConfirmation.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.ackIds = []; - object.invalidAckIds = []; - object.unorderedAckIds = []; - object.temporaryFailedAckIds = []; - } - if (message.ackIds && message.ackIds.length) { - object.ackIds = []; - for (var j = 0; j < message.ackIds.length; ++j) - object.ackIds[j] = message.ackIds[j]; - } - if (message.invalidAckIds && message.invalidAckIds.length) { - object.invalidAckIds = []; - for (var j = 0; j < message.invalidAckIds.length; ++j) - object.invalidAckIds[j] = message.invalidAckIds[j]; - } - if (message.unorderedAckIds && message.unorderedAckIds.length) { - object.unorderedAckIds = []; - for (var j = 0; j < message.unorderedAckIds.length; ++j) - object.unorderedAckIds[j] = message.unorderedAckIds[j]; - } - if (message.temporaryFailedAckIds && message.temporaryFailedAckIds.length) { - object.temporaryFailedAckIds = []; - for (var j = 0; j < message.temporaryFailedAckIds.length; ++j) - object.temporaryFailedAckIds[j] = message.temporaryFailedAckIds[j]; - } - return object; - }; - - /** - * Converts this AcknowledgeConfirmation to JSON. - * @function toJSON - * @memberof google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation - * @instance - * @returns {Object.} JSON object - */ - AcknowledgeConfirmation.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AcknowledgeConfirmation - * @function getTypeUrl - * @memberof google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AcknowledgeConfirmation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation"; - }; - - return AcknowledgeConfirmation; - })(); - - StreamingPullResponse.ModifyAckDeadlineConfirmation = (function() { - - /** - * Properties of a ModifyAckDeadlineConfirmation. - * @memberof google.pubsub.v1.StreamingPullResponse - * @interface IModifyAckDeadlineConfirmation - * @property {Array.|null} [ackIds] ModifyAckDeadlineConfirmation ackIds - * @property {Array.|null} [invalidAckIds] ModifyAckDeadlineConfirmation invalidAckIds - * @property {Array.|null} [temporaryFailedAckIds] ModifyAckDeadlineConfirmation temporaryFailedAckIds - */ - - /** - * Constructs a new ModifyAckDeadlineConfirmation. - * @memberof google.pubsub.v1.StreamingPullResponse - * @classdesc Represents a ModifyAckDeadlineConfirmation. - * @implements IModifyAckDeadlineConfirmation - * @constructor - * @param {google.pubsub.v1.StreamingPullResponse.IModifyAckDeadlineConfirmation=} [properties] Properties to set - */ - function ModifyAckDeadlineConfirmation(properties) { - this.ackIds = []; - this.invalidAckIds = []; - this.temporaryFailedAckIds = []; - 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]]; - } - - /** - * ModifyAckDeadlineConfirmation ackIds. - * @member {Array.} ackIds - * @memberof google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation - * @instance - */ - ModifyAckDeadlineConfirmation.prototype.ackIds = $util.emptyArray; - - /** - * ModifyAckDeadlineConfirmation invalidAckIds. - * @member {Array.} invalidAckIds - * @memberof google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation - * @instance - */ - ModifyAckDeadlineConfirmation.prototype.invalidAckIds = $util.emptyArray; - - /** - * ModifyAckDeadlineConfirmation temporaryFailedAckIds. - * @member {Array.} temporaryFailedAckIds - * @memberof google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation - * @instance - */ - ModifyAckDeadlineConfirmation.prototype.temporaryFailedAckIds = $util.emptyArray; - - /** - * Creates a new ModifyAckDeadlineConfirmation instance using the specified properties. - * @function create - * @memberof google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation - * @static - * @param {google.pubsub.v1.StreamingPullResponse.IModifyAckDeadlineConfirmation=} [properties] Properties to set - * @returns {google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation} ModifyAckDeadlineConfirmation instance - */ - ModifyAckDeadlineConfirmation.create = function create(properties) { - return new ModifyAckDeadlineConfirmation(properties); - }; - - /** - * Encodes the specified ModifyAckDeadlineConfirmation message. Does not implicitly {@link google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation.verify|verify} messages. - * @function encode - * @memberof google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation - * @static - * @param {google.pubsub.v1.StreamingPullResponse.IModifyAckDeadlineConfirmation} message ModifyAckDeadlineConfirmation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ModifyAckDeadlineConfirmation.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.ackIds != null && message.ackIds.length) - for (var i = 0; i < message.ackIds.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.ackIds[i]); - if (message.invalidAckIds != null && message.invalidAckIds.length) - for (var i = 0; i < message.invalidAckIds.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.invalidAckIds[i]); - if (message.temporaryFailedAckIds != null && message.temporaryFailedAckIds.length) - for (var i = 0; i < message.temporaryFailedAckIds.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.temporaryFailedAckIds[i]); - return writer; - }; - - /** - * Encodes the specified ModifyAckDeadlineConfirmation message, length delimited. Does not implicitly {@link google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation.verify|verify} messages. - * @function encodeDelimited - * @memberof google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation - * @static - * @param {google.pubsub.v1.StreamingPullResponse.IModifyAckDeadlineConfirmation} message ModifyAckDeadlineConfirmation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ModifyAckDeadlineConfirmation.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ModifyAckDeadlineConfirmation message from the specified reader or buffer. - * @function decode - * @memberof google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation} ModifyAckDeadlineConfirmation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ModifyAckDeadlineConfirmation.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.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.ackIds && message.ackIds.length)) - message.ackIds = []; - message.ackIds.push(reader.string()); - break; - } - case 2: { - if (!(message.invalidAckIds && message.invalidAckIds.length)) - message.invalidAckIds = []; - message.invalidAckIds.push(reader.string()); - break; - } - case 3: { - if (!(message.temporaryFailedAckIds && message.temporaryFailedAckIds.length)) - message.temporaryFailedAckIds = []; - message.temporaryFailedAckIds.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ModifyAckDeadlineConfirmation message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation} ModifyAckDeadlineConfirmation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ModifyAckDeadlineConfirmation.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ModifyAckDeadlineConfirmation message. - * @function verify - * @memberof google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ModifyAckDeadlineConfirmation.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.ackIds != null && message.hasOwnProperty("ackIds")) { - if (!Array.isArray(message.ackIds)) - return "ackIds: array expected"; - for (var i = 0; i < message.ackIds.length; ++i) - if (!$util.isString(message.ackIds[i])) - return "ackIds: string[] expected"; - } - if (message.invalidAckIds != null && message.hasOwnProperty("invalidAckIds")) { - if (!Array.isArray(message.invalidAckIds)) - return "invalidAckIds: array expected"; - for (var i = 0; i < message.invalidAckIds.length; ++i) - if (!$util.isString(message.invalidAckIds[i])) - return "invalidAckIds: string[] expected"; - } - if (message.temporaryFailedAckIds != null && message.hasOwnProperty("temporaryFailedAckIds")) { - if (!Array.isArray(message.temporaryFailedAckIds)) - return "temporaryFailedAckIds: array expected"; - for (var i = 0; i < message.temporaryFailedAckIds.length; ++i) - if (!$util.isString(message.temporaryFailedAckIds[i])) - return "temporaryFailedAckIds: string[] expected"; - } - return null; - }; - - /** - * Creates a ModifyAckDeadlineConfirmation message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation - * @static - * @param {Object.} object Plain object - * @returns {google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation} ModifyAckDeadlineConfirmation - */ - ModifyAckDeadlineConfirmation.fromObject = function fromObject(object) { - if (object instanceof $root.google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation) - return object; - var message = new $root.google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation(); - if (object.ackIds) { - if (!Array.isArray(object.ackIds)) - throw TypeError(".google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation.ackIds: array expected"); - message.ackIds = []; - for (var i = 0; i < object.ackIds.length; ++i) - message.ackIds[i] = String(object.ackIds[i]); - } - if (object.invalidAckIds) { - if (!Array.isArray(object.invalidAckIds)) - throw TypeError(".google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation.invalidAckIds: array expected"); - message.invalidAckIds = []; - for (var i = 0; i < object.invalidAckIds.length; ++i) - message.invalidAckIds[i] = String(object.invalidAckIds[i]); - } - if (object.temporaryFailedAckIds) { - if (!Array.isArray(object.temporaryFailedAckIds)) - throw TypeError(".google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation.temporaryFailedAckIds: array expected"); - message.temporaryFailedAckIds = []; - for (var i = 0; i < object.temporaryFailedAckIds.length; ++i) - message.temporaryFailedAckIds[i] = String(object.temporaryFailedAckIds[i]); - } - return message; - }; - - /** - * Creates a plain object from a ModifyAckDeadlineConfirmation message. Also converts values to other types if specified. - * @function toObject - * @memberof google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation - * @static - * @param {google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation} message ModifyAckDeadlineConfirmation - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ModifyAckDeadlineConfirmation.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.ackIds = []; - object.invalidAckIds = []; - object.temporaryFailedAckIds = []; - } - if (message.ackIds && message.ackIds.length) { - object.ackIds = []; - for (var j = 0; j < message.ackIds.length; ++j) - object.ackIds[j] = message.ackIds[j]; - } - if (message.invalidAckIds && message.invalidAckIds.length) { - object.invalidAckIds = []; - for (var j = 0; j < message.invalidAckIds.length; ++j) - object.invalidAckIds[j] = message.invalidAckIds[j]; - } - if (message.temporaryFailedAckIds && message.temporaryFailedAckIds.length) { - object.temporaryFailedAckIds = []; - for (var j = 0; j < message.temporaryFailedAckIds.length; ++j) - object.temporaryFailedAckIds[j] = message.temporaryFailedAckIds[j]; - } - return object; - }; - - /** - * Converts this ModifyAckDeadlineConfirmation to JSON. - * @function toJSON - * @memberof google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation - * @instance - * @returns {Object.} JSON object - */ - ModifyAckDeadlineConfirmation.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ModifyAckDeadlineConfirmation - * @function getTypeUrl - * @memberof google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ModifyAckDeadlineConfirmation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation"; - }; - - return ModifyAckDeadlineConfirmation; - })(); - - StreamingPullResponse.SubscriptionProperties = (function() { - - /** - * Properties of a SubscriptionProperties. - * @memberof google.pubsub.v1.StreamingPullResponse - * @interface ISubscriptionProperties - * @property {boolean|null} [exactlyOnceDeliveryEnabled] SubscriptionProperties exactlyOnceDeliveryEnabled - * @property {boolean|null} [messageOrderingEnabled] SubscriptionProperties messageOrderingEnabled - */ - - /** - * Constructs a new SubscriptionProperties. - * @memberof google.pubsub.v1.StreamingPullResponse - * @classdesc Represents a SubscriptionProperties. - * @implements ISubscriptionProperties - * @constructor - * @param {google.pubsub.v1.StreamingPullResponse.ISubscriptionProperties=} [properties] Properties to set - */ - function SubscriptionProperties(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]]; - } - - /** - * SubscriptionProperties exactlyOnceDeliveryEnabled. - * @member {boolean} exactlyOnceDeliveryEnabled - * @memberof google.pubsub.v1.StreamingPullResponse.SubscriptionProperties - * @instance - */ - SubscriptionProperties.prototype.exactlyOnceDeliveryEnabled = false; - - /** - * SubscriptionProperties messageOrderingEnabled. - * @member {boolean} messageOrderingEnabled - * @memberof google.pubsub.v1.StreamingPullResponse.SubscriptionProperties - * @instance - */ - SubscriptionProperties.prototype.messageOrderingEnabled = false; - - /** - * Creates a new SubscriptionProperties instance using the specified properties. - * @function create - * @memberof google.pubsub.v1.StreamingPullResponse.SubscriptionProperties - * @static - * @param {google.pubsub.v1.StreamingPullResponse.ISubscriptionProperties=} [properties] Properties to set - * @returns {google.pubsub.v1.StreamingPullResponse.SubscriptionProperties} SubscriptionProperties instance - */ - SubscriptionProperties.create = function create(properties) { - return new SubscriptionProperties(properties); - }; - - /** - * Encodes the specified SubscriptionProperties message. Does not implicitly {@link google.pubsub.v1.StreamingPullResponse.SubscriptionProperties.verify|verify} messages. - * @function encode - * @memberof google.pubsub.v1.StreamingPullResponse.SubscriptionProperties - * @static - * @param {google.pubsub.v1.StreamingPullResponse.ISubscriptionProperties} message SubscriptionProperties message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SubscriptionProperties.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.exactlyOnceDeliveryEnabled != null && Object.hasOwnProperty.call(message, "exactlyOnceDeliveryEnabled")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.exactlyOnceDeliveryEnabled); - if (message.messageOrderingEnabled != null && Object.hasOwnProperty.call(message, "messageOrderingEnabled")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.messageOrderingEnabled); - return writer; - }; - - /** - * Encodes the specified SubscriptionProperties message, length delimited. Does not implicitly {@link google.pubsub.v1.StreamingPullResponse.SubscriptionProperties.verify|verify} messages. - * @function encodeDelimited - * @memberof google.pubsub.v1.StreamingPullResponse.SubscriptionProperties - * @static - * @param {google.pubsub.v1.StreamingPullResponse.ISubscriptionProperties} message SubscriptionProperties message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SubscriptionProperties.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SubscriptionProperties message from the specified reader or buffer. - * @function decode - * @memberof google.pubsub.v1.StreamingPullResponse.SubscriptionProperties - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.pubsub.v1.StreamingPullResponse.SubscriptionProperties} SubscriptionProperties - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SubscriptionProperties.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.pubsub.v1.StreamingPullResponse.SubscriptionProperties(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.exactlyOnceDeliveryEnabled = reader.bool(); - break; - } - case 2: { - message.messageOrderingEnabled = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SubscriptionProperties message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.pubsub.v1.StreamingPullResponse.SubscriptionProperties - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.pubsub.v1.StreamingPullResponse.SubscriptionProperties} SubscriptionProperties - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SubscriptionProperties.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SubscriptionProperties message. - * @function verify - * @memberof google.pubsub.v1.StreamingPullResponse.SubscriptionProperties - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SubscriptionProperties.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.exactlyOnceDeliveryEnabled != null && message.hasOwnProperty("exactlyOnceDeliveryEnabled")) - if (typeof message.exactlyOnceDeliveryEnabled !== "boolean") - return "exactlyOnceDeliveryEnabled: boolean expected"; - if (message.messageOrderingEnabled != null && message.hasOwnProperty("messageOrderingEnabled")) - if (typeof message.messageOrderingEnabled !== "boolean") - return "messageOrderingEnabled: boolean expected"; - return null; - }; - - /** - * Creates a SubscriptionProperties message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.pubsub.v1.StreamingPullResponse.SubscriptionProperties - * @static - * @param {Object.} object Plain object - * @returns {google.pubsub.v1.StreamingPullResponse.SubscriptionProperties} SubscriptionProperties - */ - SubscriptionProperties.fromObject = function fromObject(object) { - if (object instanceof $root.google.pubsub.v1.StreamingPullResponse.SubscriptionProperties) - return object; - var message = new $root.google.pubsub.v1.StreamingPullResponse.SubscriptionProperties(); - if (object.exactlyOnceDeliveryEnabled != null) - message.exactlyOnceDeliveryEnabled = Boolean(object.exactlyOnceDeliveryEnabled); - if (object.messageOrderingEnabled != null) - message.messageOrderingEnabled = Boolean(object.messageOrderingEnabled); - return message; - }; - - /** - * Creates a plain object from a SubscriptionProperties message. Also converts values to other types if specified. - * @function toObject - * @memberof google.pubsub.v1.StreamingPullResponse.SubscriptionProperties - * @static - * @param {google.pubsub.v1.StreamingPullResponse.SubscriptionProperties} message SubscriptionProperties - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SubscriptionProperties.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.exactlyOnceDeliveryEnabled = false; - object.messageOrderingEnabled = false; - } - if (message.exactlyOnceDeliveryEnabled != null && message.hasOwnProperty("exactlyOnceDeliveryEnabled")) - object.exactlyOnceDeliveryEnabled = message.exactlyOnceDeliveryEnabled; - if (message.messageOrderingEnabled != null && message.hasOwnProperty("messageOrderingEnabled")) - object.messageOrderingEnabled = message.messageOrderingEnabled; - return object; - }; - - /** - * Converts this SubscriptionProperties to JSON. - * @function toJSON - * @memberof google.pubsub.v1.StreamingPullResponse.SubscriptionProperties - * @instance - * @returns {Object.} JSON object - */ - SubscriptionProperties.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SubscriptionProperties - * @function getTypeUrl - * @memberof google.pubsub.v1.StreamingPullResponse.SubscriptionProperties - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SubscriptionProperties.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.pubsub.v1.StreamingPullResponse.SubscriptionProperties"; - }; - - return SubscriptionProperties; - })(); - - return StreamingPullResponse; - })(); - - v1.CreateSnapshotRequest = (function() { - - /** - * Properties of a CreateSnapshotRequest. - * @memberof google.pubsub.v1 - * @interface ICreateSnapshotRequest - * @property {string|null} [name] CreateSnapshotRequest name - * @property {string|null} [subscription] CreateSnapshotRequest subscription - * @property {Object.|null} [labels] CreateSnapshotRequest labels - */ - - /** - * Constructs a new CreateSnapshotRequest. - * @memberof google.pubsub.v1 - * @classdesc Represents a CreateSnapshotRequest. - * @implements ICreateSnapshotRequest - * @constructor - * @param {google.pubsub.v1.ICreateSnapshotRequest=} [properties] Properties to set - */ - function CreateSnapshotRequest(properties) { - this.labels = {}; - 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]]; - } - - /** - * CreateSnapshotRequest name. - * @member {string} name - * @memberof google.pubsub.v1.CreateSnapshotRequest - * @instance - */ - CreateSnapshotRequest.prototype.name = ""; - - /** - * CreateSnapshotRequest subscription. - * @member {string} subscription - * @memberof google.pubsub.v1.CreateSnapshotRequest - * @instance - */ - CreateSnapshotRequest.prototype.subscription = ""; - - /** - * CreateSnapshotRequest labels. - * @member {Object.} labels - * @memberof google.pubsub.v1.CreateSnapshotRequest - * @instance - */ - CreateSnapshotRequest.prototype.labels = $util.emptyObject; - - /** - * Creates a new CreateSnapshotRequest instance using the specified properties. - * @function create - * @memberof google.pubsub.v1.CreateSnapshotRequest - * @static - * @param {google.pubsub.v1.ICreateSnapshotRequest=} [properties] Properties to set - * @returns {google.pubsub.v1.CreateSnapshotRequest} CreateSnapshotRequest instance - */ - CreateSnapshotRequest.create = function create(properties) { - return new CreateSnapshotRequest(properties); - }; - - /** - * Encodes the specified CreateSnapshotRequest message. Does not implicitly {@link google.pubsub.v1.CreateSnapshotRequest.verify|verify} messages. - * @function encode - * @memberof google.pubsub.v1.CreateSnapshotRequest - * @static - * @param {google.pubsub.v1.ICreateSnapshotRequest} message CreateSnapshotRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateSnapshotRequest.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.subscription != null && Object.hasOwnProperty.call(message, "subscription")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.subscription); - 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 CreateSnapshotRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.CreateSnapshotRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.pubsub.v1.CreateSnapshotRequest - * @static - * @param {google.pubsub.v1.ICreateSnapshotRequest} message CreateSnapshotRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateSnapshotRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateSnapshotRequest message from the specified reader or buffer. - * @function decode - * @memberof google.pubsub.v1.CreateSnapshotRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.pubsub.v1.CreateSnapshotRequest} CreateSnapshotRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateSnapshotRequest.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.pubsub.v1.CreateSnapshotRequest(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.subscription = reader.string(); - 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 CreateSnapshotRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.pubsub.v1.CreateSnapshotRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.pubsub.v1.CreateSnapshotRequest} CreateSnapshotRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateSnapshotRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateSnapshotRequest message. - * @function verify - * @memberof google.pubsub.v1.CreateSnapshotRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateSnapshotRequest.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.subscription != null && message.hasOwnProperty("subscription")) - if (!$util.isString(message.subscription)) - return "subscription: string 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 CreateSnapshotRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.pubsub.v1.CreateSnapshotRequest - * @static - * @param {Object.} object Plain object - * @returns {google.pubsub.v1.CreateSnapshotRequest} CreateSnapshotRequest - */ - CreateSnapshotRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.pubsub.v1.CreateSnapshotRequest) - return object; - var message = new $root.google.pubsub.v1.CreateSnapshotRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.subscription != null) - message.subscription = String(object.subscription); - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.pubsub.v1.CreateSnapshotRequest.labels: object expected"); - message.labels = {}; - for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) - message.labels[keys[i]] = String(object.labels[keys[i]]); - } - return message; - }; - - /** - * Creates a plain object from a CreateSnapshotRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.pubsub.v1.CreateSnapshotRequest - * @static - * @param {google.pubsub.v1.CreateSnapshotRequest} message CreateSnapshotRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateSnapshotRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.labels = {}; - if (options.defaults) { - object.name = ""; - object.subscription = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.subscription != null && message.hasOwnProperty("subscription")) - object.subscription = message.subscription; - var keys2; - if (message.labels && (keys2 = Object.keys(message.labels)).length) { - object.labels = {}; - for (var j = 0; j < keys2.length; ++j) - object.labels[keys2[j]] = message.labels[keys2[j]]; - } - return object; - }; - - /** - * Converts this CreateSnapshotRequest to JSON. - * @function toJSON - * @memberof google.pubsub.v1.CreateSnapshotRequest - * @instance - * @returns {Object.} JSON object - */ - CreateSnapshotRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateSnapshotRequest - * @function getTypeUrl - * @memberof google.pubsub.v1.CreateSnapshotRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateSnapshotRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.pubsub.v1.CreateSnapshotRequest"; - }; - - return CreateSnapshotRequest; - })(); - - v1.UpdateSnapshotRequest = (function() { - - /** - * Properties of an UpdateSnapshotRequest. - * @memberof google.pubsub.v1 - * @interface IUpdateSnapshotRequest - * @property {google.pubsub.v1.ISnapshot|null} [snapshot] UpdateSnapshotRequest snapshot - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateSnapshotRequest updateMask - */ - - /** - * Constructs a new UpdateSnapshotRequest. - * @memberof google.pubsub.v1 - * @classdesc Represents an UpdateSnapshotRequest. - * @implements IUpdateSnapshotRequest - * @constructor - * @param {google.pubsub.v1.IUpdateSnapshotRequest=} [properties] Properties to set - */ - function UpdateSnapshotRequest(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]]; - } - - /** - * UpdateSnapshotRequest snapshot. - * @member {google.pubsub.v1.ISnapshot|null|undefined} snapshot - * @memberof google.pubsub.v1.UpdateSnapshotRequest - * @instance - */ - UpdateSnapshotRequest.prototype.snapshot = null; - - /** - * UpdateSnapshotRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.pubsub.v1.UpdateSnapshotRequest - * @instance - */ - UpdateSnapshotRequest.prototype.updateMask = null; - - /** - * Creates a new UpdateSnapshotRequest instance using the specified properties. - * @function create - * @memberof google.pubsub.v1.UpdateSnapshotRequest - * @static - * @param {google.pubsub.v1.IUpdateSnapshotRequest=} [properties] Properties to set - * @returns {google.pubsub.v1.UpdateSnapshotRequest} UpdateSnapshotRequest instance - */ - UpdateSnapshotRequest.create = function create(properties) { - return new UpdateSnapshotRequest(properties); - }; - - /** - * Encodes the specified UpdateSnapshotRequest message. Does not implicitly {@link google.pubsub.v1.UpdateSnapshotRequest.verify|verify} messages. - * @function encode - * @memberof google.pubsub.v1.UpdateSnapshotRequest - * @static - * @param {google.pubsub.v1.IUpdateSnapshotRequest} message UpdateSnapshotRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateSnapshotRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.snapshot != null && Object.hasOwnProperty.call(message, "snapshot")) - $root.google.pubsub.v1.Snapshot.encode(message.snapshot, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified UpdateSnapshotRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.UpdateSnapshotRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.pubsub.v1.UpdateSnapshotRequest - * @static - * @param {google.pubsub.v1.IUpdateSnapshotRequest} message UpdateSnapshotRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateSnapshotRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateSnapshotRequest message from the specified reader or buffer. - * @function decode - * @memberof google.pubsub.v1.UpdateSnapshotRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.pubsub.v1.UpdateSnapshotRequest} UpdateSnapshotRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateSnapshotRequest.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.pubsub.v1.UpdateSnapshotRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.snapshot = $root.google.pubsub.v1.Snapshot.decode(reader, reader.uint32()); - break; - } - case 2: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpdateSnapshotRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.pubsub.v1.UpdateSnapshotRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.pubsub.v1.UpdateSnapshotRequest} UpdateSnapshotRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateSnapshotRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateSnapshotRequest message. - * @function verify - * @memberof google.pubsub.v1.UpdateSnapshotRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateSnapshotRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.snapshot != null && message.hasOwnProperty("snapshot")) { - var error = $root.google.pubsub.v1.Snapshot.verify(message.snapshot); - if (error) - return "snapshot." + error; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } - return null; - }; - - /** - * Creates an UpdateSnapshotRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.pubsub.v1.UpdateSnapshotRequest - * @static - * @param {Object.} object Plain object - * @returns {google.pubsub.v1.UpdateSnapshotRequest} UpdateSnapshotRequest - */ - UpdateSnapshotRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.pubsub.v1.UpdateSnapshotRequest) - return object; - var message = new $root.google.pubsub.v1.UpdateSnapshotRequest(); - if (object.snapshot != null) { - if (typeof object.snapshot !== "object") - throw TypeError(".google.pubsub.v1.UpdateSnapshotRequest.snapshot: object expected"); - message.snapshot = $root.google.pubsub.v1.Snapshot.fromObject(object.snapshot); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.pubsub.v1.UpdateSnapshotRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - return message; - }; - - /** - * Creates a plain object from an UpdateSnapshotRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.pubsub.v1.UpdateSnapshotRequest - * @static - * @param {google.pubsub.v1.UpdateSnapshotRequest} message UpdateSnapshotRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateSnapshotRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.snapshot = null; - object.updateMask = null; - } - if (message.snapshot != null && message.hasOwnProperty("snapshot")) - object.snapshot = $root.google.pubsub.v1.Snapshot.toObject(message.snapshot, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - return object; - }; - - /** - * Converts this UpdateSnapshotRequest to JSON. - * @function toJSON - * @memberof google.pubsub.v1.UpdateSnapshotRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateSnapshotRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateSnapshotRequest - * @function getTypeUrl - * @memberof google.pubsub.v1.UpdateSnapshotRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateSnapshotRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.pubsub.v1.UpdateSnapshotRequest"; - }; - - return UpdateSnapshotRequest; - })(); - - v1.Snapshot = (function() { - - /** - * Properties of a Snapshot. - * @memberof google.pubsub.v1 - * @interface ISnapshot - * @property {string|null} [name] Snapshot name - * @property {string|null} [topic] Snapshot topic - * @property {google.protobuf.ITimestamp|null} [expireTime] Snapshot expireTime - * @property {Object.|null} [labels] Snapshot labels - */ - - /** - * Constructs a new Snapshot. - * @memberof google.pubsub.v1 - * @classdesc Represents a Snapshot. - * @implements ISnapshot - * @constructor - * @param {google.pubsub.v1.ISnapshot=} [properties] Properties to set - */ - function Snapshot(properties) { - this.labels = {}; - 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]]; - } - - /** - * Snapshot name. - * @member {string} name - * @memberof google.pubsub.v1.Snapshot - * @instance - */ - Snapshot.prototype.name = ""; - - /** - * Snapshot topic. - * @member {string} topic - * @memberof google.pubsub.v1.Snapshot - * @instance - */ - Snapshot.prototype.topic = ""; - - /** - * Snapshot expireTime. - * @member {google.protobuf.ITimestamp|null|undefined} expireTime - * @memberof google.pubsub.v1.Snapshot - * @instance - */ - Snapshot.prototype.expireTime = null; - - /** - * Snapshot labels. - * @member {Object.} labels - * @memberof google.pubsub.v1.Snapshot - * @instance - */ - Snapshot.prototype.labels = $util.emptyObject; - - /** - * Creates a new Snapshot instance using the specified properties. - * @function create - * @memberof google.pubsub.v1.Snapshot - * @static - * @param {google.pubsub.v1.ISnapshot=} [properties] Properties to set - * @returns {google.pubsub.v1.Snapshot} Snapshot instance - */ - Snapshot.create = function create(properties) { - return new Snapshot(properties); - }; - - /** - * Encodes the specified Snapshot message. Does not implicitly {@link google.pubsub.v1.Snapshot.verify|verify} messages. - * @function encode - * @memberof google.pubsub.v1.Snapshot - * @static - * @param {google.pubsub.v1.ISnapshot} message Snapshot message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Snapshot.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.topic != null && Object.hasOwnProperty.call(message, "topic")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.topic); - if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) - $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 3, wireType 2 =*/26).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 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 Snapshot message, length delimited. Does not implicitly {@link google.pubsub.v1.Snapshot.verify|verify} messages. - * @function encodeDelimited - * @memberof google.pubsub.v1.Snapshot - * @static - * @param {google.pubsub.v1.ISnapshot} message Snapshot message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Snapshot.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Snapshot message from the specified reader or buffer. - * @function decode - * @memberof google.pubsub.v1.Snapshot - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.pubsub.v1.Snapshot} Snapshot - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Snapshot.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.pubsub.v1.Snapshot(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.topic = reader.string(); - break; - } - case 3: { - message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - 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 Snapshot message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.pubsub.v1.Snapshot - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.pubsub.v1.Snapshot} Snapshot - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Snapshot.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Snapshot message. - * @function verify - * @memberof google.pubsub.v1.Snapshot - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Snapshot.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.topic != null && message.hasOwnProperty("topic")) - if (!$util.isString(message.topic)) - return "topic: string expected"; - if (message.expireTime != null && message.hasOwnProperty("expireTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.expireTime); - if (error) - return "expireTime." + 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 Snapshot message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.pubsub.v1.Snapshot - * @static - * @param {Object.} object Plain object - * @returns {google.pubsub.v1.Snapshot} Snapshot - */ - Snapshot.fromObject = function fromObject(object) { - if (object instanceof $root.google.pubsub.v1.Snapshot) - return object; - var message = new $root.google.pubsub.v1.Snapshot(); - if (object.name != null) - message.name = String(object.name); - if (object.topic != null) - message.topic = String(object.topic); - if (object.expireTime != null) { - if (typeof object.expireTime !== "object") - throw TypeError(".google.pubsub.v1.Snapshot.expireTime: object expected"); - message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime); - } - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.pubsub.v1.Snapshot.labels: object expected"); - message.labels = {}; - for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) - message.labels[keys[i]] = String(object.labels[keys[i]]); - } - return message; - }; - - /** - * Creates a plain object from a Snapshot message. Also converts values to other types if specified. - * @function toObject - * @memberof google.pubsub.v1.Snapshot - * @static - * @param {google.pubsub.v1.Snapshot} message Snapshot - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Snapshot.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.labels = {}; - if (options.defaults) { - object.name = ""; - object.topic = ""; - object.expireTime = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.topic != null && message.hasOwnProperty("topic")) - object.topic = message.topic; - if (message.expireTime != null && message.hasOwnProperty("expireTime")) - object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); - var keys2; - if (message.labels && (keys2 = Object.keys(message.labels)).length) { - object.labels = {}; - for (var j = 0; j < keys2.length; ++j) - object.labels[keys2[j]] = message.labels[keys2[j]]; - } - return object; - }; - - /** - * Converts this Snapshot to JSON. - * @function toJSON - * @memberof google.pubsub.v1.Snapshot - * @instance - * @returns {Object.} JSON object - */ - Snapshot.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Snapshot - * @function getTypeUrl - * @memberof google.pubsub.v1.Snapshot - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Snapshot.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.pubsub.v1.Snapshot"; - }; - - return Snapshot; - })(); - - v1.GetSnapshotRequest = (function() { - - /** - * Properties of a GetSnapshotRequest. - * @memberof google.pubsub.v1 - * @interface IGetSnapshotRequest - * @property {string|null} [snapshot] GetSnapshotRequest snapshot - */ - - /** - * Constructs a new GetSnapshotRequest. - * @memberof google.pubsub.v1 - * @classdesc Represents a GetSnapshotRequest. - * @implements IGetSnapshotRequest - * @constructor - * @param {google.pubsub.v1.IGetSnapshotRequest=} [properties] Properties to set - */ - function GetSnapshotRequest(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]]; - } - - /** - * GetSnapshotRequest snapshot. - * @member {string} snapshot - * @memberof google.pubsub.v1.GetSnapshotRequest - * @instance - */ - GetSnapshotRequest.prototype.snapshot = ""; - - /** - * Creates a new GetSnapshotRequest instance using the specified properties. - * @function create - * @memberof google.pubsub.v1.GetSnapshotRequest - * @static - * @param {google.pubsub.v1.IGetSnapshotRequest=} [properties] Properties to set - * @returns {google.pubsub.v1.GetSnapshotRequest} GetSnapshotRequest instance - */ - GetSnapshotRequest.create = function create(properties) { - return new GetSnapshotRequest(properties); - }; - - /** - * Encodes the specified GetSnapshotRequest message. Does not implicitly {@link google.pubsub.v1.GetSnapshotRequest.verify|verify} messages. - * @function encode - * @memberof google.pubsub.v1.GetSnapshotRequest - * @static - * @param {google.pubsub.v1.IGetSnapshotRequest} message GetSnapshotRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetSnapshotRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.snapshot != null && Object.hasOwnProperty.call(message, "snapshot")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.snapshot); - return writer; - }; - - /** - * Encodes the specified GetSnapshotRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.GetSnapshotRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.pubsub.v1.GetSnapshotRequest - * @static - * @param {google.pubsub.v1.IGetSnapshotRequest} message GetSnapshotRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetSnapshotRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetSnapshotRequest message from the specified reader or buffer. - * @function decode - * @memberof google.pubsub.v1.GetSnapshotRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.pubsub.v1.GetSnapshotRequest} GetSnapshotRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetSnapshotRequest.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.pubsub.v1.GetSnapshotRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.snapshot = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetSnapshotRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.pubsub.v1.GetSnapshotRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.pubsub.v1.GetSnapshotRequest} GetSnapshotRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetSnapshotRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetSnapshotRequest message. - * @function verify - * @memberof google.pubsub.v1.GetSnapshotRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetSnapshotRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.snapshot != null && message.hasOwnProperty("snapshot")) - if (!$util.isString(message.snapshot)) - return "snapshot: string expected"; - return null; - }; - - /** - * Creates a GetSnapshotRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.pubsub.v1.GetSnapshotRequest - * @static - * @param {Object.} object Plain object - * @returns {google.pubsub.v1.GetSnapshotRequest} GetSnapshotRequest - */ - GetSnapshotRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.pubsub.v1.GetSnapshotRequest) - return object; - var message = new $root.google.pubsub.v1.GetSnapshotRequest(); - if (object.snapshot != null) - message.snapshot = String(object.snapshot); - return message; - }; - - /** - * Creates a plain object from a GetSnapshotRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.pubsub.v1.GetSnapshotRequest - * @static - * @param {google.pubsub.v1.GetSnapshotRequest} message GetSnapshotRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetSnapshotRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.snapshot = ""; - if (message.snapshot != null && message.hasOwnProperty("snapshot")) - object.snapshot = message.snapshot; - return object; - }; - - /** - * Converts this GetSnapshotRequest to JSON. - * @function toJSON - * @memberof google.pubsub.v1.GetSnapshotRequest - * @instance - * @returns {Object.} JSON object - */ - GetSnapshotRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetSnapshotRequest - * @function getTypeUrl - * @memberof google.pubsub.v1.GetSnapshotRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetSnapshotRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.pubsub.v1.GetSnapshotRequest"; - }; - - return GetSnapshotRequest; - })(); - - v1.ListSnapshotsRequest = (function() { - - /** - * Properties of a ListSnapshotsRequest. - * @memberof google.pubsub.v1 - * @interface IListSnapshotsRequest - * @property {string|null} [project] ListSnapshotsRequest project - * @property {number|null} [pageSize] ListSnapshotsRequest pageSize - * @property {string|null} [pageToken] ListSnapshotsRequest pageToken - */ - - /** - * Constructs a new ListSnapshotsRequest. - * @memberof google.pubsub.v1 - * @classdesc Represents a ListSnapshotsRequest. - * @implements IListSnapshotsRequest - * @constructor - * @param {google.pubsub.v1.IListSnapshotsRequest=} [properties] Properties to set - */ - function ListSnapshotsRequest(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]]; - } - - /** - * ListSnapshotsRequest project. - * @member {string} project - * @memberof google.pubsub.v1.ListSnapshotsRequest - * @instance - */ - ListSnapshotsRequest.prototype.project = ""; - - /** - * ListSnapshotsRequest pageSize. - * @member {number} pageSize - * @memberof google.pubsub.v1.ListSnapshotsRequest - * @instance - */ - ListSnapshotsRequest.prototype.pageSize = 0; - - /** - * ListSnapshotsRequest pageToken. - * @member {string} pageToken - * @memberof google.pubsub.v1.ListSnapshotsRequest - * @instance - */ - ListSnapshotsRequest.prototype.pageToken = ""; - - /** - * Creates a new ListSnapshotsRequest instance using the specified properties. - * @function create - * @memberof google.pubsub.v1.ListSnapshotsRequest - * @static - * @param {google.pubsub.v1.IListSnapshotsRequest=} [properties] Properties to set - * @returns {google.pubsub.v1.ListSnapshotsRequest} ListSnapshotsRequest instance - */ - ListSnapshotsRequest.create = function create(properties) { - return new ListSnapshotsRequest(properties); - }; - - /** - * Encodes the specified ListSnapshotsRequest message. Does not implicitly {@link google.pubsub.v1.ListSnapshotsRequest.verify|verify} messages. - * @function encode - * @memberof google.pubsub.v1.ListSnapshotsRequest - * @static - * @param {google.pubsub.v1.IListSnapshotsRequest} message ListSnapshotsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListSnapshotsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.project != null && Object.hasOwnProperty.call(message, "project")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.project); - 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); - return writer; - }; - - /** - * Encodes the specified ListSnapshotsRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.ListSnapshotsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.pubsub.v1.ListSnapshotsRequest - * @static - * @param {google.pubsub.v1.IListSnapshotsRequest} message ListSnapshotsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListSnapshotsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListSnapshotsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.pubsub.v1.ListSnapshotsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.pubsub.v1.ListSnapshotsRequest} ListSnapshotsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListSnapshotsRequest.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.pubsub.v1.ListSnapshotsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.project = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListSnapshotsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.pubsub.v1.ListSnapshotsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.pubsub.v1.ListSnapshotsRequest} ListSnapshotsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListSnapshotsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListSnapshotsRequest message. - * @function verify - * @memberof google.pubsub.v1.ListSnapshotsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListSnapshotsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.project != null && message.hasOwnProperty("project")) - if (!$util.isString(message.project)) - return "project: 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"; - return null; - }; - - /** - * Creates a ListSnapshotsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.pubsub.v1.ListSnapshotsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.pubsub.v1.ListSnapshotsRequest} ListSnapshotsRequest - */ - ListSnapshotsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.pubsub.v1.ListSnapshotsRequest) - return object; - var message = new $root.google.pubsub.v1.ListSnapshotsRequest(); - if (object.project != null) - message.project = String(object.project); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - return message; - }; - - /** - * Creates a plain object from a ListSnapshotsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.pubsub.v1.ListSnapshotsRequest - * @static - * @param {google.pubsub.v1.ListSnapshotsRequest} message ListSnapshotsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListSnapshotsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.project = ""; - object.pageSize = 0; - object.pageToken = ""; - } - if (message.project != null && message.hasOwnProperty("project")) - object.project = message.project; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - return object; - }; - - /** - * Converts this ListSnapshotsRequest to JSON. - * @function toJSON - * @memberof google.pubsub.v1.ListSnapshotsRequest - * @instance - * @returns {Object.} JSON object - */ - ListSnapshotsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListSnapshotsRequest - * @function getTypeUrl - * @memberof google.pubsub.v1.ListSnapshotsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListSnapshotsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.pubsub.v1.ListSnapshotsRequest"; - }; - - return ListSnapshotsRequest; - })(); - - v1.ListSnapshotsResponse = (function() { - - /** - * Properties of a ListSnapshotsResponse. - * @memberof google.pubsub.v1 - * @interface IListSnapshotsResponse - * @property {Array.|null} [snapshots] ListSnapshotsResponse snapshots - * @property {string|null} [nextPageToken] ListSnapshotsResponse nextPageToken - */ - - /** - * Constructs a new ListSnapshotsResponse. - * @memberof google.pubsub.v1 - * @classdesc Represents a ListSnapshotsResponse. - * @implements IListSnapshotsResponse - * @constructor - * @param {google.pubsub.v1.IListSnapshotsResponse=} [properties] Properties to set - */ - function ListSnapshotsResponse(properties) { - this.snapshots = []; - 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]]; - } - - /** - * ListSnapshotsResponse snapshots. - * @member {Array.} snapshots - * @memberof google.pubsub.v1.ListSnapshotsResponse - * @instance - */ - ListSnapshotsResponse.prototype.snapshots = $util.emptyArray; - - /** - * ListSnapshotsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.pubsub.v1.ListSnapshotsResponse - * @instance - */ - ListSnapshotsResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListSnapshotsResponse instance using the specified properties. - * @function create - * @memberof google.pubsub.v1.ListSnapshotsResponse - * @static - * @param {google.pubsub.v1.IListSnapshotsResponse=} [properties] Properties to set - * @returns {google.pubsub.v1.ListSnapshotsResponse} ListSnapshotsResponse instance - */ - ListSnapshotsResponse.create = function create(properties) { - return new ListSnapshotsResponse(properties); - }; - - /** - * Encodes the specified ListSnapshotsResponse message. Does not implicitly {@link google.pubsub.v1.ListSnapshotsResponse.verify|verify} messages. - * @function encode - * @memberof google.pubsub.v1.ListSnapshotsResponse - * @static - * @param {google.pubsub.v1.IListSnapshotsResponse} message ListSnapshotsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListSnapshotsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.snapshots != null && message.snapshots.length) - for (var i = 0; i < message.snapshots.length; ++i) - $root.google.pubsub.v1.Snapshot.encode(message.snapshots[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 ListSnapshotsResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.ListSnapshotsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.pubsub.v1.ListSnapshotsResponse - * @static - * @param {google.pubsub.v1.IListSnapshotsResponse} message ListSnapshotsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListSnapshotsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListSnapshotsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.pubsub.v1.ListSnapshotsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.pubsub.v1.ListSnapshotsResponse} ListSnapshotsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListSnapshotsResponse.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.pubsub.v1.ListSnapshotsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.snapshots && message.snapshots.length)) - message.snapshots = []; - message.snapshots.push($root.google.pubsub.v1.Snapshot.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListSnapshotsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.pubsub.v1.ListSnapshotsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.pubsub.v1.ListSnapshotsResponse} ListSnapshotsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListSnapshotsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListSnapshotsResponse message. - * @function verify - * @memberof google.pubsub.v1.ListSnapshotsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListSnapshotsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.snapshots != null && message.hasOwnProperty("snapshots")) { - if (!Array.isArray(message.snapshots)) - return "snapshots: array expected"; - for (var i = 0; i < message.snapshots.length; ++i) { - var error = $root.google.pubsub.v1.Snapshot.verify(message.snapshots[i]); - if (error) - return "snapshots." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListSnapshotsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.pubsub.v1.ListSnapshotsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.pubsub.v1.ListSnapshotsResponse} ListSnapshotsResponse - */ - ListSnapshotsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.pubsub.v1.ListSnapshotsResponse) - return object; - var message = new $root.google.pubsub.v1.ListSnapshotsResponse(); - if (object.snapshots) { - if (!Array.isArray(object.snapshots)) - throw TypeError(".google.pubsub.v1.ListSnapshotsResponse.snapshots: array expected"); - message.snapshots = []; - for (var i = 0; i < object.snapshots.length; ++i) { - if (typeof object.snapshots[i] !== "object") - throw TypeError(".google.pubsub.v1.ListSnapshotsResponse.snapshots: object expected"); - message.snapshots[i] = $root.google.pubsub.v1.Snapshot.fromObject(object.snapshots[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListSnapshotsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.pubsub.v1.ListSnapshotsResponse - * @static - * @param {google.pubsub.v1.ListSnapshotsResponse} message ListSnapshotsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListSnapshotsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.snapshots = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.snapshots && message.snapshots.length) { - object.snapshots = []; - for (var j = 0; j < message.snapshots.length; ++j) - object.snapshots[j] = $root.google.pubsub.v1.Snapshot.toObject(message.snapshots[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListSnapshotsResponse to JSON. - * @function toJSON - * @memberof google.pubsub.v1.ListSnapshotsResponse - * @instance - * @returns {Object.} JSON object - */ - ListSnapshotsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListSnapshotsResponse - * @function getTypeUrl - * @memberof google.pubsub.v1.ListSnapshotsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListSnapshotsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.pubsub.v1.ListSnapshotsResponse"; - }; - - return ListSnapshotsResponse; - })(); - - v1.DeleteSnapshotRequest = (function() { - - /** - * Properties of a DeleteSnapshotRequest. - * @memberof google.pubsub.v1 - * @interface IDeleteSnapshotRequest - * @property {string|null} [snapshot] DeleteSnapshotRequest snapshot - */ - - /** - * Constructs a new DeleteSnapshotRequest. - * @memberof google.pubsub.v1 - * @classdesc Represents a DeleteSnapshotRequest. - * @implements IDeleteSnapshotRequest - * @constructor - * @param {google.pubsub.v1.IDeleteSnapshotRequest=} [properties] Properties to set - */ - function DeleteSnapshotRequest(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]]; - } - - /** - * DeleteSnapshotRequest snapshot. - * @member {string} snapshot - * @memberof google.pubsub.v1.DeleteSnapshotRequest - * @instance - */ - DeleteSnapshotRequest.prototype.snapshot = ""; - - /** - * Creates a new DeleteSnapshotRequest instance using the specified properties. - * @function create - * @memberof google.pubsub.v1.DeleteSnapshotRequest - * @static - * @param {google.pubsub.v1.IDeleteSnapshotRequest=} [properties] Properties to set - * @returns {google.pubsub.v1.DeleteSnapshotRequest} DeleteSnapshotRequest instance - */ - DeleteSnapshotRequest.create = function create(properties) { - return new DeleteSnapshotRequest(properties); - }; - - /** - * Encodes the specified DeleteSnapshotRequest message. Does not implicitly {@link google.pubsub.v1.DeleteSnapshotRequest.verify|verify} messages. - * @function encode - * @memberof google.pubsub.v1.DeleteSnapshotRequest - * @static - * @param {google.pubsub.v1.IDeleteSnapshotRequest} message DeleteSnapshotRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteSnapshotRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.snapshot != null && Object.hasOwnProperty.call(message, "snapshot")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.snapshot); - return writer; - }; - - /** - * Encodes the specified DeleteSnapshotRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.DeleteSnapshotRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.pubsub.v1.DeleteSnapshotRequest - * @static - * @param {google.pubsub.v1.IDeleteSnapshotRequest} message DeleteSnapshotRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteSnapshotRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteSnapshotRequest message from the specified reader or buffer. - * @function decode - * @memberof google.pubsub.v1.DeleteSnapshotRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.pubsub.v1.DeleteSnapshotRequest} DeleteSnapshotRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteSnapshotRequest.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.pubsub.v1.DeleteSnapshotRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.snapshot = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteSnapshotRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.pubsub.v1.DeleteSnapshotRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.pubsub.v1.DeleteSnapshotRequest} DeleteSnapshotRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteSnapshotRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteSnapshotRequest message. - * @function verify - * @memberof google.pubsub.v1.DeleteSnapshotRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteSnapshotRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.snapshot != null && message.hasOwnProperty("snapshot")) - if (!$util.isString(message.snapshot)) - return "snapshot: string expected"; - return null; - }; - - /** - * Creates a DeleteSnapshotRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.pubsub.v1.DeleteSnapshotRequest - * @static - * @param {Object.} object Plain object - * @returns {google.pubsub.v1.DeleteSnapshotRequest} DeleteSnapshotRequest - */ - DeleteSnapshotRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.pubsub.v1.DeleteSnapshotRequest) - return object; - var message = new $root.google.pubsub.v1.DeleteSnapshotRequest(); - if (object.snapshot != null) - message.snapshot = String(object.snapshot); - return message; - }; - - /** - * Creates a plain object from a DeleteSnapshotRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.pubsub.v1.DeleteSnapshotRequest - * @static - * @param {google.pubsub.v1.DeleteSnapshotRequest} message DeleteSnapshotRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteSnapshotRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.snapshot = ""; - if (message.snapshot != null && message.hasOwnProperty("snapshot")) - object.snapshot = message.snapshot; - return object; - }; - - /** - * Converts this DeleteSnapshotRequest to JSON. - * @function toJSON - * @memberof google.pubsub.v1.DeleteSnapshotRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteSnapshotRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteSnapshotRequest - * @function getTypeUrl - * @memberof google.pubsub.v1.DeleteSnapshotRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteSnapshotRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.pubsub.v1.DeleteSnapshotRequest"; - }; - - return DeleteSnapshotRequest; - })(); - - v1.SeekRequest = (function() { - - /** - * Properties of a SeekRequest. - * @memberof google.pubsub.v1 - * @interface ISeekRequest - * @property {string|null} [subscription] SeekRequest subscription - * @property {google.protobuf.ITimestamp|null} [time] SeekRequest time - * @property {string|null} [snapshot] SeekRequest snapshot - */ - - /** - * Constructs a new SeekRequest. - * @memberof google.pubsub.v1 - * @classdesc Represents a SeekRequest. - * @implements ISeekRequest - * @constructor - * @param {google.pubsub.v1.ISeekRequest=} [properties] Properties to set - */ - function SeekRequest(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]]; - } - - /** - * SeekRequest subscription. - * @member {string} subscription - * @memberof google.pubsub.v1.SeekRequest - * @instance - */ - SeekRequest.prototype.subscription = ""; - - /** - * SeekRequest time. - * @member {google.protobuf.ITimestamp|null|undefined} time - * @memberof google.pubsub.v1.SeekRequest - * @instance - */ - SeekRequest.prototype.time = null; - - /** - * SeekRequest snapshot. - * @member {string|null|undefined} snapshot - * @memberof google.pubsub.v1.SeekRequest - * @instance - */ - SeekRequest.prototype.snapshot = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * SeekRequest target. - * @member {"time"|"snapshot"|undefined} target - * @memberof google.pubsub.v1.SeekRequest - * @instance - */ - Object.defineProperty(SeekRequest.prototype, "target", { - get: $util.oneOfGetter($oneOfFields = ["time", "snapshot"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new SeekRequest instance using the specified properties. - * @function create - * @memberof google.pubsub.v1.SeekRequest - * @static - * @param {google.pubsub.v1.ISeekRequest=} [properties] Properties to set - * @returns {google.pubsub.v1.SeekRequest} SeekRequest instance - */ - SeekRequest.create = function create(properties) { - return new SeekRequest(properties); - }; - - /** - * Encodes the specified SeekRequest message. Does not implicitly {@link google.pubsub.v1.SeekRequest.verify|verify} messages. - * @function encode - * @memberof google.pubsub.v1.SeekRequest - * @static - * @param {google.pubsub.v1.ISeekRequest} message SeekRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SeekRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.subscription != null && Object.hasOwnProperty.call(message, "subscription")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.subscription); - if (message.time != null && Object.hasOwnProperty.call(message, "time")) - $root.google.protobuf.Timestamp.encode(message.time, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.snapshot != null && Object.hasOwnProperty.call(message, "snapshot")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.snapshot); - return writer; - }; - - /** - * Encodes the specified SeekRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.SeekRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.pubsub.v1.SeekRequest - * @static - * @param {google.pubsub.v1.ISeekRequest} message SeekRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SeekRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SeekRequest message from the specified reader or buffer. - * @function decode - * @memberof google.pubsub.v1.SeekRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.pubsub.v1.SeekRequest} SeekRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SeekRequest.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.pubsub.v1.SeekRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.subscription = reader.string(); - break; - } - case 2: { - message.time = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 3: { - message.snapshot = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SeekRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.pubsub.v1.SeekRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.pubsub.v1.SeekRequest} SeekRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SeekRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SeekRequest message. - * @function verify - * @memberof google.pubsub.v1.SeekRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SeekRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.subscription != null && message.hasOwnProperty("subscription")) - if (!$util.isString(message.subscription)) - return "subscription: string expected"; - if (message.time != null && message.hasOwnProperty("time")) { - properties.target = 1; - { - var error = $root.google.protobuf.Timestamp.verify(message.time); - if (error) - return "time." + error; - } - } - if (message.snapshot != null && message.hasOwnProperty("snapshot")) { - if (properties.target === 1) - return "target: multiple values"; - properties.target = 1; - if (!$util.isString(message.snapshot)) - return "snapshot: string expected"; - } - return null; - }; - - /** - * Creates a SeekRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.pubsub.v1.SeekRequest - * @static - * @param {Object.} object Plain object - * @returns {google.pubsub.v1.SeekRequest} SeekRequest - */ - SeekRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.pubsub.v1.SeekRequest) - return object; - var message = new $root.google.pubsub.v1.SeekRequest(); - if (object.subscription != null) - message.subscription = String(object.subscription); - if (object.time != null) { - if (typeof object.time !== "object") - throw TypeError(".google.pubsub.v1.SeekRequest.time: object expected"); - message.time = $root.google.protobuf.Timestamp.fromObject(object.time); - } - if (object.snapshot != null) - message.snapshot = String(object.snapshot); - return message; - }; - - /** - * Creates a plain object from a SeekRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.pubsub.v1.SeekRequest - * @static - * @param {google.pubsub.v1.SeekRequest} message SeekRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SeekRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.subscription = ""; - if (message.subscription != null && message.hasOwnProperty("subscription")) - object.subscription = message.subscription; - if (message.time != null && message.hasOwnProperty("time")) { - object.time = $root.google.protobuf.Timestamp.toObject(message.time, options); - if (options.oneofs) - object.target = "time"; - } - if (message.snapshot != null && message.hasOwnProperty("snapshot")) { - object.snapshot = message.snapshot; - if (options.oneofs) - object.target = "snapshot"; - } - return object; - }; - - /** - * Converts this SeekRequest to JSON. - * @function toJSON - * @memberof google.pubsub.v1.SeekRequest - * @instance - * @returns {Object.} JSON object - */ - SeekRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SeekRequest - * @function getTypeUrl - * @memberof google.pubsub.v1.SeekRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SeekRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.pubsub.v1.SeekRequest"; - }; - - return SeekRequest; - })(); - - v1.SeekResponse = (function() { - - /** - * Properties of a SeekResponse. - * @memberof google.pubsub.v1 - * @interface ISeekResponse - */ - - /** - * Constructs a new SeekResponse. - * @memberof google.pubsub.v1 - * @classdesc Represents a SeekResponse. - * @implements ISeekResponse - * @constructor - * @param {google.pubsub.v1.ISeekResponse=} [properties] Properties to set - */ - function SeekResponse(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 SeekResponse instance using the specified properties. - * @function create - * @memberof google.pubsub.v1.SeekResponse - * @static - * @param {google.pubsub.v1.ISeekResponse=} [properties] Properties to set - * @returns {google.pubsub.v1.SeekResponse} SeekResponse instance - */ - SeekResponse.create = function create(properties) { - return new SeekResponse(properties); - }; - - /** - * Encodes the specified SeekResponse message. Does not implicitly {@link google.pubsub.v1.SeekResponse.verify|verify} messages. - * @function encode - * @memberof google.pubsub.v1.SeekResponse - * @static - * @param {google.pubsub.v1.ISeekResponse} message SeekResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SeekResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified SeekResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.SeekResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.pubsub.v1.SeekResponse - * @static - * @param {google.pubsub.v1.ISeekResponse} message SeekResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SeekResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SeekResponse message from the specified reader or buffer. - * @function decode - * @memberof google.pubsub.v1.SeekResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.pubsub.v1.SeekResponse} SeekResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SeekResponse.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.pubsub.v1.SeekResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SeekResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.pubsub.v1.SeekResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.pubsub.v1.SeekResponse} SeekResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SeekResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SeekResponse message. - * @function verify - * @memberof google.pubsub.v1.SeekResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SeekResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a SeekResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.pubsub.v1.SeekResponse - * @static - * @param {Object.} object Plain object - * @returns {google.pubsub.v1.SeekResponse} SeekResponse - */ - SeekResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.pubsub.v1.SeekResponse) - return object; - return new $root.google.pubsub.v1.SeekResponse(); - }; - - /** - * Creates a plain object from a SeekResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.pubsub.v1.SeekResponse - * @static - * @param {google.pubsub.v1.SeekResponse} message SeekResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SeekResponse.toObject = function toObject() { - return {}; - }; - - /** - * Converts this SeekResponse to JSON. - * @function toJSON - * @memberof google.pubsub.v1.SeekResponse - * @instance - * @returns {Object.} JSON object - */ - SeekResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SeekResponse - * @function getTypeUrl - * @memberof google.pubsub.v1.SeekResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SeekResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.pubsub.v1.SeekResponse"; - }; - - return SeekResponse; - })(); - - v1.SchemaService = (function() { - - /** - * Constructs a new SchemaService service. - * @memberof google.pubsub.v1 - * @classdesc Represents a SchemaService - * @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 SchemaService(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (SchemaService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = SchemaService; - - /** - * Creates new SchemaService service using the specified rpc implementation. - * @function create - * @memberof google.pubsub.v1.SchemaService - * @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 {SchemaService} RPC service. Useful where requests and/or responses are streamed. - */ - SchemaService.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.pubsub.v1.SchemaService|createSchema}. - * @memberof google.pubsub.v1.SchemaService - * @typedef CreateSchemaCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.pubsub.v1.Schema} [response] Schema - */ - - /** - * Calls CreateSchema. - * @function createSchema - * @memberof google.pubsub.v1.SchemaService - * @instance - * @param {google.pubsub.v1.ICreateSchemaRequest} request CreateSchemaRequest message or plain object - * @param {google.pubsub.v1.SchemaService.CreateSchemaCallback} callback Node-style callback called with the error, if any, and Schema - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(SchemaService.prototype.createSchema = function createSchema(request, callback) { - return this.rpcCall(createSchema, $root.google.pubsub.v1.CreateSchemaRequest, $root.google.pubsub.v1.Schema, request, callback); - }, "name", { value: "CreateSchema" }); - - /** - * Calls CreateSchema. - * @function createSchema - * @memberof google.pubsub.v1.SchemaService - * @instance - * @param {google.pubsub.v1.ICreateSchemaRequest} request CreateSchemaRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.pubsub.v1.SchemaService|getSchema}. - * @memberof google.pubsub.v1.SchemaService - * @typedef GetSchemaCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.pubsub.v1.Schema} [response] Schema - */ - - /** - * Calls GetSchema. - * @function getSchema - * @memberof google.pubsub.v1.SchemaService - * @instance - * @param {google.pubsub.v1.IGetSchemaRequest} request GetSchemaRequest message or plain object - * @param {google.pubsub.v1.SchemaService.GetSchemaCallback} callback Node-style callback called with the error, if any, and Schema - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(SchemaService.prototype.getSchema = function getSchema(request, callback) { - return this.rpcCall(getSchema, $root.google.pubsub.v1.GetSchemaRequest, $root.google.pubsub.v1.Schema, request, callback); - }, "name", { value: "GetSchema" }); - - /** - * Calls GetSchema. - * @function getSchema - * @memberof google.pubsub.v1.SchemaService - * @instance - * @param {google.pubsub.v1.IGetSchemaRequest} request GetSchemaRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.pubsub.v1.SchemaService|listSchemas}. - * @memberof google.pubsub.v1.SchemaService - * @typedef ListSchemasCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.pubsub.v1.ListSchemasResponse} [response] ListSchemasResponse - */ - - /** - * Calls ListSchemas. - * @function listSchemas - * @memberof google.pubsub.v1.SchemaService - * @instance - * @param {google.pubsub.v1.IListSchemasRequest} request ListSchemasRequest message or plain object - * @param {google.pubsub.v1.SchemaService.ListSchemasCallback} callback Node-style callback called with the error, if any, and ListSchemasResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(SchemaService.prototype.listSchemas = function listSchemas(request, callback) { - return this.rpcCall(listSchemas, $root.google.pubsub.v1.ListSchemasRequest, $root.google.pubsub.v1.ListSchemasResponse, request, callback); - }, "name", { value: "ListSchemas" }); - - /** - * Calls ListSchemas. - * @function listSchemas - * @memberof google.pubsub.v1.SchemaService - * @instance - * @param {google.pubsub.v1.IListSchemasRequest} request ListSchemasRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.pubsub.v1.SchemaService|listSchemaRevisions}. - * @memberof google.pubsub.v1.SchemaService - * @typedef ListSchemaRevisionsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.pubsub.v1.ListSchemaRevisionsResponse} [response] ListSchemaRevisionsResponse - */ - - /** - * Calls ListSchemaRevisions. - * @function listSchemaRevisions - * @memberof google.pubsub.v1.SchemaService - * @instance - * @param {google.pubsub.v1.IListSchemaRevisionsRequest} request ListSchemaRevisionsRequest message or plain object - * @param {google.pubsub.v1.SchemaService.ListSchemaRevisionsCallback} callback Node-style callback called with the error, if any, and ListSchemaRevisionsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(SchemaService.prototype.listSchemaRevisions = function listSchemaRevisions(request, callback) { - return this.rpcCall(listSchemaRevisions, $root.google.pubsub.v1.ListSchemaRevisionsRequest, $root.google.pubsub.v1.ListSchemaRevisionsResponse, request, callback); - }, "name", { value: "ListSchemaRevisions" }); - - /** - * Calls ListSchemaRevisions. - * @function listSchemaRevisions - * @memberof google.pubsub.v1.SchemaService - * @instance - * @param {google.pubsub.v1.IListSchemaRevisionsRequest} request ListSchemaRevisionsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.pubsub.v1.SchemaService|commitSchema}. - * @memberof google.pubsub.v1.SchemaService - * @typedef CommitSchemaCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.pubsub.v1.Schema} [response] Schema - */ - - /** - * Calls CommitSchema. - * @function commitSchema - * @memberof google.pubsub.v1.SchemaService - * @instance - * @param {google.pubsub.v1.ICommitSchemaRequest} request CommitSchemaRequest message or plain object - * @param {google.pubsub.v1.SchemaService.CommitSchemaCallback} callback Node-style callback called with the error, if any, and Schema - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(SchemaService.prototype.commitSchema = function commitSchema(request, callback) { - return this.rpcCall(commitSchema, $root.google.pubsub.v1.CommitSchemaRequest, $root.google.pubsub.v1.Schema, request, callback); - }, "name", { value: "CommitSchema" }); - - /** - * Calls CommitSchema. - * @function commitSchema - * @memberof google.pubsub.v1.SchemaService - * @instance - * @param {google.pubsub.v1.ICommitSchemaRequest} request CommitSchemaRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.pubsub.v1.SchemaService|rollbackSchema}. - * @memberof google.pubsub.v1.SchemaService - * @typedef RollbackSchemaCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.pubsub.v1.Schema} [response] Schema - */ - - /** - * Calls RollbackSchema. - * @function rollbackSchema - * @memberof google.pubsub.v1.SchemaService - * @instance - * @param {google.pubsub.v1.IRollbackSchemaRequest} request RollbackSchemaRequest message or plain object - * @param {google.pubsub.v1.SchemaService.RollbackSchemaCallback} callback Node-style callback called with the error, if any, and Schema - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(SchemaService.prototype.rollbackSchema = function rollbackSchema(request, callback) { - return this.rpcCall(rollbackSchema, $root.google.pubsub.v1.RollbackSchemaRequest, $root.google.pubsub.v1.Schema, request, callback); - }, "name", { value: "RollbackSchema" }); - - /** - * Calls RollbackSchema. - * @function rollbackSchema - * @memberof google.pubsub.v1.SchemaService - * @instance - * @param {google.pubsub.v1.IRollbackSchemaRequest} request RollbackSchemaRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.pubsub.v1.SchemaService|deleteSchemaRevision}. - * @memberof google.pubsub.v1.SchemaService - * @typedef DeleteSchemaRevisionCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.pubsub.v1.Schema} [response] Schema - */ - - /** - * Calls DeleteSchemaRevision. - * @function deleteSchemaRevision - * @memberof google.pubsub.v1.SchemaService - * @instance - * @param {google.pubsub.v1.IDeleteSchemaRevisionRequest} request DeleteSchemaRevisionRequest message or plain object - * @param {google.pubsub.v1.SchemaService.DeleteSchemaRevisionCallback} callback Node-style callback called with the error, if any, and Schema - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(SchemaService.prototype.deleteSchemaRevision = function deleteSchemaRevision(request, callback) { - return this.rpcCall(deleteSchemaRevision, $root.google.pubsub.v1.DeleteSchemaRevisionRequest, $root.google.pubsub.v1.Schema, request, callback); - }, "name", { value: "DeleteSchemaRevision" }); - - /** - * Calls DeleteSchemaRevision. - * @function deleteSchemaRevision - * @memberof google.pubsub.v1.SchemaService - * @instance - * @param {google.pubsub.v1.IDeleteSchemaRevisionRequest} request DeleteSchemaRevisionRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.pubsub.v1.SchemaService|deleteSchema}. - * @memberof google.pubsub.v1.SchemaService - * @typedef DeleteSchemaCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls DeleteSchema. - * @function deleteSchema - * @memberof google.pubsub.v1.SchemaService - * @instance - * @param {google.pubsub.v1.IDeleteSchemaRequest} request DeleteSchemaRequest message or plain object - * @param {google.pubsub.v1.SchemaService.DeleteSchemaCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(SchemaService.prototype.deleteSchema = function deleteSchema(request, callback) { - return this.rpcCall(deleteSchema, $root.google.pubsub.v1.DeleteSchemaRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteSchema" }); - - /** - * Calls DeleteSchema. - * @function deleteSchema - * @memberof google.pubsub.v1.SchemaService - * @instance - * @param {google.pubsub.v1.IDeleteSchemaRequest} request DeleteSchemaRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.pubsub.v1.SchemaService|validateSchema}. - * @memberof google.pubsub.v1.SchemaService - * @typedef ValidateSchemaCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.pubsub.v1.ValidateSchemaResponse} [response] ValidateSchemaResponse - */ - - /** - * Calls ValidateSchema. - * @function validateSchema - * @memberof google.pubsub.v1.SchemaService - * @instance - * @param {google.pubsub.v1.IValidateSchemaRequest} request ValidateSchemaRequest message or plain object - * @param {google.pubsub.v1.SchemaService.ValidateSchemaCallback} callback Node-style callback called with the error, if any, and ValidateSchemaResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(SchemaService.prototype.validateSchema = function validateSchema(request, callback) { - return this.rpcCall(validateSchema, $root.google.pubsub.v1.ValidateSchemaRequest, $root.google.pubsub.v1.ValidateSchemaResponse, request, callback); - }, "name", { value: "ValidateSchema" }); - - /** - * Calls ValidateSchema. - * @function validateSchema - * @memberof google.pubsub.v1.SchemaService - * @instance - * @param {google.pubsub.v1.IValidateSchemaRequest} request ValidateSchemaRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.pubsub.v1.SchemaService|validateMessage}. - * @memberof google.pubsub.v1.SchemaService - * @typedef ValidateMessageCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.pubsub.v1.ValidateMessageResponse} [response] ValidateMessageResponse - */ - - /** - * Calls ValidateMessage. - * @function validateMessage - * @memberof google.pubsub.v1.SchemaService - * @instance - * @param {google.pubsub.v1.IValidateMessageRequest} request ValidateMessageRequest message or plain object - * @param {google.pubsub.v1.SchemaService.ValidateMessageCallback} callback Node-style callback called with the error, if any, and ValidateMessageResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(SchemaService.prototype.validateMessage = function validateMessage(request, callback) { - return this.rpcCall(validateMessage, $root.google.pubsub.v1.ValidateMessageRequest, $root.google.pubsub.v1.ValidateMessageResponse, request, callback); - }, "name", { value: "ValidateMessage" }); - - /** - * Calls ValidateMessage. - * @function validateMessage - * @memberof google.pubsub.v1.SchemaService - * @instance - * @param {google.pubsub.v1.IValidateMessageRequest} request ValidateMessageRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return SchemaService; - })(); - - v1.Schema = (function() { - - /** - * Properties of a Schema. - * @memberof google.pubsub.v1 - * @interface ISchema - * @property {string|null} [name] Schema name - * @property {google.pubsub.v1.Schema.Type|null} [type] Schema type - * @property {string|null} [definition] Schema definition - * @property {string|null} [revisionId] Schema revisionId - * @property {google.protobuf.ITimestamp|null} [revisionCreateTime] Schema revisionCreateTime - */ - - /** - * Constructs a new Schema. - * @memberof google.pubsub.v1 - * @classdesc Represents a Schema. - * @implements ISchema - * @constructor - * @param {google.pubsub.v1.ISchema=} [properties] Properties to set - */ - function Schema(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]]; - } - - /** - * Schema name. - * @member {string} name - * @memberof google.pubsub.v1.Schema - * @instance - */ - Schema.prototype.name = ""; - - /** - * Schema type. - * @member {google.pubsub.v1.Schema.Type} type - * @memberof google.pubsub.v1.Schema - * @instance - */ - Schema.prototype.type = 0; - - /** - * Schema definition. - * @member {string} definition - * @memberof google.pubsub.v1.Schema - * @instance - */ - Schema.prototype.definition = ""; - - /** - * Schema revisionId. - * @member {string} revisionId - * @memberof google.pubsub.v1.Schema - * @instance - */ - Schema.prototype.revisionId = ""; - - /** - * Schema revisionCreateTime. - * @member {google.protobuf.ITimestamp|null|undefined} revisionCreateTime - * @memberof google.pubsub.v1.Schema - * @instance - */ - Schema.prototype.revisionCreateTime = null; - - /** - * Creates a new Schema instance using the specified properties. - * @function create - * @memberof google.pubsub.v1.Schema - * @static - * @param {google.pubsub.v1.ISchema=} [properties] Properties to set - * @returns {google.pubsub.v1.Schema} Schema instance - */ - Schema.create = function create(properties) { - return new Schema(properties); - }; - - /** - * Encodes the specified Schema message. Does not implicitly {@link google.pubsub.v1.Schema.verify|verify} messages. - * @function encode - * @memberof google.pubsub.v1.Schema - * @static - * @param {google.pubsub.v1.ISchema} message Schema message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Schema.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.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.type); - if (message.definition != null && Object.hasOwnProperty.call(message, "definition")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.definition); - if (message.revisionId != null && Object.hasOwnProperty.call(message, "revisionId")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.revisionId); - if (message.revisionCreateTime != null && Object.hasOwnProperty.call(message, "revisionCreateTime")) - $root.google.protobuf.Timestamp.encode(message.revisionCreateTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Schema message, length delimited. Does not implicitly {@link google.pubsub.v1.Schema.verify|verify} messages. - * @function encodeDelimited - * @memberof google.pubsub.v1.Schema - * @static - * @param {google.pubsub.v1.ISchema} message Schema message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Schema.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Schema message from the specified reader or buffer. - * @function decode - * @memberof google.pubsub.v1.Schema - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.pubsub.v1.Schema} Schema - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Schema.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.pubsub.v1.Schema(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.type = reader.int32(); - break; - } - case 3: { - message.definition = reader.string(); - break; - } - case 4: { - message.revisionId = reader.string(); - break; - } - case 6: { - message.revisionCreateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Schema message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.pubsub.v1.Schema - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.pubsub.v1.Schema} Schema - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Schema.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Schema message. - * @function verify - * @memberof google.pubsub.v1.Schema - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Schema.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.type != null && message.hasOwnProperty("type")) - switch (message.type) { - default: - return "type: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.definition != null && message.hasOwnProperty("definition")) - if (!$util.isString(message.definition)) - return "definition: string expected"; - if (message.revisionId != null && message.hasOwnProperty("revisionId")) - if (!$util.isString(message.revisionId)) - return "revisionId: string expected"; - if (message.revisionCreateTime != null && message.hasOwnProperty("revisionCreateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.revisionCreateTime); - if (error) - return "revisionCreateTime." + error; - } - return null; - }; - - /** - * Creates a Schema message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.pubsub.v1.Schema - * @static - * @param {Object.} object Plain object - * @returns {google.pubsub.v1.Schema} Schema - */ - Schema.fromObject = function fromObject(object) { - if (object instanceof $root.google.pubsub.v1.Schema) - return object; - var message = new $root.google.pubsub.v1.Schema(); - if (object.name != null) - message.name = String(object.name); - switch (object.type) { - default: - if (typeof object.type === "number") { - message.type = object.type; - break; - } - break; - case "TYPE_UNSPECIFIED": - case 0: - message.type = 0; - break; - case "PROTOCOL_BUFFER": - case 1: - message.type = 1; - break; - case "AVRO": - case 2: - message.type = 2; - break; - } - if (object.definition != null) - message.definition = String(object.definition); - if (object.revisionId != null) - message.revisionId = String(object.revisionId); - if (object.revisionCreateTime != null) { - if (typeof object.revisionCreateTime !== "object") - throw TypeError(".google.pubsub.v1.Schema.revisionCreateTime: object expected"); - message.revisionCreateTime = $root.google.protobuf.Timestamp.fromObject(object.revisionCreateTime); - } - return message; - }; - - /** - * Creates a plain object from a Schema message. Also converts values to other types if specified. - * @function toObject - * @memberof google.pubsub.v1.Schema - * @static - * @param {google.pubsub.v1.Schema} message Schema - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Schema.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; - object.definition = ""; - object.revisionId = ""; - object.revisionCreateTime = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.pubsub.v1.Schema.Type[message.type] === undefined ? message.type : $root.google.pubsub.v1.Schema.Type[message.type] : message.type; - if (message.definition != null && message.hasOwnProperty("definition")) - object.definition = message.definition; - if (message.revisionId != null && message.hasOwnProperty("revisionId")) - object.revisionId = message.revisionId; - if (message.revisionCreateTime != null && message.hasOwnProperty("revisionCreateTime")) - object.revisionCreateTime = $root.google.protobuf.Timestamp.toObject(message.revisionCreateTime, options); - return object; - }; - - /** - * Converts this Schema to JSON. - * @function toJSON - * @memberof google.pubsub.v1.Schema - * @instance - * @returns {Object.} JSON object - */ - Schema.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Schema - * @function getTypeUrl - * @memberof google.pubsub.v1.Schema - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Schema.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.pubsub.v1.Schema"; - }; - - /** - * Type enum. - * @name google.pubsub.v1.Schema.Type - * @enum {number} - * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value - * @property {number} PROTOCOL_BUFFER=1 PROTOCOL_BUFFER value - * @property {number} AVRO=2 AVRO value - */ - Schema.Type = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "PROTOCOL_BUFFER"] = 1; - values[valuesById[2] = "AVRO"] = 2; - return values; - })(); - - return Schema; - })(); - - /** - * SchemaView enum. - * @name google.pubsub.v1.SchemaView - * @enum {number} - * @property {number} SCHEMA_VIEW_UNSPECIFIED=0 SCHEMA_VIEW_UNSPECIFIED value - * @property {number} BASIC=1 BASIC value - * @property {number} FULL=2 FULL value - */ - v1.SchemaView = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "SCHEMA_VIEW_UNSPECIFIED"] = 0; - values[valuesById[1] = "BASIC"] = 1; - values[valuesById[2] = "FULL"] = 2; - return values; - })(); - - v1.CreateSchemaRequest = (function() { - - /** - * Properties of a CreateSchemaRequest. - * @memberof google.pubsub.v1 - * @interface ICreateSchemaRequest - * @property {string|null} [parent] CreateSchemaRequest parent - * @property {google.pubsub.v1.ISchema|null} [schema] CreateSchemaRequest schema - * @property {string|null} [schemaId] CreateSchemaRequest schemaId - */ - - /** - * Constructs a new CreateSchemaRequest. - * @memberof google.pubsub.v1 - * @classdesc Represents a CreateSchemaRequest. - * @implements ICreateSchemaRequest - * @constructor - * @param {google.pubsub.v1.ICreateSchemaRequest=} [properties] Properties to set - */ - function CreateSchemaRequest(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]]; - } - - /** - * CreateSchemaRequest parent. - * @member {string} parent - * @memberof google.pubsub.v1.CreateSchemaRequest - * @instance - */ - CreateSchemaRequest.prototype.parent = ""; - - /** - * CreateSchemaRequest schema. - * @member {google.pubsub.v1.ISchema|null|undefined} schema - * @memberof google.pubsub.v1.CreateSchemaRequest - * @instance - */ - CreateSchemaRequest.prototype.schema = null; - - /** - * CreateSchemaRequest schemaId. - * @member {string} schemaId - * @memberof google.pubsub.v1.CreateSchemaRequest - * @instance - */ - CreateSchemaRequest.prototype.schemaId = ""; - - /** - * Creates a new CreateSchemaRequest instance using the specified properties. - * @function create - * @memberof google.pubsub.v1.CreateSchemaRequest - * @static - * @param {google.pubsub.v1.ICreateSchemaRequest=} [properties] Properties to set - * @returns {google.pubsub.v1.CreateSchemaRequest} CreateSchemaRequest instance - */ - CreateSchemaRequest.create = function create(properties) { - return new CreateSchemaRequest(properties); - }; - - /** - * Encodes the specified CreateSchemaRequest message. Does not implicitly {@link google.pubsub.v1.CreateSchemaRequest.verify|verify} messages. - * @function encode - * @memberof google.pubsub.v1.CreateSchemaRequest - * @static - * @param {google.pubsub.v1.ICreateSchemaRequest} message CreateSchemaRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateSchemaRequest.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.schema != null && Object.hasOwnProperty.call(message, "schema")) - $root.google.pubsub.v1.Schema.encode(message.schema, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.schemaId != null && Object.hasOwnProperty.call(message, "schemaId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.schemaId); - return writer; - }; - - /** - * Encodes the specified CreateSchemaRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.CreateSchemaRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.pubsub.v1.CreateSchemaRequest - * @static - * @param {google.pubsub.v1.ICreateSchemaRequest} message CreateSchemaRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateSchemaRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateSchemaRequest message from the specified reader or buffer. - * @function decode - * @memberof google.pubsub.v1.CreateSchemaRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.pubsub.v1.CreateSchemaRequest} CreateSchemaRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateSchemaRequest.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.pubsub.v1.CreateSchemaRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.schema = $root.google.pubsub.v1.Schema.decode(reader, reader.uint32()); - break; - } - case 3: { - message.schemaId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateSchemaRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.pubsub.v1.CreateSchemaRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.pubsub.v1.CreateSchemaRequest} CreateSchemaRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateSchemaRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateSchemaRequest message. - * @function verify - * @memberof google.pubsub.v1.CreateSchemaRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateSchemaRequest.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.schema != null && message.hasOwnProperty("schema")) { - var error = $root.google.pubsub.v1.Schema.verify(message.schema); - if (error) - return "schema." + error; - } - if (message.schemaId != null && message.hasOwnProperty("schemaId")) - if (!$util.isString(message.schemaId)) - return "schemaId: string expected"; - return null; - }; - - /** - * Creates a CreateSchemaRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.pubsub.v1.CreateSchemaRequest - * @static - * @param {Object.} object Plain object - * @returns {google.pubsub.v1.CreateSchemaRequest} CreateSchemaRequest - */ - CreateSchemaRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.pubsub.v1.CreateSchemaRequest) - return object; - var message = new $root.google.pubsub.v1.CreateSchemaRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.schema != null) { - if (typeof object.schema !== "object") - throw TypeError(".google.pubsub.v1.CreateSchemaRequest.schema: object expected"); - message.schema = $root.google.pubsub.v1.Schema.fromObject(object.schema); - } - if (object.schemaId != null) - message.schemaId = String(object.schemaId); - return message; - }; - - /** - * Creates a plain object from a CreateSchemaRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.pubsub.v1.CreateSchemaRequest - * @static - * @param {google.pubsub.v1.CreateSchemaRequest} message CreateSchemaRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateSchemaRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.schema = null; - object.schemaId = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.schema != null && message.hasOwnProperty("schema")) - object.schema = $root.google.pubsub.v1.Schema.toObject(message.schema, options); - if (message.schemaId != null && message.hasOwnProperty("schemaId")) - object.schemaId = message.schemaId; - return object; - }; - - /** - * Converts this CreateSchemaRequest to JSON. - * @function toJSON - * @memberof google.pubsub.v1.CreateSchemaRequest - * @instance - * @returns {Object.} JSON object - */ - CreateSchemaRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateSchemaRequest - * @function getTypeUrl - * @memberof google.pubsub.v1.CreateSchemaRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateSchemaRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.pubsub.v1.CreateSchemaRequest"; - }; - - return CreateSchemaRequest; - })(); - - v1.GetSchemaRequest = (function() { - - /** - * Properties of a GetSchemaRequest. - * @memberof google.pubsub.v1 - * @interface IGetSchemaRequest - * @property {string|null} [name] GetSchemaRequest name - * @property {google.pubsub.v1.SchemaView|null} [view] GetSchemaRequest view - */ - - /** - * Constructs a new GetSchemaRequest. - * @memberof google.pubsub.v1 - * @classdesc Represents a GetSchemaRequest. - * @implements IGetSchemaRequest - * @constructor - * @param {google.pubsub.v1.IGetSchemaRequest=} [properties] Properties to set - */ - function GetSchemaRequest(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]]; - } - - /** - * GetSchemaRequest name. - * @member {string} name - * @memberof google.pubsub.v1.GetSchemaRequest - * @instance - */ - GetSchemaRequest.prototype.name = ""; - - /** - * GetSchemaRequest view. - * @member {google.pubsub.v1.SchemaView} view - * @memberof google.pubsub.v1.GetSchemaRequest - * @instance - */ - GetSchemaRequest.prototype.view = 0; - - /** - * Creates a new GetSchemaRequest instance using the specified properties. - * @function create - * @memberof google.pubsub.v1.GetSchemaRequest - * @static - * @param {google.pubsub.v1.IGetSchemaRequest=} [properties] Properties to set - * @returns {google.pubsub.v1.GetSchemaRequest} GetSchemaRequest instance - */ - GetSchemaRequest.create = function create(properties) { - return new GetSchemaRequest(properties); - }; - - /** - * Encodes the specified GetSchemaRequest message. Does not implicitly {@link google.pubsub.v1.GetSchemaRequest.verify|verify} messages. - * @function encode - * @memberof google.pubsub.v1.GetSchemaRequest - * @static - * @param {google.pubsub.v1.IGetSchemaRequest} message GetSchemaRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetSchemaRequest.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.view != null && Object.hasOwnProperty.call(message, "view")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.view); - return writer; - }; - - /** - * Encodes the specified GetSchemaRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.GetSchemaRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.pubsub.v1.GetSchemaRequest - * @static - * @param {google.pubsub.v1.IGetSchemaRequest} message GetSchemaRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetSchemaRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetSchemaRequest message from the specified reader or buffer. - * @function decode - * @memberof google.pubsub.v1.GetSchemaRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.pubsub.v1.GetSchemaRequest} GetSchemaRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetSchemaRequest.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.pubsub.v1.GetSchemaRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.view = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetSchemaRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.pubsub.v1.GetSchemaRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.pubsub.v1.GetSchemaRequest} GetSchemaRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetSchemaRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetSchemaRequest message. - * @function verify - * @memberof google.pubsub.v1.GetSchemaRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetSchemaRequest.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.view != null && message.hasOwnProperty("view")) - switch (message.view) { - default: - return "view: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates a GetSchemaRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.pubsub.v1.GetSchemaRequest - * @static - * @param {Object.} object Plain object - * @returns {google.pubsub.v1.GetSchemaRequest} GetSchemaRequest - */ - GetSchemaRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.pubsub.v1.GetSchemaRequest) - return object; - var message = new $root.google.pubsub.v1.GetSchemaRequest(); - if (object.name != null) - message.name = String(object.name); - switch (object.view) { - default: - if (typeof object.view === "number") { - message.view = object.view; - break; - } - break; - case "SCHEMA_VIEW_UNSPECIFIED": - case 0: - message.view = 0; - break; - case "BASIC": - case 1: - message.view = 1; - break; - case "FULL": - case 2: - message.view = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from a GetSchemaRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.pubsub.v1.GetSchemaRequest - * @static - * @param {google.pubsub.v1.GetSchemaRequest} message GetSchemaRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetSchemaRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.view = options.enums === String ? "SCHEMA_VIEW_UNSPECIFIED" : 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.view != null && message.hasOwnProperty("view")) - object.view = options.enums === String ? $root.google.pubsub.v1.SchemaView[message.view] === undefined ? message.view : $root.google.pubsub.v1.SchemaView[message.view] : message.view; - return object; - }; - - /** - * Converts this GetSchemaRequest to JSON. - * @function toJSON - * @memberof google.pubsub.v1.GetSchemaRequest - * @instance - * @returns {Object.} JSON object - */ - GetSchemaRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetSchemaRequest - * @function getTypeUrl - * @memberof google.pubsub.v1.GetSchemaRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetSchemaRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.pubsub.v1.GetSchemaRequest"; - }; - - return GetSchemaRequest; - })(); - - v1.ListSchemasRequest = (function() { - - /** - * Properties of a ListSchemasRequest. - * @memberof google.pubsub.v1 - * @interface IListSchemasRequest - * @property {string|null} [parent] ListSchemasRequest parent - * @property {google.pubsub.v1.SchemaView|null} [view] ListSchemasRequest view - * @property {number|null} [pageSize] ListSchemasRequest pageSize - * @property {string|null} [pageToken] ListSchemasRequest pageToken - */ - - /** - * Constructs a new ListSchemasRequest. - * @memberof google.pubsub.v1 - * @classdesc Represents a ListSchemasRequest. - * @implements IListSchemasRequest - * @constructor - * @param {google.pubsub.v1.IListSchemasRequest=} [properties] Properties to set - */ - function ListSchemasRequest(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]]; - } - - /** - * ListSchemasRequest parent. - * @member {string} parent - * @memberof google.pubsub.v1.ListSchemasRequest - * @instance - */ - ListSchemasRequest.prototype.parent = ""; - - /** - * ListSchemasRequest view. - * @member {google.pubsub.v1.SchemaView} view - * @memberof google.pubsub.v1.ListSchemasRequest - * @instance - */ - ListSchemasRequest.prototype.view = 0; - - /** - * ListSchemasRequest pageSize. - * @member {number} pageSize - * @memberof google.pubsub.v1.ListSchemasRequest - * @instance - */ - ListSchemasRequest.prototype.pageSize = 0; - - /** - * ListSchemasRequest pageToken. - * @member {string} pageToken - * @memberof google.pubsub.v1.ListSchemasRequest - * @instance - */ - ListSchemasRequest.prototype.pageToken = ""; - - /** - * Creates a new ListSchemasRequest instance using the specified properties. - * @function create - * @memberof google.pubsub.v1.ListSchemasRequest - * @static - * @param {google.pubsub.v1.IListSchemasRequest=} [properties] Properties to set - * @returns {google.pubsub.v1.ListSchemasRequest} ListSchemasRequest instance - */ - ListSchemasRequest.create = function create(properties) { - return new ListSchemasRequest(properties); - }; - - /** - * Encodes the specified ListSchemasRequest message. Does not implicitly {@link google.pubsub.v1.ListSchemasRequest.verify|verify} messages. - * @function encode - * @memberof google.pubsub.v1.ListSchemasRequest - * @static - * @param {google.pubsub.v1.IListSchemasRequest} message ListSchemasRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListSchemasRequest.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.view != null && Object.hasOwnProperty.call(message, "view")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.view); - 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); - return writer; - }; - - /** - * Encodes the specified ListSchemasRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.ListSchemasRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.pubsub.v1.ListSchemasRequest - * @static - * @param {google.pubsub.v1.IListSchemasRequest} message ListSchemasRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListSchemasRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListSchemasRequest message from the specified reader or buffer. - * @function decode - * @memberof google.pubsub.v1.ListSchemasRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.pubsub.v1.ListSchemasRequest} ListSchemasRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListSchemasRequest.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.pubsub.v1.ListSchemasRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.view = reader.int32(); - break; - } - case 3: { - message.pageSize = reader.int32(); - break; - } - case 4: { - message.pageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListSchemasRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.pubsub.v1.ListSchemasRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.pubsub.v1.ListSchemasRequest} ListSchemasRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListSchemasRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListSchemasRequest message. - * @function verify - * @memberof google.pubsub.v1.ListSchemasRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListSchemasRequest.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.view != null && message.hasOwnProperty("view")) - switch (message.view) { - default: - return "view: enum value expected"; - case 0: - case 1: - case 2: - break; - } - 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"; - return null; - }; - - /** - * Creates a ListSchemasRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.pubsub.v1.ListSchemasRequest - * @static - * @param {Object.} object Plain object - * @returns {google.pubsub.v1.ListSchemasRequest} ListSchemasRequest - */ - ListSchemasRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.pubsub.v1.ListSchemasRequest) - return object; - var message = new $root.google.pubsub.v1.ListSchemasRequest(); - if (object.parent != null) - message.parent = String(object.parent); - switch (object.view) { - default: - if (typeof object.view === "number") { - message.view = object.view; - break; - } - break; - case "SCHEMA_VIEW_UNSPECIFIED": - case 0: - message.view = 0; - break; - case "BASIC": - case 1: - message.view = 1; - break; - case "FULL": - case 2: - message.view = 2; - break; - } - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - return message; - }; - - /** - * Creates a plain object from a ListSchemasRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.pubsub.v1.ListSchemasRequest - * @static - * @param {google.pubsub.v1.ListSchemasRequest} message ListSchemasRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListSchemasRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.view = options.enums === String ? "SCHEMA_VIEW_UNSPECIFIED" : 0; - object.pageSize = 0; - object.pageToken = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.view != null && message.hasOwnProperty("view")) - object.view = options.enums === String ? $root.google.pubsub.v1.SchemaView[message.view] === undefined ? message.view : $root.google.pubsub.v1.SchemaView[message.view] : message.view; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - return object; - }; - - /** - * Converts this ListSchemasRequest to JSON. - * @function toJSON - * @memberof google.pubsub.v1.ListSchemasRequest - * @instance - * @returns {Object.} JSON object - */ - ListSchemasRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListSchemasRequest - * @function getTypeUrl - * @memberof google.pubsub.v1.ListSchemasRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListSchemasRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.pubsub.v1.ListSchemasRequest"; - }; - - return ListSchemasRequest; - })(); - - v1.ListSchemasResponse = (function() { - - /** - * Properties of a ListSchemasResponse. - * @memberof google.pubsub.v1 - * @interface IListSchemasResponse - * @property {Array.|null} [schemas] ListSchemasResponse schemas - * @property {string|null} [nextPageToken] ListSchemasResponse nextPageToken - */ - - /** - * Constructs a new ListSchemasResponse. - * @memberof google.pubsub.v1 - * @classdesc Represents a ListSchemasResponse. - * @implements IListSchemasResponse - * @constructor - * @param {google.pubsub.v1.IListSchemasResponse=} [properties] Properties to set - */ - function ListSchemasResponse(properties) { - this.schemas = []; - 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]]; - } - - /** - * ListSchemasResponse schemas. - * @member {Array.} schemas - * @memberof google.pubsub.v1.ListSchemasResponse - * @instance - */ - ListSchemasResponse.prototype.schemas = $util.emptyArray; - - /** - * ListSchemasResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.pubsub.v1.ListSchemasResponse - * @instance - */ - ListSchemasResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListSchemasResponse instance using the specified properties. - * @function create - * @memberof google.pubsub.v1.ListSchemasResponse - * @static - * @param {google.pubsub.v1.IListSchemasResponse=} [properties] Properties to set - * @returns {google.pubsub.v1.ListSchemasResponse} ListSchemasResponse instance - */ - ListSchemasResponse.create = function create(properties) { - return new ListSchemasResponse(properties); - }; - - /** - * Encodes the specified ListSchemasResponse message. Does not implicitly {@link google.pubsub.v1.ListSchemasResponse.verify|verify} messages. - * @function encode - * @memberof google.pubsub.v1.ListSchemasResponse - * @static - * @param {google.pubsub.v1.IListSchemasResponse} message ListSchemasResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListSchemasResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.schemas != null && message.schemas.length) - for (var i = 0; i < message.schemas.length; ++i) - $root.google.pubsub.v1.Schema.encode(message.schemas[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 ListSchemasResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.ListSchemasResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.pubsub.v1.ListSchemasResponse - * @static - * @param {google.pubsub.v1.IListSchemasResponse} message ListSchemasResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListSchemasResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListSchemasResponse message from the specified reader or buffer. - * @function decode - * @memberof google.pubsub.v1.ListSchemasResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.pubsub.v1.ListSchemasResponse} ListSchemasResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListSchemasResponse.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.pubsub.v1.ListSchemasResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.schemas && message.schemas.length)) - message.schemas = []; - message.schemas.push($root.google.pubsub.v1.Schema.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListSchemasResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.pubsub.v1.ListSchemasResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.pubsub.v1.ListSchemasResponse} ListSchemasResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListSchemasResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListSchemasResponse message. - * @function verify - * @memberof google.pubsub.v1.ListSchemasResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListSchemasResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.schemas != null && message.hasOwnProperty("schemas")) { - if (!Array.isArray(message.schemas)) - return "schemas: array expected"; - for (var i = 0; i < message.schemas.length; ++i) { - var error = $root.google.pubsub.v1.Schema.verify(message.schemas[i]); - if (error) - return "schemas." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListSchemasResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.pubsub.v1.ListSchemasResponse - * @static - * @param {Object.} object Plain object - * @returns {google.pubsub.v1.ListSchemasResponse} ListSchemasResponse - */ - ListSchemasResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.pubsub.v1.ListSchemasResponse) - return object; - var message = new $root.google.pubsub.v1.ListSchemasResponse(); - if (object.schemas) { - if (!Array.isArray(object.schemas)) - throw TypeError(".google.pubsub.v1.ListSchemasResponse.schemas: array expected"); - message.schemas = []; - for (var i = 0; i < object.schemas.length; ++i) { - if (typeof object.schemas[i] !== "object") - throw TypeError(".google.pubsub.v1.ListSchemasResponse.schemas: object expected"); - message.schemas[i] = $root.google.pubsub.v1.Schema.fromObject(object.schemas[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListSchemasResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.pubsub.v1.ListSchemasResponse - * @static - * @param {google.pubsub.v1.ListSchemasResponse} message ListSchemasResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListSchemasResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.schemas = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.schemas && message.schemas.length) { - object.schemas = []; - for (var j = 0; j < message.schemas.length; ++j) - object.schemas[j] = $root.google.pubsub.v1.Schema.toObject(message.schemas[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListSchemasResponse to JSON. - * @function toJSON - * @memberof google.pubsub.v1.ListSchemasResponse - * @instance - * @returns {Object.} JSON object - */ - ListSchemasResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListSchemasResponse - * @function getTypeUrl - * @memberof google.pubsub.v1.ListSchemasResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListSchemasResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.pubsub.v1.ListSchemasResponse"; - }; - - return ListSchemasResponse; - })(); - - v1.ListSchemaRevisionsRequest = (function() { - - /** - * Properties of a ListSchemaRevisionsRequest. - * @memberof google.pubsub.v1 - * @interface IListSchemaRevisionsRequest - * @property {string|null} [name] ListSchemaRevisionsRequest name - * @property {google.pubsub.v1.SchemaView|null} [view] ListSchemaRevisionsRequest view - * @property {number|null} [pageSize] ListSchemaRevisionsRequest pageSize - * @property {string|null} [pageToken] ListSchemaRevisionsRequest pageToken - */ - - /** - * Constructs a new ListSchemaRevisionsRequest. - * @memberof google.pubsub.v1 - * @classdesc Represents a ListSchemaRevisionsRequest. - * @implements IListSchemaRevisionsRequest - * @constructor - * @param {google.pubsub.v1.IListSchemaRevisionsRequest=} [properties] Properties to set - */ - function ListSchemaRevisionsRequest(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]]; - } - - /** - * ListSchemaRevisionsRequest name. - * @member {string} name - * @memberof google.pubsub.v1.ListSchemaRevisionsRequest - * @instance - */ - ListSchemaRevisionsRequest.prototype.name = ""; - - /** - * ListSchemaRevisionsRequest view. - * @member {google.pubsub.v1.SchemaView} view - * @memberof google.pubsub.v1.ListSchemaRevisionsRequest - * @instance - */ - ListSchemaRevisionsRequest.prototype.view = 0; - - /** - * ListSchemaRevisionsRequest pageSize. - * @member {number} pageSize - * @memberof google.pubsub.v1.ListSchemaRevisionsRequest - * @instance - */ - ListSchemaRevisionsRequest.prototype.pageSize = 0; - - /** - * ListSchemaRevisionsRequest pageToken. - * @member {string} pageToken - * @memberof google.pubsub.v1.ListSchemaRevisionsRequest - * @instance - */ - ListSchemaRevisionsRequest.prototype.pageToken = ""; - - /** - * Creates a new ListSchemaRevisionsRequest instance using the specified properties. - * @function create - * @memberof google.pubsub.v1.ListSchemaRevisionsRequest - * @static - * @param {google.pubsub.v1.IListSchemaRevisionsRequest=} [properties] Properties to set - * @returns {google.pubsub.v1.ListSchemaRevisionsRequest} ListSchemaRevisionsRequest instance - */ - ListSchemaRevisionsRequest.create = function create(properties) { - return new ListSchemaRevisionsRequest(properties); - }; - - /** - * Encodes the specified ListSchemaRevisionsRequest message. Does not implicitly {@link google.pubsub.v1.ListSchemaRevisionsRequest.verify|verify} messages. - * @function encode - * @memberof google.pubsub.v1.ListSchemaRevisionsRequest - * @static - * @param {google.pubsub.v1.IListSchemaRevisionsRequest} message ListSchemaRevisionsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListSchemaRevisionsRequest.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.view != null && Object.hasOwnProperty.call(message, "view")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.view); - 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); - return writer; - }; - - /** - * Encodes the specified ListSchemaRevisionsRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.ListSchemaRevisionsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.pubsub.v1.ListSchemaRevisionsRequest - * @static - * @param {google.pubsub.v1.IListSchemaRevisionsRequest} message ListSchemaRevisionsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListSchemaRevisionsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListSchemaRevisionsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.pubsub.v1.ListSchemaRevisionsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.pubsub.v1.ListSchemaRevisionsRequest} ListSchemaRevisionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListSchemaRevisionsRequest.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.pubsub.v1.ListSchemaRevisionsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.view = reader.int32(); - break; - } - case 3: { - message.pageSize = reader.int32(); - break; - } - case 4: { - message.pageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListSchemaRevisionsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.pubsub.v1.ListSchemaRevisionsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.pubsub.v1.ListSchemaRevisionsRequest} ListSchemaRevisionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListSchemaRevisionsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListSchemaRevisionsRequest message. - * @function verify - * @memberof google.pubsub.v1.ListSchemaRevisionsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListSchemaRevisionsRequest.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.view != null && message.hasOwnProperty("view")) - switch (message.view) { - default: - return "view: enum value expected"; - case 0: - case 1: - case 2: - break; - } - 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"; - return null; - }; - - /** - * Creates a ListSchemaRevisionsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.pubsub.v1.ListSchemaRevisionsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.pubsub.v1.ListSchemaRevisionsRequest} ListSchemaRevisionsRequest - */ - ListSchemaRevisionsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.pubsub.v1.ListSchemaRevisionsRequest) - return object; - var message = new $root.google.pubsub.v1.ListSchemaRevisionsRequest(); - if (object.name != null) - message.name = String(object.name); - switch (object.view) { - default: - if (typeof object.view === "number") { - message.view = object.view; - break; - } - break; - case "SCHEMA_VIEW_UNSPECIFIED": - case 0: - message.view = 0; - break; - case "BASIC": - case 1: - message.view = 1; - break; - case "FULL": - case 2: - message.view = 2; - break; - } - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - return message; - }; - - /** - * Creates a plain object from a ListSchemaRevisionsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.pubsub.v1.ListSchemaRevisionsRequest - * @static - * @param {google.pubsub.v1.ListSchemaRevisionsRequest} message ListSchemaRevisionsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListSchemaRevisionsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.view = options.enums === String ? "SCHEMA_VIEW_UNSPECIFIED" : 0; - object.pageSize = 0; - object.pageToken = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.view != null && message.hasOwnProperty("view")) - object.view = options.enums === String ? $root.google.pubsub.v1.SchemaView[message.view] === undefined ? message.view : $root.google.pubsub.v1.SchemaView[message.view] : message.view; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - return object; - }; - - /** - * Converts this ListSchemaRevisionsRequest to JSON. - * @function toJSON - * @memberof google.pubsub.v1.ListSchemaRevisionsRequest - * @instance - * @returns {Object.} JSON object - */ - ListSchemaRevisionsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListSchemaRevisionsRequest - * @function getTypeUrl - * @memberof google.pubsub.v1.ListSchemaRevisionsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListSchemaRevisionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.pubsub.v1.ListSchemaRevisionsRequest"; - }; - - return ListSchemaRevisionsRequest; - })(); - - v1.ListSchemaRevisionsResponse = (function() { - - /** - * Properties of a ListSchemaRevisionsResponse. - * @memberof google.pubsub.v1 - * @interface IListSchemaRevisionsResponse - * @property {Array.|null} [schemas] ListSchemaRevisionsResponse schemas - * @property {string|null} [nextPageToken] ListSchemaRevisionsResponse nextPageToken - */ - - /** - * Constructs a new ListSchemaRevisionsResponse. - * @memberof google.pubsub.v1 - * @classdesc Represents a ListSchemaRevisionsResponse. - * @implements IListSchemaRevisionsResponse - * @constructor - * @param {google.pubsub.v1.IListSchemaRevisionsResponse=} [properties] Properties to set - */ - function ListSchemaRevisionsResponse(properties) { - this.schemas = []; - 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]]; - } - - /** - * ListSchemaRevisionsResponse schemas. - * @member {Array.} schemas - * @memberof google.pubsub.v1.ListSchemaRevisionsResponse - * @instance - */ - ListSchemaRevisionsResponse.prototype.schemas = $util.emptyArray; - - /** - * ListSchemaRevisionsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.pubsub.v1.ListSchemaRevisionsResponse - * @instance - */ - ListSchemaRevisionsResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListSchemaRevisionsResponse instance using the specified properties. - * @function create - * @memberof google.pubsub.v1.ListSchemaRevisionsResponse - * @static - * @param {google.pubsub.v1.IListSchemaRevisionsResponse=} [properties] Properties to set - * @returns {google.pubsub.v1.ListSchemaRevisionsResponse} ListSchemaRevisionsResponse instance - */ - ListSchemaRevisionsResponse.create = function create(properties) { - return new ListSchemaRevisionsResponse(properties); - }; - - /** - * Encodes the specified ListSchemaRevisionsResponse message. Does not implicitly {@link google.pubsub.v1.ListSchemaRevisionsResponse.verify|verify} messages. - * @function encode - * @memberof google.pubsub.v1.ListSchemaRevisionsResponse - * @static - * @param {google.pubsub.v1.IListSchemaRevisionsResponse} message ListSchemaRevisionsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListSchemaRevisionsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.schemas != null && message.schemas.length) - for (var i = 0; i < message.schemas.length; ++i) - $root.google.pubsub.v1.Schema.encode(message.schemas[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 ListSchemaRevisionsResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.ListSchemaRevisionsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.pubsub.v1.ListSchemaRevisionsResponse - * @static - * @param {google.pubsub.v1.IListSchemaRevisionsResponse} message ListSchemaRevisionsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListSchemaRevisionsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListSchemaRevisionsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.pubsub.v1.ListSchemaRevisionsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.pubsub.v1.ListSchemaRevisionsResponse} ListSchemaRevisionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListSchemaRevisionsResponse.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.pubsub.v1.ListSchemaRevisionsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.schemas && message.schemas.length)) - message.schemas = []; - message.schemas.push($root.google.pubsub.v1.Schema.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListSchemaRevisionsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.pubsub.v1.ListSchemaRevisionsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.pubsub.v1.ListSchemaRevisionsResponse} ListSchemaRevisionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListSchemaRevisionsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListSchemaRevisionsResponse message. - * @function verify - * @memberof google.pubsub.v1.ListSchemaRevisionsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListSchemaRevisionsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.schemas != null && message.hasOwnProperty("schemas")) { - if (!Array.isArray(message.schemas)) - return "schemas: array expected"; - for (var i = 0; i < message.schemas.length; ++i) { - var error = $root.google.pubsub.v1.Schema.verify(message.schemas[i]); - if (error) - return "schemas." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListSchemaRevisionsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.pubsub.v1.ListSchemaRevisionsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.pubsub.v1.ListSchemaRevisionsResponse} ListSchemaRevisionsResponse - */ - ListSchemaRevisionsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.pubsub.v1.ListSchemaRevisionsResponse) - return object; - var message = new $root.google.pubsub.v1.ListSchemaRevisionsResponse(); - if (object.schemas) { - if (!Array.isArray(object.schemas)) - throw TypeError(".google.pubsub.v1.ListSchemaRevisionsResponse.schemas: array expected"); - message.schemas = []; - for (var i = 0; i < object.schemas.length; ++i) { - if (typeof object.schemas[i] !== "object") - throw TypeError(".google.pubsub.v1.ListSchemaRevisionsResponse.schemas: object expected"); - message.schemas[i] = $root.google.pubsub.v1.Schema.fromObject(object.schemas[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListSchemaRevisionsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.pubsub.v1.ListSchemaRevisionsResponse - * @static - * @param {google.pubsub.v1.ListSchemaRevisionsResponse} message ListSchemaRevisionsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListSchemaRevisionsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.schemas = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.schemas && message.schemas.length) { - object.schemas = []; - for (var j = 0; j < message.schemas.length; ++j) - object.schemas[j] = $root.google.pubsub.v1.Schema.toObject(message.schemas[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListSchemaRevisionsResponse to JSON. - * @function toJSON - * @memberof google.pubsub.v1.ListSchemaRevisionsResponse - * @instance - * @returns {Object.} JSON object - */ - ListSchemaRevisionsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListSchemaRevisionsResponse - * @function getTypeUrl - * @memberof google.pubsub.v1.ListSchemaRevisionsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListSchemaRevisionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.pubsub.v1.ListSchemaRevisionsResponse"; - }; - - return ListSchemaRevisionsResponse; - })(); - - v1.CommitSchemaRequest = (function() { - - /** - * Properties of a CommitSchemaRequest. - * @memberof google.pubsub.v1 - * @interface ICommitSchemaRequest - * @property {string|null} [name] CommitSchemaRequest name - * @property {google.pubsub.v1.ISchema|null} [schema] CommitSchemaRequest schema - */ - - /** - * Constructs a new CommitSchemaRequest. - * @memberof google.pubsub.v1 - * @classdesc Represents a CommitSchemaRequest. - * @implements ICommitSchemaRequest - * @constructor - * @param {google.pubsub.v1.ICommitSchemaRequest=} [properties] Properties to set - */ - function CommitSchemaRequest(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]]; - } - - /** - * CommitSchemaRequest name. - * @member {string} name - * @memberof google.pubsub.v1.CommitSchemaRequest - * @instance - */ - CommitSchemaRequest.prototype.name = ""; - - /** - * CommitSchemaRequest schema. - * @member {google.pubsub.v1.ISchema|null|undefined} schema - * @memberof google.pubsub.v1.CommitSchemaRequest - * @instance - */ - CommitSchemaRequest.prototype.schema = null; - - /** - * Creates a new CommitSchemaRequest instance using the specified properties. - * @function create - * @memberof google.pubsub.v1.CommitSchemaRequest - * @static - * @param {google.pubsub.v1.ICommitSchemaRequest=} [properties] Properties to set - * @returns {google.pubsub.v1.CommitSchemaRequest} CommitSchemaRequest instance - */ - CommitSchemaRequest.create = function create(properties) { - return new CommitSchemaRequest(properties); - }; - - /** - * Encodes the specified CommitSchemaRequest message. Does not implicitly {@link google.pubsub.v1.CommitSchemaRequest.verify|verify} messages. - * @function encode - * @memberof google.pubsub.v1.CommitSchemaRequest - * @static - * @param {google.pubsub.v1.ICommitSchemaRequest} message CommitSchemaRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CommitSchemaRequest.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.schema != null && Object.hasOwnProperty.call(message, "schema")) - $root.google.pubsub.v1.Schema.encode(message.schema, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CommitSchemaRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.CommitSchemaRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.pubsub.v1.CommitSchemaRequest - * @static - * @param {google.pubsub.v1.ICommitSchemaRequest} message CommitSchemaRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CommitSchemaRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CommitSchemaRequest message from the specified reader or buffer. - * @function decode - * @memberof google.pubsub.v1.CommitSchemaRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.pubsub.v1.CommitSchemaRequest} CommitSchemaRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CommitSchemaRequest.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.pubsub.v1.CommitSchemaRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.schema = $root.google.pubsub.v1.Schema.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CommitSchemaRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.pubsub.v1.CommitSchemaRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.pubsub.v1.CommitSchemaRequest} CommitSchemaRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CommitSchemaRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CommitSchemaRequest message. - * @function verify - * @memberof google.pubsub.v1.CommitSchemaRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CommitSchemaRequest.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.schema != null && message.hasOwnProperty("schema")) { - var error = $root.google.pubsub.v1.Schema.verify(message.schema); - if (error) - return "schema." + error; - } - return null; - }; - - /** - * Creates a CommitSchemaRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.pubsub.v1.CommitSchemaRequest - * @static - * @param {Object.} object Plain object - * @returns {google.pubsub.v1.CommitSchemaRequest} CommitSchemaRequest - */ - CommitSchemaRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.pubsub.v1.CommitSchemaRequest) - return object; - var message = new $root.google.pubsub.v1.CommitSchemaRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.schema != null) { - if (typeof object.schema !== "object") - throw TypeError(".google.pubsub.v1.CommitSchemaRequest.schema: object expected"); - message.schema = $root.google.pubsub.v1.Schema.fromObject(object.schema); - } - return message; - }; - - /** - * Creates a plain object from a CommitSchemaRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.pubsub.v1.CommitSchemaRequest - * @static - * @param {google.pubsub.v1.CommitSchemaRequest} message CommitSchemaRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CommitSchemaRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.schema = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.schema != null && message.hasOwnProperty("schema")) - object.schema = $root.google.pubsub.v1.Schema.toObject(message.schema, options); - return object; - }; - - /** - * Converts this CommitSchemaRequest to JSON. - * @function toJSON - * @memberof google.pubsub.v1.CommitSchemaRequest - * @instance - * @returns {Object.} JSON object - */ - CommitSchemaRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CommitSchemaRequest - * @function getTypeUrl - * @memberof google.pubsub.v1.CommitSchemaRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CommitSchemaRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.pubsub.v1.CommitSchemaRequest"; - }; - - return CommitSchemaRequest; - })(); - - v1.RollbackSchemaRequest = (function() { - - /** - * Properties of a RollbackSchemaRequest. - * @memberof google.pubsub.v1 - * @interface IRollbackSchemaRequest - * @property {string|null} [name] RollbackSchemaRequest name - * @property {string|null} [revisionId] RollbackSchemaRequest revisionId - */ - - /** - * Constructs a new RollbackSchemaRequest. - * @memberof google.pubsub.v1 - * @classdesc Represents a RollbackSchemaRequest. - * @implements IRollbackSchemaRequest - * @constructor - * @param {google.pubsub.v1.IRollbackSchemaRequest=} [properties] Properties to set - */ - function RollbackSchemaRequest(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]]; - } - - /** - * RollbackSchemaRequest name. - * @member {string} name - * @memberof google.pubsub.v1.RollbackSchemaRequest - * @instance - */ - RollbackSchemaRequest.prototype.name = ""; - - /** - * RollbackSchemaRequest revisionId. - * @member {string} revisionId - * @memberof google.pubsub.v1.RollbackSchemaRequest - * @instance - */ - RollbackSchemaRequest.prototype.revisionId = ""; - - /** - * Creates a new RollbackSchemaRequest instance using the specified properties. - * @function create - * @memberof google.pubsub.v1.RollbackSchemaRequest - * @static - * @param {google.pubsub.v1.IRollbackSchemaRequest=} [properties] Properties to set - * @returns {google.pubsub.v1.RollbackSchemaRequest} RollbackSchemaRequest instance - */ - RollbackSchemaRequest.create = function create(properties) { - return new RollbackSchemaRequest(properties); - }; - - /** - * Encodes the specified RollbackSchemaRequest message. Does not implicitly {@link google.pubsub.v1.RollbackSchemaRequest.verify|verify} messages. - * @function encode - * @memberof google.pubsub.v1.RollbackSchemaRequest - * @static - * @param {google.pubsub.v1.IRollbackSchemaRequest} message RollbackSchemaRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RollbackSchemaRequest.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.revisionId != null && Object.hasOwnProperty.call(message, "revisionId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.revisionId); - return writer; - }; - - /** - * Encodes the specified RollbackSchemaRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.RollbackSchemaRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.pubsub.v1.RollbackSchemaRequest - * @static - * @param {google.pubsub.v1.IRollbackSchemaRequest} message RollbackSchemaRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RollbackSchemaRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RollbackSchemaRequest message from the specified reader or buffer. - * @function decode - * @memberof google.pubsub.v1.RollbackSchemaRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.pubsub.v1.RollbackSchemaRequest} RollbackSchemaRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RollbackSchemaRequest.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.pubsub.v1.RollbackSchemaRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.revisionId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RollbackSchemaRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.pubsub.v1.RollbackSchemaRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.pubsub.v1.RollbackSchemaRequest} RollbackSchemaRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RollbackSchemaRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RollbackSchemaRequest message. - * @function verify - * @memberof google.pubsub.v1.RollbackSchemaRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RollbackSchemaRequest.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.revisionId != null && message.hasOwnProperty("revisionId")) - if (!$util.isString(message.revisionId)) - return "revisionId: string expected"; - return null; - }; - - /** - * Creates a RollbackSchemaRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.pubsub.v1.RollbackSchemaRequest - * @static - * @param {Object.} object Plain object - * @returns {google.pubsub.v1.RollbackSchemaRequest} RollbackSchemaRequest - */ - RollbackSchemaRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.pubsub.v1.RollbackSchemaRequest) - return object; - var message = new $root.google.pubsub.v1.RollbackSchemaRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.revisionId != null) - message.revisionId = String(object.revisionId); - return message; - }; - - /** - * Creates a plain object from a RollbackSchemaRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.pubsub.v1.RollbackSchemaRequest - * @static - * @param {google.pubsub.v1.RollbackSchemaRequest} message RollbackSchemaRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RollbackSchemaRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.revisionId = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.revisionId != null && message.hasOwnProperty("revisionId")) - object.revisionId = message.revisionId; - return object; - }; - - /** - * Converts this RollbackSchemaRequest to JSON. - * @function toJSON - * @memberof google.pubsub.v1.RollbackSchemaRequest - * @instance - * @returns {Object.} JSON object - */ - RollbackSchemaRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RollbackSchemaRequest - * @function getTypeUrl - * @memberof google.pubsub.v1.RollbackSchemaRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RollbackSchemaRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.pubsub.v1.RollbackSchemaRequest"; - }; - - return RollbackSchemaRequest; - })(); - - v1.DeleteSchemaRevisionRequest = (function() { - - /** - * Properties of a DeleteSchemaRevisionRequest. - * @memberof google.pubsub.v1 - * @interface IDeleteSchemaRevisionRequest - * @property {string|null} [name] DeleteSchemaRevisionRequest name - * @property {string|null} [revisionId] DeleteSchemaRevisionRequest revisionId - */ - - /** - * Constructs a new DeleteSchemaRevisionRequest. - * @memberof google.pubsub.v1 - * @classdesc Represents a DeleteSchemaRevisionRequest. - * @implements IDeleteSchemaRevisionRequest - * @constructor - * @param {google.pubsub.v1.IDeleteSchemaRevisionRequest=} [properties] Properties to set - */ - function DeleteSchemaRevisionRequest(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]]; - } - - /** - * DeleteSchemaRevisionRequest name. - * @member {string} name - * @memberof google.pubsub.v1.DeleteSchemaRevisionRequest - * @instance - */ - DeleteSchemaRevisionRequest.prototype.name = ""; - - /** - * DeleteSchemaRevisionRequest revisionId. - * @member {string} revisionId - * @memberof google.pubsub.v1.DeleteSchemaRevisionRequest - * @instance - */ - DeleteSchemaRevisionRequest.prototype.revisionId = ""; - - /** - * Creates a new DeleteSchemaRevisionRequest instance using the specified properties. - * @function create - * @memberof google.pubsub.v1.DeleteSchemaRevisionRequest - * @static - * @param {google.pubsub.v1.IDeleteSchemaRevisionRequest=} [properties] Properties to set - * @returns {google.pubsub.v1.DeleteSchemaRevisionRequest} DeleteSchemaRevisionRequest instance - */ - DeleteSchemaRevisionRequest.create = function create(properties) { - return new DeleteSchemaRevisionRequest(properties); - }; - - /** - * Encodes the specified DeleteSchemaRevisionRequest message. Does not implicitly {@link google.pubsub.v1.DeleteSchemaRevisionRequest.verify|verify} messages. - * @function encode - * @memberof google.pubsub.v1.DeleteSchemaRevisionRequest - * @static - * @param {google.pubsub.v1.IDeleteSchemaRevisionRequest} message DeleteSchemaRevisionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteSchemaRevisionRequest.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.revisionId != null && Object.hasOwnProperty.call(message, "revisionId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.revisionId); - return writer; - }; - - /** - * Encodes the specified DeleteSchemaRevisionRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.DeleteSchemaRevisionRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.pubsub.v1.DeleteSchemaRevisionRequest - * @static - * @param {google.pubsub.v1.IDeleteSchemaRevisionRequest} message DeleteSchemaRevisionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteSchemaRevisionRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteSchemaRevisionRequest message from the specified reader or buffer. - * @function decode - * @memberof google.pubsub.v1.DeleteSchemaRevisionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.pubsub.v1.DeleteSchemaRevisionRequest} DeleteSchemaRevisionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteSchemaRevisionRequest.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.pubsub.v1.DeleteSchemaRevisionRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.revisionId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteSchemaRevisionRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.pubsub.v1.DeleteSchemaRevisionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.pubsub.v1.DeleteSchemaRevisionRequest} DeleteSchemaRevisionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteSchemaRevisionRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteSchemaRevisionRequest message. - * @function verify - * @memberof google.pubsub.v1.DeleteSchemaRevisionRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteSchemaRevisionRequest.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.revisionId != null && message.hasOwnProperty("revisionId")) - if (!$util.isString(message.revisionId)) - return "revisionId: string expected"; - return null; - }; - - /** - * Creates a DeleteSchemaRevisionRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.pubsub.v1.DeleteSchemaRevisionRequest - * @static - * @param {Object.} object Plain object - * @returns {google.pubsub.v1.DeleteSchemaRevisionRequest} DeleteSchemaRevisionRequest - */ - DeleteSchemaRevisionRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.pubsub.v1.DeleteSchemaRevisionRequest) - return object; - var message = new $root.google.pubsub.v1.DeleteSchemaRevisionRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.revisionId != null) - message.revisionId = String(object.revisionId); - return message; - }; - - /** - * Creates a plain object from a DeleteSchemaRevisionRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.pubsub.v1.DeleteSchemaRevisionRequest - * @static - * @param {google.pubsub.v1.DeleteSchemaRevisionRequest} message DeleteSchemaRevisionRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteSchemaRevisionRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.revisionId = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.revisionId != null && message.hasOwnProperty("revisionId")) - object.revisionId = message.revisionId; - return object; - }; - - /** - * Converts this DeleteSchemaRevisionRequest to JSON. - * @function toJSON - * @memberof google.pubsub.v1.DeleteSchemaRevisionRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteSchemaRevisionRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteSchemaRevisionRequest - * @function getTypeUrl - * @memberof google.pubsub.v1.DeleteSchemaRevisionRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteSchemaRevisionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.pubsub.v1.DeleteSchemaRevisionRequest"; - }; - - return DeleteSchemaRevisionRequest; - })(); - - v1.DeleteSchemaRequest = (function() { - - /** - * Properties of a DeleteSchemaRequest. - * @memberof google.pubsub.v1 - * @interface IDeleteSchemaRequest - * @property {string|null} [name] DeleteSchemaRequest name - */ - - /** - * Constructs a new DeleteSchemaRequest. - * @memberof google.pubsub.v1 - * @classdesc Represents a DeleteSchemaRequest. - * @implements IDeleteSchemaRequest - * @constructor - * @param {google.pubsub.v1.IDeleteSchemaRequest=} [properties] Properties to set - */ - function DeleteSchemaRequest(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]]; - } - - /** - * DeleteSchemaRequest name. - * @member {string} name - * @memberof google.pubsub.v1.DeleteSchemaRequest - * @instance - */ - DeleteSchemaRequest.prototype.name = ""; - - /** - * Creates a new DeleteSchemaRequest instance using the specified properties. - * @function create - * @memberof google.pubsub.v1.DeleteSchemaRequest - * @static - * @param {google.pubsub.v1.IDeleteSchemaRequest=} [properties] Properties to set - * @returns {google.pubsub.v1.DeleteSchemaRequest} DeleteSchemaRequest instance - */ - DeleteSchemaRequest.create = function create(properties) { - return new DeleteSchemaRequest(properties); - }; - - /** - * Encodes the specified DeleteSchemaRequest message. Does not implicitly {@link google.pubsub.v1.DeleteSchemaRequest.verify|verify} messages. - * @function encode - * @memberof google.pubsub.v1.DeleteSchemaRequest - * @static - * @param {google.pubsub.v1.IDeleteSchemaRequest} message DeleteSchemaRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteSchemaRequest.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); - return writer; - }; - - /** - * Encodes the specified DeleteSchemaRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.DeleteSchemaRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.pubsub.v1.DeleteSchemaRequest - * @static - * @param {google.pubsub.v1.IDeleteSchemaRequest} message DeleteSchemaRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteSchemaRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteSchemaRequest message from the specified reader or buffer. - * @function decode - * @memberof google.pubsub.v1.DeleteSchemaRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.pubsub.v1.DeleteSchemaRequest} DeleteSchemaRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteSchemaRequest.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.pubsub.v1.DeleteSchemaRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteSchemaRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.pubsub.v1.DeleteSchemaRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.pubsub.v1.DeleteSchemaRequest} DeleteSchemaRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteSchemaRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteSchemaRequest message. - * @function verify - * @memberof google.pubsub.v1.DeleteSchemaRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteSchemaRequest.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"; - return null; - }; - - /** - * Creates a DeleteSchemaRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.pubsub.v1.DeleteSchemaRequest - * @static - * @param {Object.} object Plain object - * @returns {google.pubsub.v1.DeleteSchemaRequest} DeleteSchemaRequest - */ - DeleteSchemaRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.pubsub.v1.DeleteSchemaRequest) - return object; - var message = new $root.google.pubsub.v1.DeleteSchemaRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a DeleteSchemaRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.pubsub.v1.DeleteSchemaRequest - * @static - * @param {google.pubsub.v1.DeleteSchemaRequest} message DeleteSchemaRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteSchemaRequest.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 DeleteSchemaRequest to JSON. - * @function toJSON - * @memberof google.pubsub.v1.DeleteSchemaRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteSchemaRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteSchemaRequest - * @function getTypeUrl - * @memberof google.pubsub.v1.DeleteSchemaRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteSchemaRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.pubsub.v1.DeleteSchemaRequest"; - }; - - return DeleteSchemaRequest; - })(); - - v1.ValidateSchemaRequest = (function() { - - /** - * Properties of a ValidateSchemaRequest. - * @memberof google.pubsub.v1 - * @interface IValidateSchemaRequest - * @property {string|null} [parent] ValidateSchemaRequest parent - * @property {google.pubsub.v1.ISchema|null} [schema] ValidateSchemaRequest schema - */ - - /** - * Constructs a new ValidateSchemaRequest. - * @memberof google.pubsub.v1 - * @classdesc Represents a ValidateSchemaRequest. - * @implements IValidateSchemaRequest - * @constructor - * @param {google.pubsub.v1.IValidateSchemaRequest=} [properties] Properties to set - */ - function ValidateSchemaRequest(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]]; - } - - /** - * ValidateSchemaRequest parent. - * @member {string} parent - * @memberof google.pubsub.v1.ValidateSchemaRequest - * @instance - */ - ValidateSchemaRequest.prototype.parent = ""; - - /** - * ValidateSchemaRequest schema. - * @member {google.pubsub.v1.ISchema|null|undefined} schema - * @memberof google.pubsub.v1.ValidateSchemaRequest - * @instance - */ - ValidateSchemaRequest.prototype.schema = null; - - /** - * Creates a new ValidateSchemaRequest instance using the specified properties. - * @function create - * @memberof google.pubsub.v1.ValidateSchemaRequest - * @static - * @param {google.pubsub.v1.IValidateSchemaRequest=} [properties] Properties to set - * @returns {google.pubsub.v1.ValidateSchemaRequest} ValidateSchemaRequest instance - */ - ValidateSchemaRequest.create = function create(properties) { - return new ValidateSchemaRequest(properties); - }; - - /** - * Encodes the specified ValidateSchemaRequest message. Does not implicitly {@link google.pubsub.v1.ValidateSchemaRequest.verify|verify} messages. - * @function encode - * @memberof google.pubsub.v1.ValidateSchemaRequest - * @static - * @param {google.pubsub.v1.IValidateSchemaRequest} message ValidateSchemaRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ValidateSchemaRequest.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.schema != null && Object.hasOwnProperty.call(message, "schema")) - $root.google.pubsub.v1.Schema.encode(message.schema, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ValidateSchemaRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.ValidateSchemaRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.pubsub.v1.ValidateSchemaRequest - * @static - * @param {google.pubsub.v1.IValidateSchemaRequest} message ValidateSchemaRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ValidateSchemaRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ValidateSchemaRequest message from the specified reader or buffer. - * @function decode - * @memberof google.pubsub.v1.ValidateSchemaRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.pubsub.v1.ValidateSchemaRequest} ValidateSchemaRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ValidateSchemaRequest.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.pubsub.v1.ValidateSchemaRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.schema = $root.google.pubsub.v1.Schema.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ValidateSchemaRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.pubsub.v1.ValidateSchemaRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.pubsub.v1.ValidateSchemaRequest} ValidateSchemaRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ValidateSchemaRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ValidateSchemaRequest message. - * @function verify - * @memberof google.pubsub.v1.ValidateSchemaRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ValidateSchemaRequest.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.schema != null && message.hasOwnProperty("schema")) { - var error = $root.google.pubsub.v1.Schema.verify(message.schema); - if (error) - return "schema." + error; - } - return null; - }; - - /** - * Creates a ValidateSchemaRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.pubsub.v1.ValidateSchemaRequest - * @static - * @param {Object.} object Plain object - * @returns {google.pubsub.v1.ValidateSchemaRequest} ValidateSchemaRequest - */ - ValidateSchemaRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.pubsub.v1.ValidateSchemaRequest) - return object; - var message = new $root.google.pubsub.v1.ValidateSchemaRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.schema != null) { - if (typeof object.schema !== "object") - throw TypeError(".google.pubsub.v1.ValidateSchemaRequest.schema: object expected"); - message.schema = $root.google.pubsub.v1.Schema.fromObject(object.schema); - } - return message; - }; - - /** - * Creates a plain object from a ValidateSchemaRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.pubsub.v1.ValidateSchemaRequest - * @static - * @param {google.pubsub.v1.ValidateSchemaRequest} message ValidateSchemaRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ValidateSchemaRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.schema = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.schema != null && message.hasOwnProperty("schema")) - object.schema = $root.google.pubsub.v1.Schema.toObject(message.schema, options); - return object; - }; - - /** - * Converts this ValidateSchemaRequest to JSON. - * @function toJSON - * @memberof google.pubsub.v1.ValidateSchemaRequest - * @instance - * @returns {Object.} JSON object - */ - ValidateSchemaRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ValidateSchemaRequest - * @function getTypeUrl - * @memberof google.pubsub.v1.ValidateSchemaRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ValidateSchemaRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.pubsub.v1.ValidateSchemaRequest"; - }; - - return ValidateSchemaRequest; - })(); - - v1.ValidateSchemaResponse = (function() { - - /** - * Properties of a ValidateSchemaResponse. - * @memberof google.pubsub.v1 - * @interface IValidateSchemaResponse - */ - - /** - * Constructs a new ValidateSchemaResponse. - * @memberof google.pubsub.v1 - * @classdesc Represents a ValidateSchemaResponse. - * @implements IValidateSchemaResponse - * @constructor - * @param {google.pubsub.v1.IValidateSchemaResponse=} [properties] Properties to set - */ - function ValidateSchemaResponse(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 ValidateSchemaResponse instance using the specified properties. - * @function create - * @memberof google.pubsub.v1.ValidateSchemaResponse - * @static - * @param {google.pubsub.v1.IValidateSchemaResponse=} [properties] Properties to set - * @returns {google.pubsub.v1.ValidateSchemaResponse} ValidateSchemaResponse instance - */ - ValidateSchemaResponse.create = function create(properties) { - return new ValidateSchemaResponse(properties); - }; - - /** - * Encodes the specified ValidateSchemaResponse message. Does not implicitly {@link google.pubsub.v1.ValidateSchemaResponse.verify|verify} messages. - * @function encode - * @memberof google.pubsub.v1.ValidateSchemaResponse - * @static - * @param {google.pubsub.v1.IValidateSchemaResponse} message ValidateSchemaResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ValidateSchemaResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified ValidateSchemaResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.ValidateSchemaResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.pubsub.v1.ValidateSchemaResponse - * @static - * @param {google.pubsub.v1.IValidateSchemaResponse} message ValidateSchemaResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ValidateSchemaResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ValidateSchemaResponse message from the specified reader or buffer. - * @function decode - * @memberof google.pubsub.v1.ValidateSchemaResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.pubsub.v1.ValidateSchemaResponse} ValidateSchemaResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ValidateSchemaResponse.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.pubsub.v1.ValidateSchemaResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ValidateSchemaResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.pubsub.v1.ValidateSchemaResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.pubsub.v1.ValidateSchemaResponse} ValidateSchemaResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ValidateSchemaResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ValidateSchemaResponse message. - * @function verify - * @memberof google.pubsub.v1.ValidateSchemaResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ValidateSchemaResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a ValidateSchemaResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.pubsub.v1.ValidateSchemaResponse - * @static - * @param {Object.} object Plain object - * @returns {google.pubsub.v1.ValidateSchemaResponse} ValidateSchemaResponse - */ - ValidateSchemaResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.pubsub.v1.ValidateSchemaResponse) - return object; - return new $root.google.pubsub.v1.ValidateSchemaResponse(); - }; - - /** - * Creates a plain object from a ValidateSchemaResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.pubsub.v1.ValidateSchemaResponse - * @static - * @param {google.pubsub.v1.ValidateSchemaResponse} message ValidateSchemaResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ValidateSchemaResponse.toObject = function toObject() { - return {}; - }; - - /** - * Converts this ValidateSchemaResponse to JSON. - * @function toJSON - * @memberof google.pubsub.v1.ValidateSchemaResponse - * @instance - * @returns {Object.} JSON object - */ - ValidateSchemaResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ValidateSchemaResponse - * @function getTypeUrl - * @memberof google.pubsub.v1.ValidateSchemaResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ValidateSchemaResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.pubsub.v1.ValidateSchemaResponse"; - }; - - return ValidateSchemaResponse; - })(); - - v1.ValidateMessageRequest = (function() { - - /** - * Properties of a ValidateMessageRequest. - * @memberof google.pubsub.v1 - * @interface IValidateMessageRequest - * @property {string|null} [parent] ValidateMessageRequest parent - * @property {string|null} [name] ValidateMessageRequest name - * @property {google.pubsub.v1.ISchema|null} [schema] ValidateMessageRequest schema - * @property {Uint8Array|null} [message] ValidateMessageRequest message - * @property {google.pubsub.v1.Encoding|null} [encoding] ValidateMessageRequest encoding - */ - - /** - * Constructs a new ValidateMessageRequest. - * @memberof google.pubsub.v1 - * @classdesc Represents a ValidateMessageRequest. - * @implements IValidateMessageRequest - * @constructor - * @param {google.pubsub.v1.IValidateMessageRequest=} [properties] Properties to set - */ - function ValidateMessageRequest(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]]; - } - - /** - * ValidateMessageRequest parent. - * @member {string} parent - * @memberof google.pubsub.v1.ValidateMessageRequest - * @instance - */ - ValidateMessageRequest.prototype.parent = ""; - - /** - * ValidateMessageRequest name. - * @member {string|null|undefined} name - * @memberof google.pubsub.v1.ValidateMessageRequest - * @instance - */ - ValidateMessageRequest.prototype.name = null; - - /** - * ValidateMessageRequest schema. - * @member {google.pubsub.v1.ISchema|null|undefined} schema - * @memberof google.pubsub.v1.ValidateMessageRequest - * @instance - */ - ValidateMessageRequest.prototype.schema = null; - - /** - * ValidateMessageRequest message. - * @member {Uint8Array} message - * @memberof google.pubsub.v1.ValidateMessageRequest - * @instance - */ - ValidateMessageRequest.prototype.message = $util.newBuffer([]); - - /** - * ValidateMessageRequest encoding. - * @member {google.pubsub.v1.Encoding} encoding - * @memberof google.pubsub.v1.ValidateMessageRequest - * @instance - */ - ValidateMessageRequest.prototype.encoding = 0; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * ValidateMessageRequest schemaSpec. - * @member {"name"|"schema"|undefined} schemaSpec - * @memberof google.pubsub.v1.ValidateMessageRequest - * @instance - */ - Object.defineProperty(ValidateMessageRequest.prototype, "schemaSpec", { - get: $util.oneOfGetter($oneOfFields = ["name", "schema"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new ValidateMessageRequest instance using the specified properties. - * @function create - * @memberof google.pubsub.v1.ValidateMessageRequest - * @static - * @param {google.pubsub.v1.IValidateMessageRequest=} [properties] Properties to set - * @returns {google.pubsub.v1.ValidateMessageRequest} ValidateMessageRequest instance - */ - ValidateMessageRequest.create = function create(properties) { - return new ValidateMessageRequest(properties); - }; - - /** - * Encodes the specified ValidateMessageRequest message. Does not implicitly {@link google.pubsub.v1.ValidateMessageRequest.verify|verify} messages. - * @function encode - * @memberof google.pubsub.v1.ValidateMessageRequest - * @static - * @param {google.pubsub.v1.IValidateMessageRequest} message ValidateMessageRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ValidateMessageRequest.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.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.name); - if (message.schema != null && Object.hasOwnProperty.call(message, "schema")) - $root.google.pubsub.v1.Schema.encode(message.schema, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.message != null && Object.hasOwnProperty.call(message, "message")) - writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.message); - if (message.encoding != null && Object.hasOwnProperty.call(message, "encoding")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.encoding); - return writer; - }; - - /** - * Encodes the specified ValidateMessageRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.ValidateMessageRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.pubsub.v1.ValidateMessageRequest - * @static - * @param {google.pubsub.v1.IValidateMessageRequest} message ValidateMessageRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ValidateMessageRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ValidateMessageRequest message from the specified reader or buffer. - * @function decode - * @memberof google.pubsub.v1.ValidateMessageRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.pubsub.v1.ValidateMessageRequest} ValidateMessageRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ValidateMessageRequest.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.pubsub.v1.ValidateMessageRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.name = reader.string(); - break; - } - case 3: { - message.schema = $root.google.pubsub.v1.Schema.decode(reader, reader.uint32()); - break; - } - case 4: { - message.message = reader.bytes(); - break; - } - case 5: { - message.encoding = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ValidateMessageRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.pubsub.v1.ValidateMessageRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.pubsub.v1.ValidateMessageRequest} ValidateMessageRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ValidateMessageRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ValidateMessageRequest message. - * @function verify - * @memberof google.pubsub.v1.ValidateMessageRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ValidateMessageRequest.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.name != null && message.hasOwnProperty("name")) { - properties.schemaSpec = 1; - if (!$util.isString(message.name)) - return "name: string expected"; - } - if (message.schema != null && message.hasOwnProperty("schema")) { - if (properties.schemaSpec === 1) - return "schemaSpec: multiple values"; - properties.schemaSpec = 1; - { - var error = $root.google.pubsub.v1.Schema.verify(message.schema); - if (error) - return "schema." + error; - } - } - if (message.message != null && message.hasOwnProperty("message")) - if (!(message.message && typeof message.message.length === "number" || $util.isString(message.message))) - return "message: buffer expected"; - if (message.encoding != null && message.hasOwnProperty("encoding")) - switch (message.encoding) { - default: - return "encoding: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates a ValidateMessageRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.pubsub.v1.ValidateMessageRequest - * @static - * @param {Object.} object Plain object - * @returns {google.pubsub.v1.ValidateMessageRequest} ValidateMessageRequest - */ - ValidateMessageRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.pubsub.v1.ValidateMessageRequest) - return object; - var message = new $root.google.pubsub.v1.ValidateMessageRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.name != null) - message.name = String(object.name); - if (object.schema != null) { - if (typeof object.schema !== "object") - throw TypeError(".google.pubsub.v1.ValidateMessageRequest.schema: object expected"); - message.schema = $root.google.pubsub.v1.Schema.fromObject(object.schema); - } - if (object.message != null) - if (typeof object.message === "string") - $util.base64.decode(object.message, message.message = $util.newBuffer($util.base64.length(object.message)), 0); - else if (object.message.length >= 0) - message.message = object.message; - switch (object.encoding) { - default: - if (typeof object.encoding === "number") { - message.encoding = object.encoding; - break; - } - break; - case "ENCODING_UNSPECIFIED": - case 0: - message.encoding = 0; - break; - case "JSON": - case 1: - message.encoding = 1; - break; - case "BINARY": - case 2: - message.encoding = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from a ValidateMessageRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.pubsub.v1.ValidateMessageRequest - * @static - * @param {google.pubsub.v1.ValidateMessageRequest} message ValidateMessageRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ValidateMessageRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - if (options.bytes === String) - object.message = ""; - else { - object.message = []; - if (options.bytes !== Array) - object.message = $util.newBuffer(object.message); - } - object.encoding = options.enums === String ? "ENCODING_UNSPECIFIED" : 0; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.name != null && message.hasOwnProperty("name")) { - object.name = message.name; - if (options.oneofs) - object.schemaSpec = "name"; - } - if (message.schema != null && message.hasOwnProperty("schema")) { - object.schema = $root.google.pubsub.v1.Schema.toObject(message.schema, options); - if (options.oneofs) - object.schemaSpec = "schema"; - } - if (message.message != null && message.hasOwnProperty("message")) - object.message = options.bytes === String ? $util.base64.encode(message.message, 0, message.message.length) : options.bytes === Array ? Array.prototype.slice.call(message.message) : message.message; - if (message.encoding != null && message.hasOwnProperty("encoding")) - object.encoding = options.enums === String ? $root.google.pubsub.v1.Encoding[message.encoding] === undefined ? message.encoding : $root.google.pubsub.v1.Encoding[message.encoding] : message.encoding; - return object; - }; - - /** - * Converts this ValidateMessageRequest to JSON. - * @function toJSON - * @memberof google.pubsub.v1.ValidateMessageRequest - * @instance - * @returns {Object.} JSON object - */ - ValidateMessageRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ValidateMessageRequest - * @function getTypeUrl - * @memberof google.pubsub.v1.ValidateMessageRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ValidateMessageRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.pubsub.v1.ValidateMessageRequest"; - }; - - return ValidateMessageRequest; - })(); - - v1.ValidateMessageResponse = (function() { - - /** - * Properties of a ValidateMessageResponse. - * @memberof google.pubsub.v1 - * @interface IValidateMessageResponse - */ - - /** - * Constructs a new ValidateMessageResponse. - * @memberof google.pubsub.v1 - * @classdesc Represents a ValidateMessageResponse. - * @implements IValidateMessageResponse - * @constructor - * @param {google.pubsub.v1.IValidateMessageResponse=} [properties] Properties to set - */ - function ValidateMessageResponse(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 ValidateMessageResponse instance using the specified properties. - * @function create - * @memberof google.pubsub.v1.ValidateMessageResponse - * @static - * @param {google.pubsub.v1.IValidateMessageResponse=} [properties] Properties to set - * @returns {google.pubsub.v1.ValidateMessageResponse} ValidateMessageResponse instance - */ - ValidateMessageResponse.create = function create(properties) { - return new ValidateMessageResponse(properties); - }; - - /** - * Encodes the specified ValidateMessageResponse message. Does not implicitly {@link google.pubsub.v1.ValidateMessageResponse.verify|verify} messages. - * @function encode - * @memberof google.pubsub.v1.ValidateMessageResponse - * @static - * @param {google.pubsub.v1.IValidateMessageResponse} message ValidateMessageResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ValidateMessageResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified ValidateMessageResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.ValidateMessageResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.pubsub.v1.ValidateMessageResponse - * @static - * @param {google.pubsub.v1.IValidateMessageResponse} message ValidateMessageResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ValidateMessageResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ValidateMessageResponse message from the specified reader or buffer. - * @function decode - * @memberof google.pubsub.v1.ValidateMessageResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.pubsub.v1.ValidateMessageResponse} ValidateMessageResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ValidateMessageResponse.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.pubsub.v1.ValidateMessageResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ValidateMessageResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.pubsub.v1.ValidateMessageResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.pubsub.v1.ValidateMessageResponse} ValidateMessageResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ValidateMessageResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ValidateMessageResponse message. - * @function verify - * @memberof google.pubsub.v1.ValidateMessageResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ValidateMessageResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a ValidateMessageResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.pubsub.v1.ValidateMessageResponse - * @static - * @param {Object.} object Plain object - * @returns {google.pubsub.v1.ValidateMessageResponse} ValidateMessageResponse - */ - ValidateMessageResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.pubsub.v1.ValidateMessageResponse) - return object; - return new $root.google.pubsub.v1.ValidateMessageResponse(); - }; - - /** - * Creates a plain object from a ValidateMessageResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.pubsub.v1.ValidateMessageResponse - * @static - * @param {google.pubsub.v1.ValidateMessageResponse} message ValidateMessageResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ValidateMessageResponse.toObject = function toObject() { - return {}; - }; - - /** - * Converts this ValidateMessageResponse to JSON. - * @function toJSON - * @memberof google.pubsub.v1.ValidateMessageResponse - * @instance - * @returns {Object.} JSON object - */ - ValidateMessageResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ValidateMessageResponse - * @function getTypeUrl - * @memberof google.pubsub.v1.ValidateMessageResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ValidateMessageResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.pubsub.v1.ValidateMessageResponse"; - }; - - return ValidateMessageResponse; - })(); - - /** - * Encoding enum. - * @name google.pubsub.v1.Encoding - * @enum {number} - * @property {number} ENCODING_UNSPECIFIED=0 ENCODING_UNSPECIFIED value - * @property {number} JSON=1 JSON value - * @property {number} BINARY=2 BINARY value - */ - v1.Encoding = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ENCODING_UNSPECIFIED"] = 0; - values[valuesById[1] = "JSON"] = 1; - values[valuesById[2] = "BINARY"] = 2; - return values; - })(); - - return v1; - })(); - - return pubsub; - })(); - - 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 - * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion - */ - - /** - * 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; - - /** - * Http fullyDecodeReservedExpansion. - * @member {boolean} fullyDecodeReservedExpansion - * @memberof google.api.Http - * @instance - */ - Http.prototype.fullyDecodeReservedExpansion = false; - - /** - * 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 - */ - Http.create = function create(properties) { - return new Http(properties); - }; - - /** - * 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 - */ - Http.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * 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 - */ - Http.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * 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.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]); - } - } - if (object.fullyDecodeReservedExpansion != null) - message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion); - 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 (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.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) - object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; - 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} [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 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 selector. - * @member {string} selector - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.selector = ""; - - /** - * 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 body. - * @member {string} body - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.body = ""; - - /** - * HttpRule responseBody. - * @member {string} responseBody - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.responseBody = ""; - - /** - * 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 new HttpRule instance using the specified properties. - * @function create - * @memberof google.api.HttpRule - * @static - * @param {google.api.IHttpRule=} [properties] Properties to set - * @returns {google.api.HttpRule} HttpRule instance - */ - HttpRule.create = function create(properties) { - return new HttpRule(properties); - }; - - /** - * 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.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 - */ - 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; - } - } - return message; - }; - - /** - * 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 - */ - HttpRule.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a HttpRule message. - * @function verify - * @memberof google.api.HttpRule - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - 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"; - } - 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; - }; - - /** - * 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) - return object; - 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.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 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 = ""; - object.responseBody = ""; - } - 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); - } - if (message.responseBody != null && message.hasOwnProperty("responseBody")) - object.responseBody = message.responseBody; - 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 new CustomHttpPattern instance using the specified properties. - * @function create - * @memberof google.api.CustomHttpPattern - * @static - * @param {google.api.ICustomHttpPattern=} [properties] Properties to set - * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance - */ - CustomHttpPattern.create = function create(properties) { - return new CustomHttpPattern(properties); - }; - - /** - * 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.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; - }; - - /** - * 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 - */ - CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CustomHttpPattern message from the specified reader or buffer. - * @function decode - * @memberof google.api.CustomHttpPattern - * @static - * @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 message; - }; - - /** - * 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 - */ - CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * 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 - */ - 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 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 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; - })(); - - api.CommonLanguageSettings = (function() { - - /** - * Properties of a CommonLanguageSettings. - * @memberof google.api - * @interface ICommonLanguageSettings - * @property {string|null} [referenceDocsUri] CommonLanguageSettings referenceDocsUri - * @property {Array.|null} [destinations] CommonLanguageSettings destinations - */ - - /** - * Constructs a new CommonLanguageSettings. - * @memberof google.api - * @classdesc Represents a CommonLanguageSettings. - * @implements ICommonLanguageSettings - * @constructor - * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set - */ - 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]]; - } - - /** - * CommonLanguageSettings referenceDocsUri. - * @member {string} referenceDocsUri - * @memberof google.api.CommonLanguageSettings - * @instance - */ - CommonLanguageSettings.prototype.referenceDocsUri = ""; - - /** - * 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.CommonLanguageSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings - */ - 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; - break; - case "PACKAGE_MANAGER": - case 20: - message.destinations[i] = 20; - break; - } - } - return message; - }; - - /** - * Creates a plain object from a CommonLanguageSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.CommonLanguageSettings - * @static - * @param {google.api.CommonLanguageSettings} message CommonLanguageSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CommonLanguageSettings.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]; - } - return object; - }; - - /** - * Converts this CommonLanguageSettings to JSON. - * @function toJSON - * @memberof google.api.CommonLanguageSettings - * @instance - * @returns {Object.} JSON object - */ - CommonLanguageSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CommonLanguageSettings - * @function getTypeUrl - * @memberof google.api.CommonLanguageSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CommonLanguageSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.CommonLanguageSettings"; - }; - - return CommonLanguageSettings; - })(); - - 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; - - /** - * 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 - */ - ClientLibrarySettings.prototype.phpSettings = null; - - /** - * ClientLibrarySettings pythonSettings. - * @member {google.api.IPythonSettings|null|undefined} pythonSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.pythonSettings = null; - - /** - * ClientLibrarySettings nodeSettings. - * @member {google.api.INodeSettings|null|undefined} nodeSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.nodeSettings = null; - - /** - * ClientLibrarySettings dotnetSettings. - * @member {google.api.IDotnetSettings|null|undefined} dotnetSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.dotnetSettings = null; - - /** - * ClientLibrarySettings rubySettings. - * @member {google.api.IRubySettings|null|undefined} rubySettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.rubySettings = null; - - /** - * ClientLibrarySettings goSettings. - * @member {google.api.IGoSettings|null|undefined} goSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.goSettings = null; - - /** - * Creates a new ClientLibrarySettings instance using the specified properties. - * @function create - * @memberof google.api.ClientLibrarySettings - * @static - * @param {google.api.IClientLibrarySettings=} [properties] Properties to set - * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings instance - */ - 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; - }; - - /** - * Decodes a ClientLibrarySettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.ClientLibrarySettings - * @static - * @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 - */ - 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 (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); - } - 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 ClientLibrarySettings to JSON. - * @function toJSON - * @memberof google.api.ClientLibrarySettings - * @instance - * @returns {Object.} JSON object - */ - ClientLibrarySettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ClientLibrarySettings - * @function getTypeUrl - * @memberof google.api.ClientLibrarySettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ClientLibrarySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.ClientLibrarySettings"; - }; - - return ClientLibrarySettings; - })(); - - api.Publishing = (function() { - - /** - * Properties of a Publishing. - * @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 - * @property {string|null} [restReferenceDocumentationUri] Publishing restReferenceDocumentationUri - */ - - /** - * Constructs a new Publishing. - * @memberof google.api - * @classdesc Represents a Publishing. - * @implements IPublishing - * @constructor - * @param {google.api.IPublishing=} [properties] Properties to set - */ - 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]]; - } - - /** - * Publishing methodSettings. - * @member {Array.} methodSettings - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.methodSettings = $util.emptyArray; - - /** - * 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 = ""; - - /** - * Publishing restReferenceDocumentationUri. - * @member {string} restReferenceDocumentationUri - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.restReferenceDocumentationUri = ""; - - /** - * Creates a new Publishing instance using the specified properties. - * @function create - * @memberof google.api.Publishing - * @static - * @param {google.api.IPublishing=} [properties] Properties to set - * @returns {google.api.Publishing} Publishing instance - */ - 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); - if (message.restReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "restReferenceDocumentationUri")) - writer.uint32(/* id 111, wireType 2 =*/890).string(message.restReferenceDocumentationUri); - 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; - } - case 111: { - message.restReferenceDocumentationUri = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Publishing message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.Publishing - * @static - * @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 - */ - Publishing.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Publishing message. - * @function verify - * @memberof google.api.Publishing - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - 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; - } - } - 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"; - if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) - if (!$util.isString(message.restReferenceDocumentationUri)) - return "restReferenceDocumentationUri: string expected"; - return null; - }; - - /** - * Creates a Publishing message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.Publishing - * @static - * @param {Object.} object Plain object - * @returns {google.api.Publishing} Publishing - */ - 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); - if (object.restReferenceDocumentationUri != null) - message.restReferenceDocumentationUri = String(object.restReferenceDocumentationUri); - return message; - }; - - /** - * Creates a plain object from a Publishing message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.Publishing - * @static - * @param {google.api.Publishing} message Publishing - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - 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 = ""; - object.restReferenceDocumentationUri = ""; - } - 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; - if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) - object.restReferenceDocumentationUri = message.restReferenceDocumentationUri; - return object; - }; - - /** - * Converts this Publishing to JSON. - * @function toJSON - * @memberof google.api.Publishing - * @instance - * @returns {Object.} JSON object - */ - Publishing.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Publishing - * @function getTypeUrl - * @memberof google.api.Publishing - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Publishing.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.Publishing"; - }; - - 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 new JavaSettings instance using the specified properties. - * @function create - * @memberof google.api.JavaSettings - * @static - * @param {google.api.IJavaSettings=} [properties] Properties to set - * @returns {google.api.JavaSettings} JavaSettings instance - */ - JavaSettings.create = function create(properties) { - return new JavaSettings(properties); - }; - - /** - * 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.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; - }; - - /** - * 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 {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 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.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 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 - */ - CppSettings.create = function create(properties) { - return new CppSettings(properties); - }; - - /** - * 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 - */ - 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; - }; - - /** - * 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 - */ - CppSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * 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; - }; - - /** - * 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 - */ - CppSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * 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 - */ - 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 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); - } - 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); - return object; - }; - - /** - * Converts this CppSettings to JSON. - * @function toJSON - * @memberof google.api.CppSettings - * @instance - * @returns {Object.} JSON object - */ - CppSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CppSettings - * @function getTypeUrl - * @memberof google.api.CppSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CppSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.CppSettings"; - }; - - return CppSettings; - })(); - - api.PhpSettings = (function() { - - /** - * Properties of a PhpSettings. - * @memberof google.api - * @interface IPhpSettings - * @property {google.api.ICommonLanguageSettings|null} [common] PhpSettings common - */ - - /** - * Constructs a new PhpSettings. - * @memberof google.api - * @classdesc Represents a PhpSettings. - * @implements IPhpSettings - * @constructor - * @param {google.api.IPhpSettings=} [properties] Properties to set - */ - 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]]; - } - - /** - * PhpSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.PhpSettings - * @instance - */ - PhpSettings.prototype.common = null; - - /** - * 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 - */ - 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 PhpSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.PhpSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.PhpSettings} PhpSettings - */ - 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; - }; - - /** - * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.PhpSettings - * @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; - }; - - /** - * Converts this PhpSettings to JSON. - * @function toJSON - * @memberof google.api.PhpSettings - * @instance - * @returns {Object.} JSON object - */ - PhpSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PhpSettings - * @function getTypeUrl - * @memberof google.api.PhpSettings - * @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"; - } - return typeUrlPrefix + "/google.api.PhpSettings"; - }; - - 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 - */ - 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]]; - } - - /** - * PythonSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.PythonSettings - * @instance - */ - PythonSettings.prototype.common = null; - - /** - * 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 - */ - PythonSettings.create = function create(properties) { - return new PythonSettings(properties); - }; - - /** - * 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.api.PythonSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.PythonSettings} PythonSettings - */ - PythonSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.PythonSettings) - 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); - } - return message; - }; - - /** - * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.PythonSettings - * @static - * @param {google.api.PythonSettings} message PythonSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PythonSettings.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 PythonSettings to JSON. - * @function toJSON - * @memberof google.api.PythonSettings - * @instance - * @returns {Object.} JSON object - */ - PythonSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PythonSettings - * @function getTypeUrl - * @memberof google.api.PythonSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PythonSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.PythonSettings"; - }; - - return PythonSettings; - })(); - - api.NodeSettings = (function() { - - /** - * Properties of a NodeSettings. - * @memberof google.api - * @interface INodeSettings - * @property {google.api.ICommonLanguageSettings|null} [common] NodeSettings common - */ - - /** - * Constructs a new NodeSettings. - * @memberof google.api - * @classdesc Represents a NodeSettings. - * @implements INodeSettings - * @constructor - * @param {google.api.INodeSettings=} [properties] Properties to set - */ - 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]]; - } - - /** - * NodeSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.NodeSettings - * @instance - */ - NodeSettings.prototype.common = null; - - /** - * 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 - */ - NodeSettings.create = function create(properties) { - return new NodeSettings(properties); - }; - - /** - * 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 - */ - 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; - }; - - /** - * 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.api.NodeSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.NodeSettings} NodeSettings - */ - NodeSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.NodeSettings) - 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); - } - return message; - }; - - /** - * Creates a plain object from a NodeSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.NodeSettings - * @static - * @param {google.api.NodeSettings} message NodeSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - NodeSettings.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 NodeSettings to JSON. - * @function toJSON - * @memberof google.api.NodeSettings - * @instance - * @returns {Object.} JSON object - */ - NodeSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for NodeSettings - * @function getTypeUrl - * @memberof google.api.NodeSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - NodeSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.NodeSettings"; - }; - - return NodeSettings; - })(); - - api.DotnetSettings = (function() { - - /** - * 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 - */ - - /** - * Constructs a new DotnetSettings. - * @memberof google.api - * @classdesc Represents a DotnetSettings. - * @implements IDotnetSettings - * @constructor - * @param {google.api.IDotnetSettings=} [properties] Properties to set - */ - 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]]; - } - - /** - * 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 - */ - DotnetSettings.prototype.ignoredResources = $util.emptyArray; - - /** - * DotnetSettings forcedNamespaceAliases. - * @member {Array.} forcedNamespaceAliases - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.forcedNamespaceAliases = $util.emptyArray; - - /** - * DotnetSettings handwrittenSignatures. - * @member {Array.} handwrittenSignatures - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.handwrittenSignatures = $util.emptyArray; - - /** - * 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 - */ - DotnetSettings.create = function create(properties) { - return new DotnetSettings(properties); - }; - - /** - * 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 - */ - DotnetSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * 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 - */ - 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 a DotnetSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.DotnetSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.DotnetSettings} DotnetSettings - */ - 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]); - } - return message; - }; - - /** - * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.DotnetSettings - * @static - * @param {google.api.DotnetSettings} message DotnetSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DotnetSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.ignoredResources = []; - object.forcedNamespaceAliases = []; - object.handwrittenSignatures = []; - } - if (options.objects || options.defaults) { - object.renamedServices = {}; - object.renamedResources = {}; - } - 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 DotnetSettings to JSON. - * @function toJSON - * @memberof google.api.DotnetSettings - * @instance - * @returns {Object.} JSON object - */ - DotnetSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DotnetSettings - * @function getTypeUrl - * @memberof google.api.DotnetSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DotnetSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.DotnetSettings"; - }; - - return DotnetSettings; - })(); - - api.RubySettings = (function() { - - /** - * Properties of a RubySettings. - * @memberof google.api - * @interface IRubySettings - * @property {google.api.ICommonLanguageSettings|null} [common] RubySettings common - */ - - /** - * Constructs a new RubySettings. - * @memberof google.api - * @classdesc Represents a RubySettings. - * @implements IRubySettings - * @constructor - * @param {google.api.IRubySettings=} [properties] Properties to set - */ - 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]]; - } - - /** - * RubySettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.RubySettings - * @instance - */ - 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 RubySettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.RubySettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.RubySettings} RubySettings - */ - 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); - } - return message; - }; - - /** - * Creates a plain object from a RubySettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.RubySettings - * @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 - */ - RubySettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RubySettings - * @function getTypeUrl - * @memberof google.api.RubySettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RubySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.RubySettings"; - }; - - 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 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 - */ - GoSettings.create = function create(properties) { - return new GoSettings(properties); - }; - - /** - * 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 - */ - GoSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * 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 - */ - 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 GoSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.GoSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.GoSettings} GoSettings - */ - GoSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.GoSettings) - 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); - } - return message; - }; - - /** - * Creates a plain object from a GoSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.GoSettings - * @static - * @param {google.api.GoSettings} message GoSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GoSettings.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 GoSettings to JSON. - * @function toJSON - * @memberof google.api.GoSettings - * @instance - * @returns {Object.} JSON object - */ - GoSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GoSettings - * @function getTypeUrl - * @memberof google.api.GoSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GoSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.GoSettings"; - }; - - return GoSettings; - })(); - - 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.api.IMethodSettings=} [properties] Properties to set - */ - 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 = ""; - - /** - * MethodSettings longRunning. - * @member {google.api.MethodSettings.ILongRunning|null|undefined} longRunning - * @memberof google.api.MethodSettings - * @instance - */ - MethodSettings.prototype.longRunning = null; - - /** - * MethodSettings autoPopulatedFields. - * @member {Array.} autoPopulatedFields - * @memberof google.api.MethodSettings - * @instance - */ - 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 MethodSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.MethodSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.MethodSettings} MethodSettings - */ - 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; - }; - - /** - * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.MethodSettings - * @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); - }; - - /** - * Gets the default type url for MethodSettings - * @function getTypeUrl - * @memberof google.api.MethodSettings - * @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 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; - })(); - - api.ResourceDescriptor = (function() { - - /** - * Properties of a ResourceDescriptor. - * @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. - * @memberof google.api - * @classdesc Represents a ResourceDescriptor. - * @implements IResourceDescriptor - * @constructor - * @param {google.api.IResourceDescriptor=} [properties] Properties to set - */ - function ResourceDescriptor(properties) { - this.pattern = []; - this.style = []; - 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 - * @instance - */ - ResourceDescriptor.prototype.type = ""; - - /** - * ResourceDescriptor pattern. - * @member {Array.} pattern - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.pattern = $util.emptyArray; - - /** - * ResourceDescriptor nameField. - * @member {string} nameField - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.nameField = ""; - - /** - * ResourceDescriptor history. - * @member {google.api.ResourceDescriptor.History} history - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.history = 0; - - /** - * ResourceDescriptor plural. - * @member {string} plural - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.plural = ""; - - /** - * ResourceDescriptor singular. - * @member {string} singular - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.singular = ""; - - /** - * ResourceDescriptor style. - * @member {Array.} style - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.style = $util.emptyArray; - - /** - * Creates a new ResourceDescriptor instance using the specified properties. - * @function create - * @memberof google.api.ResourceDescriptor - * @static - * @param {google.api.IResourceDescriptor=} [properties] Properties to set - * @returns {google.api.ResourceDescriptor} ResourceDescriptor instance - */ - ResourceDescriptor.create = function create(properties) { - return new ResourceDescriptor(properties); - }; - - /** - * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. - * @function encode - * @memberof google.api.ResourceDescriptor - * @static - * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceDescriptor.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); - if (message.pattern != null && message.pattern.length) - for (var i = 0; i < message.pattern.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.pattern[i]); - if (message.nameField != null && Object.hasOwnProperty.call(message, "nameField")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); - if (message.history != null && Object.hasOwnProperty.call(message, "history")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); - if (message.plural != null && Object.hasOwnProperty.call(message, "plural")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); - if (message.singular != null && Object.hasOwnProperty.call(message, "singular")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); - if (message.style != null && message.style.length) { - writer.uint32(/* id 10, wireType 2 =*/82).fork(); - for (var i = 0; i < message.style.length; ++i) - writer.int32(message.style[i]); - writer.ldelim(); - } - return writer; - }; - - /** - * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.ResourceDescriptor - * @static - * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ResourceDescriptor message from the specified reader or buffer. - * @function decode - * @memberof google.api.ResourceDescriptor - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.ResourceDescriptor} ResourceDescriptor - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourceDescriptor.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.ResourceDescriptor(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.type = reader.string(); - break; - } - case 2: { - if (!(message.pattern && message.pattern.length)) - message.pattern = []; - message.pattern.push(reader.string()); - break; - } - case 3: { - message.nameField = reader.string(); - break; - } - case 4: { - message.history = reader.int32(); - break; - } - case 5: { - message.plural = reader.string(); - break; - } - case 6: { - message.singular = reader.string(); - break; - } - case 10: { - if (!(message.style && message.style.length)) - message.style = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.style.push(reader.int32()); - } else - message.style.push(reader.int32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.ResourceDescriptor - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.ResourceDescriptor} ResourceDescriptor - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourceDescriptor.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ResourceDescriptor message. - * @function verify - * @memberof google.api.ResourceDescriptor - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ResourceDescriptor.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.pattern != null && message.hasOwnProperty("pattern")) { - if (!Array.isArray(message.pattern)) - return "pattern: array expected"; - for (var i = 0; i < message.pattern.length; ++i) - if (!$util.isString(message.pattern[i])) - return "pattern: string[] expected"; - } - if (message.nameField != null && message.hasOwnProperty("nameField")) - if (!$util.isString(message.nameField)) - return "nameField: string expected"; - if (message.history != null && message.hasOwnProperty("history")) - switch (message.history) { - default: - return "history: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.plural != null && message.hasOwnProperty("plural")) - if (!$util.isString(message.plural)) - return "plural: string expected"; - if (message.singular != null && message.hasOwnProperty("singular")) - if (!$util.isString(message.singular)) - return "singular: string expected"; - if (message.style != null && message.hasOwnProperty("style")) { - if (!Array.isArray(message.style)) - return "style: array expected"; - for (var i = 0; i < message.style.length; ++i) - switch (message.style[i]) { - default: - return "style: enum value[] expected"; - case 0: - case 1: - break; - } - } - return null; - }; - - /** - * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.ResourceDescriptor - * @static - * @param {Object.} object Plain object - * @returns {google.api.ResourceDescriptor} ResourceDescriptor - */ - ResourceDescriptor.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.ResourceDescriptor) - 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; - } - } - return message; - }; - - /** - * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.ResourceDescriptor - * @static - * @param {google.api.ResourceDescriptor} message ResourceDescriptor - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ResourceDescriptor.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]; - } - return object; - }; - - /** - * Converts this ResourceDescriptor to JSON. - * @function toJSON - * @memberof google.api.ResourceDescriptor - * @instance - * @returns {Object.} JSON object - */ - ResourceDescriptor.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ResourceDescriptor - * @function getTypeUrl - * @memberof google.api.ResourceDescriptor - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ResourceDescriptor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.ResourceDescriptor"; - }; - - /** - * History enum. - * @name google.api.ResourceDescriptor.History - * @enum {number} - * @property {number} HISTORY_UNSPECIFIED=0 HISTORY_UNSPECIFIED value - * @property {number} ORIGINALLY_SINGLE_PATTERN=1 ORIGINALLY_SINGLE_PATTERN value - * @property {number} FUTURE_MULTI_PATTERN=2 FUTURE_MULTI_PATTERN value - */ - ResourceDescriptor.History = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "HISTORY_UNSPECIFIED"] = 0; - values[valuesById[1] = "ORIGINALLY_SINGLE_PATTERN"] = 1; - values[valuesById[2] = "FUTURE_MULTI_PATTERN"] = 2; - return values; - })(); - - /** - * Style enum. - * @name google.api.ResourceDescriptor.Style - * @enum {number} - * @property {number} STYLE_UNSPECIFIED=0 STYLE_UNSPECIFIED value - * @property {number} DECLARATIVE_FRIENDLY=1 DECLARATIVE_FRIENDLY value - */ - ResourceDescriptor.Style = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STYLE_UNSPECIFIED"] = 0; - values[valuesById[1] = "DECLARATIVE_FRIENDLY"] = 1; - return values; - })(); - - return ResourceDescriptor; - })(); - - api.ResourceReference = (function() { - - /** - * Properties of a ResourceReference. - * @memberof google.api - * @interface IResourceReference - * @property {string|null} [type] ResourceReference type - * @property {string|null} [childType] ResourceReference childType - */ - - /** - * Constructs a new ResourceReference. - * @memberof google.api - * @classdesc Represents a ResourceReference. - * @implements IResourceReference - * @constructor - * @param {google.api.IResourceReference=} [properties] Properties to set - */ - function ResourceReference(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 - * @instance - */ - ResourceReference.prototype.type = ""; - - /** - * ResourceReference childType. - * @member {string} childType - * @memberof google.api.ResourceReference - * @instance - */ - ResourceReference.prototype.childType = ""; - - /** - * Creates a new ResourceReference instance using the specified properties. - * @function create - * @memberof google.api.ResourceReference - * @static - * @param {google.api.IResourceReference=} [properties] Properties to set - * @returns {google.api.ResourceReference} ResourceReference instance - */ - ResourceReference.create = function create(properties) { - return new ResourceReference(properties); - }; - - /** - * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. - * @function encode - * @memberof google.api.ResourceReference - * @static - * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceReference.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); - if (message.childType != null && Object.hasOwnProperty.call(message, "childType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType); - return writer; - }; - - /** - * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.ResourceReference - * @static - * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceReference.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ResourceReference message from the specified reader or buffer. - * @function decode - * @memberof google.api.ResourceReference - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.ResourceReference} ResourceReference - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourceReference.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.ResourceReference(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.type = reader.string(); - break; - } - case 2: { - message.childType = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ResourceReference message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.ResourceReference - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.ResourceReference} ResourceReference - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourceReference.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ResourceReference message. - * @function verify - * @memberof google.api.ResourceReference - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ResourceReference.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.childType != null && message.hasOwnProperty("childType")) - if (!$util.isString(message.childType)) - return "childType: string expected"; - return null; - }; - - /** - * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.ResourceReference - * @static - * @param {Object.} object Plain object - * @returns {google.api.ResourceReference} ResourceReference - */ - ResourceReference.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.ResourceReference) - 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); - return message; - }; - - /** - * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.ResourceReference - * @static - * @param {google.api.ResourceReference} message ResourceReference - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ResourceReference.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; - return object; - }; - - /** - * Converts this ResourceReference to JSON. - * @function toJSON - * @memberof google.api.ResourceReference - * @instance - * @returns {Object.} JSON object - */ - ResourceReference.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ResourceReference - * @function getTypeUrl - * @memberof google.api.ResourceReference - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ResourceReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.ResourceReference"; - }; - - return ResourceReference; - })(); - - return api; - })(); - - google.protobuf = (function() { - - /** - * Namespace protobuf. - * @memberof google - * @namespace - */ - var protobuf = {}; - - 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"); - message.file = []; - for (var i = 0; i < object.file.length; ++i) { - if (typeof object.file[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorSet.file: object expected"); - message.file[i] = $root.google.protobuf.FileDescriptorProto.fromObject(object.file[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {google.protobuf.FileDescriptorSet} message FileDescriptorSet - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FileDescriptorSet.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.file = []; - if (message.file && message.file.length) { - object.file = []; - for (var j = 0; j < message.file.length; ++j) - object.file[j] = $root.google.protobuf.FileDescriptorProto.toObject(message.file[j], options); - } - return object; - }; - - /** - * Converts this FileDescriptorSet to JSON. - * @function toJSON - * @memberof google.protobuf.FileDescriptorSet - * @instance - * @returns {Object.} JSON object - */ - FileDescriptorSet.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FileDescriptorSet - * @function getTypeUrl - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FileDescriptorSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FileDescriptorSet"; - }; - - return FileDescriptorSet; - })(); - - /** - * Edition enum. - * @name google.protobuf.Edition - * @enum {number} - * @property {number} EDITION_UNKNOWN=0 EDITION_UNKNOWN value - * @property {number} EDITION_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 - * @interface IFileDescriptorProto - * @property {string|null} [name] FileDescriptorProto name - * @property {string|null} ["package"] FileDescriptorProto package - * @property {Array.|null} [dependency] FileDescriptorProto dependency - * @property {Array.|null} [publicDependency] FileDescriptorProto publicDependency - * @property {Array.|null} [weakDependency] FileDescriptorProto weakDependency - * @property {Array.|null} [messageType] FileDescriptorProto messageType - * @property {Array.|null} [enumType] FileDescriptorProto enumType - * @property {Array.|null} [service] FileDescriptorProto service - * @property {Array.|null} [extension] FileDescriptorProto extension - * @property {google.protobuf.IFileOptions|null} [options] FileDescriptorProto options - * @property {google.protobuf.ISourceCodeInfo|null} [sourceCodeInfo] FileDescriptorProto sourceCodeInfo - * @property {string|null} [syntax] FileDescriptorProto syntax - * @property {google.protobuf.Edition|null} [edition] FileDescriptorProto edition - */ - - /** - * Constructs a new FileDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a FileDescriptorProto. - * @implements IFileDescriptorProto - * @constructor - * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set - */ - function FileDescriptorProto(properties) { - this.dependency = []; - this.publicDependency = []; - this.weakDependency = []; - this.messageType = []; - this.enumType = []; - this.service = []; - this.extension = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FileDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.name = ""; - - /** - * FileDescriptorProto package. - * @member {string} package - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype["package"] = ""; - - /** - * FileDescriptorProto dependency. - * @member {Array.} dependency - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.dependency = $util.emptyArray; - - /** - * FileDescriptorProto publicDependency. - * @member {Array.} publicDependency - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.publicDependency = $util.emptyArray; - - /** - * FileDescriptorProto weakDependency. - * @member {Array.} weakDependency - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.weakDependency = $util.emptyArray; - - /** - * FileDescriptorProto messageType. - * @member {Array.} messageType - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.messageType = $util.emptyArray; - - /** - * FileDescriptorProto enumType. - * @member {Array.} enumType - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.enumType = $util.emptyArray; - - /** - * FileDescriptorProto service. - * @member {Array.} service - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.service = $util.emptyArray; - - /** - * FileDescriptorProto extension. - * @member {Array.} extension - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.extension = $util.emptyArray; - - /** - * FileDescriptorProto options. - * @member {google.protobuf.IFileOptions|null|undefined} options - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.options = null; - - /** - * FileDescriptorProto sourceCodeInfo. - * @member {google.protobuf.ISourceCodeInfo|null|undefined} sourceCodeInfo - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.sourceCodeInfo = null; - - /** - * FileDescriptorProto syntax. - * @member {string} syntax - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.syntax = ""; - - /** - * FileDescriptorProto edition. - * @member {google.protobuf.Edition} edition - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.edition = 0; - - /** - * Creates a new FileDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto instance - */ - FileDescriptorProto.create = function create(properties) { - return new FileDescriptorProto(properties); - }; - - /** - * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message["package"] != null && Object.hasOwnProperty.call(message, "package")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message["package"]); - if (message.dependency != null && message.dependency.length) - for (var i = 0; i < message.dependency.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.dependency[i]); - if (message.messageType != null && message.messageType.length) - for (var i = 0; i < message.messageType.length; ++i) - $root.google.protobuf.DescriptorProto.encode(message.messageType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.enumType != null && message.enumType.length) - for (var i = 0; i < message.enumType.length; ++i) - $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.service != null && message.service.length) - for (var i = 0; i < message.service.length; ++i) - $root.google.protobuf.ServiceDescriptorProto.encode(message.service[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.extension != null && message.extension.length) - for (var i = 0; i < message.extension.length; ++i) - $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.sourceCodeInfo != null && Object.hasOwnProperty.call(message, "sourceCodeInfo")) - $root.google.protobuf.SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.publicDependency != null && message.publicDependency.length) - for (var i = 0; i < message.publicDependency.length; ++i) - writer.uint32(/* id 10, wireType 0 =*/80).int32(message.publicDependency[i]); - if (message.weakDependency != null && message.weakDependency.length) - for (var i = 0; i < message.weakDependency.length; ++i) - writer.uint32(/* id 11, wireType 0 =*/88).int32(message.weakDependency[i]); - if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); - if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) - writer.uint32(/* id 14, wireType 0 =*/112).int32(message.edition); - 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 - */ - FileDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FileDescriptorProto) - return object; - var message = new $root.google.protobuf.FileDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object["package"] != null) - message["package"] = String(object["package"]); - if (object.dependency) { - if (!Array.isArray(object.dependency)) - throw TypeError(".google.protobuf.FileDescriptorProto.dependency: array expected"); - message.dependency = []; - for (var i = 0; i < object.dependency.length; ++i) - message.dependency[i] = String(object.dependency[i]); - } - if (object.publicDependency) { - if (!Array.isArray(object.publicDependency)) - throw TypeError(".google.protobuf.FileDescriptorProto.publicDependency: array expected"); - message.publicDependency = []; - for (var i = 0; i < object.publicDependency.length; ++i) - message.publicDependency[i] = object.publicDependency[i] | 0; - } - if (object.weakDependency) { - if (!Array.isArray(object.weakDependency)) - throw TypeError(".google.protobuf.FileDescriptorProto.weakDependency: array expected"); - message.weakDependency = []; - for (var i = 0; i < object.weakDependency.length; ++i) - message.weakDependency[i] = object.weakDependency[i] | 0; - } - if (object.messageType) { - if (!Array.isArray(object.messageType)) - throw TypeError(".google.protobuf.FileDescriptorProto.messageType: array expected"); - message.messageType = []; - for (var i = 0; i < object.messageType.length; ++i) { - if (typeof object.messageType[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.messageType: object expected"); - message.messageType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.messageType[i]); - } - } - if (object.enumType) { - if (!Array.isArray(object.enumType)) - throw TypeError(".google.protobuf.FileDescriptorProto.enumType: array expected"); - message.enumType = []; - for (var i = 0; i < object.enumType.length; ++i) { - if (typeof object.enumType[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.enumType: object expected"); - message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); - } - } - if (object.service) { - if (!Array.isArray(object.service)) - throw TypeError(".google.protobuf.FileDescriptorProto.service: array expected"); - message.service = []; - for (var i = 0; i < object.service.length; ++i) { - if (typeof object.service[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.service: object expected"); - message.service[i] = $root.google.protobuf.ServiceDescriptorProto.fromObject(object.service[i]); - } - } - if (object.extension) { - if (!Array.isArray(object.extension)) - throw TypeError(".google.protobuf.FileDescriptorProto.extension: array expected"); - message.extension = []; - for (var i = 0; i < object.extension.length; ++i) { - if (typeof object.extension[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.extension: object expected"); - message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); - } - } - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.FileOptions.fromObject(object.options); - } - if (object.sourceCodeInfo != null) { - if (typeof object.sourceCodeInfo !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.sourceCodeInfo: object expected"); - message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.fromObject(object.sourceCodeInfo); - } - if (object.syntax != null) - message.syntax = String(object.syntax); - switch (object.edition) { - default: - if (typeof object.edition === "number") { - message.edition = object.edition; - break; - } - break; - case "EDITION_UNKNOWN": - case 0: - message.edition = 0; - break; - case "EDITION_PROTO2": - case 998: - message.edition = 998; - break; - case "EDITION_PROTO3": - case 999: - message.edition = 999; - break; - case "EDITION_2023": - case 1000: - message.edition = 1000; - break; - case "EDITION_2024": - case 1001: - message.edition = 1001; - break; - case "EDITION_1_TEST_ONLY": - case 1: - message.edition = 1; - break; - case "EDITION_2_TEST_ONLY": - case 2: - message.edition = 2; - break; - case "EDITION_99997_TEST_ONLY": - case 99997: - message.edition = 99997; - break; - case "EDITION_99998_TEST_ONLY": - case 99998: - message.edition = 99998; - break; - case "EDITION_99999_TEST_ONLY": - case 99999: - message.edition = 99999; - break; - case "EDITION_MAX": - case 2147483647: - message.edition = 2147483647; - break; - } - return message; - }; - - /** - * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {google.protobuf.FileDescriptorProto} message FileDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FileDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.dependency = []; - object.messageType = []; - object.enumType = []; - object.service = []; - object.extension = []; - object.publicDependency = []; - object.weakDependency = []; - } - if (options.defaults) { - object.name = ""; - object["package"] = ""; - object.options = null; - object.sourceCodeInfo = null; - object.syntax = ""; - object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message["package"] != null && message.hasOwnProperty("package")) - object["package"] = message["package"]; - if (message.dependency && message.dependency.length) { - object.dependency = []; - for (var j = 0; j < message.dependency.length; ++j) - object.dependency[j] = message.dependency[j]; - } - if (message.messageType && message.messageType.length) { - object.messageType = []; - for (var j = 0; j < message.messageType.length; ++j) - object.messageType[j] = $root.google.protobuf.DescriptorProto.toObject(message.messageType[j], options); - } - if (message.enumType && message.enumType.length) { - object.enumType = []; - for (var j = 0; j < message.enumType.length; ++j) - object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); - } - if (message.service && message.service.length) { - object.service = []; - for (var j = 0; j < message.service.length; ++j) - object.service[j] = $root.google.protobuf.ServiceDescriptorProto.toObject(message.service[j], options); - } - if (message.extension && message.extension.length) { - object.extension = []; - for (var j = 0; j < message.extension.length; ++j) - object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); - } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.FileOptions.toObject(message.options, options); - if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) - object.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.toObject(message.sourceCodeInfo, options); - if (message.publicDependency && message.publicDependency.length) { - object.publicDependency = []; - for (var j = 0; j < message.publicDependency.length; ++j) - object.publicDependency[j] = message.publicDependency[j]; - } - if (message.weakDependency && message.weakDependency.length) { - object.weakDependency = []; - for (var j = 0; j < message.weakDependency.length; ++j) - object.weakDependency[j] = message.weakDependency[j]; - } - if (message.syntax != null && message.hasOwnProperty("syntax")) - object.syntax = message.syntax; - if (message.edition != null && message.hasOwnProperty("edition")) - object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; - return object; - }; - - /** - * Converts this FileDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.FileDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - FileDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FileDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FileDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FileDescriptorProto"; - }; - - return FileDescriptorProto; - })(); - - protobuf.DescriptorProto = (function() { - - /** - * Properties of a DescriptorProto. - * @memberof google.protobuf - * @interface IDescriptorProto - * @property {string|null} [name] DescriptorProto name - * @property {Array.|null} [field] DescriptorProto field - * @property {Array.|null} [extension] DescriptorProto extension - * @property {Array.|null} [nestedType] DescriptorProto nestedType - * @property {Array.|null} [enumType] DescriptorProto enumType - * @property {Array.|null} [extensionRange] DescriptorProto extensionRange - * @property {Array.|null} [oneofDecl] DescriptorProto oneofDecl - * @property {google.protobuf.IMessageOptions|null} [options] DescriptorProto options - * @property {Array.|null} [reservedRange] DescriptorProto reservedRange - * @property {Array.|null} [reservedName] DescriptorProto reservedName - */ - - /** - * Constructs a new DescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a DescriptorProto. - * @implements IDescriptorProto - * @constructor - * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set - */ - function DescriptorProto(properties) { - this.field = []; - this.extension = []; - this.nestedType = []; - this.enumType = []; - this.extensionRange = []; - this.oneofDecl = []; - this.reservedRange = []; - this.reservedName = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DescriptorProto name. - * @member {string} name - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.name = ""; - - /** - * DescriptorProto field. - * @member {Array.} field - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.field = $util.emptyArray; - - /** - * DescriptorProto extension. - * @member {Array.} extension - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.extension = $util.emptyArray; - - /** - * DescriptorProto nestedType. - * @member {Array.} nestedType - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.nestedType = $util.emptyArray; - - /** - * DescriptorProto enumType. - * @member {Array.} enumType - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.enumType = $util.emptyArray; - - /** - * DescriptorProto extensionRange. - * @member {Array.} extensionRange - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.extensionRange = $util.emptyArray; - - /** - * DescriptorProto oneofDecl. - * @member {Array.} oneofDecl - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.oneofDecl = $util.emptyArray; - - /** - * DescriptorProto options. - * @member {google.protobuf.IMessageOptions|null|undefined} options - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.options = null; - - /** - * DescriptorProto reservedRange. - * @member {Array.} reservedRange - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.reservedRange = $util.emptyArray; - - /** - * DescriptorProto reservedName. - * @member {Array.} reservedName - * @memberof google.protobuf.DescriptorProto - * @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 - * @memberof google.protobuf.DescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.DescriptorProto} DescriptorProto - */ - DescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.DescriptorProto) - return object; - var message = new $root.google.protobuf.DescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.field) { - if (!Array.isArray(object.field)) - throw TypeError(".google.protobuf.DescriptorProto.field: array expected"); - message.field = []; - for (var i = 0; i < object.field.length; ++i) { - if (typeof object.field[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.field: object expected"); - message.field[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.field[i]); - } - } - if (object.extension) { - if (!Array.isArray(object.extension)) - throw TypeError(".google.protobuf.DescriptorProto.extension: array expected"); - message.extension = []; - for (var i = 0; i < object.extension.length; ++i) { - if (typeof object.extension[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.extension: object expected"); - message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); - } - } - if (object.nestedType) { - if (!Array.isArray(object.nestedType)) - throw TypeError(".google.protobuf.DescriptorProto.nestedType: array expected"); - message.nestedType = []; - for (var i = 0; i < object.nestedType.length; ++i) { - if (typeof object.nestedType[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.nestedType: object expected"); - message.nestedType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.nestedType[i]); - } - } - if (object.enumType) { - if (!Array.isArray(object.enumType)) - throw TypeError(".google.protobuf.DescriptorProto.enumType: array expected"); - message.enumType = []; - for (var i = 0; i < object.enumType.length; ++i) { - if (typeof object.enumType[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.enumType: object expected"); - message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); - } - } - if (object.extensionRange) { - if (!Array.isArray(object.extensionRange)) - throw TypeError(".google.protobuf.DescriptorProto.extensionRange: array expected"); - message.extensionRange = []; - for (var i = 0; i < object.extensionRange.length; ++i) { - if (typeof object.extensionRange[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.extensionRange: object expected"); - message.extensionRange[i] = $root.google.protobuf.DescriptorProto.ExtensionRange.fromObject(object.extensionRange[i]); - } - } - if (object.oneofDecl) { - if (!Array.isArray(object.oneofDecl)) - throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: array expected"); - message.oneofDecl = []; - for (var i = 0; i < object.oneofDecl.length; ++i) { - if (typeof object.oneofDecl[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: object expected"); - message.oneofDecl[i] = $root.google.protobuf.OneofDescriptorProto.fromObject(object.oneofDecl[i]); - } - } - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.DescriptorProto.options: object expected"); - message.options = $root.google.protobuf.MessageOptions.fromObject(object.options); - } - if (object.reservedRange) { - if (!Array.isArray(object.reservedRange)) - throw TypeError(".google.protobuf.DescriptorProto.reservedRange: array expected"); - message.reservedRange = []; - for (var i = 0; i < object.reservedRange.length; ++i) { - if (typeof object.reservedRange[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.reservedRange: object expected"); - message.reservedRange[i] = $root.google.protobuf.DescriptorProto.ReservedRange.fromObject(object.reservedRange[i]); - } - } - if (object.reservedName) { - if (!Array.isArray(object.reservedName)) - throw TypeError(".google.protobuf.DescriptorProto.reservedName: array expected"); - message.reservedName = []; - for (var i = 0; i < object.reservedName.length; ++i) - message.reservedName[i] = String(object.reservedName[i]); - } - return message; - }; - - /** - * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.DescriptorProto - * @static - * @param {google.protobuf.DescriptorProto} message DescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.field = []; - object.nestedType = []; - object.enumType = []; - object.extensionRange = []; - object.extension = []; - object.oneofDecl = []; - object.reservedRange = []; - object.reservedName = []; - } - if (options.defaults) { - object.name = ""; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.field && message.field.length) { - object.field = []; - for (var j = 0; j < message.field.length; ++j) - object.field[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.field[j], options); - } - if (message.nestedType && message.nestedType.length) { - object.nestedType = []; - for (var j = 0; j < message.nestedType.length; ++j) - object.nestedType[j] = $root.google.protobuf.DescriptorProto.toObject(message.nestedType[j], options); - } - if (message.enumType && message.enumType.length) { - object.enumType = []; - for (var j = 0; j < message.enumType.length; ++j) - object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); - } - if (message.extensionRange && message.extensionRange.length) { - object.extensionRange = []; - for (var j = 0; j < message.extensionRange.length; ++j) - object.extensionRange[j] = $root.google.protobuf.DescriptorProto.ExtensionRange.toObject(message.extensionRange[j], options); - } - if (message.extension && message.extension.length) { - object.extension = []; - for (var j = 0; j < message.extension.length; ++j) - object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); - } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.MessageOptions.toObject(message.options, options); - if (message.oneofDecl && message.oneofDecl.length) { - object.oneofDecl = []; - for (var j = 0; j < message.oneofDecl.length; ++j) - object.oneofDecl[j] = $root.google.protobuf.OneofDescriptorProto.toObject(message.oneofDecl[j], options); - } - if (message.reservedRange && message.reservedRange.length) { - object.reservedRange = []; - for (var j = 0; j < message.reservedRange.length; ++j) - object.reservedRange[j] = $root.google.protobuf.DescriptorProto.ReservedRange.toObject(message.reservedRange[j], options); - } - if (message.reservedName && message.reservedName.length) { - object.reservedName = []; - for (var j = 0; j < message.reservedName.length; ++j) - object.reservedName[j] = message.reservedName[j]; - } - return object; - }; - - /** - * Converts this DescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.DescriptorProto - * @instance - * @returns {Object.} JSON object - */ - DescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.DescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.DescriptorProto"; - }; - - DescriptorProto.ExtensionRange = (function() { - - /** - * Properties of an ExtensionRange. - * @memberof google.protobuf.DescriptorProto - * @interface IExtensionRange - * @property {number|null} [start] ExtensionRange start - * @property {number|null} [end] ExtensionRange end - * @property {google.protobuf.IExtensionRangeOptions|null} [options] ExtensionRange options - */ - - /** - * Constructs a new ExtensionRange. - * @memberof google.protobuf.DescriptorProto - * @classdesc Represents an ExtensionRange. - * @implements IExtensionRange - * @constructor - * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set - */ - function ExtensionRange(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ExtensionRange start. - * @member {number} start - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance - */ - ExtensionRange.prototype.start = 0; - - /** - * ExtensionRange end. - * @member {number} end - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance - */ - ExtensionRange.prototype.end = 0; - - /** - * ExtensionRange options. - * @member {google.protobuf.IExtensionRangeOptions|null|undefined} options - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance - */ - ExtensionRange.prototype.options = null; - - /** - * Creates a new ExtensionRange instance using the specified properties. - * @function create - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set - * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange instance - */ - ExtensionRange.create = function create(properties) { - return new ExtensionRange(properties); - }; - - /** - * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. - * @function encode - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExtensionRange.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.start != null && Object.hasOwnProperty.call(message, "start")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.ExtensionRangeOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExtensionRange.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ExtensionRange message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExtensionRange.decode = function decode(reader, length) { - 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 - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange - */ - ExtensionRange.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.DescriptorProto.ExtensionRange) - return object; - var message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); - if (object.start != null) - message.start = object.start | 0; - if (object.end != null) - message.end = object.end | 0; - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.DescriptorProto.ExtensionRange.options: object expected"); - message.options = $root.google.protobuf.ExtensionRangeOptions.fromObject(object.options); - } - return message; - }; - - /** - * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {google.protobuf.DescriptorProto.ExtensionRange} message ExtensionRange - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExtensionRange.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.start = 0; - object.end = 0; - object.options = null; - } - if (message.start != null && message.hasOwnProperty("start")) - object.start = message.start; - if (message.end != null && message.hasOwnProperty("end")) - object.end = message.end; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.ExtensionRangeOptions.toObject(message.options, options); - return object; - }; - - /** - * Converts this ExtensionRange to JSON. - * @function toJSON - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance - * @returns {Object.} JSON object - */ - ExtensionRange.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ExtensionRange - * @function getTypeUrl - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExtensionRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.DescriptorProto.ExtensionRange"; - }; - - return ExtensionRange; - })(); - - DescriptorProto.ReservedRange = (function() { - - /** - * Properties of a ReservedRange. - * @memberof google.protobuf.DescriptorProto - * @interface IReservedRange - * @property {number|null} [start] ReservedRange start - * @property {number|null} [end] ReservedRange end - */ - - /** - * Constructs a new ReservedRange. - * @memberof google.protobuf.DescriptorProto - * @classdesc Represents a ReservedRange. - * @implements IReservedRange - * @constructor - * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set - */ - function ReservedRange(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ReservedRange start. - * @member {number} start - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @instance - */ - ReservedRange.prototype.start = 0; - - /** - * ReservedRange end. - * @member {number} end - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @instance - */ - ReservedRange.prototype.end = 0; - - /** - * Creates a new ReservedRange instance using the specified properties. - * @function create - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set - * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange instance - */ - ReservedRange.create = function create(properties) { - return new ReservedRange(properties); - }; - - /** - * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. - * @function encode - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReservedRange.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.start != null && Object.hasOwnProperty.call(message, "start")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); - return writer; - }; - - /** - * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReservedRange.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ReservedRange message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReservedRange.decode = function decode(reader, length) { - 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 - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange - */ - ReservedRange.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.DescriptorProto.ReservedRange) - return object; - var message = new $root.google.protobuf.DescriptorProto.ReservedRange(); - if (object.start != null) - message.start = object.start | 0; - if (object.end != null) - message.end = object.end | 0; - return message; - }; - - /** - * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {google.protobuf.DescriptorProto.ReservedRange} message ReservedRange - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ReservedRange.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.start = 0; - object.end = 0; - } - if (message.start != null && message.hasOwnProperty("start")) - object.start = message.start; - if (message.end != null && message.hasOwnProperty("end")) - object.end = message.end; - return object; - }; - - /** - * Converts this ReservedRange to JSON. - * @function toJSON - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @instance - * @returns {Object.} JSON object - */ - ReservedRange.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ReservedRange - * @function getTypeUrl - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.DescriptorProto.ReservedRange"; - }; - - return ReservedRange; - })(); - - return DescriptorProto; - })(); - - protobuf.ExtensionRangeOptions = (function() { - - /** - * Properties of an ExtensionRangeOptions. - * @memberof google.protobuf - * @interface IExtensionRangeOptions - * @property {Array.|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 ExtensionRangeOptions. - * @memberof google.protobuf - * @classdesc Represents an ExtensionRangeOptions. - * @implements IExtensionRangeOptions - * @constructor - * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set - */ - function ExtensionRangeOptions(properties) { - this.uninterpretedOption = []; - this.declaration = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ExtensionRangeOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.ExtensionRangeOptions - * @instance - */ - ExtensionRangeOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * ExtensionRangeOptions declaration. - * @member {Array.} declaration - * @memberof google.protobuf.ExtensionRangeOptions - * @instance - */ - ExtensionRangeOptions.prototype.declaration = $util.emptyArray; - - /** - * ExtensionRangeOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.ExtensionRangeOptions - * @instance - */ - ExtensionRangeOptions.prototype.features = null; - - /** - * ExtensionRangeOptions verification. - * @member {google.protobuf.ExtensionRangeOptions.VerificationState} verification - * @memberof google.protobuf.ExtensionRangeOptions - * @instance - */ - ExtensionRangeOptions.prototype.verification = 1; - - /** - * Creates a new ExtensionRangeOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set - * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions instance - */ - ExtensionRangeOptions.create = function create(properties) { - return new ExtensionRangeOptions(properties); - }; - - /** - * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExtensionRangeOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.declaration != null && message.declaration.length) - for (var i = 0; i < message.declaration.length; ++i) - $root.google.protobuf.ExtensionRangeOptions.Declaration.encode(message.declaration[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.verification != null && Object.hasOwnProperty.call(message, "verification")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.verification); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExtensionRangeOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ExtensionRangeOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExtensionRangeOptions.decode = function decode(reader, length) { - 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; - }; - - /** - * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExtensionRangeOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ExtensionRangeOptions message. - * @function verify - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExtensionRangeOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - if (message.declaration != null && message.hasOwnProperty("declaration")) { - if (!Array.isArray(message.declaration)) - return "declaration: array expected"; - for (var i = 0; i < message.declaration.length; ++i) { - var error = $root.google.protobuf.ExtensionRangeOptions.Declaration.verify(message.declaration[i]); - if (error) - return "declaration." + error; - } - } - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.verification != null && message.hasOwnProperty("verification")) - switch (message.verification) { - default: - return "verification: enum value expected"; - case 0: - case 1: - break; - } - return null; - }; - - /** - * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions - */ - ExtensionRangeOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ExtensionRangeOptions) - return object; - var message = new $root.google.protobuf.ExtensionRangeOptions(); - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - if (object.declaration) { - if (!Array.isArray(object.declaration)) - throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: array expected"); - message.declaration = []; - for (var i = 0; i < object.declaration.length; ++i) { - if (typeof object.declaration[i] !== "object") - throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: object expected"); - message.declaration[i] = $root.google.protobuf.ExtensionRangeOptions.Declaration.fromObject(object.declaration[i]); - } - } - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.ExtensionRangeOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - switch (object.verification) { - case "DECLARATION": - case 0: - message.verification = 0; - break; - default: - if (typeof object.verification === "number") { - message.verification = object.verification; - break; - } - break; - case "UNVERIFIED": - case 1: - message.verification = 1; - break; - } - return message; - }; - - /** - * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {google.protobuf.ExtensionRangeOptions} message ExtensionRangeOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExtensionRangeOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.declaration = []; - object.uninterpretedOption = []; - } - if (options.defaults) { - object.verification = options.enums === String ? "UNVERIFIED" : 1; - object.features = null; - } - if (message.declaration && message.declaration.length) { - object.declaration = []; - for (var j = 0; j < message.declaration.length; ++j) - object.declaration[j] = $root.google.protobuf.ExtensionRangeOptions.Declaration.toObject(message.declaration[j], options); - } - if (message.verification != null && message.hasOwnProperty("verification")) - object.verification = options.enums === String ? $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] === undefined ? message.verification : $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] : message.verification; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - return object; - }; - - /** - * Converts this ExtensionRangeOptions to JSON. - * @function toJSON - * @memberof google.protobuf.ExtensionRangeOptions - * @instance - * @returns {Object.} JSON object - */ - ExtensionRangeOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ExtensionRangeOptions - * @function getTypeUrl - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExtensionRangeOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions"; - }; - - ExtensionRangeOptions.Declaration = (function() { - - /** - * Properties of a Declaration. - * @memberof google.protobuf.ExtensionRangeOptions - * @interface IDeclaration - * @property {number|null} [number] Declaration number - * @property {string|null} [fullName] Declaration fullName - * @property {string|null} [type] Declaration type - * @property {boolean|null} [reserved] Declaration reserved - * @property {boolean|null} [repeated] Declaration repeated - */ - - /** - * Constructs a new Declaration. - * @memberof google.protobuf.ExtensionRangeOptions - * @classdesc Represents a Declaration. - * @implements IDeclaration - * @constructor - * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set - */ - function Declaration(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Declaration number. - * @member {number} number - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - */ - Declaration.prototype.number = 0; - - /** - * Declaration fullName. - * @member {string} fullName - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - */ - Declaration.prototype.fullName = ""; - - /** - * Declaration type. - * @member {string} type - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - */ - Declaration.prototype.type = ""; - - /** - * Declaration reserved. - * @member {boolean} reserved - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - */ - Declaration.prototype.reserved = false; - - /** - * Declaration repeated. - * @member {boolean} repeated - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - */ - Declaration.prototype.repeated = false; - - /** - * Creates a new Declaration instance using the specified properties. - * @function create - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set - * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration instance - */ - Declaration.create = function create(properties) { - return new Declaration(properties); - }; - - /** - * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. - * @function encode - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Declaration.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.number != null && Object.hasOwnProperty.call(message, "number")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.number); - if (message.fullName != null && Object.hasOwnProperty.call(message, "fullName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.fullName); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.type); - if (message.reserved != null && Object.hasOwnProperty.call(message, "reserved")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.reserved); - if (message.repeated != null && Object.hasOwnProperty.call(message, "repeated")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.repeated); - return writer; - }; - - /** - * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Declaration.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Declaration message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Declaration.decode = function decode(reader, length) { - 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; - })(); - - /** - * VerificationState enum. - * @name google.protobuf.ExtensionRangeOptions.VerificationState - * @enum {number} - * @property {number} DECLARATION=0 DECLARATION value - * @property {number} UNVERIFIED=1 UNVERIFIED value - */ - ExtensionRangeOptions.VerificationState = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "DECLARATION"] = 0; - values[valuesById[1] = "UNVERIFIED"] = 1; - return values; - })(); - - return ExtensionRangeOptions; - })(); - - protobuf.FieldDescriptorProto = (function() { - - /** - * Properties of a FieldDescriptorProto. - * @memberof google.protobuf - * @interface IFieldDescriptorProto - * @property {string|null} [name] FieldDescriptorProto name - * @property {number|null} [number] FieldDescriptorProto number - * @property {google.protobuf.FieldDescriptorProto.Label|null} [label] FieldDescriptorProto label - * @property {google.protobuf.FieldDescriptorProto.Type|null} [type] FieldDescriptorProto type - * @property {string|null} [typeName] FieldDescriptorProto typeName - * @property {string|null} [extendee] FieldDescriptorProto extendee - * @property {string|null} [defaultValue] FieldDescriptorProto defaultValue - * @property {number|null} [oneofIndex] FieldDescriptorProto oneofIndex - * @property {string|null} [jsonName] FieldDescriptorProto jsonName - * @property {google.protobuf.IFieldOptions|null} [options] FieldDescriptorProto options - * @property {boolean|null} [proto3Optional] FieldDescriptorProto proto3Optional - */ - - /** - * Constructs a new FieldDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a FieldDescriptorProto. - * @implements IFieldDescriptorProto - * @constructor - * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set - */ - function FieldDescriptorProto(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FieldDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.name = ""; - - /** - * FieldDescriptorProto number. - * @member {number} number - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.number = 0; - - /** - * FieldDescriptorProto label. - * @member {google.protobuf.FieldDescriptorProto.Label} label - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.label = 1; - - /** - * FieldDescriptorProto type. - * @member {google.protobuf.FieldDescriptorProto.Type} type - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.type = 1; - - /** - * FieldDescriptorProto typeName. - * @member {string} typeName - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.typeName = ""; - - /** - * FieldDescriptorProto extendee. - * @member {string} extendee - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.extendee = ""; - - /** - * FieldDescriptorProto defaultValue. - * @member {string} defaultValue - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.defaultValue = ""; - - /** - * FieldDescriptorProto oneofIndex. - * @member {number} oneofIndex - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.oneofIndex = 0; - - /** - * FieldDescriptorProto jsonName. - * @member {string} jsonName - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.jsonName = ""; - - /** - * FieldDescriptorProto options. - * @member {google.protobuf.IFieldOptions|null|undefined} options - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.options = null; - - /** - * FieldDescriptorProto proto3Optional. - * @member {boolean} proto3Optional - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.proto3Optional = false; - - /** - * Creates a new FieldDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto instance - */ - FieldDescriptorProto.create = function create(properties) { - return new FieldDescriptorProto(properties); - }; - - /** - * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.extendee != null && Object.hasOwnProperty.call(message, "extendee")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); - if (message.number != null && Object.hasOwnProperty.call(message, "number")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); - if (message.label != null && Object.hasOwnProperty.call(message, "label")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); - if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName); - if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.oneofIndex != null && Object.hasOwnProperty.call(message, "oneofIndex")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex); - if (message.jsonName != null && Object.hasOwnProperty.call(message, "jsonName")) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); - if (message.proto3Optional != null && Object.hasOwnProperty.call(message, "proto3Optional")) - writer.uint32(/* id 17, wireType 0 =*/136).bool(message.proto3Optional); - return writer; - }; - - /** - * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldDescriptorProto.decode = function decode(reader, length) { - 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.FieldDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto - */ - FieldDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FieldDescriptorProto) - return object; - var message = new $root.google.protobuf.FieldDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.number != null) - message.number = object.number | 0; - switch (object.label) { - default: - if (typeof object.label === "number") { - message.label = object.label; - break; - } - break; - case "LABEL_OPTIONAL": - case 1: - message.label = 1; - break; - case "LABEL_REPEATED": - case 3: - message.label = 3; - break; - case "LABEL_REQUIRED": - case 2: - message.label = 2; - break; - } - switch (object.type) { - default: - if (typeof object.type === "number") { - message.type = object.type; - break; - } - break; - case "TYPE_DOUBLE": - case 1: - message.type = 1; - break; - case "TYPE_FLOAT": - case 2: - message.type = 2; - break; - case "TYPE_INT64": - case 3: - message.type = 3; - break; - case "TYPE_UINT64": - case 4: - message.type = 4; - break; - case "TYPE_INT32": - case 5: - message.type = 5; - break; - case "TYPE_FIXED64": - case 6: - message.type = 6; - break; - case "TYPE_FIXED32": - case 7: - message.type = 7; - break; - case "TYPE_BOOL": - case 8: - message.type = 8; - break; - case "TYPE_STRING": - case 9: - message.type = 9; - break; - case "TYPE_GROUP": - case 10: - message.type = 10; - break; - case "TYPE_MESSAGE": - case 11: - message.type = 11; - break; - case "TYPE_BYTES": - case 12: - message.type = 12; - break; - case "TYPE_UINT32": - case 13: - message.type = 13; - break; - case "TYPE_ENUM": - case 14: - message.type = 14; - break; - case "TYPE_SFIXED32": - case 15: - message.type = 15; - break; - case "TYPE_SFIXED64": - case 16: - message.type = 16; - break; - case "TYPE_SINT32": - case 17: - message.type = 17; - break; - case "TYPE_SINT64": - case 18: - message.type = 18; - break; - } - if (object.typeName != null) - message.typeName = String(object.typeName); - if (object.extendee != null) - message.extendee = String(object.extendee); - if (object.defaultValue != null) - message.defaultValue = String(object.defaultValue); - if (object.oneofIndex != null) - message.oneofIndex = object.oneofIndex | 0; - if (object.jsonName != null) - message.jsonName = String(object.jsonName); - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.FieldDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.FieldOptions.fromObject(object.options); - } - if (object.proto3Optional != null) - message.proto3Optional = Boolean(object.proto3Optional); - return message; - }; - - /** - * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {google.protobuf.FieldDescriptorProto} message FieldDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FieldDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.extendee = ""; - object.number = 0; - object.label = options.enums === String ? "LABEL_OPTIONAL" : 1; - object.type = options.enums === String ? "TYPE_DOUBLE" : 1; - object.typeName = ""; - object.defaultValue = ""; - object.options = null; - object.oneofIndex = 0; - object.jsonName = ""; - object.proto3Optional = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.extendee != null && message.hasOwnProperty("extendee")) - object.extendee = message.extendee; - if (message.number != null && message.hasOwnProperty("number")) - object.number = message.number; - if (message.label != null && message.hasOwnProperty("label")) - object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] === undefined ? message.label : $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label; - if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] === undefined ? message.type : $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type; - if (message.typeName != null && message.hasOwnProperty("typeName")) - object.typeName = message.typeName; - if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) - object.defaultValue = message.defaultValue; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.FieldOptions.toObject(message.options, options); - if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) - object.oneofIndex = message.oneofIndex; - if (message.jsonName != null && message.hasOwnProperty("jsonName")) - object.jsonName = message.jsonName; - if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) - object.proto3Optional = message.proto3Optional; - return object; - }; - - /** - * Converts this FieldDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.FieldDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - FieldDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FieldDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FieldDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FieldDescriptorProto"; - }; - - /** - * Type enum. - * @name google.protobuf.FieldDescriptorProto.Type - * @enum {number} - * @property {number} TYPE_DOUBLE=1 TYPE_DOUBLE value - * @property {number} TYPE_FLOAT=2 TYPE_FLOAT value - * @property {number} TYPE_INT64=3 TYPE_INT64 value - * @property {number} TYPE_UINT64=4 TYPE_UINT64 value - * @property {number} TYPE_INT32=5 TYPE_INT32 value - * @property {number} TYPE_FIXED64=6 TYPE_FIXED64 value - * @property {number} TYPE_FIXED32=7 TYPE_FIXED32 value - * @property {number} TYPE_BOOL=8 TYPE_BOOL value - * @property {number} TYPE_STRING=9 TYPE_STRING value - * @property {number} TYPE_GROUP=10 TYPE_GROUP value - * @property {number} TYPE_MESSAGE=11 TYPE_MESSAGE value - * @property {number} TYPE_BYTES=12 TYPE_BYTES value - * @property {number} TYPE_UINT32=13 TYPE_UINT32 value - * @property {number} TYPE_ENUM=14 TYPE_ENUM value - * @property {number} TYPE_SFIXED32=15 TYPE_SFIXED32 value - * @property {number} TYPE_SFIXED64=16 TYPE_SFIXED64 value - * @property {number} TYPE_SINT32=17 TYPE_SINT32 value - * @property {number} TYPE_SINT64=18 TYPE_SINT64 value - */ - FieldDescriptorProto.Type = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[1] = "TYPE_DOUBLE"] = 1; - values[valuesById[2] = "TYPE_FLOAT"] = 2; - values[valuesById[3] = "TYPE_INT64"] = 3; - values[valuesById[4] = "TYPE_UINT64"] = 4; - values[valuesById[5] = "TYPE_INT32"] = 5; - values[valuesById[6] = "TYPE_FIXED64"] = 6; - values[valuesById[7] = "TYPE_FIXED32"] = 7; - values[valuesById[8] = "TYPE_BOOL"] = 8; - values[valuesById[9] = "TYPE_STRING"] = 9; - values[valuesById[10] = "TYPE_GROUP"] = 10; - values[valuesById[11] = "TYPE_MESSAGE"] = 11; - values[valuesById[12] = "TYPE_BYTES"] = 12; - values[valuesById[13] = "TYPE_UINT32"] = 13; - values[valuesById[14] = "TYPE_ENUM"] = 14; - values[valuesById[15] = "TYPE_SFIXED32"] = 15; - values[valuesById[16] = "TYPE_SFIXED64"] = 16; - values[valuesById[17] = "TYPE_SINT32"] = 17; - values[valuesById[18] = "TYPE_SINT64"] = 18; - return values; - })(); - - /** - * Label enum. - * @name google.protobuf.FieldDescriptorProto.Label - * @enum {number} - * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value - * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value - * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value - */ - FieldDescriptorProto.Label = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[1] = "LABEL_OPTIONAL"] = 1; - values[valuesById[3] = "LABEL_REPEATED"] = 3; - values[valuesById[2] = "LABEL_REQUIRED"] = 2; - return values; - })(); - - return FieldDescriptorProto; - })(); - - protobuf.OneofDescriptorProto = (function() { - - /** - * Properties of an OneofDescriptorProto. - * @memberof google.protobuf - * @interface IOneofDescriptorProto - * @property {string|null} [name] OneofDescriptorProto name - * @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options - */ - - /** - * Constructs a new OneofDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents an OneofDescriptorProto. - * @implements IOneofDescriptorProto - * @constructor - * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set - */ - function OneofDescriptorProto(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * OneofDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.OneofDescriptorProto - * @instance - */ - OneofDescriptorProto.prototype.name = ""; - - /** - * OneofDescriptorProto options. - * @member {google.protobuf.IOneofOptions|null|undefined} options - * @memberof google.protobuf.OneofDescriptorProto - * @instance - */ - OneofDescriptorProto.prototype.options = null; - - /** - * Creates a new OneofDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto instance - */ - OneofDescriptorProto.create = function create(properties) { - return new OneofDescriptorProto(properties); - }; - - /** - * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OneofDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OneofDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OneofDescriptorProto.decode = function decode(reader, length) { - 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.OneofDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto - */ - OneofDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.OneofDescriptorProto) - return object; - var message = new $root.google.protobuf.OneofDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.OneofDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.OneofOptions.fromObject(object.options); - } - return message; - }; - - /** - * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {google.protobuf.OneofDescriptorProto} message OneofDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OneofDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.OneofOptions.toObject(message.options, options); - return object; - }; - - /** - * Converts this OneofDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.OneofDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - OneofDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for OneofDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - OneofDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.OneofDescriptorProto"; - }; - - return OneofDescriptorProto; - })(); - - protobuf.EnumDescriptorProto = (function() { - - /** - * Properties of an EnumDescriptorProto. - * @memberof google.protobuf - * @interface IEnumDescriptorProto - * @property {string|null} [name] EnumDescriptorProto name - * @property {Array.|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 EnumDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents an EnumDescriptorProto. - * @implements IEnumDescriptorProto - * @constructor - * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set - */ - function EnumDescriptorProto(properties) { - this.value = []; - this.reservedRange = []; - this.reservedName = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnumDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.name = ""; - - /** - * EnumDescriptorProto value. - * @member {Array.} value - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.value = $util.emptyArray; - - /** - * EnumDescriptorProto options. - * @member {google.protobuf.IEnumOptions|null|undefined} options - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.options = null; - - /** - * EnumDescriptorProto reservedRange. - * @member {Array.} 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.EnumDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto - */ - EnumDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumDescriptorProto) - return object; - var message = new $root.google.protobuf.EnumDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.value) { - if (!Array.isArray(object.value)) - throw TypeError(".google.protobuf.EnumDescriptorProto.value: array expected"); - message.value = []; - for (var i = 0; i < object.value.length; ++i) { - if (typeof object.value[i] !== "object") - throw TypeError(".google.protobuf.EnumDescriptorProto.value: object expected"); - message.value[i] = $root.google.protobuf.EnumValueDescriptorProto.fromObject(object.value[i]); - } - } - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.EnumDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.EnumOptions.fromObject(object.options); - } - if (object.reservedRange) { - if (!Array.isArray(object.reservedRange)) - throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: array expected"); - message.reservedRange = []; - for (var i = 0; i < object.reservedRange.length; ++i) { - if (typeof object.reservedRange[i] !== "object") - throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: object expected"); - message.reservedRange[i] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.fromObject(object.reservedRange[i]); - } - } - if (object.reservedName) { - if (!Array.isArray(object.reservedName)) - throw TypeError(".google.protobuf.EnumDescriptorProto.reservedName: array expected"); - message.reservedName = []; - for (var i = 0; i < object.reservedName.length; ++i) - message.reservedName[i] = String(object.reservedName[i]); - } - return message; - }; - - /** - * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {google.protobuf.EnumDescriptorProto} message EnumDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.value = []; - object.reservedRange = []; - object.reservedName = []; - } - if (options.defaults) { - object.name = ""; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.value && message.value.length) { - object.value = []; - for (var j = 0; j < message.value.length; ++j) - object.value[j] = $root.google.protobuf.EnumValueDescriptorProto.toObject(message.value[j], options); - } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.EnumOptions.toObject(message.options, options); - if (message.reservedRange && message.reservedRange.length) { - object.reservedRange = []; - for (var j = 0; j < message.reservedRange.length; ++j) - object.reservedRange[j] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.toObject(message.reservedRange[j], options); - } - if (message.reservedName && message.reservedName.length) { - object.reservedName = []; - for (var j = 0; j < message.reservedName.length; ++j) - object.reservedName[j] = message.reservedName[j]; - } - return object; - }; - - /** - * Converts this EnumDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.EnumDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - EnumDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnumDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnumDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto"; - }; - - EnumDescriptorProto.EnumReservedRange = (function() { - - /** - * Properties of an EnumReservedRange. - * @memberof google.protobuf.EnumDescriptorProto - * @interface IEnumReservedRange - * @property {number|null} [start] EnumReservedRange start - * @property {number|null} [end] EnumReservedRange end - */ - - /** - * Constructs a new EnumReservedRange. - * @memberof google.protobuf.EnumDescriptorProto - * @classdesc Represents an EnumReservedRange. - * @implements IEnumReservedRange - * @constructor - * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set - */ - function EnumReservedRange(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnumReservedRange start. - * @member {number} start - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @instance - */ - EnumReservedRange.prototype.start = 0; - - /** - * EnumReservedRange end. - * @member {number} end - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @instance - */ - EnumReservedRange.prototype.end = 0; - - /** - * Creates a new EnumReservedRange instance using the specified properties. - * @function create - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set - * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange instance - */ - EnumReservedRange.create = function create(properties) { - return new EnumReservedRange(properties); - }; - - /** - * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumReservedRange.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.start != null && Object.hasOwnProperty.call(message, "start")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); - return writer; - }; - - /** - * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumReservedRange.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumReservedRange message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumReservedRange.decode = function decode(reader, length) { - 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.EnumValueDescriptorProto = (function() { - - /** - * Properties of an EnumValueDescriptorProto. - * @memberof google.protobuf - * @interface IEnumValueDescriptorProto - * @property {string|null} [name] EnumValueDescriptorProto name - * @property {number|null} [number] EnumValueDescriptorProto number - * @property {google.protobuf.IEnumValueOptions|null} [options] EnumValueDescriptorProto options - */ - - /** - * Constructs a new EnumValueDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents an EnumValueDescriptorProto. - * @implements IEnumValueDescriptorProto - * @constructor - * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set - */ - function EnumValueDescriptorProto(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnumValueDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - */ - EnumValueDescriptorProto.prototype.name = ""; - - /** - * EnumValueDescriptorProto number. - * @member {number} number - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - */ - EnumValueDescriptorProto.prototype.number = 0; - - /** - * EnumValueDescriptorProto options. - * @member {google.protobuf.IEnumValueOptions|null|undefined} options - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - */ - EnumValueDescriptorProto.prototype.options = null; - - /** - * Creates a new EnumValueDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto instance - */ - EnumValueDescriptorProto.create = function create(properties) { - return new EnumValueDescriptorProto(properties); - }; - - /** - * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValueDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.number != null && Object.hasOwnProperty.call(message, "number")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumValueDescriptorProto.decode = function decode(reader, length) { - 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; - }; - - /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumValueDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumValueDescriptorProto message. - * @function verify - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumValueDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.number != null && message.hasOwnProperty("number")) - if (!$util.isInteger(message.number)) - return "number: integer expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.EnumValueOptions.verify(message.options); - if (error) - return "options." + error; - } - return null; - }; - - /** - * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto - */ - EnumValueDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumValueDescriptorProto) - return object; - var message = new $root.google.protobuf.EnumValueDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.number != null) - message.number = object.number | 0; - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.EnumValueDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.EnumValueOptions.fromObject(object.options); - } - return message; - }; - - /** - * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {google.protobuf.EnumValueDescriptorProto} message EnumValueDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumValueDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.number = 0; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.number != null && message.hasOwnProperty("number")) - object.number = message.number; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.EnumValueOptions.toObject(message.options, options); - return object; - }; - - /** - * Converts this EnumValueDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - EnumValueDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnumValueDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnumValueDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.EnumValueDescriptorProto"; - }; - - return EnumValueDescriptorProto; - })(); - - protobuf.ServiceDescriptorProto = (function() { - - /** - * Properties of a ServiceDescriptorProto. - * @memberof google.protobuf - * @interface IServiceDescriptorProto - * @property {string|null} [name] ServiceDescriptorProto name - * @property {Array.|null} [method] ServiceDescriptorProto method - * @property {google.protobuf.IServiceOptions|null} [options] ServiceDescriptorProto options - */ - - /** - * Constructs a new ServiceDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a ServiceDescriptorProto. - * @implements IServiceDescriptorProto - * @constructor - * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set - */ - function ServiceDescriptorProto(properties) { - this.method = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ServiceDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - */ - ServiceDescriptorProto.prototype.name = ""; - - /** - * ServiceDescriptorProto method. - * @member {Array.} method - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - */ - ServiceDescriptorProto.prototype.method = $util.emptyArray; - - /** - * ServiceDescriptorProto options. - * @member {google.protobuf.IServiceOptions|null|undefined} options - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - */ - ServiceDescriptorProto.prototype.options = null; - - /** - * Creates a new ServiceDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto instance - */ - ServiceDescriptorProto.create = function create(properties) { - return new ServiceDescriptorProto(properties); - }; - - /** - * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.method != null && message.method.length) - for (var i = 0; i < message.method.length; ++i) - $root.google.protobuf.MethodDescriptorProto.encode(message.method[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.ServiceOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceDescriptorProto.decode = function decode(reader, length) { - 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 - */ - ServiceDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ServiceDescriptorProto message. - * @function verify - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ServiceDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.method != null && message.hasOwnProperty("method")) { - if (!Array.isArray(message.method)) - return "method: array expected"; - for (var i = 0; i < message.method.length; ++i) { - var error = $root.google.protobuf.MethodDescriptorProto.verify(message.method[i]); - if (error) - return "method." + error; - } - } - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.ServiceOptions.verify(message.options); - if (error) - return "options." + error; - } - return null; - }; - - /** - * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto - */ - ServiceDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ServiceDescriptorProto) - return object; - var message = new $root.google.protobuf.ServiceDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.method) { - if (!Array.isArray(object.method)) - throw TypeError(".google.protobuf.ServiceDescriptorProto.method: array expected"); - message.method = []; - for (var i = 0; i < object.method.length; ++i) { - if (typeof object.method[i] !== "object") - throw TypeError(".google.protobuf.ServiceDescriptorProto.method: object expected"); - message.method[i] = $root.google.protobuf.MethodDescriptorProto.fromObject(object.method[i]); - } - } - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.ServiceDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.ServiceOptions.fromObject(object.options); - } - return message; - }; - - /** - * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {google.protobuf.ServiceDescriptorProto} message ServiceDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ServiceDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.method = []; - if (options.defaults) { - object.name = ""; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.method && message.method.length) { - object.method = []; - for (var j = 0; j < message.method.length; ++j) - object.method[j] = $root.google.protobuf.MethodDescriptorProto.toObject(message.method[j], options); - } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.ServiceOptions.toObject(message.options, options); - return object; - }; - - /** - * Converts this ServiceDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - ServiceDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ServiceDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ServiceDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.ServiceDescriptorProto"; - }; - - return ServiceDescriptorProto; - })(); - - protobuf.MethodDescriptorProto = (function() { - - /** - * Properties of a MethodDescriptorProto. - * @memberof google.protobuf - * @interface IMethodDescriptorProto - * @property {string|null} [name] MethodDescriptorProto name - * @property {string|null} [inputType] MethodDescriptorProto inputType - * @property {string|null} [outputType] MethodDescriptorProto outputType - * @property {google.protobuf.IMethodOptions|null} [options] MethodDescriptorProto options - * @property {boolean|null} [clientStreaming] MethodDescriptorProto clientStreaming - * @property {boolean|null} [serverStreaming] MethodDescriptorProto serverStreaming - */ - - /** - * Constructs a new MethodDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a MethodDescriptorProto. - * @implements IMethodDescriptorProto - * @constructor - * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set - */ - function MethodDescriptorProto(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MethodDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.name = ""; - - /** - * MethodDescriptorProto inputType. - * @member {string} inputType - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.inputType = ""; - - /** - * MethodDescriptorProto outputType. - * @member {string} outputType - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.outputType = ""; - - /** - * MethodDescriptorProto options. - * @member {google.protobuf.IMethodOptions|null|undefined} options - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.options = null; - - /** - * MethodDescriptorProto clientStreaming. - * @member {boolean} clientStreaming - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.clientStreaming = false; - - /** - * MethodDescriptorProto serverStreaming. - * @member {boolean} serverStreaming - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.serverStreaming = false; - - /** - * Creates a new MethodDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto instance - */ - MethodDescriptorProto.create = function create(properties) { - return new MethodDescriptorProto(properties); - }; - - /** - * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.inputType != null && Object.hasOwnProperty.call(message, "inputType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputType); - if (message.outputType != null && Object.hasOwnProperty.call(message, "outputType")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputType); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.MethodOptions.encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.clientStreaming != null && Object.hasOwnProperty.call(message, "clientStreaming")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.clientStreaming); - if (message.serverStreaming != null && Object.hasOwnProperty.call(message, "serverStreaming")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.serverStreaming); - return writer; - }; - - /** - * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodDescriptorProto.decode = function decode(reader, length) { - 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 2: { - message.inputType = reader.string(); - break; - } - case 3: { - message.outputType = reader.string(); - break; - } - case 4: { - message.options = $root.google.protobuf.MethodOptions.decode(reader, reader.uint32()); - break; - } - case 5: { - message.clientStreaming = reader.bool(); - break; - } - case 6: { - message.serverStreaming = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MethodDescriptorProto message. - * @function verify - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MethodDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.inputType != null && message.hasOwnProperty("inputType")) - if (!$util.isString(message.inputType)) - return "inputType: string expected"; - if (message.outputType != null && message.hasOwnProperty("outputType")) - if (!$util.isString(message.outputType)) - return "outputType: string expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.MethodOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) - if (typeof message.clientStreaming !== "boolean") - return "clientStreaming: boolean expected"; - if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) - if (typeof message.serverStreaming !== "boolean") - return "serverStreaming: boolean expected"; - return null; - }; - - /** - * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {Object.} 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"; - } - return typeUrlPrefix + "/google.protobuf.MethodDescriptorProto"; - }; - - return MethodDescriptorProto; - })(); - - protobuf.FileOptions = (function() { - - /** - * Properties of a FileOptions. - * @memberof google.protobuf - * @interface IFileOptions - * @property {string|null} [javaPackage] FileOptions javaPackage - * @property {string|null} [javaOuterClassname] FileOptions javaOuterClassname - * @property {boolean|null} [javaMultipleFiles] FileOptions javaMultipleFiles - * @property {boolean|null} [javaGenerateEqualsAndHash] FileOptions javaGenerateEqualsAndHash - * @property {boolean|null} [javaStringCheckUtf8] FileOptions javaStringCheckUtf8 - * @property {google.protobuf.FileOptions.OptimizeMode|null} [optimizeFor] FileOptions optimizeFor - * @property {string|null} [goPackage] FileOptions goPackage - * @property {boolean|null} [ccGenericServices] FileOptions ccGenericServices - * @property {boolean|null} [javaGenericServices] FileOptions javaGenericServices - * @property {boolean|null} [pyGenericServices] FileOptions pyGenericServices - * @property {boolean|null} [deprecated] FileOptions deprecated - * @property {boolean|null} [ccEnableArenas] FileOptions ccEnableArenas - * @property {string|null} [objcClassPrefix] FileOptions objcClassPrefix - * @property {string|null} [csharpNamespace] FileOptions csharpNamespace - * @property {string|null} [swiftPrefix] FileOptions swiftPrefix - * @property {string|null} [phpClassPrefix] FileOptions phpClassPrefix - * @property {string|null} [phpNamespace] FileOptions phpNamespace - * @property {string|null} [phpMetadataNamespace] FileOptions phpMetadataNamespace - * @property {string|null} [rubyPackage] FileOptions rubyPackage - * @property {google.protobuf.IFeatureSet|null} [features] FileOptions features - * @property {Array.|null} [uninterpretedOption] FileOptions uninterpretedOption - * @property {Array.|null} [".google.api.resourceDefinition"] FileOptions .google.api.resourceDefinition - */ - - /** - * Constructs a new FileOptions. - * @memberof google.protobuf - * @classdesc Represents a FileOptions. - * @implements IFileOptions - * @constructor - * @param {google.protobuf.IFileOptions=} [properties] Properties to set - */ - function FileOptions(properties) { - this.uninterpretedOption = []; - this[".google.api.resourceDefinition"] = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FileOptions javaPackage. - * @member {string} javaPackage - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaPackage = ""; - - /** - * FileOptions javaOuterClassname. - * @member {string} javaOuterClassname - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaOuterClassname = ""; - - /** - * FileOptions javaMultipleFiles. - * @member {boolean} javaMultipleFiles - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaMultipleFiles = false; - - /** - * FileOptions javaGenerateEqualsAndHash. - * @member {boolean} javaGenerateEqualsAndHash - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaGenerateEqualsAndHash = false; - - /** - * FileOptions javaStringCheckUtf8. - * @member {boolean} javaStringCheckUtf8 - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaStringCheckUtf8 = false; - - /** - * FileOptions optimizeFor. - * @member {google.protobuf.FileOptions.OptimizeMode} optimizeFor - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.optimizeFor = 1; - - /** - * FileOptions goPackage. - * @member {string} goPackage - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.goPackage = ""; - - /** - * FileOptions ccGenericServices. - * @member {boolean} ccGenericServices - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.ccGenericServices = false; - - /** - * FileOptions javaGenericServices. - * @member {boolean} javaGenericServices - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaGenericServices = false; - - /** - * FileOptions pyGenericServices. - * @member {boolean} pyGenericServices - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.pyGenericServices = false; - - /** - * FileOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.deprecated = false; - - /** - * FileOptions ccEnableArenas. - * @member {boolean} ccEnableArenas - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.ccEnableArenas = true; - - /** - * FileOptions objcClassPrefix. - * @member {string} objcClassPrefix - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.objcClassPrefix = ""; - - /** - * FileOptions csharpNamespace. - * @member {string} csharpNamespace - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.csharpNamespace = ""; - - /** - * FileOptions swiftPrefix. - * @member {string} swiftPrefix - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.swiftPrefix = ""; - - /** - * FileOptions phpClassPrefix. - * @member {string} phpClassPrefix - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.phpClassPrefix = ""; - - /** - * FileOptions phpNamespace. - * @member {string} phpNamespace - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.phpNamespace = ""; - - /** - * FileOptions phpMetadataNamespace. - * @member {string} phpMetadataNamespace - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.phpMetadataNamespace = ""; - - /** - * FileOptions rubyPackage. - * @member {string} rubyPackage - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.rubyPackage = ""; - - /** - * FileOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.features = null; - - /** - * FileOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * FileOptions .google.api.resourceDefinition. - * @member {Array.} .google.api.resourceDefinition - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".google.api.resourceDefinition"] = $util.emptyArray; - - /** - * Creates a new FileOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.FileOptions - * @static - * @param {google.protobuf.IFileOptions=} [properties] Properties to set - * @returns {google.protobuf.FileOptions} FileOptions instance - */ - FileOptions.create = function create(properties) { - return new FileOptions(properties); - }; - - /** - * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FileOptions - * @static - * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.javaPackage != null && Object.hasOwnProperty.call(message, "javaPackage")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.javaPackage); - if (message.javaOuterClassname != null && Object.hasOwnProperty.call(message, "javaOuterClassname")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.javaOuterClassname); - if (message.optimizeFor != null && Object.hasOwnProperty.call(message, "optimizeFor")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimizeFor); - if (message.javaMultipleFiles != null && Object.hasOwnProperty.call(message, "javaMultipleFiles")) - writer.uint32(/* id 10, wireType 0 =*/80).bool(message.javaMultipleFiles); - if (message.goPackage != null && Object.hasOwnProperty.call(message, "goPackage")) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.goPackage); - if (message.ccGenericServices != null && Object.hasOwnProperty.call(message, "ccGenericServices")) - writer.uint32(/* id 16, wireType 0 =*/128).bool(message.ccGenericServices); - if (message.javaGenericServices != null && Object.hasOwnProperty.call(message, "javaGenericServices")) - writer.uint32(/* id 17, wireType 0 =*/136).bool(message.javaGenericServices); - if (message.pyGenericServices != null && Object.hasOwnProperty.call(message, "pyGenericServices")) - writer.uint32(/* id 18, wireType 0 =*/144).bool(message.pyGenericServices); - if (message.javaGenerateEqualsAndHash != null && Object.hasOwnProperty.call(message, "javaGenerateEqualsAndHash")) - writer.uint32(/* id 20, wireType 0 =*/160).bool(message.javaGenerateEqualsAndHash); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated); - if (message.javaStringCheckUtf8 != null && Object.hasOwnProperty.call(message, "javaStringCheckUtf8")) - writer.uint32(/* id 27, wireType 0 =*/216).bool(message.javaStringCheckUtf8); - if (message.ccEnableArenas != null && Object.hasOwnProperty.call(message, "ccEnableArenas")) - writer.uint32(/* id 31, wireType 0 =*/248).bool(message.ccEnableArenas); - if (message.objcClassPrefix != null && Object.hasOwnProperty.call(message, "objcClassPrefix")) - writer.uint32(/* id 36, wireType 2 =*/290).string(message.objcClassPrefix); - if (message.csharpNamespace != null && Object.hasOwnProperty.call(message, "csharpNamespace")) - writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharpNamespace); - if (message.swiftPrefix != null && Object.hasOwnProperty.call(message, "swiftPrefix")) - writer.uint32(/* id 39, wireType 2 =*/314).string(message.swiftPrefix); - if (message.phpClassPrefix != null && Object.hasOwnProperty.call(message, "phpClassPrefix")) - writer.uint32(/* id 40, wireType 2 =*/322).string(message.phpClassPrefix); - if (message.phpNamespace != null && Object.hasOwnProperty.call(message, "phpNamespace")) - writer.uint32(/* id 41, wireType 2 =*/330).string(message.phpNamespace); - if (message.phpMetadataNamespace != null && Object.hasOwnProperty.call(message, "phpMetadataNamespace")) - writer.uint32(/* id 44, wireType 2 =*/354).string(message.phpMetadataNamespace); - if (message.rubyPackage != null && Object.hasOwnProperty.call(message, "rubyPackage")) - writer.uint32(/* id 45, wireType 2 =*/362).string(message.rubyPackage); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.api.resourceDefinition"] != null && message[".google.api.resourceDefinition"].length) - for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) - $root.google.api.ResourceDescriptor.encode(message[".google.api.resourceDefinition"][i], writer.uint32(/* id 1053, wireType 2 =*/8426).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; - } - case 1053: { - if (!(message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length)) - message[".google.api.resourceDefinition"] = []; - message[".google.api.resourceDefinition"].push($root.google.api.ResourceDescriptor.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; - } - } - if (message[".google.api.resourceDefinition"] != null && message.hasOwnProperty(".google.api.resourceDefinition")) { - if (!Array.isArray(message[".google.api.resourceDefinition"])) - return ".google.api.resourceDefinition: array expected"; - for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) { - var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resourceDefinition"][i]); - if (error) - return ".google.api.resourceDefinition." + 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]); - } - } - 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]); - } - } - 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 - */ - FileOptions.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 = 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.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); - } - return object; - }; - - /** - * Converts this FileOptions to JSON. - * @function toJSON - * @memberof google.protobuf.FileOptions - * @instance - * @returns {Object.} JSON object - */ - FileOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FileOptions - * @function getTypeUrl - * @memberof google.protobuf.FileOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FileOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FileOptions"; - }; - - /** - * OptimizeMode enum. - * @name google.protobuf.FileOptions.OptimizeMode - * @enum {number} - * @property {number} SPEED=1 SPEED value - * @property {number} CODE_SIZE=2 CODE_SIZE value - * @property {number} LITE_RUNTIME=3 LITE_RUNTIME value - */ - FileOptions.OptimizeMode = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[1] = "SPEED"] = 1; - values[valuesById[2] = "CODE_SIZE"] = 2; - values[valuesById[3] = "LITE_RUNTIME"] = 3; - return values; - })(); - - return FileOptions; - })(); - - protobuf.MessageOptions = (function() { - - /** - * Properties of a MessageOptions. - * @memberof google.protobuf - * @interface IMessageOptions - * @property {boolean|null} [messageSetWireFormat] MessageOptions messageSetWireFormat - * @property {boolean|null} [noStandardDescriptorAccessor] MessageOptions noStandardDescriptorAccessor - * @property {boolean|null} [deprecated] MessageOptions deprecated - * @property {boolean|null} [mapEntry] MessageOptions mapEntry - * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] MessageOptions deprecatedLegacyJsonFieldConflicts - * @property {google.protobuf.IFeatureSet|null} [features] MessageOptions features - * @property {Array.|null} [uninterpretedOption] MessageOptions uninterpretedOption - * @property {google.api.IResourceDescriptor|null} [".google.api.resource"] MessageOptions .google.api.resource - */ - - /** - * Constructs a new MessageOptions. - * @memberof google.protobuf - * @classdesc Represents a MessageOptions. - * @implements IMessageOptions - * @constructor - * @param {google.protobuf.IMessageOptions=} [properties] Properties to set - */ - function MessageOptions(properties) { - this.uninterpretedOption = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MessageOptions messageSetWireFormat. - * @member {boolean} messageSetWireFormat - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.messageSetWireFormat = false; - - /** - * MessageOptions noStandardDescriptorAccessor. - * @member {boolean} noStandardDescriptorAccessor - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.noStandardDescriptorAccessor = false; - - /** - * MessageOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.deprecated = false; - - /** - * MessageOptions mapEntry. - * @member {boolean} mapEntry - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.mapEntry = false; - - /** - * MessageOptions deprecatedLegacyJsonFieldConflicts. - * @member {boolean} deprecatedLegacyJsonFieldConflicts - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; - - /** - * MessageOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.features = null; - - /** - * MessageOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * MessageOptions .google.api.resource. - * @member {google.api.IResourceDescriptor|null|undefined} .google.api.resource - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".google.api.resource"] = null; - - /** - * 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(); - if (message[".google.api.resource"] != null && Object.hasOwnProperty.call(message, ".google.api.resource")) - $root.google.api.ResourceDescriptor.encode(message[".google.api.resource"], writer.uint32(/* id 1053, wireType 2 =*/8426).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; - } - case 1053: { - message[".google.api.resource"] = $root.google.api.ResourceDescriptor.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; - } - } - if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) { - var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resource"]); - if (error) - return ".google.api.resource." + error; - } - return null; - }; - - /** - * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.MessageOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.MessageOptions} MessageOptions - */ - MessageOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.MessageOptions) - return object; - var message = new $root.google.protobuf.MessageOptions(); - if (object.messageSetWireFormat != null) - message.messageSetWireFormat = Boolean(object.messageSetWireFormat); - if (object.noStandardDescriptorAccessor != null) - message.noStandardDescriptorAccessor = Boolean(object.noStandardDescriptorAccessor); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.mapEntry != null) - message.mapEntry = Boolean(object.mapEntry); - if (object.deprecatedLegacyJsonFieldConflicts != null) - message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.MessageOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - 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"]); - } - return message; - }; - - /** - * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.MessageOptions - * @static - * @param {google.protobuf.MessageOptions} message MessageOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MessageOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (options.defaults) { - object.messageSetWireFormat = false; - object.noStandardDescriptorAccessor = false; - object.deprecated = false; - object.mapEntry = false; - object.deprecatedLegacyJsonFieldConflicts = false; - object.features = null; - object[".google.api.resource"] = 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.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) - object[".google.api.resource"] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resource"], options); - return object; - }; - - /** - * Converts this MessageOptions to JSON. - * @function toJSON - * @memberof google.protobuf.MessageOptions - * @instance - * @returns {Object.} JSON object - */ - MessageOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MessageOptions - * @function getTypeUrl - * @memberof google.protobuf.MessageOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MessageOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.MessageOptions"; - }; - - return MessageOptions; - })(); - - protobuf.FieldOptions = (function() { - - /** - * Properties of a FieldOptions. - * @memberof google.protobuf - * @interface IFieldOptions - * @property {google.protobuf.FieldOptions.CType|null} [ctype] FieldOptions ctype - * @property {boolean|null} [packed] FieldOptions packed - * @property {google.protobuf.FieldOptions.JSType|null} [jstype] FieldOptions jstype - * @property {boolean|null} [lazy] FieldOptions lazy - * @property {boolean|null} [unverifiedLazy] FieldOptions unverifiedLazy - * @property {boolean|null} [deprecated] FieldOptions deprecated - * @property {boolean|null} [weak] FieldOptions weak - * @property {boolean|null} [debugRedact] FieldOptions debugRedact - * @property {google.protobuf.FieldOptions.OptionRetention|null} [retention] FieldOptions retention - * @property {Array.|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 - * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference - */ - - /** - * Constructs a new FieldOptions. - * @memberof google.protobuf - * @classdesc Represents a FieldOptions. - * @implements IFieldOptions - * @constructor - * @param {google.protobuf.IFieldOptions=} [properties] Properties to set - */ - function FieldOptions(properties) { - this.targets = []; - this.editionDefaults = []; - this.uninterpretedOption = []; - 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]]; - } - - /** - * FieldOptions ctype. - * @member {google.protobuf.FieldOptions.CType} ctype - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.ctype = 0; - - /** - * FieldOptions packed. - * @member {boolean} packed - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.packed = false; - - /** - * FieldOptions jstype. - * @member {google.protobuf.FieldOptions.JSType} jstype - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.jstype = 0; - - /** - * FieldOptions lazy. - * @member {boolean} lazy - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.lazy = false; - - /** - * FieldOptions unverifiedLazy. - * @member {boolean} unverifiedLazy - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.unverifiedLazy = false; - - /** - * FieldOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.deprecated = false; - - /** - * FieldOptions weak. - * @member {boolean} weak - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.weak = false; - - /** - * FieldOptions debugRedact. - * @member {boolean} debugRedact - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.debugRedact = false; - - /** - * FieldOptions retention. - * @member {google.protobuf.FieldOptions.OptionRetention} retention - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.retention = 0; - - /** - * FieldOptions targets. - * @member {Array.} 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; - - /** - * FieldOptions .google.api.resourceReference. - * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".google.api.resourceReference"] = null; - - /** - * Creates a new FieldOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.FieldOptions - * @static - * @param {google.protobuf.IFieldOptions=} [properties] Properties to set - * @returns {google.protobuf.FieldOptions} FieldOptions instance - */ - FieldOptions.create = function create(properties) { - return new FieldOptions(properties); - }; - - /** - * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FieldOptions - * @static - * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.ctype != null && Object.hasOwnProperty.call(message, "ctype")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype); - if (message.packed != null && Object.hasOwnProperty.call(message, "packed")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.lazy != null && Object.hasOwnProperty.call(message, "lazy")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy); - if (message.jstype != null && Object.hasOwnProperty.call(message, "jstype")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype); - if (message.weak != null && Object.hasOwnProperty.call(message, "weak")) - writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak); - if (message.unverifiedLazy != null && Object.hasOwnProperty.call(message, "unverifiedLazy")) - writer.uint32(/* id 15, wireType 0 =*/120).bool(message.unverifiedLazy); - if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) - writer.uint32(/* id 16, wireType 0 =*/128).bool(message.debugRedact); - if (message.retention != null && Object.hasOwnProperty.call(message, "retention")) - writer.uint32(/* id 17, wireType 0 =*/136).int32(message.retention); - if (message.targets != null && message.targets.length) - for (var i = 0; i < message.targets.length; ++i) - writer.uint32(/* id 19, wireType 0 =*/152).int32(message.targets[i]); - if (message.editionDefaults != null && message.editionDefaults.length) - for (var i = 0; i < message.editionDefaults.length; ++i) - $root.google.protobuf.FieldOptions.EditionDefault.encode(message.editionDefaults[i], writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); - if (message.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) - for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) - writer.uint32(/* id 1052, wireType 0 =*/8416).int32(message[".google.api.fieldBehavior"][i]); - if (message[".google.api.resourceReference"] != null && Object.hasOwnProperty.call(message, ".google.api.resourceReference")) - $root.google.api.ResourceReference.encode(message[".google.api.resourceReference"], writer.uint32(/* id 1055, wireType 2 =*/8442).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FieldOptions - * @static - * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FieldOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FieldOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FieldOptions} FieldOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldOptions.decode = function decode(reader, length) { - 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; - } - case 1055: { - message[".google.api.resourceReference"] = $root.google.api.ResourceReference.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FieldOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FieldOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FieldOptions} FieldOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FieldOptions message. - * @function verify - * @memberof google.protobuf.FieldOptions - * @static - * @param {Object.} 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; - } - } - if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) { - var error = $root.google.api.ResourceReference.verify(message[".google.api.resourceReference"]); - if (error) - return ".google.api.resourceReference." + error; - } - return null; - }; - - /** - * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FieldOptions - * @static - * @param {Object.} 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; - } - } - 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"]); - } - 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; - 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.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]; - } - 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; - }; - - /** - * 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 - */ - FieldOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FieldOptions"; - }; - - /** - * CType enum. - * @name google.protobuf.FieldOptions.CType - * @enum {number} - * @property {number} STRING=0 STRING value - * @property {number} CORD=1 CORD value - * @property {number} STRING_PIECE=2 STRING_PIECE value - */ - FieldOptions.CType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STRING"] = 0; - values[valuesById[1] = "CORD"] = 1; - values[valuesById[2] = "STRING_PIECE"] = 2; - return values; - })(); - - /** - * JSType enum. - * @name google.protobuf.FieldOptions.JSType - * @enum {number} - * @property {number} JS_NORMAL=0 JS_NORMAL value - * @property {number} JS_STRING=1 JS_STRING value - * @property {number} JS_NUMBER=2 JS_NUMBER value - */ - FieldOptions.JSType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "JS_NORMAL"] = 0; - values[valuesById[1] = "JS_STRING"] = 1; - values[valuesById[2] = "JS_NUMBER"] = 2; - return values; - })(); - - /** - * OptionRetention enum. - * @name google.protobuf.FieldOptions.OptionRetention - * @enum {number} - * @property {number} RETENTION_UNKNOWN=0 RETENTION_UNKNOWN value - * @property {number} RETENTION_RUNTIME=1 RETENTION_RUNTIME value - * @property {number} RETENTION_SOURCE=2 RETENTION_SOURCE value - */ - FieldOptions.OptionRetention = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "RETENTION_UNKNOWN"] = 0; - values[valuesById[1] = "RETENTION_RUNTIME"] = 1; - values[valuesById[2] = "RETENTION_SOURCE"] = 2; - return values; - })(); - - /** - * OptionTargetType enum. - * @name google.protobuf.FieldOptions.OptionTargetType - * @enum {number} - * @property {number} TARGET_TYPE_UNKNOWN=0 TARGET_TYPE_UNKNOWN value - * @property {number} TARGET_TYPE_FILE=1 TARGET_TYPE_FILE value - * @property {number} TARGET_TYPE_EXTENSION_RANGE=2 TARGET_TYPE_EXTENSION_RANGE value - * @property {number} TARGET_TYPE_MESSAGE=3 TARGET_TYPE_MESSAGE value - * @property {number} TARGET_TYPE_FIELD=4 TARGET_TYPE_FIELD value - * @property {number} TARGET_TYPE_ONEOF=5 TARGET_TYPE_ONEOF value - * @property {number} TARGET_TYPE_ENUM=6 TARGET_TYPE_ENUM value - * @property {number} TARGET_TYPE_ENUM_ENTRY=7 TARGET_TYPE_ENUM_ENTRY value - * @property {number} TARGET_TYPE_SERVICE=8 TARGET_TYPE_SERVICE value - * @property {number} TARGET_TYPE_METHOD=9 TARGET_TYPE_METHOD value - */ - FieldOptions.OptionTargetType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TARGET_TYPE_UNKNOWN"] = 0; - values[valuesById[1] = "TARGET_TYPE_FILE"] = 1; - values[valuesById[2] = "TARGET_TYPE_EXTENSION_RANGE"] = 2; - values[valuesById[3] = "TARGET_TYPE_MESSAGE"] = 3; - values[valuesById[4] = "TARGET_TYPE_FIELD"] = 4; - values[valuesById[5] = "TARGET_TYPE_ONEOF"] = 5; - values[valuesById[6] = "TARGET_TYPE_ENUM"] = 6; - values[valuesById[7] = "TARGET_TYPE_ENUM_ENTRY"] = 7; - values[valuesById[8] = "TARGET_TYPE_SERVICE"] = 8; - values[valuesById[9] = "TARGET_TYPE_METHOD"] = 9; - return values; - })(); - - FieldOptions.EditionDefault = (function() { - - /** - * Properties of an EditionDefault. - * @memberof google.protobuf.FieldOptions - * @interface IEditionDefault - * @property {google.protobuf.Edition|null} [edition] EditionDefault edition - * @property {string|null} [value] EditionDefault value - */ - - /** - * Constructs a new EditionDefault. - * @memberof google.protobuf.FieldOptions - * @classdesc Represents an EditionDefault. - * @implements IEditionDefault - * @constructor - * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set - */ - function EditionDefault(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EditionDefault edition. - * @member {google.protobuf.Edition} edition - * @memberof google.protobuf.FieldOptions.EditionDefault - * @instance - */ - EditionDefault.prototype.edition = 0; - - /** - * EditionDefault value. - * @member {string} value - * @memberof google.protobuf.FieldOptions.EditionDefault - * @instance - */ - EditionDefault.prototype.value = ""; - - /** - * Creates a new EditionDefault instance using the specified properties. - * @function create - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set - * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault instance - */ - EditionDefault.create = function create(properties) { - return new EditionDefault(properties); - }; - - /** - * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EditionDefault.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.value); - if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); - return writer; - }; - - /** - * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EditionDefault.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EditionDefault message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EditionDefault.decode = function decode(reader, length) { - 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.FieldOptions.EditionDefault - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault - */ - EditionDefault.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FieldOptions.EditionDefault) - return object; - var message = new $root.google.protobuf.FieldOptions.EditionDefault(); - switch (object.edition) { - default: - if (typeof object.edition === "number") { - message.edition = object.edition; - break; - } - break; - case "EDITION_UNKNOWN": - case 0: - message.edition = 0; - break; - case "EDITION_PROTO2": - case 998: - message.edition = 998; - break; - case "EDITION_PROTO3": - case 999: - message.edition = 999; - break; - case "EDITION_2023": - case 1000: - message.edition = 1000; - break; - case "EDITION_2024": - case 1001: - message.edition = 1001; - break; - case "EDITION_1_TEST_ONLY": - case 1: - message.edition = 1; - break; - case "EDITION_2_TEST_ONLY": - case 2: - message.edition = 2; - break; - case "EDITION_99997_TEST_ONLY": - case 99997: - message.edition = 99997; - break; - case "EDITION_99998_TEST_ONLY": - case 99998: - message.edition = 99998; - break; - case "EDITION_99999_TEST_ONLY": - case 99999: - message.edition = 99999; - break; - case "EDITION_MAX": - case 2147483647: - message.edition = 2147483647; - break; - } - if (object.value != null) - message.value = String(object.value); - return message; - }; - - /** - * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {google.protobuf.FieldOptions.EditionDefault} message EditionDefault - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EditionDefault.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.value = ""; - object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; - } - if (message.value != null && message.hasOwnProperty("value")) - object.value = message.value; - if (message.edition != null && message.hasOwnProperty("edition")) - object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; - return object; - }; - - /** - * Converts this EditionDefault to JSON. - * @function toJSON - * @memberof google.protobuf.FieldOptions.EditionDefault - * @instance - * @returns {Object.} JSON object - */ - EditionDefault.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EditionDefault - * @function getTypeUrl - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FieldOptions.EditionDefault"; - }; - - return EditionDefault; - })(); - - return FieldOptions; - })(); - - protobuf.OneofOptions = (function() { - - /** - * Properties of an OneofOptions. - * @memberof google.protobuf - * @interface IOneofOptions - * @property {google.protobuf.IFeatureSet|null} [features] OneofOptions features - * @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 features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.OneofOptions - * @instance - */ - OneofOptions.prototype.features = null; - - /** - * 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.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.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.OneofOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.OneofOptions - * @static - * @param {google.protobuf.OneofOptions} message OneofOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OneofOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (options.defaults) - object.features = null; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - return object; - }; - - /** - * Converts this OneofOptions to JSON. - * @function toJSON - * @memberof google.protobuf.OneofOptions - * @instance - * @returns {Object.} JSON object - */ - OneofOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for OneofOptions - * @function getTypeUrl - * @memberof google.protobuf.OneofOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - OneofOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.OneofOptions"; - }; - - return OneofOptions; - })(); - - protobuf.EnumOptions = (function() { - - /** - * Properties of an EnumOptions. - * @memberof google.protobuf - * @interface IEnumOptions - * @property {boolean|null} [allowAlias] EnumOptions allowAlias - * @property {boolean|null} [deprecated] EnumOptions deprecated - * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] EnumOptions deprecatedLegacyJsonFieldConflicts - * @property {google.protobuf.IFeatureSet|null} [features] EnumOptions features - * @property {Array.|null} [uninterpretedOption] EnumOptions uninterpretedOption - */ - - /** - * Constructs a new EnumOptions. - * @memberof google.protobuf - * @classdesc Represents an EnumOptions. - * @implements IEnumOptions - * @constructor - * @param {google.protobuf.IEnumOptions=} [properties] Properties to set - */ - function EnumOptions(properties) { - this.uninterpretedOption = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnumOptions allowAlias. - * @member {boolean} allowAlias - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.allowAlias = false; - - /** - * EnumOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.deprecated = false; - - /** - * EnumOptions deprecatedLegacyJsonFieldConflicts. - * @member {boolean} deprecatedLegacyJsonFieldConflicts - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; - - /** - * EnumOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.features = null; - - /** - * EnumOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * Creates a new EnumOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.EnumOptions - * @static - * @param {google.protobuf.IEnumOptions=} [properties] Properties to set - * @returns {google.protobuf.EnumOptions} EnumOptions instance - */ - EnumOptions.create = function create(properties) { - return new EnumOptions(properties); - }; - - /** - * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumOptions - * @static - * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.allowAlias != null && Object.hasOwnProperty.call(message, "allowAlias")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.deprecatedLegacyJsonFieldConflicts); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumOptions - * @static - * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumOptions} EnumOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumOptions.decode = function decode(reader, length) { - 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 message; - }; - - /** - * Decodes an EnumOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumOptions} EnumOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumOptions message. - * @function verify - * @memberof google.protobuf.EnumOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) - if (typeof message.allowAlias !== "boolean") - return "allowAlias: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) - if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") - return "deprecatedLegacyJsonFieldConflicts: boolean expected"; - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - return null; - }; - - /** - * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumOptions} EnumOptions - */ - EnumOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumOptions) - return object; - var message = new $root.google.protobuf.EnumOptions(); - if (object.allowAlias != null) - message.allowAlias = Boolean(object.allowAlias); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.deprecatedLegacyJsonFieldConflicts != null) - message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.EnumOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumOptions - * @static - * @param {google.protobuf.EnumOptions} message EnumOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (options.defaults) { - object.allowAlias = false; - object.deprecated = false; - object.deprecatedLegacyJsonFieldConflicts = false; - object.features = null; - } - if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) - object.allowAlias = message.allowAlias; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) - object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - return object; - }; - - /** - * Converts this EnumOptions to JSON. - * @function toJSON - * @memberof google.protobuf.EnumOptions - * @instance - * @returns {Object.} JSON object - */ - EnumOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnumOptions - * @function getTypeUrl - * @memberof google.protobuf.EnumOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnumOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.EnumOptions"; - }; - - return EnumOptions; - })(); - - protobuf.EnumValueOptions = (function() { - - /** - * Properties of an EnumValueOptions. - * @memberof google.protobuf - * @interface IEnumValueOptions - * @property {boolean|null} [deprecated] EnumValueOptions deprecated - * @property {google.protobuf.IFeatureSet|null} [features] EnumValueOptions features - * @property {boolean|null} [debugRedact] EnumValueOptions debugRedact - * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption - */ - - /** - * Constructs a new EnumValueOptions. - * @memberof google.protobuf - * @classdesc Represents an EnumValueOptions. - * @implements IEnumValueOptions - * @constructor - * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set - */ - function EnumValueOptions(properties) { - this.uninterpretedOption = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnumValueOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.EnumValueOptions - * @instance - */ - EnumValueOptions.prototype.deprecated = false; - - /** - * EnumValueOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.EnumValueOptions - * @instance - */ - EnumValueOptions.prototype.features = null; - - /** - * EnumValueOptions debugRedact. - * @member {boolean} debugRedact - * @memberof google.protobuf.EnumValueOptions - * @instance - */ - EnumValueOptions.prototype.debugRedact = false; - - /** - * EnumValueOptions 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.EnumValueOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions - */ - EnumValueOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumValueOptions) - return object; - var message = new $root.google.protobuf.EnumValueOptions(); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.EnumValueOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.debugRedact != null) - message.debugRedact = Boolean(object.debugRedact); - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {google.protobuf.EnumValueOptions} message EnumValueOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumValueOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (options.defaults) { - object.deprecated = false; - object.features = null; - object.debugRedact = false; - } - 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 EnumValueOptions to JSON. - * @function toJSON - * @memberof google.protobuf.EnumValueOptions - * @instance - * @returns {Object.} JSON object - */ - EnumValueOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnumValueOptions - * @function getTypeUrl - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnumValueOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.EnumValueOptions"; - }; - - return EnumValueOptions; - })(); - - protobuf.ServiceOptions = (function() { - - /** - * Properties of a ServiceOptions. - * @memberof google.protobuf - * @interface IServiceOptions - * @property {google.protobuf.IFeatureSet|null} [features] ServiceOptions features - * @property {boolean|null} [deprecated] ServiceOptions deprecated - * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption - * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost - * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes - * @property {string|null} [".google.api.apiVersion"] ServiceOptions .google.api.apiVersion - */ - - /** - * Constructs a new ServiceOptions. - * @memberof google.protobuf - * @classdesc Represents a ServiceOptions. - * @implements IServiceOptions - * @constructor - * @param {google.protobuf.IServiceOptions=} [properties] Properties to set - */ - function ServiceOptions(properties) { - this.uninterpretedOption = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ServiceOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype.features = null; - - /** - * ServiceOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype.deprecated = false; - - /** - * ServiceOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * ServiceOptions .google.api.defaultHost. - * @member {string} .google.api.defaultHost - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype[".google.api.defaultHost"] = ""; - - /** - * ServiceOptions .google.api.oauthScopes. - * @member {string} .google.api.oauthScopes - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype[".google.api.oauthScopes"] = ""; - - /** - * ServiceOptions .google.api.apiVersion. - * @member {string} .google.api.apiVersion - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype[".google.api.apiVersion"] = ""; - - /** - * Creates a new ServiceOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.ServiceOptions - * @static - * @param {google.protobuf.IServiceOptions=} [properties] Properties to set - * @returns {google.protobuf.ServiceOptions} ServiceOptions instance - */ - ServiceOptions.create = function create(properties) { - return new ServiceOptions(properties); - }; - - /** - * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.ServiceOptions - * @static - * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 34, wireType 2 =*/274).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - 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"]); - if (message[".google.api.apiVersion"] != null && Object.hasOwnProperty.call(message, ".google.api.apiVersion")) - writer.uint32(/* id 525000001, wireType 2 =*/4200000010).string(message[".google.api.apiVersion"]); - return writer; - }; - - /** - * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.ServiceOptions - * @static - * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ServiceOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.ServiceOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.ServiceOptions} ServiceOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceOptions.decode = function decode(reader, length) { - 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; - } - case 525000001: { - message[".google.api.apiVersion"] = 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 - */ - ServiceOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ServiceOptions message. - * @function verify - * @memberof google.protobuf.ServiceOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ServiceOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - 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"; - if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) - if (!$util.isString(message[".google.api.apiVersion"])) - return ".google.api.apiVersion: string expected"; - return null; - }; - - /** - * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.ServiceOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.ServiceOptions} ServiceOptions - */ - ServiceOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ServiceOptions) - return object; - var message = new $root.google.protobuf.ServiceOptions(); - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.ServiceOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - 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"]); - if (object[".google.api.apiVersion"] != null) - message[".google.api.apiVersion"] = String(object[".google.api.apiVersion"]); - return message; - }; - - /** - * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.ServiceOptions - * @static - * @param {google.protobuf.ServiceOptions} message ServiceOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ServiceOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (options.defaults) { - object.deprecated = false; - object.features = null; - object[".google.api.defaultHost"] = ""; - object[".google.api.oauthScopes"] = ""; - object[".google.api.apiVersion"] = ""; - } - 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"]; - if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) - object[".google.api.apiVersion"] = message[".google.api.apiVersion"]; - return object; - }; - - /** - * Converts this ServiceOptions to JSON. - * @function toJSON - * @memberof google.protobuf.ServiceOptions - * @instance - * @returns {Object.} JSON object - */ - ServiceOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ServiceOptions - * @function getTypeUrl - * @memberof google.protobuf.ServiceOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ServiceOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.ServiceOptions"; - }; - - return ServiceOptions; - })(); - - protobuf.MethodOptions = (function() { - - /** - * Properties of a MethodOptions. - * @memberof google.protobuf - * @interface IMethodOptions - * @property {boolean|null} [deprecated] MethodOptions deprecated - * @property {google.protobuf.MethodOptions.IdempotencyLevel|null} [idempotencyLevel] MethodOptions idempotencyLevel - * @property {google.protobuf.IFeatureSet|null} [features] MethodOptions features - * @property {Array.|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 MethodOptions. - * @memberof google.protobuf - * @classdesc Represents a MethodOptions. - * @implements IMethodOptions - * @constructor - * @param {google.protobuf.IMethodOptions=} [properties] Properties to set - */ - 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]]; - } - - /** - * MethodOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype.deprecated = false; - - /** - * MethodOptions idempotencyLevel. - * @member {google.protobuf.MethodOptions.IdempotencyLevel} idempotencyLevel - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype.idempotencyLevel = 0; - - /** - * MethodOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype.features = null; - - /** - * MethodOptions uninterpretedOption. - * @member {Array.} 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.MethodOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.MethodOptions} MethodOptions - */ - MethodOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.MethodOptions) - return object; - var message = new $root.google.protobuf.MethodOptions(); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - switch (object.idempotencyLevel) { - default: - if (typeof object.idempotencyLevel === "number") { - message.idempotencyLevel = object.idempotencyLevel; - break; - } - break; - case "IDEMPOTENCY_UNKNOWN": - case 0: - message.idempotencyLevel = 0; - break; - case "NO_SIDE_EFFECTS": - case 1: - message.idempotencyLevel = 1; - break; - case "IDEMPOTENT": - case 2: - message.idempotencyLevel = 2; - break; - } - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.MethodOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - 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 MethodOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.MethodOptions - * @static - * @param {google.protobuf.MethodOptions} message MethodOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MethodOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - 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 MethodOptions to JSON. - * @function toJSON - * @memberof google.protobuf.MethodOptions - * @instance - * @returns {Object.} JSON object - */ - MethodOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MethodOptions - * @function getTypeUrl - * @memberof google.protobuf.MethodOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MethodOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.MethodOptions"; - }; - - /** - * IdempotencyLevel enum. - * @name google.protobuf.MethodOptions.IdempotencyLevel - * @enum {number} - * @property {number} IDEMPOTENCY_UNKNOWN=0 IDEMPOTENCY_UNKNOWN value - * @property {number} NO_SIDE_EFFECTS=1 NO_SIDE_EFFECTS value - * @property {number} IDEMPOTENT=2 IDEMPOTENT value - */ - MethodOptions.IdempotencyLevel = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "IDEMPOTENCY_UNKNOWN"] = 0; - values[valuesById[1] = "NO_SIDE_EFFECTS"] = 1; - values[valuesById[2] = "IDEMPOTENT"] = 2; - return values; - })(); - - return MethodOptions; - })(); - - protobuf.UninterpretedOption = (function() { - - /** - * Properties of an UninterpretedOption. - * @memberof google.protobuf - * @interface IUninterpretedOption - * @property {Array.|null} [name] UninterpretedOption name - * @property {string|null} [identifierValue] UninterpretedOption identifierValue - * @property {number|Long|null} [positiveIntValue] UninterpretedOption positiveIntValue - * @property {number|Long|null} [negativeIntValue] UninterpretedOption negativeIntValue - * @property {number|null} [doubleValue] UninterpretedOption doubleValue - * @property {Uint8Array|null} [stringValue] UninterpretedOption stringValue - * @property {string|null} [aggregateValue] UninterpretedOption aggregateValue - */ - - /** - * Constructs a new UninterpretedOption. - * @memberof google.protobuf - * @classdesc Represents an UninterpretedOption. - * @implements IUninterpretedOption - * @constructor - * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set - */ - function UninterpretedOption(properties) { - this.name = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UninterpretedOption name. - * @member {Array.} name - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.name = $util.emptyArray; - - /** - * UninterpretedOption identifierValue. - * @member {string} identifierValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.identifierValue = ""; - - /** - * UninterpretedOption positiveIntValue. - * @member {number|Long} positiveIntValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * UninterpretedOption negativeIntValue. - * @member {number|Long} negativeIntValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.negativeIntValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * UninterpretedOption doubleValue. - * @member {number} doubleValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.doubleValue = 0; - - /** - * UninterpretedOption stringValue. - * @member {Uint8Array} stringValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.stringValue = $util.newBuffer([]); - - /** - * UninterpretedOption aggregateValue. - * @member {string} aggregateValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.aggregateValue = ""; - - /** - * Creates a new UninterpretedOption instance using the specified properties. - * @function create - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption instance - */ - UninterpretedOption.create = function create(properties) { - return new UninterpretedOption(properties); - }; - - /** - * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. - * @function encode - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UninterpretedOption.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && message.name.length) - for (var i = 0; i < message.name.length; ++i) - $root.google.protobuf.UninterpretedOption.NamePart.encode(message.name[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.identifierValue != null && Object.hasOwnProperty.call(message, "identifierValue")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue); - if (message.positiveIntValue != null && Object.hasOwnProperty.call(message, "positiveIntValue")) - writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue); - if (message.negativeIntValue != null && Object.hasOwnProperty.call(message, "negativeIntValue")) - writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue); - if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) - writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue); - if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) - writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue); - if (message.aggregateValue != null && Object.hasOwnProperty.call(message, "aggregateValue")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue); - return writer; - }; - - /** - * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UninterpretedOption message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UninterpretedOption.decode = function decode(reader, length) { - 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 message; - }; - - /** - * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UninterpretedOption.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UninterpretedOption message. - * @function verify - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UninterpretedOption.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) { - if (!Array.isArray(message.name)) - return "name: array expected"; - for (var i = 0; i < message.name.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.NamePart.verify(message.name[i]); - if (error) - return "name." + error; - } - } - if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) - if (!$util.isString(message.identifierValue)) - return "identifierValue: string expected"; - if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) - if (!$util.isInteger(message.positiveIntValue) && !(message.positiveIntValue && $util.isInteger(message.positiveIntValue.low) && $util.isInteger(message.positiveIntValue.high))) - return "positiveIntValue: integer|Long expected"; - if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) - if (!$util.isInteger(message.negativeIntValue) && !(message.negativeIntValue && $util.isInteger(message.negativeIntValue.low) && $util.isInteger(message.negativeIntValue.high))) - return "negativeIntValue: integer|Long expected"; - if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) - if (typeof message.doubleValue !== "number") - return "doubleValue: number expected"; - if (message.stringValue != null && message.hasOwnProperty("stringValue")) - if (!(message.stringValue && typeof message.stringValue.length === "number" || $util.isString(message.stringValue))) - return "stringValue: buffer expected"; - if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) - if (!$util.isString(message.aggregateValue)) - return "aggregateValue: string expected"; - return null; - }; - - /** - * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption - */ - UninterpretedOption.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.UninterpretedOption) - return object; - var message = new $root.google.protobuf.UninterpretedOption(); - if (object.name) { - if (!Array.isArray(object.name)) - throw TypeError(".google.protobuf.UninterpretedOption.name: array expected"); - message.name = []; - for (var i = 0; i < object.name.length; ++i) { - if (typeof object.name[i] !== "object") - throw TypeError(".google.protobuf.UninterpretedOption.name: object expected"); - message.name[i] = $root.google.protobuf.UninterpretedOption.NamePart.fromObject(object.name[i]); - } - } - if (object.identifierValue != null) - message.identifierValue = String(object.identifierValue); - if (object.positiveIntValue != null) - if ($util.Long) - (message.positiveIntValue = $util.Long.fromValue(object.positiveIntValue)).unsigned = true; - else if (typeof object.positiveIntValue === "string") - message.positiveIntValue = parseInt(object.positiveIntValue, 10); - else if (typeof object.positiveIntValue === "number") - message.positiveIntValue = object.positiveIntValue; - else if (typeof object.positiveIntValue === "object") - message.positiveIntValue = new $util.LongBits(object.positiveIntValue.low >>> 0, object.positiveIntValue.high >>> 0).toNumber(true); - if (object.negativeIntValue != null) - if ($util.Long) - (message.negativeIntValue = $util.Long.fromValue(object.negativeIntValue)).unsigned = false; - else if (typeof object.negativeIntValue === "string") - message.negativeIntValue = parseInt(object.negativeIntValue, 10); - else if (typeof object.negativeIntValue === "number") - message.negativeIntValue = object.negativeIntValue; - else if (typeof object.negativeIntValue === "object") - message.negativeIntValue = new $util.LongBits(object.negativeIntValue.low >>> 0, object.negativeIntValue.high >>> 0).toNumber(); - if (object.doubleValue != null) - message.doubleValue = Number(object.doubleValue); - if (object.stringValue != null) - if (typeof object.stringValue === "string") - $util.base64.decode(object.stringValue, message.stringValue = $util.newBuffer($util.base64.length(object.stringValue)), 0); - else if (object.stringValue.length >= 0) - message.stringValue = object.stringValue; - if (object.aggregateValue != null) - message.aggregateValue = String(object.aggregateValue); - return message; - }; - - /** - * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {google.protobuf.UninterpretedOption} message UninterpretedOption - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UninterpretedOption.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.name = []; - if (options.defaults) { - object.identifierValue = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.positiveIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.positiveIntValue = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.negativeIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.negativeIntValue = options.longs === String ? "0" : 0; - object.doubleValue = 0; - if (options.bytes === String) - object.stringValue = ""; - else { - object.stringValue = []; - if (options.bytes !== Array) - object.stringValue = $util.newBuffer(object.stringValue); - } - object.aggregateValue = ""; - } - if (message.name && message.name.length) { - object.name = []; - for (var j = 0; j < message.name.length; ++j) - object.name[j] = $root.google.protobuf.UninterpretedOption.NamePart.toObject(message.name[j], options); - } - if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) - object.identifierValue = message.identifierValue; - if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) - if (typeof message.positiveIntValue === "number") - object.positiveIntValue = options.longs === String ? String(message.positiveIntValue) : message.positiveIntValue; - else - object.positiveIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.positiveIntValue) : options.longs === Number ? new $util.LongBits(message.positiveIntValue.low >>> 0, message.positiveIntValue.high >>> 0).toNumber(true) : message.positiveIntValue; - if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) - if (typeof message.negativeIntValue === "number") - object.negativeIntValue = options.longs === String ? String(message.negativeIntValue) : message.negativeIntValue; - else - object.negativeIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.negativeIntValue) : options.longs === Number ? new $util.LongBits(message.negativeIntValue.low >>> 0, message.negativeIntValue.high >>> 0).toNumber() : message.negativeIntValue; - if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) - object.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue; - if (message.stringValue != null && message.hasOwnProperty("stringValue")) - object.stringValue = options.bytes === String ? $util.base64.encode(message.stringValue, 0, message.stringValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.stringValue) : message.stringValue; - if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) - object.aggregateValue = message.aggregateValue; - return object; - }; - - /** - * Converts this UninterpretedOption to JSON. - * @function toJSON - * @memberof google.protobuf.UninterpretedOption - * @instance - * @returns {Object.} JSON object - */ - UninterpretedOption.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UninterpretedOption - * @function getTypeUrl - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UninterpretedOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.UninterpretedOption"; - }; - - UninterpretedOption.NamePart = (function() { - - /** - * Properties of a NamePart. - * @memberof google.protobuf.UninterpretedOption - * @interface INamePart - * @property {string} namePart NamePart namePart - * @property {boolean} isExtension NamePart isExtension - */ - - /** - * Constructs a new NamePart. - * @memberof google.protobuf.UninterpretedOption - * @classdesc Represents a NamePart. - * @implements INamePart - * @constructor - * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set - */ - function NamePart(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * NamePart namePart. - * @member {string} namePart - * @memberof google.protobuf.UninterpretedOption.NamePart - * @instance - */ - NamePart.prototype.namePart = ""; - - /** - * NamePart isExtension. - * @member {boolean} isExtension - * @memberof google.protobuf.UninterpretedOption.NamePart - * @instance - */ - NamePart.prototype.isExtension = false; - - /** - * Creates a new NamePart instance using the specified properties. - * @function create - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart instance - */ - NamePart.create = function create(properties) { - return new NamePart(properties); - }; - - /** - * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. - * @function encode - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NamePart.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - writer.uint32(/* id 1, wireType 2 =*/10).string(message.namePart); - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isExtension); - return writer; - }; - - /** - * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NamePart.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a NamePart message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NamePart.decode = function decode(reader, length) { - 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.FeatureSet = (function() { - - /** - * Properties of a FeatureSet. - * @memberof google.protobuf - * @interface IFeatureSet - * @property {google.protobuf.FeatureSet.FieldPresence|null} [fieldPresence] FeatureSet fieldPresence - * @property {google.protobuf.FeatureSet.EnumType|null} [enumType] FeatureSet enumType - * @property {google.protobuf.FeatureSet.RepeatedFieldEncoding|null} [repeatedFieldEncoding] FeatureSet repeatedFieldEncoding - * @property {google.protobuf.FeatureSet.Utf8Validation|null} [utf8Validation] FeatureSet utf8Validation - * @property {google.protobuf.FeatureSet.MessageEncoding|null} [messageEncoding] FeatureSet messageEncoding - * @property {google.protobuf.FeatureSet.JsonFormat|null} [jsonFormat] FeatureSet jsonFormat - */ - - /** - * Constructs a new FeatureSet. - * @memberof google.protobuf - * @classdesc Represents a FeatureSet. - * @implements IFeatureSet - * @constructor - * @param {google.protobuf.IFeatureSet=} [properties] Properties to set - */ - function FeatureSet(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FeatureSet fieldPresence. - * @member {google.protobuf.FeatureSet.FieldPresence} fieldPresence - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.fieldPresence = 0; - - /** - * FeatureSet enumType. - * @member {google.protobuf.FeatureSet.EnumType} enumType - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.enumType = 0; - - /** - * FeatureSet repeatedFieldEncoding. - * @member {google.protobuf.FeatureSet.RepeatedFieldEncoding} repeatedFieldEncoding - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.repeatedFieldEncoding = 0; - - /** - * FeatureSet utf8Validation. - * @member {google.protobuf.FeatureSet.Utf8Validation} utf8Validation - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.utf8Validation = 0; - - /** - * FeatureSet messageEncoding. - * @member {google.protobuf.FeatureSet.MessageEncoding} messageEncoding - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.messageEncoding = 0; - - /** - * FeatureSet jsonFormat. - * @member {google.protobuf.FeatureSet.JsonFormat} jsonFormat - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.jsonFormat = 0; - - /** - * Creates a new FeatureSet instance using the specified properties. - * @function create - * @memberof google.protobuf.FeatureSet - * @static - * @param {google.protobuf.IFeatureSet=} [properties] Properties to set - * @returns {google.protobuf.FeatureSet} FeatureSet instance - */ - FeatureSet.create = function create(properties) { - return new FeatureSet(properties); - }; - - /** - * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FeatureSet - * @static - * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSet.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.fieldPresence != null && Object.hasOwnProperty.call(message, "fieldPresence")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.fieldPresence); - if (message.enumType != null && Object.hasOwnProperty.call(message, "enumType")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.enumType); - if (message.repeatedFieldEncoding != null && Object.hasOwnProperty.call(message, "repeatedFieldEncoding")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.repeatedFieldEncoding); - if (message.utf8Validation != null && Object.hasOwnProperty.call(message, "utf8Validation")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.utf8Validation); - if (message.messageEncoding != null && Object.hasOwnProperty.call(message, "messageEncoding")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.messageEncoding); - if (message.jsonFormat != null && Object.hasOwnProperty.call(message, "jsonFormat")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jsonFormat); - return writer; - }; - - /** - * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FeatureSet - * @static - * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSet.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FeatureSet message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FeatureSet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FeatureSet} FeatureSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSet.decode = function decode(reader, length) { - 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 message; - }; - - /** - * Decodes a FeatureSet message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FeatureSet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FeatureSet} FeatureSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSet.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FeatureSet message. - * @function verify - * @memberof google.protobuf.FeatureSet - * @static - * @param {Object.} 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 FeatureSet message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FeatureSet - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FeatureSet} FeatureSet - */ - FeatureSet.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FeatureSet) - return object; - var message = new $root.google.protobuf.FeatureSet(); - switch (object.fieldPresence) { - default: - if (typeof object.fieldPresence === "number") { - message.fieldPresence = object.fieldPresence; - break; - } - break; - case "FIELD_PRESENCE_UNKNOWN": - case 0: - message.fieldPresence = 0; - break; - case "EXPLICIT": - case 1: - message.fieldPresence = 1; - break; - case "IMPLICIT": - case 2: - message.fieldPresence = 2; - break; - case "LEGACY_REQUIRED": - case 3: - message.fieldPresence = 3; - break; - } - switch (object.enumType) { - default: - if (typeof object.enumType === "number") { - message.enumType = object.enumType; - break; - } - break; - case "ENUM_TYPE_UNKNOWN": - case 0: - message.enumType = 0; - break; - case "OPEN": - case 1: - message.enumType = 1; - break; - case "CLOSED": - case 2: - message.enumType = 2; - break; - } - switch (object.repeatedFieldEncoding) { - default: - if (typeof object.repeatedFieldEncoding === "number") { - message.repeatedFieldEncoding = object.repeatedFieldEncoding; - break; - } - break; - case "REPEATED_FIELD_ENCODING_UNKNOWN": - case 0: - message.repeatedFieldEncoding = 0; - break; - case "PACKED": - case 1: - message.repeatedFieldEncoding = 1; - break; - case "EXPANDED": - case 2: - message.repeatedFieldEncoding = 2; - break; - } - switch (object.utf8Validation) { - default: - if (typeof object.utf8Validation === "number") { - message.utf8Validation = object.utf8Validation; - break; - } - break; - case "UTF8_VALIDATION_UNKNOWN": - case 0: - message.utf8Validation = 0; - break; - case "VERIFY": - case 2: - message.utf8Validation = 2; - break; - case "NONE": - case 3: - message.utf8Validation = 3; - break; - } - switch (object.messageEncoding) { - default: - if (typeof object.messageEncoding === "number") { - message.messageEncoding = object.messageEncoding; - break; - } - break; - case "MESSAGE_ENCODING_UNKNOWN": - case 0: - message.messageEncoding = 0; - break; - case "LENGTH_PREFIXED": - case 1: - message.messageEncoding = 1; - break; - case "DELIMITED": - case 2: - message.messageEncoding = 2; - break; - } - switch (object.jsonFormat) { - default: - if (typeof object.jsonFormat === "number") { - message.jsonFormat = object.jsonFormat; - break; - } - break; - case "JSON_FORMAT_UNKNOWN": - case 0: - message.jsonFormat = 0; - break; - case "ALLOW": - case 1: - message.jsonFormat = 1; - break; - case "LEGACY_BEST_EFFORT": - case 2: - message.jsonFormat = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FeatureSet - * @static - * @param {google.protobuf.FeatureSet} message FeatureSet - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FeatureSet.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.fieldPresence = options.enums === String ? "FIELD_PRESENCE_UNKNOWN" : 0; - object.enumType = options.enums === String ? "ENUM_TYPE_UNKNOWN" : 0; - object.repeatedFieldEncoding = options.enums === String ? "REPEATED_FIELD_ENCODING_UNKNOWN" : 0; - object.utf8Validation = options.enums === String ? "UTF8_VALIDATION_UNKNOWN" : 0; - object.messageEncoding = options.enums === String ? "MESSAGE_ENCODING_UNKNOWN" : 0; - object.jsonFormat = options.enums === String ? "JSON_FORMAT_UNKNOWN" : 0; - } - 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 FeatureSet to JSON. - * @function toJSON - * @memberof google.protobuf.FeatureSet - * @instance - * @returns {Object.} JSON object - */ - FeatureSet.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FeatureSet - * @function getTypeUrl - * @memberof google.protobuf.FeatureSet - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FeatureSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FeatureSet"; - }; - - /** - * FieldPresence enum. - * @name google.protobuf.FeatureSet.FieldPresence - * @enum {number} - * @property {number} FIELD_PRESENCE_UNKNOWN=0 FIELD_PRESENCE_UNKNOWN value - * @property {number} EXPLICIT=1 EXPLICIT value - * @property {number} IMPLICIT=2 IMPLICIT value - * @property {number} LEGACY_REQUIRED=3 LEGACY_REQUIRED value - */ - FeatureSet.FieldPresence = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "FIELD_PRESENCE_UNKNOWN"] = 0; - values[valuesById[1] = "EXPLICIT"] = 1; - values[valuesById[2] = "IMPLICIT"] = 2; - values[valuesById[3] = "LEGACY_REQUIRED"] = 3; - return values; - })(); - - /** - * EnumType enum. - * @name google.protobuf.FeatureSet.EnumType - * @enum {number} - * @property {number} ENUM_TYPE_UNKNOWN=0 ENUM_TYPE_UNKNOWN value - * @property {number} OPEN=1 OPEN value - * @property {number} CLOSED=2 CLOSED value - */ - FeatureSet.EnumType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ENUM_TYPE_UNKNOWN"] = 0; - values[valuesById[1] = "OPEN"] = 1; - values[valuesById[2] = "CLOSED"] = 2; - return values; - })(); - - /** - * RepeatedFieldEncoding enum. - * @name google.protobuf.FeatureSet.RepeatedFieldEncoding - * @enum {number} - * @property {number} REPEATED_FIELD_ENCODING_UNKNOWN=0 REPEATED_FIELD_ENCODING_UNKNOWN value - * @property {number} PACKED=1 PACKED value - * @property {number} EXPANDED=2 EXPANDED value - */ - FeatureSet.RepeatedFieldEncoding = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "REPEATED_FIELD_ENCODING_UNKNOWN"] = 0; - values[valuesById[1] = "PACKED"] = 1; - values[valuesById[2] = "EXPANDED"] = 2; - return values; - })(); - - /** - * Utf8Validation enum. - * @name google.protobuf.FeatureSet.Utf8Validation - * @enum {number} - * @property {number} UTF8_VALIDATION_UNKNOWN=0 UTF8_VALIDATION_UNKNOWN value - * @property {number} VERIFY=2 VERIFY value - * @property {number} NONE=3 NONE value - */ - FeatureSet.Utf8Validation = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "UTF8_VALIDATION_UNKNOWN"] = 0; - values[valuesById[2] = "VERIFY"] = 2; - values[valuesById[3] = "NONE"] = 3; - return values; - })(); - - /** - * MessageEncoding enum. - * @name google.protobuf.FeatureSet.MessageEncoding - * @enum {number} - * @property {number} MESSAGE_ENCODING_UNKNOWN=0 MESSAGE_ENCODING_UNKNOWN value - * @property {number} LENGTH_PREFIXED=1 LENGTH_PREFIXED value - * @property {number} DELIMITED=2 DELIMITED value - */ - FeatureSet.MessageEncoding = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "MESSAGE_ENCODING_UNKNOWN"] = 0; - values[valuesById[1] = "LENGTH_PREFIXED"] = 1; - values[valuesById[2] = "DELIMITED"] = 2; - return values; - })(); - - /** - * JsonFormat enum. - * @name google.protobuf.FeatureSet.JsonFormat - * @enum {number} - * @property {number} JSON_FORMAT_UNKNOWN=0 JSON_FORMAT_UNKNOWN value - * @property {number} ALLOW=1 ALLOW value - * @property {number} LEGACY_BEST_EFFORT=2 LEGACY_BEST_EFFORT value - */ - FeatureSet.JsonFormat = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "JSON_FORMAT_UNKNOWN"] = 0; - values[valuesById[1] = "ALLOW"] = 1; - values[valuesById[2] = "LEGACY_BEST_EFFORT"] = 2; - return values; - })(); - - return FeatureSet; - })(); - - protobuf.FeatureSetDefaults = (function() { - - /** - * Properties of a FeatureSetDefaults. - * @memberof google.protobuf - * @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 FeatureSetDefaults. - * @memberof google.protobuf - * @classdesc Represents a FeatureSetDefaults. - * @implements IFeatureSetDefaults - * @constructor - * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set - */ - function FeatureSetDefaults(properties) { - this.defaults = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FeatureSetDefaults defaults. - * @member {Array.} defaults - * @memberof google.protobuf.FeatureSetDefaults - * @instance - */ - FeatureSetDefaults.prototype.defaults = $util.emptyArray; - - /** - * FeatureSetDefaults minimumEdition. - * @member {google.protobuf.Edition} minimumEdition - * @memberof google.protobuf.FeatureSetDefaults - * @instance - */ - FeatureSetDefaults.prototype.minimumEdition = 0; - - /** - * FeatureSetDefaults maximumEdition. - * @member {google.protobuf.Edition} maximumEdition - * @memberof google.protobuf.FeatureSetDefaults - * @instance - */ - FeatureSetDefaults.prototype.maximumEdition = 0; - - /** - * Creates a new FeatureSetDefaults instance using the specified properties. - * @function create - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set - * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults instance - */ - FeatureSetDefaults.create = function create(properties) { - return new FeatureSetDefaults(properties); - }; - - /** - * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSetDefaults.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.defaults != null && message.defaults.length) - for (var i = 0; i < message.defaults.length; ++i) - $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.encode(message.defaults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.minimumEdition != null && Object.hasOwnProperty.call(message, "minimumEdition")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.minimumEdition); - if (message.maximumEdition != null && Object.hasOwnProperty.call(message, "maximumEdition")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.maximumEdition); - return writer; - }; - - /** - * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSetDefaults.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FeatureSetDefaults message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSetDefaults.decode = function decode(reader, length) { - 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.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 FeatureSetDefaults message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {google.protobuf.FeatureSetDefaults} message FeatureSetDefaults - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FeatureSetDefaults.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.defaults = []; - if (options.defaults) { - object.minimumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; - object.maximumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; - } - if (message.defaults && message.defaults.length) { - object.defaults = []; - for (var j = 0; j < message.defaults.length; ++j) - object.defaults[j] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.toObject(message.defaults[j], options); - } - if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition")) - object.minimumEdition = options.enums === String ? $root.google.protobuf.Edition[message.minimumEdition] === undefined ? message.minimumEdition : $root.google.protobuf.Edition[message.minimumEdition] : message.minimumEdition; - if (message.maximumEdition != null && message.hasOwnProperty("maximumEdition")) - object.maximumEdition = options.enums === String ? $root.google.protobuf.Edition[message.maximumEdition] === undefined ? message.maximumEdition : $root.google.protobuf.Edition[message.maximumEdition] : message.maximumEdition; - return object; - }; - - /** - * Converts this FeatureSetDefaults to JSON. - * @function toJSON - * @memberof google.protobuf.FeatureSetDefaults - * @instance - * @returns {Object.} JSON object - */ - FeatureSetDefaults.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FeatureSetDefaults - * @function getTypeUrl - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FeatureSetDefaults.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults"; - }; - - FeatureSetDefaults.FeatureSetEditionDefault = (function() { - - /** - * Properties of a FeatureSetEditionDefault. - * @memberof google.protobuf.FeatureSetDefaults - * @interface IFeatureSetEditionDefault - * @property {google.protobuf.Edition|null} [edition] FeatureSetEditionDefault edition - * @property {google.protobuf.IFeatureSet|null} [features] FeatureSetEditionDefault features - */ - - /** - * Constructs a new FeatureSetEditionDefault. - * @memberof google.protobuf.FeatureSetDefaults - * @classdesc Represents a FeatureSetEditionDefault. - * @implements IFeatureSetEditionDefault - * @constructor - * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set - */ - function FeatureSetEditionDefault(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FeatureSetEditionDefault edition. - * @member {google.protobuf.Edition} edition - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @instance - */ - FeatureSetEditionDefault.prototype.edition = 0; - - /** - * FeatureSetEditionDefault 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 {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set - * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault instance - */ - FeatureSetEditionDefault.create = function create(properties) { - return new FeatureSetEditionDefault(properties); - }; - - /** - * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSetEditionDefault.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.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; - }; - - /** - * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSetEditionDefault.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSetEditionDefault.decode = function decode(reader, length) { - 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 message; - }; - - /** - * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSetEditionDefault.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FeatureSetEditionDefault message. - * @function verify - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {Object.} 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; - } - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - return null; - }; - - /** - * Creates a FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault - */ - FeatureSetEditionDefault.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault) - return object; - var message = new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault(); - switch (object.edition) { - default: - if (typeof object.edition === "number") { - message.edition = object.edition; - break; - } - break; - case "EDITION_UNKNOWN": - case 0: - message.edition = 0; - break; - case "EDITION_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); - } - return message; - }; - - /** - * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} message FeatureSetEditionDefault - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FeatureSetEditionDefault.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.features = null; - object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; - } - 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 FeatureSetEditionDefault to JSON. - * @function toJSON - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @instance - * @returns {Object.} JSON object - */ - FeatureSetEditionDefault.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FeatureSetEditionDefault - * @function getTypeUrl - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FeatureSetEditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault"; - }; - - return FeatureSetEditionDefault; - })(); - - return FeatureSetDefaults; - })(); - - protobuf.SourceCodeInfo = (function() { - - /** - * Properties of a SourceCodeInfo. - * @memberof google.protobuf - * @interface ISourceCodeInfo - * @property {Array.|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; - var message = new $root.google.protobuf.SourceCodeInfo(); - if (object.location) { - if (!Array.isArray(object.location)) - throw TypeError(".google.protobuf.SourceCodeInfo.location: array expected"); - message.location = []; - for (var i = 0; i < object.location.length; ++i) { - if (typeof object.location[i] !== "object") - throw TypeError(".google.protobuf.SourceCodeInfo.location: object expected"); - message.location[i] = $root.google.protobuf.SourceCodeInfo.Location.fromObject(object.location[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} 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 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 new Location instance using the specified properties. - * @function create - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set - * @returns {google.protobuf.SourceCodeInfo.Location} Location instance - */ - Location.create = function create(properties) { - return new Location(properties); - }; - - /** - * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. - * @function encode - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Location.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.path != null && message.path.length) { - writer.uint32(/* id 1, wireType 2 =*/10).fork(); - for (var i = 0; i < message.path.length; ++i) - writer.int32(message.path[i]); - writer.ldelim(); - } - if (message.span != null && message.span.length) { - writer.uint32(/* id 2, wireType 2 =*/18).fork(); - for (var i = 0; i < message.span.length; ++i) - writer.int32(message.span[i]); - writer.ldelim(); - } - if (message.leadingComments != null && Object.hasOwnProperty.call(message, "leadingComments")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); - if (message.trailingComments != null && Object.hasOwnProperty.call(message, "trailingComments")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailingComments); - if (message.leadingDetachedComments != null && message.leadingDetachedComments.length) - for (var i = 0; i < message.leadingDetachedComments.length; ++i) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.leadingDetachedComments[i]); - return writer; - }; - - /** - * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Location.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Location message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.SourceCodeInfo.Location} Location - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Location.decode = function decode(reader, length) { - 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; - }; - - /** - * Decodes a Location message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.SourceCodeInfo.Location} Location - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Location.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Location message. - * @function verify - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Location.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.path != null && message.hasOwnProperty("path")) { - if (!Array.isArray(message.path)) - return "path: array expected"; - for (var i = 0; i < message.path.length; ++i) - if (!$util.isInteger(message.path[i])) - return "path: integer[] expected"; - } - if (message.span != null && message.hasOwnProperty("span")) { - if (!Array.isArray(message.span)) - return "span: array expected"; - for (var i = 0; i < message.span.length; ++i) - if (!$util.isInteger(message.span[i])) - return "span: integer[] expected"; - } - if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) - if (!$util.isString(message.leadingComments)) - return "leadingComments: string expected"; - if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) - if (!$util.isString(message.trailingComments)) - return "trailingComments: string expected"; - if (message.leadingDetachedComments != null && message.hasOwnProperty("leadingDetachedComments")) { - if (!Array.isArray(message.leadingDetachedComments)) - return "leadingDetachedComments: array expected"; - for (var i = 0; i < message.leadingDetachedComments.length; ++i) - if (!$util.isString(message.leadingDetachedComments[i])) - return "leadingDetachedComments: string[] expected"; - } - return null; - }; - - /** - * Creates a Location message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {Object.} 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; - })(); - - 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.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.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 - */ - 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]]; - } - - /** - * FieldMask paths. - * @member {Array.} paths - * @memberof google.protobuf.FieldMask - * @instance - */ - FieldMask.prototype.paths = $util.emptyArray; - - /** - * Creates a new FieldMask instance using the specified properties. - * @function create - * @memberof google.protobuf.FieldMask - * @static - * @param {google.protobuf.IFieldMask=} [properties] Properties to set - * @returns {google.protobuf.FieldMask} FieldMask instance - */ - FieldMask.create = function create(properties) { - return new FieldMask(properties); - }; - - /** - * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FieldMask - * @static - * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldMask.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.paths != null && message.paths.length) - for (var i = 0; i < message.paths.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.paths[i]); - return writer; - }; - - /** - * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FieldMask - * @static - * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldMask.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FieldMask message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FieldMask - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FieldMask} FieldMask - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldMask.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.FieldMask(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.paths && message.paths.length)) - message.paths = []; - message.paths.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FieldMask message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FieldMask - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FieldMask} FieldMask - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldMask.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FieldMask message. - * @function verify - * @memberof google.protobuf.FieldMask - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FieldMask.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.paths != null && message.hasOwnProperty("paths")) { - if (!Array.isArray(message.paths)) - return "paths: array expected"; - for (var i = 0; i < message.paths.length; ++i) - if (!$util.isString(message.paths[i])) - return "paths: string[] expected"; - } - return null; - }; - - /** - * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FieldMask - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FieldMask} FieldMask - */ - FieldMask.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FieldMask) - 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]); - } - return message; - }; - - /** - * Creates a plain object from a FieldMask message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FieldMask - * @static - * @param {google.protobuf.FieldMask} message FieldMask - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FieldMask.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]; - } - return object; - }; - - /** - * Converts this FieldMask to JSON. - * @function toJSON - * @memberof google.protobuf.FieldMask - * @instance - * @returns {Object.} JSON object - */ - FieldMask.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FieldMask - * @function getTypeUrl - * @memberof google.protobuf.FieldMask - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FieldMask.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FieldMask"; - }; - - return FieldMask; - })(); - - protobuf.Timestamp = (function() { - - /** - * Properties of a Timestamp. - * @memberof google.protobuf - * @interface ITimestamp - * @property {number|Long|null} [seconds] Timestamp seconds - * @property {number|null} [nanos] Timestamp nanos - */ - - /** - * Constructs a new Timestamp. - * @memberof google.protobuf - * @classdesc Represents a Timestamp. - * @implements ITimestamp - * @constructor - * @param {google.protobuf.ITimestamp=} [properties] Properties to set - */ - 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]]; - } - - /** - * Timestamp seconds. - * @member {number|Long} 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 - * @instance - */ - 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; - })(); - - return protobuf; - })(); - - return google; - })(); - - return $root; -}); diff --git a/owl-bot-staging/v1/protos/protos.json b/owl-bot-staging/v1/protos/protos.json deleted file mode 100644 index 6497622c4..000000000 --- a/owl-bot-staging/v1/protos/protos.json +++ /dev/null @@ -1,4338 +0,0 @@ -{ - "nested": { - "google": { - "nested": { - "pubsub": { - "nested": { - "v1": { - "options": { - "cc_enable_arenas": true, - "csharp_namespace": "Google.Cloud.PubSub.V1", - "go_package": "cloud.google.com/go/pubsub/apiv1/pubsubpb;pubsubpb", - "java_multiple_files": true, - "java_outer_classname": "SchemaProto", - "java_package": "com.google.pubsub.v1", - "php_namespace": "Google\\Cloud\\PubSub\\V1", - "ruby_package": "Google::Cloud::PubSub::V1" - }, - "nested": { - "Publisher": { - "options": { - "(google.api.default_host)": "pubsub.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/pubsub" - }, - "methods": { - "CreateTopic": { - "requestType": "Topic", - "responseType": "Topic", - "options": { - "(google.api.http).put": "/v1/{name=projects/*/topics/*}", - "(google.api.http).body": "*", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "put": "/v1/{name=projects/*/topics/*}", - "body": "*" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "UpdateTopic": { - "requestType": "UpdateTopicRequest", - "responseType": "Topic", - "options": { - "(google.api.http).patch": "/v1/{topic.name=projects/*/topics/*}", - "(google.api.http).body": "*", - "(google.api.method_signature)": "topic,update_mask" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v1/{topic.name=projects/*/topics/*}", - "body": "*" - } - }, - { - "(google.api.method_signature)": "topic,update_mask" - } - ] - }, - "Publish": { - "requestType": "PublishRequest", - "responseType": "PublishResponse", - "options": { - "(google.api.http).post": "/v1/{topic=projects/*/topics/*}:publish", - "(google.api.http).body": "*", - "(google.api.method_signature)": "topic,messages" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{topic=projects/*/topics/*}:publish", - "body": "*" - } - }, - { - "(google.api.method_signature)": "topic,messages" - } - ] - }, - "GetTopic": { - "requestType": "GetTopicRequest", - "responseType": "Topic", - "options": { - "(google.api.http).get": "/v1/{topic=projects/*/topics/*}", - "(google.api.method_signature)": "topic" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{topic=projects/*/topics/*}" - } - }, - { - "(google.api.method_signature)": "topic" - } - ] - }, - "ListTopics": { - "requestType": "ListTopicsRequest", - "responseType": "ListTopicsResponse", - "options": { - "(google.api.http).get": "/v1/{project=projects/*}/topics", - "(google.api.method_signature)": "project" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{project=projects/*}/topics" - } - }, - { - "(google.api.method_signature)": "project" - } - ] - }, - "ListTopicSubscriptions": { - "requestType": "ListTopicSubscriptionsRequest", - "responseType": "ListTopicSubscriptionsResponse", - "options": { - "(google.api.http).get": "/v1/{topic=projects/*/topics/*}/subscriptions", - "(google.api.method_signature)": "topic" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{topic=projects/*/topics/*}/subscriptions" - } - }, - { - "(google.api.method_signature)": "topic" - } - ] - }, - "ListTopicSnapshots": { - "requestType": "ListTopicSnapshotsRequest", - "responseType": "ListTopicSnapshotsResponse", - "options": { - "(google.api.http).get": "/v1/{topic=projects/*/topics/*}/snapshots", - "(google.api.method_signature)": "topic" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{topic=projects/*/topics/*}/snapshots" - } - }, - { - "(google.api.method_signature)": "topic" - } - ] - }, - "DeleteTopic": { - "requestType": "DeleteTopicRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).delete": "/v1/{topic=projects/*/topics/*}", - "(google.api.method_signature)": "topic" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1/{topic=projects/*/topics/*}" - } - }, - { - "(google.api.method_signature)": "topic" - } - ] - }, - "DetachSubscription": { - "requestType": "DetachSubscriptionRequest", - "responseType": "DetachSubscriptionResponse", - "options": { - "(google.api.http).post": "/v1/{subscription=projects/*/subscriptions/*}:detach" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{subscription=projects/*/subscriptions/*}:detach" - } - } - ] - } - } - }, - "MessageStoragePolicy": { - "fields": { - "allowedPersistenceRegions": { - "rule": "repeated", - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "enforceInTransit": { - "type": "bool", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "SchemaSettings": { - "fields": { - "schema": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "pubsub.googleapis.com/Schema" - } - }, - "encoding": { - "type": "Encoding", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "firstRevisionId": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "lastRevisionId": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "IngestionDataSourceSettings": { - "oneofs": { - "source": { - "oneof": [ - "awsKinesis" - ] - } - }, - "fields": { - "awsKinesis": { - "type": "AwsKinesis", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "AwsKinesis": { - "fields": { - "state": { - "type": "State", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "streamArn": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "consumerArn": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "awsRoleArn": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "gcpServiceAccount": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - }, - "nested": { - "State": { - "values": { - "STATE_UNSPECIFIED": 0, - "ACTIVE": 1, - "KINESIS_PERMISSION_DENIED": 2, - "PUBLISH_PERMISSION_DENIED": 3, - "STREAM_NOT_FOUND": 4, - "CONSUMER_NOT_FOUND": 5 - } - } - } - } - } - }, - "Topic": { - "options": { - "(google.api.resource).type": "pubsub.googleapis.com/Topic", - "(google.api.resource).pattern": "_deleted-topic_" - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "labels": { - "keyType": "string", - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "messageStoragePolicy": { - "type": "MessageStoragePolicy", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "kmsKeyName": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "schemaSettings": { - "type": "SchemaSettings", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "satisfiesPzs": { - "type": "bool", - "id": 7, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "messageRetentionDuration": { - "type": "google.protobuf.Duration", - "id": 8, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "state": { - "type": "State", - "id": 9, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "ingestionDataSourceSettings": { - "type": "IngestionDataSourceSettings", - "id": 10, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "State": { - "values": { - "STATE_UNSPECIFIED": 0, - "ACTIVE": 1, - "INGESTION_RESOURCE_ERROR": 2 - } - } - } - }, - "PubsubMessage": { - "fields": { - "data": { - "type": "bytes", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "attributes": { - "keyType": "string", - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "messageId": { - "type": "string", - "id": 3 - }, - "publishTime": { - "type": "google.protobuf.Timestamp", - "id": 4 - }, - "orderingKey": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "GetTopicRequest": { - "fields": { - "topic": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "pubsub.googleapis.com/Topic" - } - } - } - }, - "UpdateTopicRequest": { - "fields": { - "topic": { - "type": "Topic", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "PublishRequest": { - "fields": { - "topic": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "pubsub.googleapis.com/Topic" - } - }, - "messages": { - "rule": "repeated", - "type": "PubsubMessage", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "PublishResponse": { - "fields": { - "messageIds": { - "rule": "repeated", - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListTopicsRequest": { - "fields": { - "project": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Project" - } - }, - "pageSize": { - "type": "int32", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pageToken": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListTopicsResponse": { - "fields": { - "topics": { - "rule": "repeated", - "type": "Topic", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "nextPageToken": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListTopicSubscriptionsRequest": { - "fields": { - "topic": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "pubsub.googleapis.com/Topic" - } - }, - "pageSize": { - "type": "int32", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pageToken": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListTopicSubscriptionsResponse": { - "fields": { - "subscriptions": { - "rule": "repeated", - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "(google.api.resource_reference).type": "pubsub.googleapis.com/Subscription" - } - }, - "nextPageToken": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListTopicSnapshotsRequest": { - "fields": { - "topic": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "pubsub.googleapis.com/Topic" - } - }, - "pageSize": { - "type": "int32", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pageToken": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListTopicSnapshotsResponse": { - "fields": { - "snapshots": { - "rule": "repeated", - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "nextPageToken": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "DeleteTopicRequest": { - "fields": { - "topic": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "pubsub.googleapis.com/Topic" - } - } - } - }, - "DetachSubscriptionRequest": { - "fields": { - "subscription": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "pubsub.googleapis.com/Subscription" - } - } - } - }, - "DetachSubscriptionResponse": { - "fields": {} - }, - "Subscriber": { - "options": { - "(google.api.default_host)": "pubsub.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/pubsub" - }, - "methods": { - "CreateSubscription": { - "requestType": "Subscription", - "responseType": "Subscription", - "options": { - "(google.api.http).put": "/v1/{name=projects/*/subscriptions/*}", - "(google.api.http).body": "*", - "(google.api.method_signature)": "name,topic,push_config,ack_deadline_seconds" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "put": "/v1/{name=projects/*/subscriptions/*}", - "body": "*" - } - }, - { - "(google.api.method_signature)": "name,topic,push_config,ack_deadline_seconds" - } - ] - }, - "GetSubscription": { - "requestType": "GetSubscriptionRequest", - "responseType": "Subscription", - "options": { - "(google.api.http).get": "/v1/{subscription=projects/*/subscriptions/*}", - "(google.api.method_signature)": "subscription" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{subscription=projects/*/subscriptions/*}" - } - }, - { - "(google.api.method_signature)": "subscription" - } - ] - }, - "UpdateSubscription": { - "requestType": "UpdateSubscriptionRequest", - "responseType": "Subscription", - "options": { - "(google.api.http).patch": "/v1/{subscription.name=projects/*/subscriptions/*}", - "(google.api.http).body": "*", - "(google.api.method_signature)": "subscription,update_mask" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v1/{subscription.name=projects/*/subscriptions/*}", - "body": "*" - } - }, - { - "(google.api.method_signature)": "subscription,update_mask" - } - ] - }, - "ListSubscriptions": { - "requestType": "ListSubscriptionsRequest", - "responseType": "ListSubscriptionsResponse", - "options": { - "(google.api.http).get": "/v1/{project=projects/*}/subscriptions", - "(google.api.method_signature)": "project" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{project=projects/*}/subscriptions" - } - }, - { - "(google.api.method_signature)": "project" - } - ] - }, - "DeleteSubscription": { - "requestType": "DeleteSubscriptionRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).delete": "/v1/{subscription=projects/*/subscriptions/*}", - "(google.api.method_signature)": "subscription" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1/{subscription=projects/*/subscriptions/*}" - } - }, - { - "(google.api.method_signature)": "subscription" - } - ] - }, - "ModifyAckDeadline": { - "requestType": "ModifyAckDeadlineRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).post": "/v1/{subscription=projects/*/subscriptions/*}:modifyAckDeadline", - "(google.api.http).body": "*", - "(google.api.method_signature)": "subscription,ack_ids,ack_deadline_seconds" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{subscription=projects/*/subscriptions/*}:modifyAckDeadline", - "body": "*" - } - }, - { - "(google.api.method_signature)": "subscription,ack_ids,ack_deadline_seconds" - } - ] - }, - "Acknowledge": { - "requestType": "AcknowledgeRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).post": "/v1/{subscription=projects/*/subscriptions/*}:acknowledge", - "(google.api.http).body": "*", - "(google.api.method_signature)": "subscription,ack_ids" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{subscription=projects/*/subscriptions/*}:acknowledge", - "body": "*" - } - }, - { - "(google.api.method_signature)": "subscription,ack_ids" - } - ] - }, - "Pull": { - "requestType": "PullRequest", - "responseType": "PullResponse", - "options": { - "(google.api.http).post": "/v1/{subscription=projects/*/subscriptions/*}:pull", - "(google.api.http).body": "*", - "(google.api.method_signature)": "subscription,max_messages" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{subscription=projects/*/subscriptions/*}:pull", - "body": "*" - } - }, - { - "(google.api.method_signature)": "subscription,return_immediately,max_messages" - }, - { - "(google.api.method_signature)": "subscription,max_messages" - } - ] - }, - "StreamingPull": { - "requestType": "StreamingPullRequest", - "requestStream": true, - "responseType": "StreamingPullResponse", - "responseStream": true - }, - "ModifyPushConfig": { - "requestType": "ModifyPushConfigRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).post": "/v1/{subscription=projects/*/subscriptions/*}:modifyPushConfig", - "(google.api.http).body": "*", - "(google.api.method_signature)": "subscription,push_config" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{subscription=projects/*/subscriptions/*}:modifyPushConfig", - "body": "*" - } - }, - { - "(google.api.method_signature)": "subscription,push_config" - } - ] - }, - "GetSnapshot": { - "requestType": "GetSnapshotRequest", - "responseType": "Snapshot", - "options": { - "(google.api.http).get": "/v1/{snapshot=projects/*/snapshots/*}", - "(google.api.method_signature)": "snapshot" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{snapshot=projects/*/snapshots/*}" - } - }, - { - "(google.api.method_signature)": "snapshot" - } - ] - }, - "ListSnapshots": { - "requestType": "ListSnapshotsRequest", - "responseType": "ListSnapshotsResponse", - "options": { - "(google.api.http).get": "/v1/{project=projects/*}/snapshots", - "(google.api.method_signature)": "project" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{project=projects/*}/snapshots" - } - }, - { - "(google.api.method_signature)": "project" - } - ] - }, - "CreateSnapshot": { - "requestType": "CreateSnapshotRequest", - "responseType": "Snapshot", - "options": { - "(google.api.http).put": "/v1/{name=projects/*/snapshots/*}", - "(google.api.http).body": "*", - "(google.api.method_signature)": "name,subscription" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "put": "/v1/{name=projects/*/snapshots/*}", - "body": "*" - } - }, - { - "(google.api.method_signature)": "name,subscription" - } - ] - }, - "UpdateSnapshot": { - "requestType": "UpdateSnapshotRequest", - "responseType": "Snapshot", - "options": { - "(google.api.http).patch": "/v1/{snapshot.name=projects/*/snapshots/*}", - "(google.api.http).body": "*", - "(google.api.method_signature)": "snapshot,update_mask" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v1/{snapshot.name=projects/*/snapshots/*}", - "body": "*" - } - }, - { - "(google.api.method_signature)": "snapshot,update_mask" - } - ] - }, - "DeleteSnapshot": { - "requestType": "DeleteSnapshotRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).delete": "/v1/{snapshot=projects/*/snapshots/*}", - "(google.api.method_signature)": "snapshot" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1/{snapshot=projects/*/snapshots/*}" - } - }, - { - "(google.api.method_signature)": "snapshot" - } - ] - }, - "Seek": { - "requestType": "SeekRequest", - "responseType": "SeekResponse", - "options": { - "(google.api.http).post": "/v1/{subscription=projects/*/subscriptions/*}:seek", - "(google.api.http).body": "*" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{subscription=projects/*/subscriptions/*}:seek", - "body": "*" - } - } - ] - } - } - }, - "Subscription": { - "options": { - "(google.api.resource).type": "pubsub.googleapis.com/Subscription", - "(google.api.resource).pattern": "projects/{project}/subscriptions/{subscription}" - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "topic": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "pubsub.googleapis.com/Topic" - } - }, - "pushConfig": { - "type": "PushConfig", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "bigqueryConfig": { - "type": "BigQueryConfig", - "id": 18, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "cloudStorageConfig": { - "type": "CloudStorageConfig", - "id": 22, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "ackDeadlineSeconds": { - "type": "int32", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "retainAckedMessages": { - "type": "bool", - "id": 7, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "messageRetentionDuration": { - "type": "google.protobuf.Duration", - "id": 8, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "labels": { - "keyType": "string", - "type": "string", - "id": 9, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "enableMessageOrdering": { - "type": "bool", - "id": 10, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "expirationPolicy": { - "type": "ExpirationPolicy", - "id": 11, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "filter": { - "type": "string", - "id": 12, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "deadLetterPolicy": { - "type": "DeadLetterPolicy", - "id": 13, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "retryPolicy": { - "type": "RetryPolicy", - "id": 14, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "detached": { - "type": "bool", - "id": 15, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "enableExactlyOnceDelivery": { - "type": "bool", - "id": 16, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "topicMessageRetentionDuration": { - "type": "google.protobuf.Duration", - "id": 17, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "state": { - "type": "State", - "id": 19, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - }, - "nested": { - "State": { - "values": { - "STATE_UNSPECIFIED": 0, - "ACTIVE": 1, - "RESOURCE_ERROR": 2 - } - } - } - }, - "RetryPolicy": { - "fields": { - "minimumBackoff": { - "type": "google.protobuf.Duration", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "maximumBackoff": { - "type": "google.protobuf.Duration", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "DeadLetterPolicy": { - "fields": { - "deadLetterTopic": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "maxDeliveryAttempts": { - "type": "int32", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ExpirationPolicy": { - "fields": { - "ttl": { - "type": "google.protobuf.Duration", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "PushConfig": { - "oneofs": { - "authenticationMethod": { - "oneof": [ - "oidcToken" - ] - }, - "wrapper": { - "oneof": [ - "pubsubWrapper", - "noWrapper" - ] - } - }, - "fields": { - "pushEndpoint": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "attributes": { - "keyType": "string", - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "oidcToken": { - "type": "OidcToken", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pubsubWrapper": { - "type": "PubsubWrapper", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "noWrapper": { - "type": "NoWrapper", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "OidcToken": { - "fields": { - "serviceAccountEmail": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "audience": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "PubsubWrapper": { - "fields": {} - }, - "NoWrapper": { - "fields": { - "writeMetadata": { - "type": "bool", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - } - } - }, - "BigQueryConfig": { - "fields": { - "table": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "useTopicSchema": { - "type": "bool", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "writeMetadata": { - "type": "bool", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "dropUnknownFields": { - "type": "bool", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "state": { - "type": "State", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "useTableSchema": { - "type": "bool", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "serviceAccountEmail": { - "type": "string", - "id": 7, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "State": { - "values": { - "STATE_UNSPECIFIED": 0, - "ACTIVE": 1, - "PERMISSION_DENIED": 2, - "NOT_FOUND": 3, - "SCHEMA_MISMATCH": 4, - "IN_TRANSIT_LOCATION_RESTRICTION": 5 - } - } - } - }, - "CloudStorageConfig": { - "oneofs": { - "outputFormat": { - "oneof": [ - "textConfig", - "avroConfig" - ] - } - }, - "fields": { - "bucket": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "filenamePrefix": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "filenameSuffix": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "filenameDatetimeFormat": { - "type": "string", - "id": 10, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "textConfig": { - "type": "TextConfig", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "avroConfig": { - "type": "AvroConfig", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "maxDuration": { - "type": "google.protobuf.Duration", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "maxBytes": { - "type": "int64", - "id": 7, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "state": { - "type": "State", - "id": 9, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "serviceAccountEmail": { - "type": "string", - "id": 11, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "TextConfig": { - "fields": {} - }, - "AvroConfig": { - "fields": { - "writeMetadata": { - "type": "bool", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "useTopicSchema": { - "type": "bool", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "State": { - "values": { - "STATE_UNSPECIFIED": 0, - "ACTIVE": 1, - "PERMISSION_DENIED": 2, - "NOT_FOUND": 3, - "IN_TRANSIT_LOCATION_RESTRICTION": 4, - "SCHEMA_MISMATCH": 5 - } - } - } - }, - "ReceivedMessage": { - "fields": { - "ackId": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "message": { - "type": "PubsubMessage", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "deliveryAttempt": { - "type": "int32", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "GetSubscriptionRequest": { - "fields": { - "subscription": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "pubsub.googleapis.com/Subscription" - } - } - } - }, - "UpdateSubscriptionRequest": { - "fields": { - "subscription": { - "type": "Subscription", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "ListSubscriptionsRequest": { - "fields": { - "project": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Project" - } - }, - "pageSize": { - "type": "int32", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pageToken": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListSubscriptionsResponse": { - "fields": { - "subscriptions": { - "rule": "repeated", - "type": "Subscription", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "nextPageToken": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "DeleteSubscriptionRequest": { - "fields": { - "subscription": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "pubsub.googleapis.com/Subscription" - } - } - } - }, - "ModifyPushConfigRequest": { - "fields": { - "subscription": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "pubsub.googleapis.com/Subscription" - } - }, - "pushConfig": { - "type": "PushConfig", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "PullRequest": { - "fields": { - "subscription": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "pubsub.googleapis.com/Subscription" - } - }, - "returnImmediately": { - "type": "bool", - "id": 2, - "options": { - "deprecated": true, - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "maxMessages": { - "type": "int32", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "PullResponse": { - "fields": { - "receivedMessages": { - "rule": "repeated", - "type": "ReceivedMessage", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ModifyAckDeadlineRequest": { - "fields": { - "subscription": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "pubsub.googleapis.com/Subscription" - } - }, - "ackIds": { - "rule": "repeated", - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "ackDeadlineSeconds": { - "type": "int32", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "AcknowledgeRequest": { - "fields": { - "subscription": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "pubsub.googleapis.com/Subscription" - } - }, - "ackIds": { - "rule": "repeated", - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "StreamingPullRequest": { - "fields": { - "subscription": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "pubsub.googleapis.com/Subscription" - } - }, - "ackIds": { - "rule": "repeated", - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "modifyDeadlineSeconds": { - "rule": "repeated", - "type": "int32", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "modifyDeadlineAckIds": { - "rule": "repeated", - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "streamAckDeadlineSeconds": { - "type": "int32", - "id": 5, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "clientId": { - "type": "string", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "maxOutstandingMessages": { - "type": "int64", - "id": 7, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "maxOutstandingBytes": { - "type": "int64", - "id": 8, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "StreamingPullResponse": { - "fields": { - "receivedMessages": { - "rule": "repeated", - "type": "ReceivedMessage", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "acknowledgeConfirmation": { - "type": "AcknowledgeConfirmation", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "modifyAckDeadlineConfirmation": { - "type": "ModifyAckDeadlineConfirmation", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "subscriptionProperties": { - "type": "SubscriptionProperties", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "AcknowledgeConfirmation": { - "fields": { - "ackIds": { - "rule": "repeated", - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "invalidAckIds": { - "rule": "repeated", - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "unorderedAckIds": { - "rule": "repeated", - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "temporaryFailedAckIds": { - "rule": "repeated", - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ModifyAckDeadlineConfirmation": { - "fields": { - "ackIds": { - "rule": "repeated", - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "invalidAckIds": { - "rule": "repeated", - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "temporaryFailedAckIds": { - "rule": "repeated", - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "SubscriptionProperties": { - "fields": { - "exactlyOnceDeliveryEnabled": { - "type": "bool", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "messageOrderingEnabled": { - "type": "bool", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - } - } - }, - "CreateSnapshotRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "pubsub.googleapis.com/Snapshot" - } - }, - "subscription": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "pubsub.googleapis.com/Subscription" - } - }, - "labels": { - "keyType": "string", - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "UpdateSnapshotRequest": { - "fields": { - "snapshot": { - "type": "Snapshot", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "Snapshot": { - "options": { - "(google.api.resource).type": "pubsub.googleapis.com/Snapshot", - "(google.api.resource).pattern": "projects/{project}/snapshots/{snapshot}" - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "topic": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "(google.api.resource_reference).type": "pubsub.googleapis.com/Topic" - } - }, - "expireTime": { - "type": "google.protobuf.Timestamp", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "labels": { - "keyType": "string", - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "GetSnapshotRequest": { - "fields": { - "snapshot": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "pubsub.googleapis.com/Snapshot" - } - } - } - }, - "ListSnapshotsRequest": { - "fields": { - "project": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Project" - } - }, - "pageSize": { - "type": "int32", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pageToken": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListSnapshotsResponse": { - "fields": { - "snapshots": { - "rule": "repeated", - "type": "Snapshot", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "nextPageToken": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "DeleteSnapshotRequest": { - "fields": { - "snapshot": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "pubsub.googleapis.com/Snapshot" - } - } - } - }, - "SeekRequest": { - "oneofs": { - "target": { - "oneof": [ - "time", - "snapshot" - ] - } - }, - "fields": { - "subscription": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "pubsub.googleapis.com/Subscription" - } - }, - "time": { - "type": "google.protobuf.Timestamp", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "snapshot": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "(google.api.resource_reference).type": "pubsub.googleapis.com/Snapshot" - } - } - } - }, - "SeekResponse": { - "fields": {} - }, - "SchemaService": { - "options": { - "(google.api.default_host)": "pubsub.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/pubsub" - }, - "methods": { - "CreateSchema": { - "requestType": "CreateSchemaRequest", - "responseType": "Schema", - "options": { - "(google.api.http).post": "/v1/{parent=projects/*}/schemas", - "(google.api.http).body": "schema", - "(google.api.method_signature)": "parent,schema,schema_id" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{parent=projects/*}/schemas", - "body": "schema" - } - }, - { - "(google.api.method_signature)": "parent,schema,schema_id" - } - ] - }, - "GetSchema": { - "requestType": "GetSchemaRequest", - "responseType": "Schema", - "options": { - "(google.api.http).get": "/v1/{name=projects/*/schemas/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=projects/*/schemas/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "ListSchemas": { - "requestType": "ListSchemasRequest", - "responseType": "ListSchemasResponse", - "options": { - "(google.api.http).get": "/v1/{parent=projects/*}/schemas", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{parent=projects/*}/schemas" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "ListSchemaRevisions": { - "requestType": "ListSchemaRevisionsRequest", - "responseType": "ListSchemaRevisionsResponse", - "options": { - "(google.api.http).get": "/v1/{name=projects/*/schemas/*}:listRevisions", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=projects/*/schemas/*}:listRevisions" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "CommitSchema": { - "requestType": "CommitSchemaRequest", - "responseType": "Schema", - "options": { - "(google.api.http).post": "/v1/{name=projects/*/schemas/*}:commit", - "(google.api.http).body": "*", - "(google.api.method_signature)": "name,schema" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{name=projects/*/schemas/*}:commit", - "body": "*" - } - }, - { - "(google.api.method_signature)": "name,schema" - } - ] - }, - "RollbackSchema": { - "requestType": "RollbackSchemaRequest", - "responseType": "Schema", - "options": { - "(google.api.http).post": "/v1/{name=projects/*/schemas/*}:rollback", - "(google.api.http).body": "*", - "(google.api.method_signature)": "name,revision_id" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{name=projects/*/schemas/*}:rollback", - "body": "*" - } - }, - { - "(google.api.method_signature)": "name,revision_id" - } - ] - }, - "DeleteSchemaRevision": { - "requestType": "DeleteSchemaRevisionRequest", - "responseType": "Schema", - "options": { - "(google.api.http).delete": "/v1/{name=projects/*/schemas/*}:deleteRevision", - "(google.api.method_signature)": "name,revision_id" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1/{name=projects/*/schemas/*}:deleteRevision" - } - }, - { - "(google.api.method_signature)": "name,revision_id" - } - ] - }, - "DeleteSchema": { - "requestType": "DeleteSchemaRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).delete": "/v1/{name=projects/*/schemas/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1/{name=projects/*/schemas/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "ValidateSchema": { - "requestType": "ValidateSchemaRequest", - "responseType": "ValidateSchemaResponse", - "options": { - "(google.api.http).post": "/v1/{parent=projects/*}/schemas:validate", - "(google.api.http).body": "*", - "(google.api.method_signature)": "parent,schema" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{parent=projects/*}/schemas:validate", - "body": "*" - } - }, - { - "(google.api.method_signature)": "parent,schema" - } - ] - }, - "ValidateMessage": { - "requestType": "ValidateMessageRequest", - "responseType": "ValidateMessageResponse", - "options": { - "(google.api.http).post": "/v1/{parent=projects/*}/schemas:validateMessage", - "(google.api.http).body": "*" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{parent=projects/*}/schemas:validateMessage", - "body": "*" - } - } - ] - } - } - }, - "Schema": { - "options": { - "(google.api.resource).type": "pubsub.googleapis.com/Schema", - "(google.api.resource).pattern": "projects/{project}/schemas/{schema}" - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "type": { - "type": "Type", - "id": 2 - }, - "definition": { - "type": "string", - "id": 3 - }, - "revisionId": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "revisionCreateTime": { - "type": "google.protobuf.Timestamp", - "id": 6, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - }, - "nested": { - "Type": { - "values": { - "TYPE_UNSPECIFIED": 0, - "PROTOCOL_BUFFER": 1, - "AVRO": 2 - } - } - } - }, - "SchemaView": { - "values": { - "SCHEMA_VIEW_UNSPECIFIED": 0, - "BASIC": 1, - "FULL": 2 - } - }, - "CreateSchemaRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "pubsub.googleapis.com/Schema" - } - }, - "schema": { - "type": "Schema", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "schemaId": { - "type": "string", - "id": 3 - } - } - }, - "GetSchemaRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "pubsub.googleapis.com/Schema" - } - }, - "view": { - "type": "SchemaView", - "id": 2 - } - } - }, - "ListSchemasRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Project" - } - }, - "view": { - "type": "SchemaView", - "id": 2 - }, - "pageSize": { - "type": "int32", - "id": 3 - }, - "pageToken": { - "type": "string", - "id": 4 - } - } - }, - "ListSchemasResponse": { - "fields": { - "schemas": { - "rule": "repeated", - "type": "Schema", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "ListSchemaRevisionsRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "pubsub.googleapis.com/Schema" - } - }, - "view": { - "type": "SchemaView", - "id": 2 - }, - "pageSize": { - "type": "int32", - "id": 3 - }, - "pageToken": { - "type": "string", - "id": 4 - } - } - }, - "ListSchemaRevisionsResponse": { - "fields": { - "schemas": { - "rule": "repeated", - "type": "Schema", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "CommitSchemaRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "pubsub.googleapis.com/Schema" - } - }, - "schema": { - "type": "Schema", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "RollbackSchemaRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "pubsub.googleapis.com/Schema" - } - }, - "revisionId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "DeleteSchemaRevisionRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "pubsub.googleapis.com/Schema" - } - }, - "revisionId": { - "type": "string", - "id": 2, - "options": { - "deprecated": true, - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "DeleteSchemaRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "pubsub.googleapis.com/Schema" - } - } - } - }, - "ValidateSchemaRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Project" - } - }, - "schema": { - "type": "Schema", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "ValidateSchemaResponse": { - "fields": {} - }, - "ValidateMessageRequest": { - "oneofs": { - "schemaSpec": { - "oneof": [ - "name", - "schema" - ] - } - }, - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Project" - } - }, - "name": { - "type": "string", - "id": 2, - "options": { - "(google.api.resource_reference).type": "pubsub.googleapis.com/Schema" - } - }, - "schema": { - "type": "Schema", - "id": 3 - }, - "message": { - "type": "bytes", - "id": 4 - }, - "encoding": { - "type": "Encoding", - "id": 5 - } - } - }, - "ValidateMessageResponse": { - "fields": {} - }, - "Encoding": { - "values": { - "ENCODING_UNSPECIFIED": 0, - "JSON": 1, - "BINARY": 2 - } - } - } - } - } - }, - "api": { - "options": { - "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", - "java_multiple_files": true, - "java_outer_classname": "ResourceProto", - "java_package": "com.google.api", - "objc_class_prefix": "GAPI", - "cc_enable_arenas": true - }, - "nested": { - "http": { - "type": "HttpRule", - "id": 72295728, - "extend": "google.protobuf.MethodOptions" - }, - "Http": { - "fields": { - "rules": { - "rule": "repeated", - "type": "HttpRule", - "id": 1 - }, - "fullyDecodeReservedExpansion": { - "type": "bool", - "id": 2 - } - } - }, - "HttpRule": { - "oneofs": { - "pattern": { - "oneof": [ - "get", - "put", - "post", - "delete", - "patch", - "custom" - ] - } - }, - "fields": { - "selector": { - "type": "string", - "id": 1 - }, - "get": { - "type": "string", - "id": 2 - }, - "put": { - "type": "string", - "id": 3 - }, - "post": { - "type": "string", - "id": 4 - }, - "delete": { - "type": "string", - "id": 5 - }, - "patch": { - "type": "string", - "id": 6 - }, - "custom": { - "type": "CustomHttpPattern", - "id": 8 - }, - "body": { - "type": "string", - "id": 7 - }, - "responseBody": { - "type": "string", - "id": 12 - }, - "additionalBindings": { - "rule": "repeated", - "type": "HttpRule", - "id": 11 - } - } - }, - "CustomHttpPattern": { - "fields": { - "kind": { - "type": "string", - "id": 1 - }, - "path": { - "type": "string", - "id": 2 - } - } - }, - "methodSignature": { - "rule": "repeated", - "type": "string", - "id": 1051, - "extend": "google.protobuf.MethodOptions" - }, - "defaultHost": { - "type": "string", - "id": 1049, - "extend": "google.protobuf.ServiceOptions" - }, - "oauthScopes": { - "type": "string", - "id": 1050, - "extend": "google.protobuf.ServiceOptions" - }, - "apiVersion": { - "type": "string", - "id": 525000001, - "extend": "google.protobuf.ServiceOptions" - }, - "CommonLanguageSettings": { - "fields": { - "referenceDocsUri": { - "type": "string", - "id": 1, - "options": { - "deprecated": true - } - }, - "destinations": { - "rule": "repeated", - "type": "ClientLibraryDestination", - "id": 2 - } - } - }, - "ClientLibrarySettings": { - "fields": { - "version": { - "type": "string", - "id": 1 - }, - "launchStage": { - "type": "LaunchStage", - "id": 2 - }, - "restNumericEnums": { - "type": "bool", - "id": 3 - }, - "javaSettings": { - "type": "JavaSettings", - "id": 21 - }, - "cppSettings": { - "type": "CppSettings", - "id": 22 - }, - "phpSettings": { - "type": "PhpSettings", - "id": 23 - }, - "pythonSettings": { - "type": "PythonSettings", - "id": 24 - }, - "nodeSettings": { - "type": "NodeSettings", - "id": 25 - }, - "dotnetSettings": { - "type": "DotnetSettings", - "id": 26 - }, - "rubySettings": { - "type": "RubySettings", - "id": 27 - }, - "goSettings": { - "type": "GoSettings", - "id": 28 - } - } - }, - "Publishing": { - "fields": { - "methodSettings": { - "rule": "repeated", - "type": "MethodSettings", - "id": 2 - }, - "newIssueUri": { - "type": "string", - "id": 101 - }, - "documentationUri": { - "type": "string", - "id": 102 - }, - "apiShortName": { - "type": "string", - "id": 103 - }, - "githubLabel": { - "type": "string", - "id": 104 - }, - "codeownerGithubTeams": { - "rule": "repeated", - "type": "string", - "id": 105 - }, - "docTagPrefix": { - "type": "string", - "id": 106 - }, - "organization": { - "type": "ClientLibraryOrganization", - "id": 107 - }, - "librarySettings": { - "rule": "repeated", - "type": "ClientLibrarySettings", - "id": 109 - }, - "protoReferenceDocumentationUri": { - "type": "string", - "id": 110 - }, - "restReferenceDocumentationUri": { - "type": "string", - "id": 111 - } - } - }, - "JavaSettings": { - "fields": { - "libraryPackage": { - "type": "string", - "id": 1 - }, - "serviceClassNames": { - "keyType": "string", - "type": "string", - "id": 2 - }, - "common": { - "type": "CommonLanguageSettings", - "id": 3 - } - } - }, - "CppSettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - } - } - }, - "PhpSettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - } - } - }, - "PythonSettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - } - } - }, - "NodeSettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - } - } - }, - "DotnetSettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - }, - "renamedServices": { - "keyType": "string", - "type": "string", - "id": 2 - }, - "renamedResources": { - "keyType": "string", - "type": "string", - "id": 3 - }, - "ignoredResources": { - "rule": "repeated", - "type": "string", - "id": 4 - }, - "forcedNamespaceAliases": { - "rule": "repeated", - "type": "string", - "id": 5 - }, - "handwrittenSignatures": { - "rule": "repeated", - "type": "string", - "id": 6 - } - } - }, - "RubySettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - } - } - }, - "GoSettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - } - } - }, - "MethodSettings": { - "fields": { - "selector": { - "type": "string", - "id": 1 - }, - "longRunning": { - "type": "LongRunning", - "id": 2 - }, - "autoPopulatedFields": { - "rule": "repeated", - "type": "string", - "id": 3 - } - }, - "nested": { - "LongRunning": { - "fields": { - "initialPollDelay": { - "type": "google.protobuf.Duration", - "id": 1 - }, - "pollDelayMultiplier": { - "type": "float", - "id": 2 - }, - "maxPollDelay": { - "type": "google.protobuf.Duration", - "id": 3 - }, - "totalPollTimeout": { - "type": "google.protobuf.Duration", - "id": 4 - } - } - } - } - }, - "ClientLibraryOrganization": { - "values": { - "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": 0, - "CLOUD": 1, - "ADS": 2, - "PHOTOS": 3, - "STREET_VIEW": 4, - "SHOPPING": 5, - "GEO": 6, - "GENERATIVE_AI": 7 - } - }, - "ClientLibraryDestination": { - "values": { - "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED": 0, - "GITHUB": 10, - "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", - "id": 1052, - "extend": "google.protobuf.FieldOptions", - "options": { - "packed": false - } - }, - "FieldBehavior": { - "values": { - "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 - } - }, - "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 - } - } - } - } - }, - "protobuf": { - "options": { - "go_package": "google.golang.org/protobuf/types/descriptorpb", - "java_package": "com.google.protobuf", - "java_outer_classname": "DescriptorProtos", - "csharp_namespace": "Google.Protobuf.Reflection", - "objc_class_prefix": "GPB", - "cc_enable_arenas": true, - "optimize_for": "SPEED" - }, - "nested": { - "FileDescriptorSet": { - "fields": { - "file": { - "rule": "repeated", - "type": "FileDescriptorProto", - "id": 1 - } - } - }, - "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": { - "type": "string", - "id": 1 - }, - "package": { - "type": "string", - "id": 2 - }, - "dependency": { - "rule": "repeated", - "type": "string", - "id": 3 - }, - "publicDependency": { - "rule": "repeated", - "type": "int32", - "id": 10, - "options": { - "packed": false - } - }, - "weakDependency": { - "rule": "repeated", - "type": "int32", - "id": 11, - "options": { - "packed": false - } - }, - "messageType": { - "rule": "repeated", - "type": "DescriptorProto", - "id": 4 - }, - "enumType": { - "rule": "repeated", - "type": "EnumDescriptorProto", - "id": 5 - }, - "service": { - "rule": "repeated", - "type": "ServiceDescriptorProto", - "id": 6 - }, - "extension": { - "rule": "repeated", - "type": "FieldDescriptorProto", - "id": 7 - }, - "options": { - "type": "FileOptions", - "id": 8 - }, - "sourceCodeInfo": { - "type": "SourceCodeInfo", - "id": 9 - }, - "syntax": { - "type": "string", - "id": 12 - }, - "edition": { - "type": "Edition", - "id": 14 - } - } - }, - "DescriptorProto": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "field": { - "rule": "repeated", - "type": "FieldDescriptorProto", - "id": 2 - }, - "extension": { - "rule": "repeated", - "type": "FieldDescriptorProto", - "id": 6 - }, - "nestedType": { - "rule": "repeated", - "type": "DescriptorProto", - "id": 3 - }, - "enumType": { - "rule": "repeated", - "type": "EnumDescriptorProto", - "id": 4 - }, - "extensionRange": { - "rule": "repeated", - "type": "ExtensionRange", - "id": 5 - }, - "oneofDecl": { - "rule": "repeated", - "type": "OneofDescriptorProto", - "id": 8 - }, - "options": { - "type": "MessageOptions", - "id": 7 - }, - "reservedRange": { - "rule": "repeated", - "type": "ReservedRange", - "id": 9 - }, - "reservedName": { - "rule": "repeated", - "type": "string", - "id": 10 - } - }, - "nested": { - "ExtensionRange": { - "fields": { - "start": { - "type": "int32", - "id": 1 - }, - "end": { - "type": "int32", - "id": 2 - }, - "options": { - "type": "ExtensionRangeOptions", - "id": 3 - } - } - }, - "ReservedRange": { - "fields": { - "start": { - "type": "int32", - "id": 1 - }, - "end": { - "type": "int32", - "id": 2 - } - } - } - } - }, - "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": { - "type": "string", - "id": 1 - }, - "number": { - "type": "int32", - "id": 3 - }, - "label": { - "type": "Label", - "id": 4 - }, - "type": { - "type": "Type", - "id": 5 - }, - "typeName": { - "type": "string", - "id": 6 - }, - "extendee": { - "type": "string", - "id": 2 - }, - "defaultValue": { - "type": "string", - "id": 7 - }, - "oneofIndex": { - "type": "int32", - "id": 9 - }, - "jsonName": { - "type": "string", - "id": 10 - }, - "options": { - "type": "FieldOptions", - "id": 8 - }, - "proto3Optional": { - "type": "bool", - "id": 17 - } - }, - "nested": { - "Type": { - "values": { - "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": { - "values": { - "LABEL_OPTIONAL": 1, - "LABEL_REPEATED": 3, - "LABEL_REQUIRED": 2 - } - } - } - }, - "OneofDescriptorProto": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "options": { - "type": "OneofOptions", - "id": 2 - } - } - }, - "EnumDescriptorProto": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "value": { - "rule": "repeated", - "type": "EnumValueDescriptorProto", - "id": 2 - }, - "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 - } - } - } - } - }, - "EnumValueDescriptorProto": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "number": { - "type": "int32", - "id": 2 - }, - "options": { - "type": "EnumValueOptions", - "id": 3 - } - } - }, - "ServiceDescriptorProto": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "method": { - "rule": "repeated", - "type": "MethodDescriptorProto", - "id": 2 - }, - "options": { - "type": "ServiceOptions", - "id": 3 - } - } - }, - "MethodDescriptorProto": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "inputType": { - "type": "string", - "id": 2 - }, - "outputType": { - "type": "string", - "id": 3 - }, - "options": { - "type": "MethodOptions", - "id": 4 - }, - "clientStreaming": { - "type": "bool", - "id": 5, - "options": { - "default": false - } - }, - "serverStreaming": { - "type": "bool", - "id": 6, - "options": { - "default": false - } - } - } - }, - "FileOptions": { - "fields": { - "javaPackage": { - "type": "string", - "id": 1 - }, - "javaOuterClassname": { - "type": "string", - "id": 8 - }, - "javaMultipleFiles": { - "type": "bool", - "id": 10, - "options": { - "default": false - } - }, - "javaGenerateEqualsAndHash": { - "type": "bool", - "id": 20, - "options": { - "deprecated": true - } - }, - "javaStringCheckUtf8": { - "type": "bool", - "id": 27, - "options": { - "default": false - } - }, - "optimizeFor": { - "type": "OptimizeMode", - "id": 9, - "options": { - "default": "SPEED" - } - }, - "goPackage": { - "type": "string", - "id": 11 - }, - "ccGenericServices": { - "type": "bool", - "id": 16, - "options": { - "default": false - } - }, - "javaGenericServices": { - "type": "bool", - "id": 17, - "options": { - "default": false - } - }, - "pyGenericServices": { - "type": "bool", - "id": 18, - "options": { - "default": false - } - }, - "deprecated": { - "type": "bool", - "id": 23, - "options": { - "default": false - } - }, - "ccEnableArenas": { - "type": "bool", - "id": 31, - "options": { - "default": true - } - }, - "objcClassPrefix": { - "type": "string", - "id": 36 - }, - "csharpNamespace": { - "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", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "reserved": [ - [ - 42, - 42 - ], - [ - 38, - 38 - ] - ], - "nested": { - "OptimizeMode": { - "values": { - "SPEED": 1, - "CODE_SIZE": 2, - "LITE_RUNTIME": 3 - } - } - } - }, - "MessageOptions": { - "fields": { - "messageSetWireFormat": { - "type": "bool", - "id": 1, - "options": { - "default": false - } - }, - "noStandardDescriptorAccessor": { - "type": "bool", - "id": 2, - "options": { - "default": false - } - }, - "deprecated": { - "type": "bool", - "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", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "reserved": [ - [ - 4, - 4 - ], - [ - 5, - 5 - ], - [ - 6, - 6 - ], - [ - 8, - 8 - ], - [ - 9, - 9 - ] - ] - }, - "FieldOptions": { - "fields": { - "ctype": { - "type": "CType", - "id": 1, - "options": { - "default": "STRING" - } - }, - "packed": { - "type": "bool", - "id": 2 - }, - "jstype": { - "type": "JSType", - "id": 6, - "options": { - "default": "JS_NORMAL" - } - }, - "lazy": { - "type": "bool", - "id": 5, - "options": { - "default": false - } - }, - "unverifiedLazy": { - "type": "bool", - "id": 15, - "options": { - "default": false - } - }, - "deprecated": { - "type": "bool", - "id": 3, - "options": { - "default": false - } - }, - "weak": { - "type": "bool", - "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", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "reserved": [ - [ - 4, - 4 - ], - [ - 18, - 18 - ] - ], - "nested": { - "CType": { - "values": { - "STRING": 0, - "CORD": 1, - "STRING_PIECE": 2 - } - }, - "JSType": { - "values": { - "JS_NORMAL": 0, - "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", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ] - }, - "EnumOptions": { - "fields": { - "allowAlias": { - "type": "bool", - "id": 2 - }, - "deprecated": { - "type": "bool", - "id": 3, - "options": { - "default": false - } - }, - "deprecatedLegacyJsonFieldConflicts": { - "type": "bool", - "id": 6, - "options": { - "deprecated": true - } - }, - "features": { - "type": "FeatureSet", - "id": 7 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "reserved": [ - [ - 5, - 5 - ] - ] - }, - "EnumValueOptions": { - "fields": { - "deprecated": { - "type": "bool", - "id": 1, - "options": { - "default": false - } - }, - "features": { - "type": "FeatureSet", - "id": 2 - }, - "debugRedact": { - "type": "bool", - "id": 3, - "options": { - "default": false - } - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ] - }, - "ServiceOptions": { - "fields": { - "features": { - "type": "FeatureSet", - "id": 34 - }, - "deprecated": { - "type": "bool", - "id": 33, - "options": { - "default": false - } - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ] - }, - "MethodOptions": { - "fields": { - "deprecated": { - "type": "bool", - "id": 33, - "options": { - "default": false - } - }, - "idempotencyLevel": { - "type": "IdempotencyLevel", - "id": 34, - "options": { - "default": "IDEMPOTENCY_UNKNOWN" - } - }, - "features": { - "type": "FeatureSet", - "id": 35 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "nested": { - "IdempotencyLevel": { - "values": { - "IDEMPOTENCY_UNKNOWN": 0, - "NO_SIDE_EFFECTS": 1, - "IDEMPOTENT": 2 - } - } - } - }, - "UninterpretedOption": { - "fields": { - "name": { - "rule": "repeated", - "type": "NamePart", - "id": 2 - }, - "identifierValue": { - "type": "string", - "id": 3 - }, - "positiveIntValue": { - "type": "uint64", - "id": 4 - }, - "negativeIntValue": { - "type": "int64", - "id": 5 - }, - "doubleValue": { - "type": "double", - "id": 6 - }, - "stringValue": { - "type": "bytes", - "id": 7 - }, - "aggregateValue": { - "type": "string", - "id": 8 - } - }, - "nested": { - "NamePart": { - "fields": { - "namePart": { - "rule": "required", - "type": "string", - "id": 1 - }, - "isExtension": { - "rule": "required", - "type": "bool", - "id": 2 - } - } - } - } - }, - "FeatureSet": { - "fields": { - "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 - ], - [ - 1002, - 1002 - ], - [ - 9990, - 9990 - ], - [ - 9995, - 9999 - ], - [ - 10000, - 10000 - ] - ], - "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": { - "path": { - "rule": "repeated", - "type": "int32", - "id": 1 - }, - "span": { - "rule": "repeated", - "type": "int32", - "id": 2 - }, - "leadingComments": { - "type": "string", - "id": 3 - }, - "trailingComments": { - "type": "string", - "id": 4 - }, - "leadingDetachedComments": { - "rule": "repeated", - "type": "string", - "id": 6 - } - } - } - } - }, - "GeneratedCodeInfo": { - "fields": { - "annotation": { - "rule": "repeated", - "type": "Annotation", - "id": 1 - } - }, - "nested": { - "Annotation": { - "fields": { - "path": { - "rule": "repeated", - "type": "int32", - "id": 1 - }, - "sourceFile": { - "type": "string", - "id": 2 - }, - "begin": { - "type": "int32", - "id": 3 - }, - "end": { - "type": "int32", - "id": 4 - }, - "semantic": { - "type": "Semantic", - "id": 5 - } - }, - "nested": { - "Semantic": { - "values": { - "NONE": 0, - "SET": 1, - "ALIAS": 2 - } - } - } - } - } - }, - "Duration": { - "fields": { - "seconds": { - "type": "int64", - "id": 1 - }, - "nanos": { - "type": "int32", - "id": 2 - } - } - }, - "Empty": { - "fields": {} - }, - "FieldMask": { - "fields": { - "paths": { - "rule": "repeated", - "type": "string", - "id": 1 - } - } - }, - "Timestamp": { - "fields": { - "seconds": { - "type": "int64", - "id": 1 - }, - "nanos": { - "type": "int32", - "id": 2 - } - } - } - } - } - } - } - } -} \ No newline at end of file diff --git a/owl-bot-staging/v1/src/index.ts b/owl-bot-staging/v1/src/index.ts deleted file mode 100644 index fd5e2ff08..000000000 --- a/owl-bot-staging/v1/src/index.ts +++ /dev/null @@ -1,29 +0,0 @@ -// 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 -// -// https://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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import * as v1 from './v1'; -const PublisherClient = v1.PublisherClient; -type PublisherClient = v1.PublisherClient; -const SchemaServiceClient = v1.SchemaServiceClient; -type SchemaServiceClient = v1.SchemaServiceClient; -const SubscriberClient = v1.SubscriberClient; -type SubscriberClient = v1.SubscriberClient; -export {v1, PublisherClient, SchemaServiceClient, SubscriberClient}; -export default {v1, PublisherClient, SchemaServiceClient, SubscriberClient}; -import * as protos from '../protos/protos'; -export {protos} diff --git a/owl-bot-staging/v1/src/v1/index.ts b/owl-bot-staging/v1/src/v1/index.ts deleted file mode 100644 index f12ac87b4..000000000 --- a/owl-bot-staging/v1/src/v1/index.ts +++ /dev/null @@ -1,21 +0,0 @@ -// 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 -// -// https://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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -export {PublisherClient} from './publisher_client'; -export {SchemaServiceClient} from './schema_service_client'; -export {SubscriberClient} from './subscriber_client'; diff --git a/owl-bot-staging/v1/src/v1/publisher_client.ts b/owl-bot-staging/v1/src/v1/publisher_client.ts deleted file mode 100644 index 1b5b0aede..000000000 --- a/owl-bot-staging/v1/src/v1/publisher_client.ts +++ /dev/null @@ -1,1701 +0,0 @@ -// 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 -// -// https://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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -/* global window */ -import type * as gax from 'google-gax'; -import type {Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback, GaxCall, IamClient, IamProtos} from 'google-gax'; -import {Transform} from 'stream'; -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); - -/** - * Client JSON configuration object, loaded from - * `src/v1/publisher_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './publisher_client_config.json'; -const version = require('../../../package.json').version; - -/** - * The service that an application uses to manipulate topics, and to send - * messages to a topic. - * @class - * @memberof v1 - */ -export class PublisherClient { - private _terminated = false; - private _opts: ClientOptions; - private _providedCustomServicePath: boolean; - private _gaxModule: typeof gax | typeof gax.fallback; - private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; - private _protos: {}; - private _defaults: {[method: string]: gax.CallSettings}; - private _universeDomain: string; - private _servicePath: string; - auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: {[name: string]: Function}; - iamClient: IamClient; - pathTemplates: {[name: string]: gax.PathTemplate}; - publisherStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of PublisherClient. - * - * @param {object} [options] - The configuration object. - * The options accepted by the constructor are described in detail - * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). - * The common options are: - * @param {object} [options.credentials] - Credentials object. - * @param {string} [options.credentials.client_email] - * @param {string} [options.credentials.private_key] - * @param {string} [options.email] - Account email address. Required when - * using a .pem or .p12 keyFilename. - * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or - * .p12 key downloaded from the Google Developers Console. If you provide - * a path to a JSON file, the projectId option below is not necessary. - * NOTE: .pem and .p12 require you to specify options.email as well. - * @param {number} [options.port] - The port on which to connect to - * the remote host. - * @param {string} [options.projectId] - The project ID from the Google - * Developer's Console, e.g. 'grape-spaceship-123'. We will also check - * the environment variable GCLOUD_PROJECT for your project ID. If your - * app is running in an environment which supports - * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, - * your project ID will be detected automatically. - * @param {string} [options.apiEndpoint] - The domain name of the - * API remote host. - * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. - * Follows the structure of {@link gapicConfig}. - * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. - * For more information, please check the - * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. - * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you - * need to avoid loading the default gRPC version and want to use the fallback - * HTTP implementation. Load only fallback version and pass it to the constructor: - * ``` - * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new PublisherClient({fallback: true}, gax); - * ``` - */ - constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { - // Ensure that options include all the required fields. - const staticMembers = this.constructor as typeof PublisherClient; - if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) { - throw new Error('Please set either universe_domain or universeDomain, but not both.'); - } - const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined; - this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com'; - this._servicePath = 'pubsub.' + this._universeDomain; - const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; - this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); - const port = opts?.port || staticMembers.port; - const clientConfig = opts?.clientConfig ?? {}; - const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); - opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); - - // Request numeric enum values if REST transport is used. - opts.numericEnums = true; - - // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. - if (servicePath !== this._servicePath && !('scopes' in opts)) { - opts['scopes'] = staticMembers.scopes; - } - - // Load google-gax module synchronously if needed - if (!gaxInstance) { - gaxInstance = require('google-gax') as typeof gax; - } - - // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; - - // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. - this._gaxGrpc = new this._gaxModule.GrpcClient(opts); - - // Save options to use in initialize() method. - this._opts = opts; - - // Save the auth object to the client, for use by other methods. - this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); - - // Set useJWTAccessWithScope on the auth object. - this.auth.useJWTAccessWithScope = true; - - // Set defaultServicePath on the auth object. - this.auth.defaultServicePath = this._servicePath; - - // Set the default scopes in auth client if needed. - if (servicePath === this._servicePath) { - this.auth.defaultScopes = staticMembers.scopes; - } - this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); - - - // Determine the client header string. - const clientHeader = [ - `gax/${this._gaxModule.version}`, - `gapic/${version}`, - ]; - if (typeof process === 'object' && 'versions' in process) { - clientHeader.push(`gl-node/${process.versions.node}`); - } else { - clientHeader.push(`gl-web/${this._gaxModule.version}`); - } - if (!opts.fallback) { - clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else { - clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); - } - if (opts.libName && opts.libVersion) { - clientHeader.push(`${opts.libName}/${opts.libVersion}`); - } - // Load the applicable protos. - this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); - - // This API contains "path templates"; forward-slash-separated - // identifiers to uniquely identify resources within the API. - // Create useful helper objects for these. - this.pathTemplates = { - projectPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}' - ), - projectTopicPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/topics/{topic}' - ), - schemaPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/schemas/{schema}' - ), - snapshotPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/snapshots/{snapshot}' - ), - subscriptionPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/subscriptions/{subscription}' - ), - }; - - // Some of the methods on this service return "paged" results, - // (e.g. 50 results at a time, with tokens to get subsequent - // pages). Denote the keys used for pagination and results. - this.descriptors.page = { - listTopics: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'topics'), - listTopicSubscriptions: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'subscriptions'), - listTopicSnapshots: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'snapshots') - }; - - const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); - // Some methods on this API support automatically batching - // requests; denote this. - - this.descriptors.batching = { - publish: new this._gaxModule.BundleDescriptor( - 'messages', - ['topic'], - 'message_ids', - this._gaxModule.GrpcClient.createByteLengthFunction( - // eslint-disable-next-line @typescript-eslint/no-explicit-any - protoFilesRoot.lookupType('google.pubsub.v1.PubsubMessage') as any - ) - ), - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.pubsub.v1.Publisher', gapicConfig as gax.ClientConfig, - opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); - - // Set up a dictionary of "inner API calls"; the core implementation - // of calling the API is handled in `google-gax`, with this code - // merely providing the destination and request information. - this.innerApiCalls = {}; - - // Add a warn function to the client constructor so it can be easily tested. - this.warn = this._gaxModule.warn; - } - - /** - * Initialize the client. - * Performs asynchronous operations (such as authentication) and prepares the client. - * This function will be called automatically when any class method is called for the - * first time, but if you need to initialize it before calling an actual method, - * feel free to call initialize() directly. - * - * You can await on this method if you want to make sure the client is initialized. - * - * @returns {Promise} A promise that resolves to an authenticated service stub. - */ - initialize() { - // If the client stub promise is already initialized, return immediately. - if (this.publisherStub) { - return this.publisherStub; - } - - // Put together the "service stub" for - // google.pubsub.v1.Publisher. - this.publisherStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.pubsub.v1.Publisher') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.pubsub.v1.Publisher, - this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; - - // Iterate over each of the methods that the service provides - // and create an API call method for each. - const publisherStubMethods = - ['createTopic', 'updateTopic', 'publish', 'getTopic', 'listTopics', 'listTopicSubscriptions', 'listTopicSnapshots', 'deleteTopic', 'detachSubscription']; - for (const methodName of publisherStubMethods) { - const callPromise = this.publisherStub.then( - stub => (...args: Array<{}>) => { - if (this._terminated) { - return Promise.reject('The client has already been closed.'); - } - const func = stub[methodName]; - return func.apply(stub, args); - }, - (err: Error|null|undefined) => () => { - throw err; - }); - - const descriptor = - this.descriptors.page[methodName] || - this.descriptors.batching?.[methodName] || - undefined; - const apiCall = this._gaxModule.createApiCall( - callPromise, - this._defaults[methodName], - descriptor, - this._opts.fallback - ); - - this.innerApiCalls[methodName] = apiCall; - } - - return this.publisherStub; - } - - /** - * The DNS address for this API service. - * @deprecated Use the apiEndpoint method of the client instance. - * @returns {string} The DNS address for this service. - */ - static get servicePath() { - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); - } - return 'pubsub.googleapis.com'; - } - - /** - * The DNS address for this API service - same as servicePath. - * @deprecated Use the apiEndpoint method of the client instance. - * @returns {string} The DNS address for this service. - */ - static get apiEndpoint() { - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); - } - return 'pubsub.googleapis.com'; - } - - /** - * The DNS address for this API service. - * @returns {string} The DNS address for this service. - */ - get apiEndpoint() { - return this._servicePath; - } - - get universeDomain() { - return this._universeDomain; - } - - /** - * The port for this API service. - * @returns {number} The default port for this service. - */ - static get port() { - return 443; - } - - /** - * The scopes needed to make gRPC calls for every method defined - * in this service. - * @returns {string[]} List of default scopes. - */ - static get scopes() { - return [ - 'https://www.googleapis.com/auth/cloud-platform', - 'https://www.googleapis.com/auth/pubsub' - ]; - } - - getProjectId(): Promise; - getProjectId(callback: Callback): void; - /** - * Return the project ID used by this class. - * @returns {Promise} A promise that resolves to string containing the project ID. - */ - getProjectId(callback?: Callback): - Promise|void { - if (callback) { - this.auth.getProjectId(callback); - return; - } - return this.auth.getProjectId(); - } - - // ------------------- - // -- Service calls -- - // ------------------- -/** - * Creates the given topic with the given name. See the [resource name rules] - * (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the topic. It must have the format - * `"projects/{project}/topics/{topic}"`. `{topic}` must start with a letter, - * and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), - * underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent - * signs (`%`). It must be between 3 and 255 characters in length, and it - * must not start with `"goog"`. - * @param {number[]} [request.labels] - * Optional. See [Creating and managing labels] - * (https://cloud.google.com/pubsub/docs/labels). - * @param {google.pubsub.v1.MessageStoragePolicy} [request.messageStoragePolicy] - * Optional. Policy constraining the set of Google Cloud Platform regions - * where messages published to the topic may be stored. If not present, then - * no constraints are in effect. - * @param {string} [request.kmsKeyName] - * Optional. The resource name of the Cloud KMS CryptoKey to be used to - * protect access to messages published on this topic. - * - * The expected format is `projects/* /locations/* /keyRings/* /cryptoKeys/*`. - * @param {google.pubsub.v1.SchemaSettings} [request.schemaSettings] - * Optional. Settings for validating messages published against a schema. - * @param {boolean} [request.satisfiesPzs] - * Optional. Reserved for future use. This field is set only in responses from - * the server; it is ignored if it is set in any requests. - * @param {google.protobuf.Duration} [request.messageRetentionDuration] - * Optional. Indicates the minimum duration to retain a message after it is - * published to the topic. If this field is set, messages published to the - * topic in the last `message_retention_duration` are always available to - * subscribers. For instance, it allows any attached subscription to [seek to - * a - * timestamp](https://cloud.google.com/pubsub/docs/replay-overview#seek_to_a_time) - * that is up to `message_retention_duration` in the past. If this field is - * not set, message retention is controlled by settings on individual - * subscriptions. Cannot be more than 31 days or less than 10 minutes. - * @param {google.pubsub.v1.Topic.State} request.state - * Output only. An output-only field indicating the state of the topic. - * @param {google.pubsub.v1.IngestionDataSourceSettings} [request.ingestionDataSourceSettings] - * Optional. Settings for ingestion from a data source into this topic. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.pubsub.v1.Topic|Topic}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - */ - createTopic( - request?: protos.google.pubsub.v1.ITopic, - options?: CallOptions): - Promise<[ - protos.google.pubsub.v1.ITopic, - protos.google.pubsub.v1.ITopic|undefined, {}|undefined - ]>; - createTopic( - request: protos.google.pubsub.v1.ITopic, - options: CallOptions, - callback: Callback< - protos.google.pubsub.v1.ITopic, - protos.google.pubsub.v1.ITopic|null|undefined, - {}|null|undefined>): void; - createTopic( - request: protos.google.pubsub.v1.ITopic, - callback: Callback< - protos.google.pubsub.v1.ITopic, - protos.google.pubsub.v1.ITopic|null|undefined, - {}|null|undefined>): void; - createTopic( - request?: protos.google.pubsub.v1.ITopic, - optionsOrCallback?: CallOptions|Callback< - protos.google.pubsub.v1.ITopic, - protos.google.pubsub.v1.ITopic|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.pubsub.v1.ITopic, - protos.google.pubsub.v1.ITopic|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.pubsub.v1.ITopic, - protos.google.pubsub.v1.ITopic|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.createTopic(request, options, callback); - } -/** - * Updates an existing topic by updating the fields specified in the update - * mask. Note that certain properties of a topic are not modifiable. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.pubsub.v1.Topic} request.topic - * Required. The updated topic object. - * @param {google.protobuf.FieldMask} request.updateMask - * Required. Indicates which fields in the provided topic to update. Must be - * specified and non-empty. Note that if `update_mask` contains - * "message_storage_policy" but the `message_storage_policy` is not set in - * the `topic` provided above, then the updated value is determined by the - * policy configured at the project or organization level. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.pubsub.v1.Topic|Topic}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - */ - updateTopic( - request?: protos.google.pubsub.v1.IUpdateTopicRequest, - options?: CallOptions): - Promise<[ - protos.google.pubsub.v1.ITopic, - protos.google.pubsub.v1.IUpdateTopicRequest|undefined, {}|undefined - ]>; - updateTopic( - request: protos.google.pubsub.v1.IUpdateTopicRequest, - options: CallOptions, - callback: Callback< - protos.google.pubsub.v1.ITopic, - protos.google.pubsub.v1.IUpdateTopicRequest|null|undefined, - {}|null|undefined>): void; - updateTopic( - request: protos.google.pubsub.v1.IUpdateTopicRequest, - callback: Callback< - protos.google.pubsub.v1.ITopic, - protos.google.pubsub.v1.IUpdateTopicRequest|null|undefined, - {}|null|undefined>): void; - updateTopic( - request?: protos.google.pubsub.v1.IUpdateTopicRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.pubsub.v1.ITopic, - protos.google.pubsub.v1.IUpdateTopicRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.pubsub.v1.ITopic, - protos.google.pubsub.v1.IUpdateTopicRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.pubsub.v1.ITopic, - protos.google.pubsub.v1.IUpdateTopicRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'topic.name': request.topic!.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.updateTopic(request, options, callback); - } -/** - * Adds one or more messages to the topic. Returns `NOT_FOUND` if the topic - * does not exist. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.topic - * Required. The messages in the request will be published on this topic. - * Format is `projects/{project}/topics/{topic}`. - * @param {number[]} request.messages - * Required. The messages to publish. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.pubsub.v1.PublishResponse|PublishResponse}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - */ - publish( - request?: protos.google.pubsub.v1.IPublishRequest, - options?: CallOptions): - Promise<[ - protos.google.pubsub.v1.IPublishResponse, - protos.google.pubsub.v1.IPublishRequest|undefined, {}|undefined - ]>; - publish( - request: protos.google.pubsub.v1.IPublishRequest, - options: CallOptions, - callback: Callback< - protos.google.pubsub.v1.IPublishResponse, - protos.google.pubsub.v1.IPublishRequest|null|undefined, - {}|null|undefined>): void; - publish( - request: protos.google.pubsub.v1.IPublishRequest, - callback: Callback< - protos.google.pubsub.v1.IPublishResponse, - protos.google.pubsub.v1.IPublishRequest|null|undefined, - {}|null|undefined>): void; - publish( - request?: protos.google.pubsub.v1.IPublishRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.pubsub.v1.IPublishResponse, - protos.google.pubsub.v1.IPublishRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.pubsub.v1.IPublishResponse, - protos.google.pubsub.v1.IPublishRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.pubsub.v1.IPublishResponse, - protos.google.pubsub.v1.IPublishRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'topic': request.topic ?? '', - }); - this.initialize(); - return this.innerApiCalls.publish(request, options, callback); - } -/** - * Gets the configuration of a topic. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.topic - * Required. The name of the topic to get. - * Format is `projects/{project}/topics/{topic}`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.pubsub.v1.Topic|Topic}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - */ - getTopic( - request?: protos.google.pubsub.v1.IGetTopicRequest, - options?: CallOptions): - Promise<[ - protos.google.pubsub.v1.ITopic, - protos.google.pubsub.v1.IGetTopicRequest|undefined, {}|undefined - ]>; - getTopic( - request: protos.google.pubsub.v1.IGetTopicRequest, - options: CallOptions, - callback: Callback< - protos.google.pubsub.v1.ITopic, - protos.google.pubsub.v1.IGetTopicRequest|null|undefined, - {}|null|undefined>): void; - getTopic( - request: protos.google.pubsub.v1.IGetTopicRequest, - callback: Callback< - protos.google.pubsub.v1.ITopic, - protos.google.pubsub.v1.IGetTopicRequest|null|undefined, - {}|null|undefined>): void; - getTopic( - request?: protos.google.pubsub.v1.IGetTopicRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.pubsub.v1.ITopic, - protos.google.pubsub.v1.IGetTopicRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.pubsub.v1.ITopic, - protos.google.pubsub.v1.IGetTopicRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.pubsub.v1.ITopic, - protos.google.pubsub.v1.IGetTopicRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'topic': request.topic ?? '', - }); - this.initialize(); - return this.innerApiCalls.getTopic(request, options, callback); - } -/** - * Deletes the topic with the given name. Returns `NOT_FOUND` if the topic - * does not exist. After a topic is deleted, a new topic may be created with - * the same name; this is an entirely new topic with none of the old - * configuration or subscriptions. Existing subscriptions to this topic are - * not deleted, but their `topic` field is set to `_deleted-topic_`. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.topic - * Required. Name of the topic to delete. - * Format is `projects/{project}/topics/{topic}`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - */ - deleteTopic( - request?: protos.google.pubsub.v1.IDeleteTopicRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.pubsub.v1.IDeleteTopicRequest|undefined, {}|undefined - ]>; - deleteTopic( - request: protos.google.pubsub.v1.IDeleteTopicRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.pubsub.v1.IDeleteTopicRequest|null|undefined, - {}|null|undefined>): void; - deleteTopic( - request: protos.google.pubsub.v1.IDeleteTopicRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.pubsub.v1.IDeleteTopicRequest|null|undefined, - {}|null|undefined>): void; - deleteTopic( - request?: protos.google.pubsub.v1.IDeleteTopicRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.pubsub.v1.IDeleteTopicRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.pubsub.v1.IDeleteTopicRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.pubsub.v1.IDeleteTopicRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'topic': request.topic ?? '', - }); - this.initialize(); - return this.innerApiCalls.deleteTopic(request, options, callback); - } -/** - * Detaches a subscription from this topic. All messages retained in the - * subscription are dropped. Subsequent `Pull` and `StreamingPull` requests - * will return FAILED_PRECONDITION. If the subscription is a push - * subscription, pushes to the endpoint will stop. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.subscription - * Required. The subscription to detach. - * Format is `projects/{project}/subscriptions/{subscription}`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.pubsub.v1.DetachSubscriptionResponse|DetachSubscriptionResponse}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - */ - detachSubscription( - request?: protos.google.pubsub.v1.IDetachSubscriptionRequest, - options?: CallOptions): - Promise<[ - protos.google.pubsub.v1.IDetachSubscriptionResponse, - protos.google.pubsub.v1.IDetachSubscriptionRequest|undefined, {}|undefined - ]>; - detachSubscription( - request: protos.google.pubsub.v1.IDetachSubscriptionRequest, - options: CallOptions, - callback: Callback< - protos.google.pubsub.v1.IDetachSubscriptionResponse, - protos.google.pubsub.v1.IDetachSubscriptionRequest|null|undefined, - {}|null|undefined>): void; - detachSubscription( - request: protos.google.pubsub.v1.IDetachSubscriptionRequest, - callback: Callback< - protos.google.pubsub.v1.IDetachSubscriptionResponse, - protos.google.pubsub.v1.IDetachSubscriptionRequest|null|undefined, - {}|null|undefined>): void; - detachSubscription( - request?: protos.google.pubsub.v1.IDetachSubscriptionRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.pubsub.v1.IDetachSubscriptionResponse, - protos.google.pubsub.v1.IDetachSubscriptionRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.pubsub.v1.IDetachSubscriptionResponse, - protos.google.pubsub.v1.IDetachSubscriptionRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.pubsub.v1.IDetachSubscriptionResponse, - protos.google.pubsub.v1.IDetachSubscriptionRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'subscription': request.subscription ?? '', - }); - this.initialize(); - return this.innerApiCalls.detachSubscription(request, options, callback); - } - - /** - * Lists matching topics. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.project - * Required. The name of the project in which to list topics. - * Format is `projects/{project-id}`. - * @param {number} [request.pageSize] - * Optional. Maximum number of topics to return. - * @param {string} [request.pageToken] - * Optional. The value returned by the last `ListTopicsResponse`; indicates - * that this is a continuation of a prior `ListTopics` call, and that the - * system should return the next page of data. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.pubsub.v1.Topic|Topic}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listTopicsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listTopics( - request?: protos.google.pubsub.v1.IListTopicsRequest, - options?: CallOptions): - Promise<[ - protos.google.pubsub.v1.ITopic[], - protos.google.pubsub.v1.IListTopicsRequest|null, - protos.google.pubsub.v1.IListTopicsResponse - ]>; - listTopics( - request: protos.google.pubsub.v1.IListTopicsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.pubsub.v1.IListTopicsRequest, - protos.google.pubsub.v1.IListTopicsResponse|null|undefined, - protos.google.pubsub.v1.ITopic>): void; - listTopics( - request: protos.google.pubsub.v1.IListTopicsRequest, - callback: PaginationCallback< - protos.google.pubsub.v1.IListTopicsRequest, - protos.google.pubsub.v1.IListTopicsResponse|null|undefined, - protos.google.pubsub.v1.ITopic>): void; - listTopics( - request?: protos.google.pubsub.v1.IListTopicsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.pubsub.v1.IListTopicsRequest, - protos.google.pubsub.v1.IListTopicsResponse|null|undefined, - protos.google.pubsub.v1.ITopic>, - callback?: PaginationCallback< - protos.google.pubsub.v1.IListTopicsRequest, - protos.google.pubsub.v1.IListTopicsResponse|null|undefined, - protos.google.pubsub.v1.ITopic>): - Promise<[ - protos.google.pubsub.v1.ITopic[], - protos.google.pubsub.v1.IListTopicsRequest|null, - protos.google.pubsub.v1.IListTopicsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'project': request.project ?? '', - }); - this.initialize(); - return this.innerApiCalls.listTopics(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.project - * Required. The name of the project in which to list topics. - * Format is `projects/{project-id}`. - * @param {number} [request.pageSize] - * Optional. Maximum number of topics to return. - * @param {string} [request.pageToken] - * Optional. The value returned by the last `ListTopicsResponse`; indicates - * that this is a continuation of a prior `ListTopics` call, and that the - * system should return the next page of data. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link protos.google.pubsub.v1.Topic|Topic} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listTopicsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listTopicsStream( - request?: protos.google.pubsub.v1.IListTopicsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'project': request.project ?? '', - }); - const defaultCallSettings = this._defaults['listTopics']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listTopics.createStream( - this.innerApiCalls.listTopics as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listTopics`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.project - * Required. The name of the project in which to list topics. - * Format is `projects/{project-id}`. - * @param {number} [request.pageSize] - * Optional. Maximum number of topics to return. - * @param {string} [request.pageToken] - * Optional. The value returned by the last `ListTopicsResponse`; indicates - * that this is a continuation of a prior `ListTopics` call, and that the - * system should return the next page of data. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.pubsub.v1.Topic|Topic}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listTopicsAsync( - request?: protos.google.pubsub.v1.IListTopicsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'project': request.project ?? '', - }); - const defaultCallSettings = this._defaults['listTopics']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listTopics.asyncIterate( - this.innerApiCalls['listTopics'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Lists the names of the attached subscriptions on this topic. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.topic - * Required. The name of the topic that subscriptions are attached to. - * Format is `projects/{project}/topics/{topic}`. - * @param {number} [request.pageSize] - * Optional. Maximum number of subscription names to return. - * @param {string} [request.pageToken] - * Optional. The value returned by the last `ListTopicSubscriptionsResponse`; - * indicates that this is a continuation of a prior `ListTopicSubscriptions` - * call, and that the system should return the next page of data. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of string. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listTopicSubscriptionsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listTopicSubscriptions( - request?: protos.google.pubsub.v1.IListTopicSubscriptionsRequest, - options?: CallOptions): - Promise<[ - string[], - protos.google.pubsub.v1.IListTopicSubscriptionsRequest|null, - protos.google.pubsub.v1.IListTopicSubscriptionsResponse - ]>; - listTopicSubscriptions( - request: protos.google.pubsub.v1.IListTopicSubscriptionsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.pubsub.v1.IListTopicSubscriptionsRequest, - protos.google.pubsub.v1.IListTopicSubscriptionsResponse|null|undefined, - string>): void; - listTopicSubscriptions( - request: protos.google.pubsub.v1.IListTopicSubscriptionsRequest, - callback: PaginationCallback< - protos.google.pubsub.v1.IListTopicSubscriptionsRequest, - protos.google.pubsub.v1.IListTopicSubscriptionsResponse|null|undefined, - string>): void; - listTopicSubscriptions( - request?: protos.google.pubsub.v1.IListTopicSubscriptionsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.pubsub.v1.IListTopicSubscriptionsRequest, - protos.google.pubsub.v1.IListTopicSubscriptionsResponse|null|undefined, - string>, - callback?: PaginationCallback< - protos.google.pubsub.v1.IListTopicSubscriptionsRequest, - protos.google.pubsub.v1.IListTopicSubscriptionsResponse|null|undefined, - string>): - Promise<[ - string[], - protos.google.pubsub.v1.IListTopicSubscriptionsRequest|null, - protos.google.pubsub.v1.IListTopicSubscriptionsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'topic': request.topic ?? '', - }); - this.initialize(); - return this.innerApiCalls.listTopicSubscriptions(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.topic - * Required. The name of the topic that subscriptions are attached to. - * Format is `projects/{project}/topics/{topic}`. - * @param {number} [request.pageSize] - * Optional. Maximum number of subscription names to return. - * @param {string} [request.pageToken] - * Optional. The value returned by the last `ListTopicSubscriptionsResponse`; - * indicates that this is a continuation of a prior `ListTopicSubscriptions` - * call, and that the system should return the next page of data. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing string on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listTopicSubscriptionsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listTopicSubscriptionsStream( - request?: protos.google.pubsub.v1.IListTopicSubscriptionsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'topic': request.topic ?? '', - }); - const defaultCallSettings = this._defaults['listTopicSubscriptions']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listTopicSubscriptions.createStream( - this.innerApiCalls.listTopicSubscriptions as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listTopicSubscriptions`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.topic - * Required. The name of the topic that subscriptions are attached to. - * Format is `projects/{project}/topics/{topic}`. - * @param {number} [request.pageSize] - * Optional. Maximum number of subscription names to return. - * @param {string} [request.pageToken] - * Optional. The value returned by the last `ListTopicSubscriptionsResponse`; - * indicates that this is a continuation of a prior `ListTopicSubscriptions` - * call, and that the system should return the next page of data. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * string. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listTopicSubscriptionsAsync( - request?: protos.google.pubsub.v1.IListTopicSubscriptionsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'topic': request.topic ?? '', - }); - const defaultCallSettings = this._defaults['listTopicSubscriptions']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listTopicSubscriptions.asyncIterate( - this.innerApiCalls['listTopicSubscriptions'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Lists the names of the snapshots on this topic. Snapshots are used in - * [Seek](https://cloud.google.com/pubsub/docs/replay-overview) operations, - * which allow you to manage message acknowledgments in bulk. That is, you can - * set the acknowledgment state of messages in an existing subscription to the - * state captured by a snapshot. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.topic - * Required. The name of the topic that snapshots are attached to. - * Format is `projects/{project}/topics/{topic}`. - * @param {number} [request.pageSize] - * Optional. Maximum number of snapshot names to return. - * @param {string} [request.pageToken] - * Optional. The value returned by the last `ListTopicSnapshotsResponse`; - * indicates that this is a continuation of a prior `ListTopicSnapshots` call, - * and that the system should return the next page of data. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of string. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listTopicSnapshotsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listTopicSnapshots( - request?: protos.google.pubsub.v1.IListTopicSnapshotsRequest, - options?: CallOptions): - Promise<[ - string[], - protos.google.pubsub.v1.IListTopicSnapshotsRequest|null, - protos.google.pubsub.v1.IListTopicSnapshotsResponse - ]>; - listTopicSnapshots( - request: protos.google.pubsub.v1.IListTopicSnapshotsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.pubsub.v1.IListTopicSnapshotsRequest, - protos.google.pubsub.v1.IListTopicSnapshotsResponse|null|undefined, - string>): void; - listTopicSnapshots( - request: protos.google.pubsub.v1.IListTopicSnapshotsRequest, - callback: PaginationCallback< - protos.google.pubsub.v1.IListTopicSnapshotsRequest, - protos.google.pubsub.v1.IListTopicSnapshotsResponse|null|undefined, - string>): void; - listTopicSnapshots( - request?: protos.google.pubsub.v1.IListTopicSnapshotsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.pubsub.v1.IListTopicSnapshotsRequest, - protos.google.pubsub.v1.IListTopicSnapshotsResponse|null|undefined, - string>, - callback?: PaginationCallback< - protos.google.pubsub.v1.IListTopicSnapshotsRequest, - protos.google.pubsub.v1.IListTopicSnapshotsResponse|null|undefined, - string>): - Promise<[ - string[], - protos.google.pubsub.v1.IListTopicSnapshotsRequest|null, - protos.google.pubsub.v1.IListTopicSnapshotsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'topic': request.topic ?? '', - }); - this.initialize(); - return this.innerApiCalls.listTopicSnapshots(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.topic - * Required. The name of the topic that snapshots are attached to. - * Format is `projects/{project}/topics/{topic}`. - * @param {number} [request.pageSize] - * Optional. Maximum number of snapshot names to return. - * @param {string} [request.pageToken] - * Optional. The value returned by the last `ListTopicSnapshotsResponse`; - * indicates that this is a continuation of a prior `ListTopicSnapshots` call, - * and that the system should return the next page of data. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing string on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listTopicSnapshotsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listTopicSnapshotsStream( - request?: protos.google.pubsub.v1.IListTopicSnapshotsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'topic': request.topic ?? '', - }); - const defaultCallSettings = this._defaults['listTopicSnapshots']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listTopicSnapshots.createStream( - this.innerApiCalls.listTopicSnapshots as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listTopicSnapshots`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.topic - * Required. The name of the topic that snapshots are attached to. - * Format is `projects/{project}/topics/{topic}`. - * @param {number} [request.pageSize] - * Optional. Maximum number of snapshot names to return. - * @param {string} [request.pageToken] - * Optional. The value returned by the last `ListTopicSnapshotsResponse`; - * indicates that this is a continuation of a prior `ListTopicSnapshots` call, - * and that the system should return the next page of data. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * string. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listTopicSnapshotsAsync( - request?: protos.google.pubsub.v1.IListTopicSnapshotsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'topic': request.topic ?? '', - }); - const defaultCallSettings = this._defaults['listTopicSnapshots']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listTopicSnapshots.asyncIterate( - this.innerApiCalls['listTopicSnapshots'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } -/** - * Gets the access control policy for a resource. Returns an empty policy - * if the resource exists and does not have a policy set. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {Object} [request.options] - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. This field is only used by Cloud IAM. - * - * This object should have the same structure as {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing {@link google.iam.v1.Policy | Policy}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.Policy | Policy}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - getIamPolicy( - request: IamProtos.google.iam.v1.GetIamPolicyRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ):Promise<[IamProtos.google.iam.v1.Policy]> { - return this.iamClient.getIamPolicy(request, options, callback); - } - -/** - * Returns permissions that a caller has on the specified resource. If the - * resource does not exist, this will return an empty set of - * permissions, not a NOT_FOUND error. - * - * Note: This operation is designed to be used for building - * permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {string[]} request.permissions - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - setIamPolicy( - request: IamProtos.google.iam.v1.SetIamPolicyRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ):Promise<[IamProtos.google.iam.v1.Policy]> { - return this.iamClient.setIamPolicy(request, options, callback); - } - -/** - * Returns permissions that a caller has on the specified resource. If the - * resource does not exist, this will return an empty set of - * permissions, not a NOT_FOUND error. - * - * Note: This operation is designed to be used for building - * permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {string[]} request.permissions - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - */ - testIamPermissions( - request: IamProtos.google.iam.v1.TestIamPermissionsRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.TestIamPermissionsResponse, - IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.TestIamPermissionsResponse, - IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, - {} | null | undefined - > - ):Promise<[IamProtos.google.iam.v1.TestIamPermissionsResponse]> { - return this.iamClient.testIamPermissions(request, options, callback); - } - - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified project resource name string. - * - * @param {string} project - * @returns {string} Resource name string. - */ - projectPath(project:string) { - return this.pathTemplates.projectPathTemplate.render({ - project: project, - }); - } - - /** - * Parse the project from Project resource. - * - * @param {string} projectName - * A fully-qualified path representing Project resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectName(projectName: string) { - return this.pathTemplates.projectPathTemplate.match(projectName).project; - } - - /** - * Return a fully-qualified projectTopic resource name string. - * - * @param {string} project - * @param {string} topic - * @returns {string} Resource name string. - */ - projectTopicPath(project:string,topic:string) { - return this.pathTemplates.projectTopicPathTemplate.render({ - project: project, - topic: topic, - }); - } - - /** - * Parse the project from ProjectTopic resource. - * - * @param {string} projectTopicName - * A fully-qualified path representing project_topic resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectTopicName(projectTopicName: string) { - return this.pathTemplates.projectTopicPathTemplate.match(projectTopicName).project; - } - - /** - * Parse the topic from ProjectTopic resource. - * - * @param {string} projectTopicName - * A fully-qualified path representing project_topic resource. - * @returns {string} A string representing the topic. - */ - matchTopicFromProjectTopicName(projectTopicName: string) { - return this.pathTemplates.projectTopicPathTemplate.match(projectTopicName).topic; - } - - /** - * Return a fully-qualified schema resource name string. - * - * @param {string} project - * @param {string} schema - * @returns {string} Resource name string. - */ - schemaPath(project:string,schema:string) { - return this.pathTemplates.schemaPathTemplate.render({ - project: project, - schema: schema, - }); - } - - /** - * Parse the project from Schema resource. - * - * @param {string} schemaName - * A fully-qualified path representing Schema resource. - * @returns {string} A string representing the project. - */ - matchProjectFromSchemaName(schemaName: string) { - return this.pathTemplates.schemaPathTemplate.match(schemaName).project; - } - - /** - * Parse the schema from Schema resource. - * - * @param {string} schemaName - * A fully-qualified path representing Schema resource. - * @returns {string} A string representing the schema. - */ - matchSchemaFromSchemaName(schemaName: string) { - return this.pathTemplates.schemaPathTemplate.match(schemaName).schema; - } - - /** - * Return a fully-qualified snapshot resource name string. - * - * @param {string} project - * @param {string} snapshot - * @returns {string} Resource name string. - */ - snapshotPath(project:string,snapshot:string) { - return this.pathTemplates.snapshotPathTemplate.render({ - project: project, - snapshot: snapshot, - }); - } - - /** - * Parse the project from Snapshot resource. - * - * @param {string} snapshotName - * A fully-qualified path representing Snapshot resource. - * @returns {string} A string representing the project. - */ - matchProjectFromSnapshotName(snapshotName: string) { - return this.pathTemplates.snapshotPathTemplate.match(snapshotName).project; - } - - /** - * Parse the snapshot from Snapshot resource. - * - * @param {string} snapshotName - * A fully-qualified path representing Snapshot resource. - * @returns {string} A string representing the snapshot. - */ - matchSnapshotFromSnapshotName(snapshotName: string) { - return this.pathTemplates.snapshotPathTemplate.match(snapshotName).snapshot; - } - - /** - * Return a fully-qualified subscription resource name string. - * - * @param {string} project - * @param {string} subscription - * @returns {string} Resource name string. - */ - subscriptionPath(project:string,subscription:string) { - return this.pathTemplates.subscriptionPathTemplate.render({ - project: project, - subscription: subscription, - }); - } - - /** - * Parse the project from Subscription resource. - * - * @param {string} subscriptionName - * A fully-qualified path representing Subscription resource. - * @returns {string} A string representing the project. - */ - matchProjectFromSubscriptionName(subscriptionName: string) { - return this.pathTemplates.subscriptionPathTemplate.match(subscriptionName).project; - } - - /** - * Parse the subscription from Subscription resource. - * - * @param {string} subscriptionName - * A fully-qualified path representing Subscription resource. - * @returns {string} A string representing the subscription. - */ - matchSubscriptionFromSubscriptionName(subscriptionName: string) { - return this.pathTemplates.subscriptionPathTemplate.match(subscriptionName).subscription; - } - - /** - * Terminate the gRPC channel and close the client. - * - * The client will no longer be usable and all future behavior is undefined. - * @returns {Promise} A promise that resolves when the client is closed. - */ - close(): Promise { - if (this.publisherStub && !this._terminated) { - return this.publisherStub.then(stub => { - this._terminated = true; - stub.close(); - this.iamClient.close(); - }); - } - return Promise.resolve(); - } -} diff --git a/owl-bot-staging/v1/src/v1/publisher_client_config.json b/owl-bot-staging/v1/src/v1/publisher_client_config.json deleted file mode 100644 index 187d70936..000000000 --- a/owl-bot-staging/v1/src/v1/publisher_client_config.json +++ /dev/null @@ -1,103 +0,0 @@ -{ - "interfaces": { - "google.pubsub.v1.Publisher": { - "retry_codes": { - "non_idempotent": [], - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ], - "unavailable": [ - "UNAVAILABLE" - ], - "cancelled_unknown_deadline_exceeded_resource_exhausted_aborted_internal_unavailable": [ - "CANCELLED", - "UNKNOWN", - "DEADLINE_EXCEEDED", - "RESOURCE_EXHAUSTED", - "ABORTED", - "INTERNAL", - "UNAVAILABLE" - ], - "unknown_aborted_unavailable": [ - "UNKNOWN", - "ABORTED", - "UNAVAILABLE" - ] - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - }, - "693222d32e887d96c8faeadca469f7763ccda85a": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 4, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "CreateTopic": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "default" - }, - "UpdateTopic": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "default" - }, - "Publish": { - "timeout_millis": 60000, - "retry_codes_name": "cancelled_unknown_deadline_exceeded_resource_exhausted_aborted_internal_unavailable", - "retry_params_name": "693222d32e887d96c8faeadca469f7763ccda85a", - "bundling": { - "element_count_threshold": 100, - "request_byte_threshold": 1048576, - "delay_threshold_millis": 10, - "element_count_limit": 1000 - } - }, - "GetTopic": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_aborted_unavailable", - "retry_params_name": "default" - }, - "ListTopics": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_aborted_unavailable", - "retry_params_name": "default" - }, - "ListTopicSubscriptions": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_aborted_unavailable", - "retry_params_name": "default" - }, - "ListTopicSnapshots": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_aborted_unavailable", - "retry_params_name": "default" - }, - "DeleteTopic": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "default" - }, - "DetachSubscription": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/v1/src/v1/publisher_proto_list.json b/owl-bot-staging/v1/src/v1/publisher_proto_list.json deleted file mode 100644 index 91011aec1..000000000 --- a/owl-bot-staging/v1/src/v1/publisher_proto_list.json +++ /dev/null @@ -1,4 +0,0 @@ -[ - "../../protos/google/pubsub/v1/pubsub.proto", - "../../protos/google/pubsub/v1/schema.proto" -] diff --git a/owl-bot-staging/v1/src/v1/schema_service_client.ts b/owl-bot-staging/v1/src/v1/schema_service_client.ts deleted file mode 100644 index f7f64778e..000000000 --- a/owl-bot-staging/v1/src/v1/schema_service_client.ts +++ /dev/null @@ -1,1643 +0,0 @@ -// 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 -// -// https://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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -/* global window */ -import type * as gax from 'google-gax'; -import type {Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback, GaxCall, IamClient, IamProtos} from 'google-gax'; -import {Transform} from 'stream'; -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); - -/** - * Client JSON configuration object, loaded from - * `src/v1/schema_service_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './schema_service_client_config.json'; -const version = require('../../../package.json').version; - -/** - * Service for doing schema-related operations. - * @class - * @memberof v1 - */ -export class SchemaServiceClient { - private _terminated = false; - private _opts: ClientOptions; - private _providedCustomServicePath: boolean; - private _gaxModule: typeof gax | typeof gax.fallback; - private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; - private _protos: {}; - private _defaults: {[method: string]: gax.CallSettings}; - private _universeDomain: string; - private _servicePath: string; - auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: {[name: string]: Function}; - iamClient: IamClient; - pathTemplates: {[name: string]: gax.PathTemplate}; - schemaServiceStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of SchemaServiceClient. - * - * @param {object} [options] - The configuration object. - * The options accepted by the constructor are described in detail - * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). - * The common options are: - * @param {object} [options.credentials] - Credentials object. - * @param {string} [options.credentials.client_email] - * @param {string} [options.credentials.private_key] - * @param {string} [options.email] - Account email address. Required when - * using a .pem or .p12 keyFilename. - * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or - * .p12 key downloaded from the Google Developers Console. If you provide - * a path to a JSON file, the projectId option below is not necessary. - * NOTE: .pem and .p12 require you to specify options.email as well. - * @param {number} [options.port] - The port on which to connect to - * the remote host. - * @param {string} [options.projectId] - The project ID from the Google - * Developer's Console, e.g. 'grape-spaceship-123'. We will also check - * the environment variable GCLOUD_PROJECT for your project ID. If your - * app is running in an environment which supports - * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, - * your project ID will be detected automatically. - * @param {string} [options.apiEndpoint] - The domain name of the - * API remote host. - * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. - * Follows the structure of {@link gapicConfig}. - * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. - * For more information, please check the - * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. - * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you - * need to avoid loading the default gRPC version and want to use the fallback - * HTTP implementation. Load only fallback version and pass it to the constructor: - * ``` - * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new SchemaServiceClient({fallback: true}, gax); - * ``` - */ - constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { - // Ensure that options include all the required fields. - const staticMembers = this.constructor as typeof SchemaServiceClient; - if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) { - throw new Error('Please set either universe_domain or universeDomain, but not both.'); - } - const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined; - this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com'; - this._servicePath = 'pubsub.' + this._universeDomain; - const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; - this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); - const port = opts?.port || staticMembers.port; - const clientConfig = opts?.clientConfig ?? {}; - const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); - opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); - - // Request numeric enum values if REST transport is used. - opts.numericEnums = true; - - // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. - if (servicePath !== this._servicePath && !('scopes' in opts)) { - opts['scopes'] = staticMembers.scopes; - } - - // Load google-gax module synchronously if needed - if (!gaxInstance) { - gaxInstance = require('google-gax') as typeof gax; - } - - // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; - - // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. - this._gaxGrpc = new this._gaxModule.GrpcClient(opts); - - // Save options to use in initialize() method. - this._opts = opts; - - // Save the auth object to the client, for use by other methods. - this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); - - // Set useJWTAccessWithScope on the auth object. - this.auth.useJWTAccessWithScope = true; - - // Set defaultServicePath on the auth object. - this.auth.defaultServicePath = this._servicePath; - - // Set the default scopes in auth client if needed. - if (servicePath === this._servicePath) { - this.auth.defaultScopes = staticMembers.scopes; - } - this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); - - - // Determine the client header string. - const clientHeader = [ - `gax/${this._gaxModule.version}`, - `gapic/${version}`, - ]; - if (typeof process === 'object' && 'versions' in process) { - clientHeader.push(`gl-node/${process.versions.node}`); - } else { - clientHeader.push(`gl-web/${this._gaxModule.version}`); - } - if (!opts.fallback) { - clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else { - clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); - } - if (opts.libName && opts.libVersion) { - clientHeader.push(`${opts.libName}/${opts.libVersion}`); - } - // Load the applicable protos. - this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); - - // This API contains "path templates"; forward-slash-separated - // identifiers to uniquely identify resources within the API. - // Create useful helper objects for these. - this.pathTemplates = { - projectPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}' - ), - projectTopicPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/topics/{topic}' - ), - schemaPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/schemas/{schema}' - ), - snapshotPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/snapshots/{snapshot}' - ), - subscriptionPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/subscriptions/{subscription}' - ), - }; - - // Some of the methods on this service return "paged" results, - // (e.g. 50 results at a time, with tokens to get subsequent - // pages). Denote the keys used for pagination and results. - this.descriptors.page = { - listSchemas: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'schemas'), - listSchemaRevisions: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'schemas') - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.pubsub.v1.SchemaService', gapicConfig as gax.ClientConfig, - opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); - - // Set up a dictionary of "inner API calls"; the core implementation - // of calling the API is handled in `google-gax`, with this code - // merely providing the destination and request information. - this.innerApiCalls = {}; - - // Add a warn function to the client constructor so it can be easily tested. - this.warn = this._gaxModule.warn; - } - - /** - * Initialize the client. - * Performs asynchronous operations (such as authentication) and prepares the client. - * This function will be called automatically when any class method is called for the - * first time, but if you need to initialize it before calling an actual method, - * feel free to call initialize() directly. - * - * You can await on this method if you want to make sure the client is initialized. - * - * @returns {Promise} A promise that resolves to an authenticated service stub. - */ - initialize() { - // If the client stub promise is already initialized, return immediately. - if (this.schemaServiceStub) { - return this.schemaServiceStub; - } - - // Put together the "service stub" for - // google.pubsub.v1.SchemaService. - this.schemaServiceStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.pubsub.v1.SchemaService') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.pubsub.v1.SchemaService, - this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; - - // Iterate over each of the methods that the service provides - // and create an API call method for each. - const schemaServiceStubMethods = - ['createSchema', 'getSchema', 'listSchemas', 'listSchemaRevisions', 'commitSchema', 'rollbackSchema', 'deleteSchemaRevision', 'deleteSchema', 'validateSchema', 'validateMessage']; - for (const methodName of schemaServiceStubMethods) { - const callPromise = this.schemaServiceStub.then( - stub => (...args: Array<{}>) => { - if (this._terminated) { - return Promise.reject('The client has already been closed.'); - } - const func = stub[methodName]; - return func.apply(stub, args); - }, - (err: Error|null|undefined) => () => { - throw err; - }); - - const descriptor = - this.descriptors.page[methodName] || - undefined; - const apiCall = this._gaxModule.createApiCall( - callPromise, - this._defaults[methodName], - descriptor, - this._opts.fallback - ); - - this.innerApiCalls[methodName] = apiCall; - } - - return this.schemaServiceStub; - } - - /** - * The DNS address for this API service. - * @deprecated Use the apiEndpoint method of the client instance. - * @returns {string} The DNS address for this service. - */ - static get servicePath() { - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); - } - return 'pubsub.googleapis.com'; - } - - /** - * The DNS address for this API service - same as servicePath. - * @deprecated Use the apiEndpoint method of the client instance. - * @returns {string} The DNS address for this service. - */ - static get apiEndpoint() { - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); - } - return 'pubsub.googleapis.com'; - } - - /** - * The DNS address for this API service. - * @returns {string} The DNS address for this service. - */ - get apiEndpoint() { - return this._servicePath; - } - - get universeDomain() { - return this._universeDomain; - } - - /** - * The port for this API service. - * @returns {number} The default port for this service. - */ - static get port() { - return 443; - } - - /** - * The scopes needed to make gRPC calls for every method defined - * in this service. - * @returns {string[]} List of default scopes. - */ - static get scopes() { - return [ - 'https://www.googleapis.com/auth/cloud-platform', - 'https://www.googleapis.com/auth/pubsub' - ]; - } - - getProjectId(): Promise; - getProjectId(callback: Callback): void; - /** - * Return the project ID used by this class. - * @returns {Promise} A promise that resolves to string containing the project ID. - */ - getProjectId(callback?: Callback): - Promise|void { - if (callback) { - this.auth.getProjectId(callback); - return; - } - return this.auth.getProjectId(); - } - - // ------------------- - // -- Service calls -- - // ------------------- -/** - * Creates a schema. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the project in which to create the schema. - * Format is `projects/{project-id}`. - * @param {google.pubsub.v1.Schema} request.schema - * Required. The schema object to create. - * - * This schema's `name` parameter is ignored. The schema object returned - * by CreateSchema will have a `name` made using the given `parent` and - * `schema_id`. - * @param {string} request.schemaId - * The ID to use for the schema, which will become the final component of - * the schema's resource name. - * - * See https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names for - * resource name constraints. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.pubsub.v1.Schema|Schema}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - */ - createSchema( - request?: protos.google.pubsub.v1.ICreateSchemaRequest, - options?: CallOptions): - Promise<[ - protos.google.pubsub.v1.ISchema, - protos.google.pubsub.v1.ICreateSchemaRequest|undefined, {}|undefined - ]>; - createSchema( - request: protos.google.pubsub.v1.ICreateSchemaRequest, - options: CallOptions, - callback: Callback< - protos.google.pubsub.v1.ISchema, - protos.google.pubsub.v1.ICreateSchemaRequest|null|undefined, - {}|null|undefined>): void; - createSchema( - request: protos.google.pubsub.v1.ICreateSchemaRequest, - callback: Callback< - protos.google.pubsub.v1.ISchema, - protos.google.pubsub.v1.ICreateSchemaRequest|null|undefined, - {}|null|undefined>): void; - createSchema( - request?: protos.google.pubsub.v1.ICreateSchemaRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.pubsub.v1.ISchema, - protos.google.pubsub.v1.ICreateSchemaRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.pubsub.v1.ISchema, - protos.google.pubsub.v1.ICreateSchemaRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.pubsub.v1.ISchema, - protos.google.pubsub.v1.ICreateSchemaRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize(); - return this.innerApiCalls.createSchema(request, options, callback); - } -/** - * Gets a schema. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the schema to get. - * Format is `projects/{project}/schemas/{schema}`. - * @param {google.pubsub.v1.SchemaView} request.view - * The set of fields to return in the response. If not set, returns a Schema - * with all fields filled out. Set to `BASIC` to omit the `definition`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.pubsub.v1.Schema|Schema}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - */ - getSchema( - request?: protos.google.pubsub.v1.IGetSchemaRequest, - options?: CallOptions): - Promise<[ - protos.google.pubsub.v1.ISchema, - protos.google.pubsub.v1.IGetSchemaRequest|undefined, {}|undefined - ]>; - getSchema( - request: protos.google.pubsub.v1.IGetSchemaRequest, - options: CallOptions, - callback: Callback< - protos.google.pubsub.v1.ISchema, - protos.google.pubsub.v1.IGetSchemaRequest|null|undefined, - {}|null|undefined>): void; - getSchema( - request: protos.google.pubsub.v1.IGetSchemaRequest, - callback: Callback< - protos.google.pubsub.v1.ISchema, - protos.google.pubsub.v1.IGetSchemaRequest|null|undefined, - {}|null|undefined>): void; - getSchema( - request?: protos.google.pubsub.v1.IGetSchemaRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.pubsub.v1.ISchema, - protos.google.pubsub.v1.IGetSchemaRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.pubsub.v1.ISchema, - protos.google.pubsub.v1.IGetSchemaRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.pubsub.v1.ISchema, - protos.google.pubsub.v1.IGetSchemaRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.getSchema(request, options, callback); - } -/** - * Commits a new schema revision to an existing schema. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the schema we are revising. - * Format is `projects/{project}/schemas/{schema}`. - * @param {google.pubsub.v1.Schema} request.schema - * Required. The schema revision to commit. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.pubsub.v1.Schema|Schema}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - */ - commitSchema( - request?: protos.google.pubsub.v1.ICommitSchemaRequest, - options?: CallOptions): - Promise<[ - protos.google.pubsub.v1.ISchema, - protos.google.pubsub.v1.ICommitSchemaRequest|undefined, {}|undefined - ]>; - commitSchema( - request: protos.google.pubsub.v1.ICommitSchemaRequest, - options: CallOptions, - callback: Callback< - protos.google.pubsub.v1.ISchema, - protos.google.pubsub.v1.ICommitSchemaRequest|null|undefined, - {}|null|undefined>): void; - commitSchema( - request: protos.google.pubsub.v1.ICommitSchemaRequest, - callback: Callback< - protos.google.pubsub.v1.ISchema, - protos.google.pubsub.v1.ICommitSchemaRequest|null|undefined, - {}|null|undefined>): void; - commitSchema( - request?: protos.google.pubsub.v1.ICommitSchemaRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.pubsub.v1.ISchema, - protos.google.pubsub.v1.ICommitSchemaRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.pubsub.v1.ISchema, - protos.google.pubsub.v1.ICommitSchemaRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.pubsub.v1.ISchema, - protos.google.pubsub.v1.ICommitSchemaRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.commitSchema(request, options, callback); - } -/** - * Creates a new schema revision that is a copy of the provided revision_id. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The schema being rolled back with revision id. - * @param {string} request.revisionId - * Required. The revision ID to roll back to. - * It must be a revision of the same schema. - * - * Example: c7cfa2a8 - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.pubsub.v1.Schema|Schema}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - */ - rollbackSchema( - request?: protos.google.pubsub.v1.IRollbackSchemaRequest, - options?: CallOptions): - Promise<[ - protos.google.pubsub.v1.ISchema, - protos.google.pubsub.v1.IRollbackSchemaRequest|undefined, {}|undefined - ]>; - rollbackSchema( - request: protos.google.pubsub.v1.IRollbackSchemaRequest, - options: CallOptions, - callback: Callback< - protos.google.pubsub.v1.ISchema, - protos.google.pubsub.v1.IRollbackSchemaRequest|null|undefined, - {}|null|undefined>): void; - rollbackSchema( - request: protos.google.pubsub.v1.IRollbackSchemaRequest, - callback: Callback< - protos.google.pubsub.v1.ISchema, - protos.google.pubsub.v1.IRollbackSchemaRequest|null|undefined, - {}|null|undefined>): void; - rollbackSchema( - request?: protos.google.pubsub.v1.IRollbackSchemaRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.pubsub.v1.ISchema, - protos.google.pubsub.v1.IRollbackSchemaRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.pubsub.v1.ISchema, - protos.google.pubsub.v1.IRollbackSchemaRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.pubsub.v1.ISchema, - protos.google.pubsub.v1.IRollbackSchemaRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.rollbackSchema(request, options, callback); - } -/** - * Deletes a specific schema revision. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the schema revision to be deleted, with a revision ID - * explicitly included. - * - * Example: `projects/123/schemas/my-schema@c7cfa2a8` - * @param {string} [request.revisionId] - * Optional. This field is deprecated and should not be used for specifying - * the revision ID. The revision ID should be specified via the `name` - * parameter. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.pubsub.v1.Schema|Schema}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - */ - deleteSchemaRevision( - request?: protos.google.pubsub.v1.IDeleteSchemaRevisionRequest, - options?: CallOptions): - Promise<[ - protos.google.pubsub.v1.ISchema, - protos.google.pubsub.v1.IDeleteSchemaRevisionRequest|undefined, {}|undefined - ]>; - deleteSchemaRevision( - request: protos.google.pubsub.v1.IDeleteSchemaRevisionRequest, - options: CallOptions, - callback: Callback< - protos.google.pubsub.v1.ISchema, - protos.google.pubsub.v1.IDeleteSchemaRevisionRequest|null|undefined, - {}|null|undefined>): void; - deleteSchemaRevision( - request: protos.google.pubsub.v1.IDeleteSchemaRevisionRequest, - callback: Callback< - protos.google.pubsub.v1.ISchema, - protos.google.pubsub.v1.IDeleteSchemaRevisionRequest|null|undefined, - {}|null|undefined>): void; - deleteSchemaRevision( - request?: protos.google.pubsub.v1.IDeleteSchemaRevisionRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.pubsub.v1.ISchema, - protos.google.pubsub.v1.IDeleteSchemaRevisionRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.pubsub.v1.ISchema, - protos.google.pubsub.v1.IDeleteSchemaRevisionRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.pubsub.v1.ISchema, - protos.google.pubsub.v1.IDeleteSchemaRevisionRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.deleteSchemaRevision(request, options, callback); - } -/** - * Deletes a schema. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Name of the schema to delete. - * Format is `projects/{project}/schemas/{schema}`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - */ - deleteSchema( - request?: protos.google.pubsub.v1.IDeleteSchemaRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.pubsub.v1.IDeleteSchemaRequest|undefined, {}|undefined - ]>; - deleteSchema( - request: protos.google.pubsub.v1.IDeleteSchemaRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.pubsub.v1.IDeleteSchemaRequest|null|undefined, - {}|null|undefined>): void; - deleteSchema( - request: protos.google.pubsub.v1.IDeleteSchemaRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.pubsub.v1.IDeleteSchemaRequest|null|undefined, - {}|null|undefined>): void; - deleteSchema( - request?: protos.google.pubsub.v1.IDeleteSchemaRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.pubsub.v1.IDeleteSchemaRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.pubsub.v1.IDeleteSchemaRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.pubsub.v1.IDeleteSchemaRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.deleteSchema(request, options, callback); - } -/** - * Validates a schema. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the project in which to validate schemas. - * Format is `projects/{project-id}`. - * @param {google.pubsub.v1.Schema} request.schema - * Required. The schema object to validate. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.pubsub.v1.ValidateSchemaResponse|ValidateSchemaResponse}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - */ - validateSchema( - request?: protos.google.pubsub.v1.IValidateSchemaRequest, - options?: CallOptions): - Promise<[ - protos.google.pubsub.v1.IValidateSchemaResponse, - protos.google.pubsub.v1.IValidateSchemaRequest|undefined, {}|undefined - ]>; - validateSchema( - request: protos.google.pubsub.v1.IValidateSchemaRequest, - options: CallOptions, - callback: Callback< - protos.google.pubsub.v1.IValidateSchemaResponse, - protos.google.pubsub.v1.IValidateSchemaRequest|null|undefined, - {}|null|undefined>): void; - validateSchema( - request: protos.google.pubsub.v1.IValidateSchemaRequest, - callback: Callback< - protos.google.pubsub.v1.IValidateSchemaResponse, - protos.google.pubsub.v1.IValidateSchemaRequest|null|undefined, - {}|null|undefined>): void; - validateSchema( - request?: protos.google.pubsub.v1.IValidateSchemaRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.pubsub.v1.IValidateSchemaResponse, - protos.google.pubsub.v1.IValidateSchemaRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.pubsub.v1.IValidateSchemaResponse, - protos.google.pubsub.v1.IValidateSchemaRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.pubsub.v1.IValidateSchemaResponse, - protos.google.pubsub.v1.IValidateSchemaRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize(); - return this.innerApiCalls.validateSchema(request, options, callback); - } -/** - * Validates a message against a schema. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the project in which to validate schemas. - * Format is `projects/{project-id}`. - * @param {string} request.name - * Name of the schema against which to validate. - * - * Format is `projects/{project}/schemas/{schema}`. - * @param {google.pubsub.v1.Schema} request.schema - * Ad-hoc schema against which to validate - * @param {Buffer} request.message - * Message to validate against the provided `schema_spec`. - * @param {google.pubsub.v1.Encoding} request.encoding - * The encoding expected for messages - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.pubsub.v1.ValidateMessageResponse|ValidateMessageResponse}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - */ - validateMessage( - request?: protos.google.pubsub.v1.IValidateMessageRequest, - options?: CallOptions): - Promise<[ - protos.google.pubsub.v1.IValidateMessageResponse, - protos.google.pubsub.v1.IValidateMessageRequest|undefined, {}|undefined - ]>; - validateMessage( - request: protos.google.pubsub.v1.IValidateMessageRequest, - options: CallOptions, - callback: Callback< - protos.google.pubsub.v1.IValidateMessageResponse, - protos.google.pubsub.v1.IValidateMessageRequest|null|undefined, - {}|null|undefined>): void; - validateMessage( - request: protos.google.pubsub.v1.IValidateMessageRequest, - callback: Callback< - protos.google.pubsub.v1.IValidateMessageResponse, - protos.google.pubsub.v1.IValidateMessageRequest|null|undefined, - {}|null|undefined>): void; - validateMessage( - request?: protos.google.pubsub.v1.IValidateMessageRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.pubsub.v1.IValidateMessageResponse, - protos.google.pubsub.v1.IValidateMessageRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.pubsub.v1.IValidateMessageResponse, - protos.google.pubsub.v1.IValidateMessageRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.pubsub.v1.IValidateMessageResponse, - protos.google.pubsub.v1.IValidateMessageRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize(); - return this.innerApiCalls.validateMessage(request, options, callback); - } - - /** - * Lists schemas in a project. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the project in which to list schemas. - * Format is `projects/{project-id}`. - * @param {google.pubsub.v1.SchemaView} request.view - * The set of Schema fields to return in the response. If not set, returns - * Schemas with `name` and `type`, but not `definition`. Set to `FULL` to - * retrieve all fields. - * @param {number} request.pageSize - * Maximum number of schemas to return. - * @param {string} request.pageToken - * The value returned by the last `ListSchemasResponse`; indicates that - * this is a continuation of a prior `ListSchemas` call, and that the - * system should return the next page of data. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.pubsub.v1.Schema|Schema}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listSchemasAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listSchemas( - request?: protos.google.pubsub.v1.IListSchemasRequest, - options?: CallOptions): - Promise<[ - protos.google.pubsub.v1.ISchema[], - protos.google.pubsub.v1.IListSchemasRequest|null, - protos.google.pubsub.v1.IListSchemasResponse - ]>; - listSchemas( - request: protos.google.pubsub.v1.IListSchemasRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.pubsub.v1.IListSchemasRequest, - protos.google.pubsub.v1.IListSchemasResponse|null|undefined, - protos.google.pubsub.v1.ISchema>): void; - listSchemas( - request: protos.google.pubsub.v1.IListSchemasRequest, - callback: PaginationCallback< - protos.google.pubsub.v1.IListSchemasRequest, - protos.google.pubsub.v1.IListSchemasResponse|null|undefined, - protos.google.pubsub.v1.ISchema>): void; - listSchemas( - request?: protos.google.pubsub.v1.IListSchemasRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.pubsub.v1.IListSchemasRequest, - protos.google.pubsub.v1.IListSchemasResponse|null|undefined, - protos.google.pubsub.v1.ISchema>, - callback?: PaginationCallback< - protos.google.pubsub.v1.IListSchemasRequest, - protos.google.pubsub.v1.IListSchemasResponse|null|undefined, - protos.google.pubsub.v1.ISchema>): - Promise<[ - protos.google.pubsub.v1.ISchema[], - protos.google.pubsub.v1.IListSchemasRequest|null, - protos.google.pubsub.v1.IListSchemasResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize(); - return this.innerApiCalls.listSchemas(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the project in which to list schemas. - * Format is `projects/{project-id}`. - * @param {google.pubsub.v1.SchemaView} request.view - * The set of Schema fields to return in the response. If not set, returns - * Schemas with `name` and `type`, but not `definition`. Set to `FULL` to - * retrieve all fields. - * @param {number} request.pageSize - * Maximum number of schemas to return. - * @param {string} request.pageToken - * The value returned by the last `ListSchemasResponse`; indicates that - * this is a continuation of a prior `ListSchemas` call, and that the - * system should return the next page of data. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link protos.google.pubsub.v1.Schema|Schema} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listSchemasAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listSchemasStream( - request?: protos.google.pubsub.v1.IListSchemasRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listSchemas']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listSchemas.createStream( - this.innerApiCalls.listSchemas as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listSchemas`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the project in which to list schemas. - * Format is `projects/{project-id}`. - * @param {google.pubsub.v1.SchemaView} request.view - * The set of Schema fields to return in the response. If not set, returns - * Schemas with `name` and `type`, but not `definition`. Set to `FULL` to - * retrieve all fields. - * @param {number} request.pageSize - * Maximum number of schemas to return. - * @param {string} request.pageToken - * The value returned by the last `ListSchemasResponse`; indicates that - * this is a continuation of a prior `ListSchemas` call, and that the - * system should return the next page of data. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.pubsub.v1.Schema|Schema}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listSchemasAsync( - request?: protos.google.pubsub.v1.IListSchemasRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listSchemas']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listSchemas.asyncIterate( - this.innerApiCalls['listSchemas'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Lists all schema revisions for the named schema. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the schema to list revisions for. - * @param {google.pubsub.v1.SchemaView} request.view - * The set of Schema fields to return in the response. If not set, returns - * Schemas with `name` and `type`, but not `definition`. Set to `FULL` to - * retrieve all fields. - * @param {number} request.pageSize - * The maximum number of revisions to return per page. - * @param {string} request.pageToken - * The page token, received from a previous ListSchemaRevisions call. - * Provide this to retrieve the subsequent page. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.pubsub.v1.Schema|Schema}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listSchemaRevisionsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listSchemaRevisions( - request?: protos.google.pubsub.v1.IListSchemaRevisionsRequest, - options?: CallOptions): - Promise<[ - protos.google.pubsub.v1.ISchema[], - protos.google.pubsub.v1.IListSchemaRevisionsRequest|null, - protos.google.pubsub.v1.IListSchemaRevisionsResponse - ]>; - listSchemaRevisions( - request: protos.google.pubsub.v1.IListSchemaRevisionsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.pubsub.v1.IListSchemaRevisionsRequest, - protos.google.pubsub.v1.IListSchemaRevisionsResponse|null|undefined, - protos.google.pubsub.v1.ISchema>): void; - listSchemaRevisions( - request: protos.google.pubsub.v1.IListSchemaRevisionsRequest, - callback: PaginationCallback< - protos.google.pubsub.v1.IListSchemaRevisionsRequest, - protos.google.pubsub.v1.IListSchemaRevisionsResponse|null|undefined, - protos.google.pubsub.v1.ISchema>): void; - listSchemaRevisions( - request?: protos.google.pubsub.v1.IListSchemaRevisionsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.pubsub.v1.IListSchemaRevisionsRequest, - protos.google.pubsub.v1.IListSchemaRevisionsResponse|null|undefined, - protos.google.pubsub.v1.ISchema>, - callback?: PaginationCallback< - protos.google.pubsub.v1.IListSchemaRevisionsRequest, - protos.google.pubsub.v1.IListSchemaRevisionsResponse|null|undefined, - protos.google.pubsub.v1.ISchema>): - Promise<[ - protos.google.pubsub.v1.ISchema[], - protos.google.pubsub.v1.IListSchemaRevisionsRequest|null, - protos.google.pubsub.v1.IListSchemaRevisionsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.listSchemaRevisions(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the schema to list revisions for. - * @param {google.pubsub.v1.SchemaView} request.view - * The set of Schema fields to return in the response. If not set, returns - * Schemas with `name` and `type`, but not `definition`. Set to `FULL` to - * retrieve all fields. - * @param {number} request.pageSize - * The maximum number of revisions to return per page. - * @param {string} request.pageToken - * The page token, received from a previous ListSchemaRevisions call. - * Provide this to retrieve the subsequent page. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link protos.google.pubsub.v1.Schema|Schema} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listSchemaRevisionsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listSchemaRevisionsStream( - request?: protos.google.pubsub.v1.IListSchemaRevisionsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - const defaultCallSettings = this._defaults['listSchemaRevisions']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listSchemaRevisions.createStream( - this.innerApiCalls.listSchemaRevisions as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listSchemaRevisions`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the schema to list revisions for. - * @param {google.pubsub.v1.SchemaView} request.view - * The set of Schema fields to return in the response. If not set, returns - * Schemas with `name` and `type`, but not `definition`. Set to `FULL` to - * retrieve all fields. - * @param {number} request.pageSize - * The maximum number of revisions to return per page. - * @param {string} request.pageToken - * The page token, received from a previous ListSchemaRevisions call. - * Provide this to retrieve the subsequent page. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.pubsub.v1.Schema|Schema}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listSchemaRevisionsAsync( - request?: protos.google.pubsub.v1.IListSchemaRevisionsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - const defaultCallSettings = this._defaults['listSchemaRevisions']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listSchemaRevisions.asyncIterate( - this.innerApiCalls['listSchemaRevisions'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } -/** - * Gets the access control policy for a resource. Returns an empty policy - * if the resource exists and does not have a policy set. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {Object} [request.options] - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. This field is only used by Cloud IAM. - * - * This object should have the same structure as {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing {@link google.iam.v1.Policy | Policy}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.Policy | Policy}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - getIamPolicy( - request: IamProtos.google.iam.v1.GetIamPolicyRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ):Promise<[IamProtos.google.iam.v1.Policy]> { - return this.iamClient.getIamPolicy(request, options, callback); - } - -/** - * Returns permissions that a caller has on the specified resource. If the - * resource does not exist, this will return an empty set of - * permissions, not a NOT_FOUND error. - * - * Note: This operation is designed to be used for building - * permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {string[]} request.permissions - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - setIamPolicy( - request: IamProtos.google.iam.v1.SetIamPolicyRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ):Promise<[IamProtos.google.iam.v1.Policy]> { - return this.iamClient.setIamPolicy(request, options, callback); - } - -/** - * Returns permissions that a caller has on the specified resource. If the - * resource does not exist, this will return an empty set of - * permissions, not a NOT_FOUND error. - * - * Note: This operation is designed to be used for building - * permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {string[]} request.permissions - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - */ - testIamPermissions( - request: IamProtos.google.iam.v1.TestIamPermissionsRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.TestIamPermissionsResponse, - IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.TestIamPermissionsResponse, - IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, - {} | null | undefined - > - ):Promise<[IamProtos.google.iam.v1.TestIamPermissionsResponse]> { - return this.iamClient.testIamPermissions(request, options, callback); - } - - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified project resource name string. - * - * @param {string} project - * @returns {string} Resource name string. - */ - projectPath(project:string) { - return this.pathTemplates.projectPathTemplate.render({ - project: project, - }); - } - - /** - * Parse the project from Project resource. - * - * @param {string} projectName - * A fully-qualified path representing Project resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectName(projectName: string) { - return this.pathTemplates.projectPathTemplate.match(projectName).project; - } - - /** - * Return a fully-qualified projectTopic resource name string. - * - * @param {string} project - * @param {string} topic - * @returns {string} Resource name string. - */ - projectTopicPath(project:string,topic:string) { - return this.pathTemplates.projectTopicPathTemplate.render({ - project: project, - topic: topic, - }); - } - - /** - * Parse the project from ProjectTopic resource. - * - * @param {string} projectTopicName - * A fully-qualified path representing project_topic resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectTopicName(projectTopicName: string) { - return this.pathTemplates.projectTopicPathTemplate.match(projectTopicName).project; - } - - /** - * Parse the topic from ProjectTopic resource. - * - * @param {string} projectTopicName - * A fully-qualified path representing project_topic resource. - * @returns {string} A string representing the topic. - */ - matchTopicFromProjectTopicName(projectTopicName: string) { - return this.pathTemplates.projectTopicPathTemplate.match(projectTopicName).topic; - } - - /** - * Return a fully-qualified schema resource name string. - * - * @param {string} project - * @param {string} schema - * @returns {string} Resource name string. - */ - schemaPath(project:string,schema:string) { - return this.pathTemplates.schemaPathTemplate.render({ - project: project, - schema: schema, - }); - } - - /** - * Parse the project from Schema resource. - * - * @param {string} schemaName - * A fully-qualified path representing Schema resource. - * @returns {string} A string representing the project. - */ - matchProjectFromSchemaName(schemaName: string) { - return this.pathTemplates.schemaPathTemplate.match(schemaName).project; - } - - /** - * Parse the schema from Schema resource. - * - * @param {string} schemaName - * A fully-qualified path representing Schema resource. - * @returns {string} A string representing the schema. - */ - matchSchemaFromSchemaName(schemaName: string) { - return this.pathTemplates.schemaPathTemplate.match(schemaName).schema; - } - - /** - * Return a fully-qualified snapshot resource name string. - * - * @param {string} project - * @param {string} snapshot - * @returns {string} Resource name string. - */ - snapshotPath(project:string,snapshot:string) { - return this.pathTemplates.snapshotPathTemplate.render({ - project: project, - snapshot: snapshot, - }); - } - - /** - * Parse the project from Snapshot resource. - * - * @param {string} snapshotName - * A fully-qualified path representing Snapshot resource. - * @returns {string} A string representing the project. - */ - matchProjectFromSnapshotName(snapshotName: string) { - return this.pathTemplates.snapshotPathTemplate.match(snapshotName).project; - } - - /** - * Parse the snapshot from Snapshot resource. - * - * @param {string} snapshotName - * A fully-qualified path representing Snapshot resource. - * @returns {string} A string representing the snapshot. - */ - matchSnapshotFromSnapshotName(snapshotName: string) { - return this.pathTemplates.snapshotPathTemplate.match(snapshotName).snapshot; - } - - /** - * Return a fully-qualified subscription resource name string. - * - * @param {string} project - * @param {string} subscription - * @returns {string} Resource name string. - */ - subscriptionPath(project:string,subscription:string) { - return this.pathTemplates.subscriptionPathTemplate.render({ - project: project, - subscription: subscription, - }); - } - - /** - * Parse the project from Subscription resource. - * - * @param {string} subscriptionName - * A fully-qualified path representing Subscription resource. - * @returns {string} A string representing the project. - */ - matchProjectFromSubscriptionName(subscriptionName: string) { - return this.pathTemplates.subscriptionPathTemplate.match(subscriptionName).project; - } - - /** - * Parse the subscription from Subscription resource. - * - * @param {string} subscriptionName - * A fully-qualified path representing Subscription resource. - * @returns {string} A string representing the subscription. - */ - matchSubscriptionFromSubscriptionName(subscriptionName: string) { - return this.pathTemplates.subscriptionPathTemplate.match(subscriptionName).subscription; - } - - /** - * Terminate the gRPC channel and close the client. - * - * The client will no longer be usable and all future behavior is undefined. - * @returns {Promise} A promise that resolves when the client is closed. - */ - close(): Promise { - if (this.schemaServiceStub && !this._terminated) { - return this.schemaServiceStub.then(stub => { - this._terminated = true; - stub.close(); - this.iamClient.close(); - }); - } - return Promise.resolve(); - } -} diff --git a/owl-bot-staging/v1/src/v1/schema_service_client_config.json b/owl-bot-staging/v1/src/v1/schema_service_client_config.json deleted file mode 100644 index 5a2280962..000000000 --- a/owl-bot-staging/v1/src/v1/schema_service_client_config.json +++ /dev/null @@ -1,79 +0,0 @@ -{ - "interfaces": { - "google.pubsub.v1.SchemaService": { - "retry_codes": { - "non_idempotent": [], - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ], - "unavailable": [ - "UNAVAILABLE" - ] - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "CreateSchema": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "default" - }, - "GetSchema": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "default" - }, - "ListSchemas": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "default" - }, - "ListSchemaRevisions": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "default" - }, - "CommitSchema": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "default" - }, - "RollbackSchema": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "default" - }, - "DeleteSchemaRevision": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "default" - }, - "DeleteSchema": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "default" - }, - "ValidateSchema": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "default" - }, - "ValidateMessage": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/v1/src/v1/schema_service_proto_list.json b/owl-bot-staging/v1/src/v1/schema_service_proto_list.json deleted file mode 100644 index 91011aec1..000000000 --- a/owl-bot-staging/v1/src/v1/schema_service_proto_list.json +++ /dev/null @@ -1,4 +0,0 @@ -[ - "../../protos/google/pubsub/v1/pubsub.proto", - "../../protos/google/pubsub/v1/schema.proto" -] diff --git a/owl-bot-staging/v1/src/v1/subscriber_client.ts b/owl-bot-staging/v1/src/v1/subscriber_client.ts deleted file mode 100644 index 9dbd372b9..000000000 --- a/owl-bot-staging/v1/src/v1/subscriber_client.ts +++ /dev/null @@ -1,2235 +0,0 @@ -// 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 -// -// https://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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -/* global window */ -import type * as gax from 'google-gax'; -import type {Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback, GaxCall, IamClient, IamProtos} from 'google-gax'; -import {Transform, PassThrough} from 'stream'; -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); - -/** - * Client JSON configuration object, loaded from - * `src/v1/subscriber_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './subscriber_client_config.json'; -const version = require('../../../package.json').version; - -/** - * The service that an application uses to manipulate subscriptions and to - * consume messages from a subscription via the `Pull` method or by - * establishing a bi-directional stream using the `StreamingPull` method. - * @class - * @memberof v1 - */ -export class SubscriberClient { - private _terminated = false; - private _opts: ClientOptions; - private _providedCustomServicePath: boolean; - private _gaxModule: typeof gax | typeof gax.fallback; - private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; - private _protos: {}; - private _defaults: {[method: string]: gax.CallSettings}; - private _universeDomain: string; - private _servicePath: string; - auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: {[name: string]: Function}; - iamClient: IamClient; - pathTemplates: {[name: string]: gax.PathTemplate}; - subscriberStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of SubscriberClient. - * - * @param {object} [options] - The configuration object. - * The options accepted by the constructor are described in detail - * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). - * The common options are: - * @param {object} [options.credentials] - Credentials object. - * @param {string} [options.credentials.client_email] - * @param {string} [options.credentials.private_key] - * @param {string} [options.email] - Account email address. Required when - * using a .pem or .p12 keyFilename. - * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or - * .p12 key downloaded from the Google Developers Console. If you provide - * a path to a JSON file, the projectId option below is not necessary. - * NOTE: .pem and .p12 require you to specify options.email as well. - * @param {number} [options.port] - The port on which to connect to - * the remote host. - * @param {string} [options.projectId] - The project ID from the Google - * Developer's Console, e.g. 'grape-spaceship-123'. We will also check - * the environment variable GCLOUD_PROJECT for your project ID. If your - * app is running in an environment which supports - * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, - * your project ID will be detected automatically. - * @param {string} [options.apiEndpoint] - The domain name of the - * API remote host. - * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. - * Follows the structure of {@link gapicConfig}. - * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. - * For more information, please check the - * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. - * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you - * need to avoid loading the default gRPC version and want to use the fallback - * HTTP implementation. Load only fallback version and pass it to the constructor: - * ``` - * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new SubscriberClient({fallback: true}, gax); - * ``` - */ - constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { - // Ensure that options include all the required fields. - const staticMembers = this.constructor as typeof SubscriberClient; - if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) { - throw new Error('Please set either universe_domain or universeDomain, but not both.'); - } - const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined; - this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com'; - this._servicePath = 'pubsub.' + this._universeDomain; - const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; - this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); - const port = opts?.port || staticMembers.port; - const clientConfig = opts?.clientConfig ?? {}; - const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); - opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); - - // Request numeric enum values if REST transport is used. - opts.numericEnums = true; - - // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. - if (servicePath !== this._servicePath && !('scopes' in opts)) { - opts['scopes'] = staticMembers.scopes; - } - - // Load google-gax module synchronously if needed - if (!gaxInstance) { - gaxInstance = require('google-gax') as typeof gax; - } - - // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; - - // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. - this._gaxGrpc = new this._gaxModule.GrpcClient(opts); - - // Save options to use in initialize() method. - this._opts = opts; - - // Save the auth object to the client, for use by other methods. - this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); - - // Set useJWTAccessWithScope on the auth object. - this.auth.useJWTAccessWithScope = true; - - // Set defaultServicePath on the auth object. - this.auth.defaultServicePath = this._servicePath; - - // Set the default scopes in auth client if needed. - if (servicePath === this._servicePath) { - this.auth.defaultScopes = staticMembers.scopes; - } - this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); - - - // Determine the client header string. - const clientHeader = [ - `gax/${this._gaxModule.version}`, - `gapic/${version}`, - ]; - if (typeof process === 'object' && 'versions' in process) { - clientHeader.push(`gl-node/${process.versions.node}`); - } else { - clientHeader.push(`gl-web/${this._gaxModule.version}`); - } - if (!opts.fallback) { - clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else { - clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); - } - if (opts.libName && opts.libVersion) { - clientHeader.push(`${opts.libName}/${opts.libVersion}`); - } - // Load the applicable protos. - this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); - - // This API contains "path templates"; forward-slash-separated - // identifiers to uniquely identify resources within the API. - // Create useful helper objects for these. - this.pathTemplates = { - projectPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}' - ), - projectTopicPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/topics/{topic}' - ), - schemaPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/schemas/{schema}' - ), - snapshotPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/snapshots/{snapshot}' - ), - subscriptionPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/subscriptions/{subscription}' - ), - }; - - // Some of the methods on this service return "paged" results, - // (e.g. 50 results at a time, with tokens to get subsequent - // pages). Denote the keys used for pagination and results. - this.descriptors.page = { - listSubscriptions: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'subscriptions'), - listSnapshots: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'snapshots') - }; - - // Some of the methods on this service provide streaming responses. - // Provide descriptors for these. - this.descriptors.stream = { - streamingPull: new this._gaxModule.StreamDescriptor(this._gaxModule.StreamType.BIDI_STREAMING, !!opts.fallback, !!opts.gaxServerStreamingRetries) - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.pubsub.v1.Subscriber', gapicConfig as gax.ClientConfig, - opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); - - // Set up a dictionary of "inner API calls"; the core implementation - // of calling the API is handled in `google-gax`, with this code - // merely providing the destination and request information. - this.innerApiCalls = {}; - - // Add a warn function to the client constructor so it can be easily tested. - this.warn = this._gaxModule.warn; - } - - /** - * Initialize the client. - * Performs asynchronous operations (such as authentication) and prepares the client. - * This function will be called automatically when any class method is called for the - * first time, but if you need to initialize it before calling an actual method, - * feel free to call initialize() directly. - * - * You can await on this method if you want to make sure the client is initialized. - * - * @returns {Promise} A promise that resolves to an authenticated service stub. - */ - initialize() { - // If the client stub promise is already initialized, return immediately. - if (this.subscriberStub) { - return this.subscriberStub; - } - - // Put together the "service stub" for - // google.pubsub.v1.Subscriber. - this.subscriberStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.pubsub.v1.Subscriber') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.pubsub.v1.Subscriber, - this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; - - // Iterate over each of the methods that the service provides - // and create an API call method for each. - const subscriberStubMethods = - ['createSubscription', 'getSubscription', 'updateSubscription', 'listSubscriptions', 'deleteSubscription', 'modifyAckDeadline', 'acknowledge', 'pull', 'streamingPull', 'modifyPushConfig', 'getSnapshot', 'listSnapshots', 'createSnapshot', 'updateSnapshot', 'deleteSnapshot', 'seek']; - for (const methodName of subscriberStubMethods) { - const callPromise = this.subscriberStub.then( - stub => (...args: Array<{}>) => { - if (this._terminated) { - if (methodName in this.descriptors.stream) { - const stream = new PassThrough(); - setImmediate(() => { - stream.emit('error', new this._gaxModule.GoogleError('The client has already been closed.')); - }); - return stream; - } - return Promise.reject('The client has already been closed.'); - } - const func = stub[methodName]; - return func.apply(stub, args); - }, - (err: Error|null|undefined) => () => { - throw err; - }); - - const descriptor = - this.descriptors.page[methodName] || - this.descriptors.stream[methodName] || - undefined; - const apiCall = this._gaxModule.createApiCall( - callPromise, - this._defaults[methodName], - descriptor, - this._opts.fallback - ); - - this.innerApiCalls[methodName] = apiCall; - } - - return this.subscriberStub; - } - - /** - * The DNS address for this API service. - * @deprecated Use the apiEndpoint method of the client instance. - * @returns {string} The DNS address for this service. - */ - static get servicePath() { - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); - } - return 'pubsub.googleapis.com'; - } - - /** - * The DNS address for this API service - same as servicePath. - * @deprecated Use the apiEndpoint method of the client instance. - * @returns {string} The DNS address for this service. - */ - static get apiEndpoint() { - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); - } - return 'pubsub.googleapis.com'; - } - - /** - * The DNS address for this API service. - * @returns {string} The DNS address for this service. - */ - get apiEndpoint() { - return this._servicePath; - } - - get universeDomain() { - return this._universeDomain; - } - - /** - * The port for this API service. - * @returns {number} The default port for this service. - */ - static get port() { - return 443; - } - - /** - * The scopes needed to make gRPC calls for every method defined - * in this service. - * @returns {string[]} List of default scopes. - */ - static get scopes() { - return [ - 'https://www.googleapis.com/auth/cloud-platform', - 'https://www.googleapis.com/auth/pubsub' - ]; - } - - getProjectId(): Promise; - getProjectId(callback: Callback): void; - /** - * Return the project ID used by this class. - * @returns {Promise} A promise that resolves to string containing the project ID. - */ - getProjectId(callback?: Callback): - Promise|void { - if (callback) { - this.auth.getProjectId(callback); - return; - } - return this.auth.getProjectId(); - } - - // ------------------- - // -- Service calls -- - // ------------------- -/** - * Creates a subscription to a given topic. See the [resource name rules] - * (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). - * If the subscription already exists, returns `ALREADY_EXISTS`. - * If the corresponding topic doesn't exist, returns `NOT_FOUND`. - * - * If the name is not provided in the request, the server will assign a random - * name for this subscription on the same project as the topic, conforming - * to the [resource name format] - * (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). The - * generated name is populated in the returned Subscription object. Note that - * for REST API requests, you must specify a name in the request. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the subscription. It must have the format - * `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must - * start with a letter, and contain only letters (`[A-Za-z]`), numbers - * (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`), - * plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters - * in length, and it must not start with `"goog"`. - * @param {string} request.topic - * Required. The name of the topic from which this subscription is receiving - * messages. Format is `projects/{project}/topics/{topic}`. The value of this - * field will be `_deleted-topic_` if the topic has been deleted. - * @param {google.pubsub.v1.PushConfig} [request.pushConfig] - * Optional. If push delivery is used with this subscription, this field is - * used to configure it. - * @param {google.pubsub.v1.BigQueryConfig} [request.bigqueryConfig] - * Optional. If delivery to BigQuery is used with this subscription, this - * field is used to configure it. - * @param {google.pubsub.v1.CloudStorageConfig} [request.cloudStorageConfig] - * Optional. If delivery to Google Cloud Storage is used with this - * subscription, this field is used to configure it. - * @param {number} [request.ackDeadlineSeconds] - * Optional. The approximate amount of time (on a best-effort basis) Pub/Sub - * waits for the subscriber to acknowledge receipt before resending the - * message. In the interval after the message is delivered and before it is - * acknowledged, it is considered to be _outstanding_. During that time - * period, the message will not be redelivered (on a best-effort basis). - * - * For pull subscriptions, this value is used as the initial value for the ack - * deadline. To override this value for a given message, call - * `ModifyAckDeadline` with the corresponding `ack_id` if using - * non-streaming pull or send the `ack_id` in a - * `StreamingModifyAckDeadlineRequest` if using streaming pull. - * The minimum custom deadline you can specify is 10 seconds. - * The maximum custom deadline you can specify is 600 seconds (10 minutes). - * If this parameter is 0, a default value of 10 seconds is used. - * - * For push delivery, this value is also used to set the request timeout for - * the call to the push endpoint. - * - * If the subscriber never acknowledges the message, the Pub/Sub - * system will eventually redeliver the message. - * @param {boolean} [request.retainAckedMessages] - * Optional. Indicates whether to retain acknowledged messages. If true, then - * messages are not expunged from the subscription's backlog, even if they are - * acknowledged, until they fall out of the `message_retention_duration` - * window. This must be true if you would like to [`Seek` to a timestamp] - * (https://cloud.google.com/pubsub/docs/replay-overview#seek_to_a_time) in - * the past to replay previously-acknowledged messages. - * @param {google.protobuf.Duration} [request.messageRetentionDuration] - * Optional. How long to retain unacknowledged messages in the subscription's - * backlog, from the moment a message is published. If `retain_acked_messages` - * is true, then this also configures the retention of acknowledged messages, - * and thus configures how far back in time a `Seek` can be done. Defaults to - * 7 days. Cannot be more than 7 days or less than 10 minutes. - * @param {number[]} [request.labels] - * Optional. See [Creating and managing - * labels](https://cloud.google.com/pubsub/docs/labels). - * @param {boolean} [request.enableMessageOrdering] - * Optional. If true, messages published with the same `ordering_key` in - * `PubsubMessage` will be delivered to the subscribers in the order in which - * they are received by the Pub/Sub system. Otherwise, they may be delivered - * in any order. - * @param {google.pubsub.v1.ExpirationPolicy} [request.expirationPolicy] - * Optional. A policy that specifies the conditions for this subscription's - * expiration. A subscription is considered active as long as any connected - * subscriber is successfully consuming messages from the subscription or is - * issuing operations on the subscription. If `expiration_policy` is not set, - * a *default policy* with `ttl` of 31 days will be used. The minimum allowed - * value for `expiration_policy.ttl` is 1 day. If `expiration_policy` is set, - * but `expiration_policy.ttl` is not set, the subscription never expires. - * @param {string} [request.filter] - * Optional. An expression written in the Pub/Sub [filter - * language](https://cloud.google.com/pubsub/docs/filtering). If non-empty, - * then only `PubsubMessage`s whose `attributes` field matches the filter are - * delivered on this subscription. If empty, then no messages are filtered - * out. - * @param {google.pubsub.v1.DeadLetterPolicy} [request.deadLetterPolicy] - * Optional. A policy that specifies the conditions for dead lettering - * messages in this subscription. If dead_letter_policy is not set, dead - * lettering is disabled. - * - * The Pub/Sub service account associated with this subscriptions's - * parent project (i.e., - * service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have - * permission to Acknowledge() messages on this subscription. - * @param {google.pubsub.v1.RetryPolicy} [request.retryPolicy] - * Optional. A policy that specifies how Pub/Sub retries message delivery for - * this subscription. - * - * If not set, the default retry policy is applied. This generally implies - * that messages will be retried as soon as possible for healthy subscribers. - * RetryPolicy will be triggered on NACKs or acknowledgement deadline - * exceeded events for a given message. - * @param {boolean} [request.detached] - * Optional. Indicates whether the subscription is detached from its topic. - * Detached subscriptions don't receive messages from their topic and don't - * retain any backlog. `Pull` and `StreamingPull` requests will return - * FAILED_PRECONDITION. If the subscription is a push subscription, pushes to - * the endpoint will not be made. - * @param {boolean} [request.enableExactlyOnceDelivery] - * Optional. If true, Pub/Sub provides the following guarantees for the - * delivery of a message with a given value of `message_id` on this - * subscription: - * - * * The message sent to a subscriber is guaranteed not to be resent - * before the message's acknowledgement deadline expires. - * * An acknowledged message will not be resent to a subscriber. - * - * Note that subscribers may still receive multiple copies of a message - * when `enable_exactly_once_delivery` is true if the message was published - * multiple times by a publisher client. These copies are considered distinct - * by Pub/Sub and have distinct `message_id` values. - * @param {google.protobuf.Duration} request.topicMessageRetentionDuration - * Output only. Indicates the minimum duration for which a message is retained - * after it is published to the subscription's topic. If this field is set, - * messages published to the subscription's topic in the last - * `topic_message_retention_duration` are always available to subscribers. See - * the `message_retention_duration` field in `Topic`. This field is set only - * in responses from the server; it is ignored if it is set in any requests. - * @param {google.pubsub.v1.Subscription.State} request.state - * Output only. An output-only field indicating whether or not the - * subscription can receive messages. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.pubsub.v1.Subscription|Subscription}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - */ - createSubscription( - request?: protos.google.pubsub.v1.ISubscription, - options?: CallOptions): - Promise<[ - protos.google.pubsub.v1.ISubscription, - protos.google.pubsub.v1.ISubscription|undefined, {}|undefined - ]>; - createSubscription( - request: protos.google.pubsub.v1.ISubscription, - options: CallOptions, - callback: Callback< - protos.google.pubsub.v1.ISubscription, - protos.google.pubsub.v1.ISubscription|null|undefined, - {}|null|undefined>): void; - createSubscription( - request: protos.google.pubsub.v1.ISubscription, - callback: Callback< - protos.google.pubsub.v1.ISubscription, - protos.google.pubsub.v1.ISubscription|null|undefined, - {}|null|undefined>): void; - createSubscription( - request?: protos.google.pubsub.v1.ISubscription, - optionsOrCallback?: CallOptions|Callback< - protos.google.pubsub.v1.ISubscription, - protos.google.pubsub.v1.ISubscription|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.pubsub.v1.ISubscription, - protos.google.pubsub.v1.ISubscription|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.pubsub.v1.ISubscription, - protos.google.pubsub.v1.ISubscription|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.createSubscription(request, options, callback); - } -/** - * Gets the configuration details of a subscription. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.subscription - * Required. The name of the subscription to get. - * Format is `projects/{project}/subscriptions/{sub}`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.pubsub.v1.Subscription|Subscription}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - */ - getSubscription( - request?: protos.google.pubsub.v1.IGetSubscriptionRequest, - options?: CallOptions): - Promise<[ - protos.google.pubsub.v1.ISubscription, - protos.google.pubsub.v1.IGetSubscriptionRequest|undefined, {}|undefined - ]>; - getSubscription( - request: protos.google.pubsub.v1.IGetSubscriptionRequest, - options: CallOptions, - callback: Callback< - protos.google.pubsub.v1.ISubscription, - protos.google.pubsub.v1.IGetSubscriptionRequest|null|undefined, - {}|null|undefined>): void; - getSubscription( - request: protos.google.pubsub.v1.IGetSubscriptionRequest, - callback: Callback< - protos.google.pubsub.v1.ISubscription, - protos.google.pubsub.v1.IGetSubscriptionRequest|null|undefined, - {}|null|undefined>): void; - getSubscription( - request?: protos.google.pubsub.v1.IGetSubscriptionRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.pubsub.v1.ISubscription, - protos.google.pubsub.v1.IGetSubscriptionRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.pubsub.v1.ISubscription, - protos.google.pubsub.v1.IGetSubscriptionRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.pubsub.v1.ISubscription, - protos.google.pubsub.v1.IGetSubscriptionRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'subscription': request.subscription ?? '', - }); - this.initialize(); - return this.innerApiCalls.getSubscription(request, options, callback); - } -/** - * Updates an existing subscription by updating the fields specified in the - * update mask. Note that certain properties of a subscription, such as its - * topic, are not modifiable. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.pubsub.v1.Subscription} request.subscription - * Required. The updated subscription object. - * @param {google.protobuf.FieldMask} request.updateMask - * Required. Indicates which fields in the provided subscription to update. - * Must be specified and non-empty. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.pubsub.v1.Subscription|Subscription}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - */ - updateSubscription( - request?: protos.google.pubsub.v1.IUpdateSubscriptionRequest, - options?: CallOptions): - Promise<[ - protos.google.pubsub.v1.ISubscription, - protos.google.pubsub.v1.IUpdateSubscriptionRequest|undefined, {}|undefined - ]>; - updateSubscription( - request: protos.google.pubsub.v1.IUpdateSubscriptionRequest, - options: CallOptions, - callback: Callback< - protos.google.pubsub.v1.ISubscription, - protos.google.pubsub.v1.IUpdateSubscriptionRequest|null|undefined, - {}|null|undefined>): void; - updateSubscription( - request: protos.google.pubsub.v1.IUpdateSubscriptionRequest, - callback: Callback< - protos.google.pubsub.v1.ISubscription, - protos.google.pubsub.v1.IUpdateSubscriptionRequest|null|undefined, - {}|null|undefined>): void; - updateSubscription( - request?: protos.google.pubsub.v1.IUpdateSubscriptionRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.pubsub.v1.ISubscription, - protos.google.pubsub.v1.IUpdateSubscriptionRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.pubsub.v1.ISubscription, - protos.google.pubsub.v1.IUpdateSubscriptionRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.pubsub.v1.ISubscription, - protos.google.pubsub.v1.IUpdateSubscriptionRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'subscription.name': request.subscription!.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.updateSubscription(request, options, callback); - } -/** - * Deletes an existing subscription. All messages retained in the subscription - * are immediately dropped. Calls to `Pull` after deletion will return - * `NOT_FOUND`. After a subscription is deleted, a new one may be created with - * the same name, but the new one has no association with the old - * subscription or its topic unless the same topic is specified. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.subscription - * Required. The subscription to delete. - * Format is `projects/{project}/subscriptions/{sub}`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - */ - deleteSubscription( - request?: protos.google.pubsub.v1.IDeleteSubscriptionRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.pubsub.v1.IDeleteSubscriptionRequest|undefined, {}|undefined - ]>; - deleteSubscription( - request: protos.google.pubsub.v1.IDeleteSubscriptionRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.pubsub.v1.IDeleteSubscriptionRequest|null|undefined, - {}|null|undefined>): void; - deleteSubscription( - request: protos.google.pubsub.v1.IDeleteSubscriptionRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.pubsub.v1.IDeleteSubscriptionRequest|null|undefined, - {}|null|undefined>): void; - deleteSubscription( - request?: protos.google.pubsub.v1.IDeleteSubscriptionRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.pubsub.v1.IDeleteSubscriptionRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.pubsub.v1.IDeleteSubscriptionRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.pubsub.v1.IDeleteSubscriptionRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'subscription': request.subscription ?? '', - }); - this.initialize(); - return this.innerApiCalls.deleteSubscription(request, options, callback); - } -/** - * Modifies the ack deadline for a specific message. This method is useful - * to indicate that more time is needed to process a message by the - * subscriber, or to make the message available for redelivery if the - * processing was interrupted. Note that this does not modify the - * subscription-level `ackDeadlineSeconds` used for subsequent messages. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.subscription - * Required. The name of the subscription. - * Format is `projects/{project}/subscriptions/{sub}`. - * @param {string[]} request.ackIds - * Required. List of acknowledgment IDs. - * @param {number} request.ackDeadlineSeconds - * Required. The new ack deadline with respect to the time this request was - * sent to the Pub/Sub system. For example, if the value is 10, the new ack - * deadline will expire 10 seconds after the `ModifyAckDeadline` call was - * made. Specifying zero might immediately make the message available for - * delivery to another subscriber client. This typically results in an - * increase in the rate of message redeliveries (that is, duplicates). - * The minimum deadline you can specify is 0 seconds. - * The maximum deadline you can specify in a single request is 600 seconds - * (10 minutes). - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - */ - modifyAckDeadline( - request?: protos.google.pubsub.v1.IModifyAckDeadlineRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.pubsub.v1.IModifyAckDeadlineRequest|undefined, {}|undefined - ]>; - modifyAckDeadline( - request: protos.google.pubsub.v1.IModifyAckDeadlineRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.pubsub.v1.IModifyAckDeadlineRequest|null|undefined, - {}|null|undefined>): void; - modifyAckDeadline( - request: protos.google.pubsub.v1.IModifyAckDeadlineRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.pubsub.v1.IModifyAckDeadlineRequest|null|undefined, - {}|null|undefined>): void; - modifyAckDeadline( - request?: protos.google.pubsub.v1.IModifyAckDeadlineRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.pubsub.v1.IModifyAckDeadlineRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.pubsub.v1.IModifyAckDeadlineRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.pubsub.v1.IModifyAckDeadlineRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'subscription': request.subscription ?? '', - }); - this.initialize(); - return this.innerApiCalls.modifyAckDeadline(request, options, callback); - } -/** - * Acknowledges the messages associated with the `ack_ids` in the - * `AcknowledgeRequest`. The Pub/Sub system can remove the relevant messages - * from the subscription. - * - * Acknowledging a message whose ack deadline has expired may succeed, - * but such a message may be redelivered later. Acknowledging a message more - * than once will not result in an error. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.subscription - * Required. The subscription whose message is being acknowledged. - * Format is `projects/{project}/subscriptions/{sub}`. - * @param {string[]} request.ackIds - * Required. The acknowledgment ID for the messages being acknowledged that - * was returned by the Pub/Sub system in the `Pull` response. Must not be - * empty. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - */ - acknowledge( - request?: protos.google.pubsub.v1.IAcknowledgeRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.pubsub.v1.IAcknowledgeRequest|undefined, {}|undefined - ]>; - acknowledge( - request: protos.google.pubsub.v1.IAcknowledgeRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.pubsub.v1.IAcknowledgeRequest|null|undefined, - {}|null|undefined>): void; - acknowledge( - request: protos.google.pubsub.v1.IAcknowledgeRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.pubsub.v1.IAcknowledgeRequest|null|undefined, - {}|null|undefined>): void; - acknowledge( - request?: protos.google.pubsub.v1.IAcknowledgeRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.pubsub.v1.IAcknowledgeRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.pubsub.v1.IAcknowledgeRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.pubsub.v1.IAcknowledgeRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'subscription': request.subscription ?? '', - }); - this.initialize(); - return this.innerApiCalls.acknowledge(request, options, callback); - } -/** - * Pulls messages from the server. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.subscription - * Required. The subscription from which messages should be pulled. - * Format is `projects/{project}/subscriptions/{sub}`. - * @param {boolean} [request.returnImmediately] - * Optional. If this field set to true, the system will respond immediately - * even if it there are no messages available to return in the `Pull` - * response. Otherwise, the system may wait (for a bounded amount of time) - * until at least one message is available, rather than returning no messages. - * Warning: setting this field to `true` is discouraged because it adversely - * impacts the performance of `Pull` operations. We recommend that users do - * not set this field. - * @param {number} request.maxMessages - * Required. The maximum number of messages to return for this request. Must - * be a positive integer. The Pub/Sub system may return fewer than the number - * specified. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.pubsub.v1.PullResponse|PullResponse}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - */ - pull( - request?: protos.google.pubsub.v1.IPullRequest, - options?: CallOptions): - Promise<[ - protos.google.pubsub.v1.IPullResponse, - protos.google.pubsub.v1.IPullRequest|undefined, {}|undefined - ]>; - pull( - request: protos.google.pubsub.v1.IPullRequest, - options: CallOptions, - callback: Callback< - protos.google.pubsub.v1.IPullResponse, - protos.google.pubsub.v1.IPullRequest|null|undefined, - {}|null|undefined>): void; - pull( - request: protos.google.pubsub.v1.IPullRequest, - callback: Callback< - protos.google.pubsub.v1.IPullResponse, - protos.google.pubsub.v1.IPullRequest|null|undefined, - {}|null|undefined>): void; - pull( - request?: protos.google.pubsub.v1.IPullRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.pubsub.v1.IPullResponse, - protos.google.pubsub.v1.IPullRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.pubsub.v1.IPullResponse, - protos.google.pubsub.v1.IPullRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.pubsub.v1.IPullResponse, - protos.google.pubsub.v1.IPullRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'subscription': request.subscription ?? '', - }); - this.initialize(); - return this.innerApiCalls.pull(request, options, callback); - } -/** - * Modifies the `PushConfig` for a specified subscription. - * - * This may be used to change a push subscription to a pull one (signified by - * an empty `PushConfig`) or vice versa, or change the endpoint URL and other - * attributes of a push subscription. Messages will accumulate for delivery - * continuously through the call regardless of changes to the `PushConfig`. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.subscription - * Required. The name of the subscription. - * Format is `projects/{project}/subscriptions/{sub}`. - * @param {google.pubsub.v1.PushConfig} request.pushConfig - * Required. The push configuration for future deliveries. - * - * An empty `pushConfig` indicates that the Pub/Sub system should - * stop pushing messages from the given subscription and allow - * messages to be pulled and acknowledged - effectively pausing - * the subscription if `Pull` or `StreamingPull` is not called. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - */ - modifyPushConfig( - request?: protos.google.pubsub.v1.IModifyPushConfigRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.pubsub.v1.IModifyPushConfigRequest|undefined, {}|undefined - ]>; - modifyPushConfig( - request: protos.google.pubsub.v1.IModifyPushConfigRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.pubsub.v1.IModifyPushConfigRequest|null|undefined, - {}|null|undefined>): void; - modifyPushConfig( - request: protos.google.pubsub.v1.IModifyPushConfigRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.pubsub.v1.IModifyPushConfigRequest|null|undefined, - {}|null|undefined>): void; - modifyPushConfig( - request?: protos.google.pubsub.v1.IModifyPushConfigRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.pubsub.v1.IModifyPushConfigRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.pubsub.v1.IModifyPushConfigRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.pubsub.v1.IModifyPushConfigRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'subscription': request.subscription ?? '', - }); - this.initialize(); - return this.innerApiCalls.modifyPushConfig(request, options, callback); - } -/** - * Gets the configuration details of a snapshot. Snapshots are used in - * [Seek](https://cloud.google.com/pubsub/docs/replay-overview) operations, - * which allow you to manage message acknowledgments in bulk. That is, you can - * set the acknowledgment state of messages in an existing subscription to the - * state captured by a snapshot. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.snapshot - * Required. The name of the snapshot to get. - * Format is `projects/{project}/snapshots/{snap}`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.pubsub.v1.Snapshot|Snapshot}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - */ - getSnapshot( - request?: protos.google.pubsub.v1.IGetSnapshotRequest, - options?: CallOptions): - Promise<[ - protos.google.pubsub.v1.ISnapshot, - protos.google.pubsub.v1.IGetSnapshotRequest|undefined, {}|undefined - ]>; - getSnapshot( - request: protos.google.pubsub.v1.IGetSnapshotRequest, - options: CallOptions, - callback: Callback< - protos.google.pubsub.v1.ISnapshot, - protos.google.pubsub.v1.IGetSnapshotRequest|null|undefined, - {}|null|undefined>): void; - getSnapshot( - request: protos.google.pubsub.v1.IGetSnapshotRequest, - callback: Callback< - protos.google.pubsub.v1.ISnapshot, - protos.google.pubsub.v1.IGetSnapshotRequest|null|undefined, - {}|null|undefined>): void; - getSnapshot( - request?: protos.google.pubsub.v1.IGetSnapshotRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.pubsub.v1.ISnapshot, - protos.google.pubsub.v1.IGetSnapshotRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.pubsub.v1.ISnapshot, - protos.google.pubsub.v1.IGetSnapshotRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.pubsub.v1.ISnapshot, - protos.google.pubsub.v1.IGetSnapshotRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'snapshot': request.snapshot ?? '', - }); - this.initialize(); - return this.innerApiCalls.getSnapshot(request, options, callback); - } -/** - * Creates a snapshot from the requested subscription. Snapshots are used in - * [Seek](https://cloud.google.com/pubsub/docs/replay-overview) operations, - * which allow you to manage message acknowledgments in bulk. That is, you can - * set the acknowledgment state of messages in an existing subscription to the - * state captured by a snapshot. - * If the snapshot already exists, returns `ALREADY_EXISTS`. - * If the requested subscription doesn't exist, returns `NOT_FOUND`. - * If the backlog in the subscription is too old -- and the resulting snapshot - * would expire in less than 1 hour -- then `FAILED_PRECONDITION` is returned. - * See also the `Snapshot.expire_time` field. If the name is not provided in - * the request, the server will assign a random - * name for this snapshot on the same project as the subscription, conforming - * to the [resource name format] - * (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). The - * generated name is populated in the returned Snapshot object. Note that for - * REST API requests, you must specify a name in the request. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. User-provided name for this snapshot. If the name is not provided - * in the request, the server will assign a random name for this snapshot on - * the same project as the subscription. Note that for REST API requests, you - * must specify a name. See the [resource name - * rules](https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). - * Format is `projects/{project}/snapshots/{snap}`. - * @param {string} request.subscription - * Required. The subscription whose backlog the snapshot retains. - * Specifically, the created snapshot is guaranteed to retain: - * (a) The existing backlog on the subscription. More precisely, this is - * defined as the messages in the subscription's backlog that are - * unacknowledged upon the successful completion of the - * `CreateSnapshot` request; as well as: - * (b) Any messages published to the subscription's topic following the - * successful completion of the CreateSnapshot request. - * Format is `projects/{project}/subscriptions/{sub}`. - * @param {number[]} [request.labels] - * Optional. See [Creating and managing - * labels](https://cloud.google.com/pubsub/docs/labels). - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.pubsub.v1.Snapshot|Snapshot}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - */ - createSnapshot( - request?: protos.google.pubsub.v1.ICreateSnapshotRequest, - options?: CallOptions): - Promise<[ - protos.google.pubsub.v1.ISnapshot, - protos.google.pubsub.v1.ICreateSnapshotRequest|undefined, {}|undefined - ]>; - createSnapshot( - request: protos.google.pubsub.v1.ICreateSnapshotRequest, - options: CallOptions, - callback: Callback< - protos.google.pubsub.v1.ISnapshot, - protos.google.pubsub.v1.ICreateSnapshotRequest|null|undefined, - {}|null|undefined>): void; - createSnapshot( - request: protos.google.pubsub.v1.ICreateSnapshotRequest, - callback: Callback< - protos.google.pubsub.v1.ISnapshot, - protos.google.pubsub.v1.ICreateSnapshotRequest|null|undefined, - {}|null|undefined>): void; - createSnapshot( - request?: protos.google.pubsub.v1.ICreateSnapshotRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.pubsub.v1.ISnapshot, - protos.google.pubsub.v1.ICreateSnapshotRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.pubsub.v1.ISnapshot, - protos.google.pubsub.v1.ICreateSnapshotRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.pubsub.v1.ISnapshot, - protos.google.pubsub.v1.ICreateSnapshotRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.createSnapshot(request, options, callback); - } -/** - * Updates an existing snapshot by updating the fields specified in the update - * mask. Snapshots are used in - * [Seek](https://cloud.google.com/pubsub/docs/replay-overview) operations, - * which allow you to manage message acknowledgments in bulk. That is, you can - * set the acknowledgment state of messages in an existing subscription to the - * state captured by a snapshot. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.pubsub.v1.Snapshot} request.snapshot - * Required. The updated snapshot object. - * @param {google.protobuf.FieldMask} request.updateMask - * Required. Indicates which fields in the provided snapshot to update. - * Must be specified and non-empty. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.pubsub.v1.Snapshot|Snapshot}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - */ - updateSnapshot( - request?: protos.google.pubsub.v1.IUpdateSnapshotRequest, - options?: CallOptions): - Promise<[ - protos.google.pubsub.v1.ISnapshot, - protos.google.pubsub.v1.IUpdateSnapshotRequest|undefined, {}|undefined - ]>; - updateSnapshot( - request: protos.google.pubsub.v1.IUpdateSnapshotRequest, - options: CallOptions, - callback: Callback< - protos.google.pubsub.v1.ISnapshot, - protos.google.pubsub.v1.IUpdateSnapshotRequest|null|undefined, - {}|null|undefined>): void; - updateSnapshot( - request: protos.google.pubsub.v1.IUpdateSnapshotRequest, - callback: Callback< - protos.google.pubsub.v1.ISnapshot, - protos.google.pubsub.v1.IUpdateSnapshotRequest|null|undefined, - {}|null|undefined>): void; - updateSnapshot( - request?: protos.google.pubsub.v1.IUpdateSnapshotRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.pubsub.v1.ISnapshot, - protos.google.pubsub.v1.IUpdateSnapshotRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.pubsub.v1.ISnapshot, - protos.google.pubsub.v1.IUpdateSnapshotRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.pubsub.v1.ISnapshot, - protos.google.pubsub.v1.IUpdateSnapshotRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'snapshot.name': request.snapshot!.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.updateSnapshot(request, options, callback); - } -/** - * Removes an existing snapshot. Snapshots are used in [Seek] - * (https://cloud.google.com/pubsub/docs/replay-overview) operations, which - * allow you to manage message acknowledgments in bulk. That is, you can set - * the acknowledgment state of messages in an existing subscription to the - * state captured by a snapshot. - * When the snapshot is deleted, all messages retained in the snapshot - * are immediately dropped. After a snapshot is deleted, a new one may be - * created with the same name, but the new one has no association with the old - * snapshot or its subscription, unless the same subscription is specified. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.snapshot - * Required. The name of the snapshot to delete. - * Format is `projects/{project}/snapshots/{snap}`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - */ - deleteSnapshot( - request?: protos.google.pubsub.v1.IDeleteSnapshotRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.pubsub.v1.IDeleteSnapshotRequest|undefined, {}|undefined - ]>; - deleteSnapshot( - request: protos.google.pubsub.v1.IDeleteSnapshotRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.pubsub.v1.IDeleteSnapshotRequest|null|undefined, - {}|null|undefined>): void; - deleteSnapshot( - request: protos.google.pubsub.v1.IDeleteSnapshotRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.pubsub.v1.IDeleteSnapshotRequest|null|undefined, - {}|null|undefined>): void; - deleteSnapshot( - request?: protos.google.pubsub.v1.IDeleteSnapshotRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.pubsub.v1.IDeleteSnapshotRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.pubsub.v1.IDeleteSnapshotRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.pubsub.v1.IDeleteSnapshotRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'snapshot': request.snapshot ?? '', - }); - this.initialize(); - return this.innerApiCalls.deleteSnapshot(request, options, callback); - } -/** - * Seeks an existing subscription to a point in time or to a given snapshot, - * whichever is provided in the request. Snapshots are used in [Seek] - * (https://cloud.google.com/pubsub/docs/replay-overview) operations, which - * allow you to manage message acknowledgments in bulk. That is, you can set - * the acknowledgment state of messages in an existing subscription to the - * state captured by a snapshot. Note that both the subscription and the - * snapshot must be on the same topic. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.subscription - * Required. The subscription to affect. - * @param {google.protobuf.Timestamp} [request.time] - * Optional. The time to seek to. - * Messages retained in the subscription that were published before this - * time are marked as acknowledged, and messages retained in the - * subscription that were published after this time are marked as - * unacknowledged. Note that this operation affects only those messages - * retained in the subscription (configured by the combination of - * `message_retention_duration` and `retain_acked_messages`). For example, - * if `time` corresponds to a point before the message retention - * window (or to a point before the system's notion of the subscription - * creation time), only retained messages will be marked as unacknowledged, - * and already-expunged messages will not be restored. - * @param {string} [request.snapshot] - * Optional. The snapshot to seek to. The snapshot's topic must be the same - * as that of the provided subscription. Format is - * `projects/{project}/snapshots/{snap}`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.pubsub.v1.SeekResponse|SeekResponse}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - */ - seek( - request?: protos.google.pubsub.v1.ISeekRequest, - options?: CallOptions): - Promise<[ - protos.google.pubsub.v1.ISeekResponse, - protos.google.pubsub.v1.ISeekRequest|undefined, {}|undefined - ]>; - seek( - request: protos.google.pubsub.v1.ISeekRequest, - options: CallOptions, - callback: Callback< - protos.google.pubsub.v1.ISeekResponse, - protos.google.pubsub.v1.ISeekRequest|null|undefined, - {}|null|undefined>): void; - seek( - request: protos.google.pubsub.v1.ISeekRequest, - callback: Callback< - protos.google.pubsub.v1.ISeekResponse, - protos.google.pubsub.v1.ISeekRequest|null|undefined, - {}|null|undefined>): void; - seek( - request?: protos.google.pubsub.v1.ISeekRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.pubsub.v1.ISeekResponse, - protos.google.pubsub.v1.ISeekRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.pubsub.v1.ISeekResponse, - protos.google.pubsub.v1.ISeekRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.pubsub.v1.ISeekResponse, - protos.google.pubsub.v1.ISeekRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'subscription': request.subscription ?? '', - }); - this.initialize(); - return this.innerApiCalls.seek(request, options, callback); - } - -/** - * Establishes a stream with the server, which sends messages down to the - * client. The client streams acknowledgements and ack deadline modifications - * back to the server. The server will close the stream and return the status - * on any error. The server may close the stream with status `UNAVAILABLE` to - * reassign server-side resources, in which case, the client should - * re-establish the stream. Flow control can be achieved by configuring the - * underlying RPC channel. - * - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which is both readable and writable. It accepts objects - * representing {@link protos.google.pubsub.v1.StreamingPullRequest|StreamingPullRequest} for write() method, and - * will emit objects representing {@link protos.google.pubsub.v1.StreamingPullResponse|StreamingPullResponse} on 'data' event asynchronously. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#bi-directional-streaming | documentation } - * for more details and examples. - */ - streamingPull( - options?: CallOptions): - gax.CancellableStream { - this.initialize(); - return this.innerApiCalls.streamingPull(null, options); - } - - /** - * Lists matching subscriptions. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.project - * Required. The name of the project in which to list subscriptions. - * Format is `projects/{project-id}`. - * @param {number} [request.pageSize] - * Optional. Maximum number of subscriptions to return. - * @param {string} [request.pageToken] - * Optional. The value returned by the last `ListSubscriptionsResponse`; - * indicates that this is a continuation of a prior `ListSubscriptions` call, - * and that the system should return the next page of data. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.pubsub.v1.Subscription|Subscription}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listSubscriptionsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listSubscriptions( - request?: protos.google.pubsub.v1.IListSubscriptionsRequest, - options?: CallOptions): - Promise<[ - protos.google.pubsub.v1.ISubscription[], - protos.google.pubsub.v1.IListSubscriptionsRequest|null, - protos.google.pubsub.v1.IListSubscriptionsResponse - ]>; - listSubscriptions( - request: protos.google.pubsub.v1.IListSubscriptionsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.pubsub.v1.IListSubscriptionsRequest, - protos.google.pubsub.v1.IListSubscriptionsResponse|null|undefined, - protos.google.pubsub.v1.ISubscription>): void; - listSubscriptions( - request: protos.google.pubsub.v1.IListSubscriptionsRequest, - callback: PaginationCallback< - protos.google.pubsub.v1.IListSubscriptionsRequest, - protos.google.pubsub.v1.IListSubscriptionsResponse|null|undefined, - protos.google.pubsub.v1.ISubscription>): void; - listSubscriptions( - request?: protos.google.pubsub.v1.IListSubscriptionsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.pubsub.v1.IListSubscriptionsRequest, - protos.google.pubsub.v1.IListSubscriptionsResponse|null|undefined, - protos.google.pubsub.v1.ISubscription>, - callback?: PaginationCallback< - protos.google.pubsub.v1.IListSubscriptionsRequest, - protos.google.pubsub.v1.IListSubscriptionsResponse|null|undefined, - protos.google.pubsub.v1.ISubscription>): - Promise<[ - protos.google.pubsub.v1.ISubscription[], - protos.google.pubsub.v1.IListSubscriptionsRequest|null, - protos.google.pubsub.v1.IListSubscriptionsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'project': request.project ?? '', - }); - this.initialize(); - return this.innerApiCalls.listSubscriptions(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.project - * Required. The name of the project in which to list subscriptions. - * Format is `projects/{project-id}`. - * @param {number} [request.pageSize] - * Optional. Maximum number of subscriptions to return. - * @param {string} [request.pageToken] - * Optional. The value returned by the last `ListSubscriptionsResponse`; - * indicates that this is a continuation of a prior `ListSubscriptions` call, - * and that the system should return the next page of data. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link protos.google.pubsub.v1.Subscription|Subscription} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listSubscriptionsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listSubscriptionsStream( - request?: protos.google.pubsub.v1.IListSubscriptionsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'project': request.project ?? '', - }); - const defaultCallSettings = this._defaults['listSubscriptions']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listSubscriptions.createStream( - this.innerApiCalls.listSubscriptions as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listSubscriptions`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.project - * Required. The name of the project in which to list subscriptions. - * Format is `projects/{project-id}`. - * @param {number} [request.pageSize] - * Optional. Maximum number of subscriptions to return. - * @param {string} [request.pageToken] - * Optional. The value returned by the last `ListSubscriptionsResponse`; - * indicates that this is a continuation of a prior `ListSubscriptions` call, - * and that the system should return the next page of data. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.pubsub.v1.Subscription|Subscription}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listSubscriptionsAsync( - request?: protos.google.pubsub.v1.IListSubscriptionsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'project': request.project ?? '', - }); - const defaultCallSettings = this._defaults['listSubscriptions']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listSubscriptions.asyncIterate( - this.innerApiCalls['listSubscriptions'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Lists the existing snapshots. Snapshots are used in [Seek]( - * https://cloud.google.com/pubsub/docs/replay-overview) operations, which - * allow you to manage message acknowledgments in bulk. That is, you can set - * the acknowledgment state of messages in an existing subscription to the - * state captured by a snapshot. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.project - * Required. The name of the project in which to list snapshots. - * Format is `projects/{project-id}`. - * @param {number} [request.pageSize] - * Optional. Maximum number of snapshots to return. - * @param {string} [request.pageToken] - * Optional. The value returned by the last `ListSnapshotsResponse`; indicates - * that this is a continuation of a prior `ListSnapshots` call, and that the - * system should return the next page of data. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.pubsub.v1.Snapshot|Snapshot}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listSnapshotsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listSnapshots( - request?: protos.google.pubsub.v1.IListSnapshotsRequest, - options?: CallOptions): - Promise<[ - protos.google.pubsub.v1.ISnapshot[], - protos.google.pubsub.v1.IListSnapshotsRequest|null, - protos.google.pubsub.v1.IListSnapshotsResponse - ]>; - listSnapshots( - request: protos.google.pubsub.v1.IListSnapshotsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.pubsub.v1.IListSnapshotsRequest, - protos.google.pubsub.v1.IListSnapshotsResponse|null|undefined, - protos.google.pubsub.v1.ISnapshot>): void; - listSnapshots( - request: protos.google.pubsub.v1.IListSnapshotsRequest, - callback: PaginationCallback< - protos.google.pubsub.v1.IListSnapshotsRequest, - protos.google.pubsub.v1.IListSnapshotsResponse|null|undefined, - protos.google.pubsub.v1.ISnapshot>): void; - listSnapshots( - request?: protos.google.pubsub.v1.IListSnapshotsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.pubsub.v1.IListSnapshotsRequest, - protos.google.pubsub.v1.IListSnapshotsResponse|null|undefined, - protos.google.pubsub.v1.ISnapshot>, - callback?: PaginationCallback< - protos.google.pubsub.v1.IListSnapshotsRequest, - protos.google.pubsub.v1.IListSnapshotsResponse|null|undefined, - protos.google.pubsub.v1.ISnapshot>): - Promise<[ - protos.google.pubsub.v1.ISnapshot[], - protos.google.pubsub.v1.IListSnapshotsRequest|null, - protos.google.pubsub.v1.IListSnapshotsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'project': request.project ?? '', - }); - this.initialize(); - return this.innerApiCalls.listSnapshots(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.project - * Required. The name of the project in which to list snapshots. - * Format is `projects/{project-id}`. - * @param {number} [request.pageSize] - * Optional. Maximum number of snapshots to return. - * @param {string} [request.pageToken] - * Optional. The value returned by the last `ListSnapshotsResponse`; indicates - * that this is a continuation of a prior `ListSnapshots` call, and that the - * system should return the next page of data. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link protos.google.pubsub.v1.Snapshot|Snapshot} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listSnapshotsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listSnapshotsStream( - request?: protos.google.pubsub.v1.IListSnapshotsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'project': request.project ?? '', - }); - const defaultCallSettings = this._defaults['listSnapshots']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listSnapshots.createStream( - this.innerApiCalls.listSnapshots as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listSnapshots`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.project - * Required. The name of the project in which to list snapshots. - * Format is `projects/{project-id}`. - * @param {number} [request.pageSize] - * Optional. Maximum number of snapshots to return. - * @param {string} [request.pageToken] - * Optional. The value returned by the last `ListSnapshotsResponse`; indicates - * that this is a continuation of a prior `ListSnapshots` call, and that the - * system should return the next page of data. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.pubsub.v1.Snapshot|Snapshot}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listSnapshotsAsync( - request?: protos.google.pubsub.v1.IListSnapshotsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'project': request.project ?? '', - }); - const defaultCallSettings = this._defaults['listSnapshots']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listSnapshots.asyncIterate( - this.innerApiCalls['listSnapshots'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } -/** - * Gets the access control policy for a resource. Returns an empty policy - * if the resource exists and does not have a policy set. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {Object} [request.options] - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. This field is only used by Cloud IAM. - * - * This object should have the same structure as {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing {@link google.iam.v1.Policy | Policy}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.Policy | Policy}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - getIamPolicy( - request: IamProtos.google.iam.v1.GetIamPolicyRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ):Promise<[IamProtos.google.iam.v1.Policy]> { - return this.iamClient.getIamPolicy(request, options, callback); - } - -/** - * Returns permissions that a caller has on the specified resource. If the - * resource does not exist, this will return an empty set of - * permissions, not a NOT_FOUND error. - * - * Note: This operation is designed to be used for building - * permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {string[]} request.permissions - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - setIamPolicy( - request: IamProtos.google.iam.v1.SetIamPolicyRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ):Promise<[IamProtos.google.iam.v1.Policy]> { - return this.iamClient.setIamPolicy(request, options, callback); - } - -/** - * Returns permissions that a caller has on the specified resource. If the - * resource does not exist, this will return an empty set of - * permissions, not a NOT_FOUND error. - * - * Note: This operation is designed to be used for building - * permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {string[]} request.permissions - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - */ - testIamPermissions( - request: IamProtos.google.iam.v1.TestIamPermissionsRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.TestIamPermissionsResponse, - IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.TestIamPermissionsResponse, - IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, - {} | null | undefined - > - ):Promise<[IamProtos.google.iam.v1.TestIamPermissionsResponse]> { - return this.iamClient.testIamPermissions(request, options, callback); - } - - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified project resource name string. - * - * @param {string} project - * @returns {string} Resource name string. - */ - projectPath(project:string) { - return this.pathTemplates.projectPathTemplate.render({ - project: project, - }); - } - - /** - * Parse the project from Project resource. - * - * @param {string} projectName - * A fully-qualified path representing Project resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectName(projectName: string) { - return this.pathTemplates.projectPathTemplate.match(projectName).project; - } - - /** - * Return a fully-qualified projectTopic resource name string. - * - * @param {string} project - * @param {string} topic - * @returns {string} Resource name string. - */ - projectTopicPath(project:string,topic:string) { - return this.pathTemplates.projectTopicPathTemplate.render({ - project: project, - topic: topic, - }); - } - - /** - * Parse the project from ProjectTopic resource. - * - * @param {string} projectTopicName - * A fully-qualified path representing project_topic resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectTopicName(projectTopicName: string) { - return this.pathTemplates.projectTopicPathTemplate.match(projectTopicName).project; - } - - /** - * Parse the topic from ProjectTopic resource. - * - * @param {string} projectTopicName - * A fully-qualified path representing project_topic resource. - * @returns {string} A string representing the topic. - */ - matchTopicFromProjectTopicName(projectTopicName: string) { - return this.pathTemplates.projectTopicPathTemplate.match(projectTopicName).topic; - } - - /** - * Return a fully-qualified schema resource name string. - * - * @param {string} project - * @param {string} schema - * @returns {string} Resource name string. - */ - schemaPath(project:string,schema:string) { - return this.pathTemplates.schemaPathTemplate.render({ - project: project, - schema: schema, - }); - } - - /** - * Parse the project from Schema resource. - * - * @param {string} schemaName - * A fully-qualified path representing Schema resource. - * @returns {string} A string representing the project. - */ - matchProjectFromSchemaName(schemaName: string) { - return this.pathTemplates.schemaPathTemplate.match(schemaName).project; - } - - /** - * Parse the schema from Schema resource. - * - * @param {string} schemaName - * A fully-qualified path representing Schema resource. - * @returns {string} A string representing the schema. - */ - matchSchemaFromSchemaName(schemaName: string) { - return this.pathTemplates.schemaPathTemplate.match(schemaName).schema; - } - - /** - * Return a fully-qualified snapshot resource name string. - * - * @param {string} project - * @param {string} snapshot - * @returns {string} Resource name string. - */ - snapshotPath(project:string,snapshot:string) { - return this.pathTemplates.snapshotPathTemplate.render({ - project: project, - snapshot: snapshot, - }); - } - - /** - * Parse the project from Snapshot resource. - * - * @param {string} snapshotName - * A fully-qualified path representing Snapshot resource. - * @returns {string} A string representing the project. - */ - matchProjectFromSnapshotName(snapshotName: string) { - return this.pathTemplates.snapshotPathTemplate.match(snapshotName).project; - } - - /** - * Parse the snapshot from Snapshot resource. - * - * @param {string} snapshotName - * A fully-qualified path representing Snapshot resource. - * @returns {string} A string representing the snapshot. - */ - matchSnapshotFromSnapshotName(snapshotName: string) { - return this.pathTemplates.snapshotPathTemplate.match(snapshotName).snapshot; - } - - /** - * Return a fully-qualified subscription resource name string. - * - * @param {string} project - * @param {string} subscription - * @returns {string} Resource name string. - */ - subscriptionPath(project:string,subscription:string) { - return this.pathTemplates.subscriptionPathTemplate.render({ - project: project, - subscription: subscription, - }); - } - - /** - * Parse the project from Subscription resource. - * - * @param {string} subscriptionName - * A fully-qualified path representing Subscription resource. - * @returns {string} A string representing the project. - */ - matchProjectFromSubscriptionName(subscriptionName: string) { - return this.pathTemplates.subscriptionPathTemplate.match(subscriptionName).project; - } - - /** - * Parse the subscription from Subscription resource. - * - * @param {string} subscriptionName - * A fully-qualified path representing Subscription resource. - * @returns {string} A string representing the subscription. - */ - matchSubscriptionFromSubscriptionName(subscriptionName: string) { - return this.pathTemplates.subscriptionPathTemplate.match(subscriptionName).subscription; - } - - /** - * Terminate the gRPC channel and close the client. - * - * The client will no longer be usable and all future behavior is undefined. - * @returns {Promise} A promise that resolves when the client is closed. - */ - close(): Promise { - if (this.subscriberStub && !this._terminated) { - return this.subscriberStub.then(stub => { - this._terminated = true; - stub.close(); - this.iamClient.close(); - }); - } - return Promise.resolve(); - } -} diff --git a/owl-bot-staging/v1/src/v1/subscriber_client_config.json b/owl-bot-staging/v1/src/v1/subscriber_client_config.json deleted file mode 100644 index a549d3010..000000000 --- a/owl-bot-staging/v1/src/v1/subscriber_client_config.json +++ /dev/null @@ -1,136 +0,0 @@ -{ - "interfaces": { - "google.pubsub.v1.Subscriber": { - "retry_codes": { - "non_idempotent": [], - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ], - "unknown_aborted_unavailable": [ - "UNKNOWN", - "ABORTED", - "UNAVAILABLE" - ], - "unavailable": [ - "UNAVAILABLE" - ], - "unknown_aborted_internal_unavailable": [ - "UNKNOWN", - "ABORTED", - "INTERNAL", - "UNAVAILABLE" - ], - "deadline_exceeded_resource_exhausted_aborted_internal_unavailable": [ - "DEADLINE_EXCEEDED", - "RESOURCE_EXHAUSTED", - "ABORTED", - "INTERNAL", - "UNAVAILABLE" - ] - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - }, - "693222d32e887d96c8faeadca469f7763ccda85a": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 4, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "CreateSubscription": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_aborted_unavailable", - "retry_params_name": "default" - }, - "GetSubscription": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_aborted_unavailable", - "retry_params_name": "default" - }, - "UpdateSubscription": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "default" - }, - "ListSubscriptions": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_aborted_unavailable", - "retry_params_name": "default" - }, - "DeleteSubscription": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "default" - }, - "ModifyAckDeadline": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "default" - }, - "Acknowledge": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "default" - }, - "Pull": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_aborted_internal_unavailable", - "retry_params_name": "default" - }, - "StreamingPull": { - "timeout_millis": 900000, - "retry_codes_name": "deadline_exceeded_resource_exhausted_aborted_internal_unavailable", - "retry_params_name": "693222d32e887d96c8faeadca469f7763ccda85a" - }, - "ModifyPushConfig": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "default" - }, - "GetSnapshot": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_aborted_unavailable", - "retry_params_name": "default" - }, - "ListSnapshots": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_aborted_unavailable", - "retry_params_name": "default" - }, - "CreateSnapshot": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "default" - }, - "UpdateSnapshot": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "default" - }, - "DeleteSnapshot": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "default" - }, - "Seek": { - "timeout_millis": 60000, - "retry_codes_name": "unknown_aborted_unavailable", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/v1/src/v1/subscriber_proto_list.json b/owl-bot-staging/v1/src/v1/subscriber_proto_list.json deleted file mode 100644 index 91011aec1..000000000 --- a/owl-bot-staging/v1/src/v1/subscriber_proto_list.json +++ /dev/null @@ -1,4 +0,0 @@ -[ - "../../protos/google/pubsub/v1/pubsub.proto", - "../../protos/google/pubsub/v1/schema.proto" -] diff --git a/owl-bot-staging/v1/test/gapic_publisher_v1.ts b/owl-bot-staging/v1/test/gapic_publisher_v1.ts deleted file mode 100644 index 7510cebe7..000000000 --- a/owl-bot-staging/v1/test/gapic_publisher_v1.ts +++ /dev/null @@ -1,2077 +0,0 @@ -// 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 -// -// https://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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import * as protos from '../protos/protos'; -import * as assert from 'assert'; -import * as sinon from 'sinon'; -import {SinonStub} from 'sinon'; -import {describe, it} from 'mocha'; -import * as publisherModule from '../src'; - -import {PassThrough} from 'stream'; - -import {protobuf, IamProtos} from 'google-gax'; - -// Dynamically loaded proto JSON is needed to get the type information -// to fill in default values for request objects -const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); - -// eslint-disable-next-line @typescript-eslint/no-unused-vars -function getTypeDefaultValue(typeName: string, fields: string[]) { - let type = root.lookupType(typeName) as protobuf.Type; - for (const field of fields.slice(0, -1)) { - type = type.fields[field]?.resolvedType as protobuf.Type; - } - return type.fields[fields[fields.length - 1]]?.defaultValue; -} - -function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message) - .toObject(instance as protobuf.Message, {defaults: true}); - return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; -} - -function stubSimpleCall(response?: ResponseType, error?: Error) { - return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); -} - -function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { - return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); -} - -function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { - const pagingStub = sinon.stub(); - if (responses) { - for (let i = 0; i < responses.length; ++i) { - pagingStub.onCall(i).callsArgWith(2, null, responses[i]); - } - } - const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; - const mockStream = new PassThrough({ - objectMode: true, - transform: transformStub, - }); - // trigger as many responses as needed - if (responses) { - for (let i = 0; i < responses.length; ++i) { - setImmediate(() => { mockStream.write({}); }); - } - setImmediate(() => { mockStream.end(); }); - } else { - setImmediate(() => { mockStream.write({}); }); - setImmediate(() => { mockStream.end(); }); - } - return sinon.stub().returns(mockStream); -} - -function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { - let counter = 0; - const asyncIterable = { - [Symbol.asyncIterator]() { - return { - async next() { - if (error) { - return Promise.reject(error); - } - if (counter >= responses!.length) { - return Promise.resolve({done: true, value: undefined}); - } - return Promise.resolve({done: false, value: responses![counter++]}); - } - }; - } - }; - return sinon.stub().returns(asyncIterable); -} - -describe('v1.PublisherClient', () => { - describe('Common methods', () => { - it('has apiEndpoint', () => { - const client = new publisherModule.v1.PublisherClient(); - const apiEndpoint = client.apiEndpoint; - assert.strictEqual(apiEndpoint, 'pubsub.googleapis.com'); - }); - - it('has universeDomain', () => { - const client = new publisherModule.v1.PublisherClient(); - const universeDomain = client.universeDomain; - assert.strictEqual(universeDomain, "googleapis.com"); - }); - - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - it('throws DeprecationWarning if static servicePath is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const servicePath = publisherModule.v1.PublisherClient.servicePath; - assert.strictEqual(servicePath, 'pubsub.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - - it('throws DeprecationWarning if static apiEndpoint is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const apiEndpoint = publisherModule.v1.PublisherClient.apiEndpoint; - assert.strictEqual(apiEndpoint, 'pubsub.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - } - it('sets apiEndpoint according to universe domain camelCase', () => { - const client = new publisherModule.v1.PublisherClient({universeDomain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'pubsub.example.com'); - }); - - it('sets apiEndpoint according to universe domain snakeCase', () => { - const client = new publisherModule.v1.PublisherClient({universe_domain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'pubsub.example.com'); - }); - - if (typeof process === 'object' && 'env' in process) { - describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { - it('sets apiEndpoint from environment variable', () => { - const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; - const client = new publisherModule.v1.PublisherClient(); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'pubsub.example.com'); - if (saved) { - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; - } else { - delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - } - }); - - it('value configured in code has priority over environment variable', () => { - const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; - const client = new publisherModule.v1.PublisherClient({universeDomain: 'configured.example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'pubsub.configured.example.com'); - if (saved) { - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; - } else { - delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - } - }); - }); - } - it('does not allow setting both universeDomain and universe_domain', () => { - assert.throws(() => { new publisherModule.v1.PublisherClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); - }); - - it('has port', () => { - const port = publisherModule.v1.PublisherClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new publisherModule.v1.PublisherClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new publisherModule.v1.PublisherClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new publisherModule.v1.PublisherClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.publisherStub, undefined); - await client.initialize(); - assert(client.publisherStub); - }); - - it('has close method for the initialized client', done => { - const client = new publisherModule.v1.PublisherClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - assert(client.publisherStub); - client.close().then(() => { - done(); - }); - }); - - it('has close method for the non-initialized client', done => { - const client = new publisherModule.v1.PublisherClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.publisherStub, undefined); - client.close().then(() => { - done(); - }); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new publisherModule.v1.PublisherClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); - const result = await client.getProjectId(); - assert.strictEqual(result, fakeProjectId); - assert((client.auth.getProjectId as SinonStub).calledWithExactly()); - }); - - it('has getProjectId method with callback', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new publisherModule.v1.PublisherClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); - const promise = new Promise((resolve, reject) => { - client.getProjectId((err?: Error|null, projectId?: string|null) => { - if (err) { - reject(err); - } else { - resolve(projectId); - } - }); - }); - const result = await promise; - assert.strictEqual(result, fakeProjectId); - }); - }); - - describe('createTopic', () => { - it('invokes createTopic without error', async () => { - const client = new publisherModule.v1.PublisherClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.Topic() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.Topic', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.pubsub.v1.Topic() - ); - client.innerApiCalls.createTopic = stubSimpleCall(expectedResponse); - const [response] = await client.createTopic(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createTopic as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createTopic as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createTopic without error using callback', async () => { - const client = new publisherModule.v1.PublisherClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.Topic() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.Topic', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.pubsub.v1.Topic() - ); - client.innerApiCalls.createTopic = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createTopic( - request, - (err?: Error|null, result?: protos.google.pubsub.v1.ITopic|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createTopic as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createTopic as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createTopic with error', async () => { - const client = new publisherModule.v1.PublisherClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.Topic() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.Topic', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createTopic = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createTopic(request), expectedError); - const actualRequest = (client.innerApiCalls.createTopic as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createTopic as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createTopic with closed client', async () => { - const client = new publisherModule.v1.PublisherClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.Topic() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.Topic', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createTopic(request), expectedError); - }); - }); - - describe('updateTopic', () => { - it('invokes updateTopic without error', async () => { - const client = new publisherModule.v1.PublisherClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.UpdateTopicRequest() - ); - request.topic ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.UpdateTopicRequest', ['topic', 'name']); - request.topic.name = defaultValue1; - const expectedHeaderRequestParams = `topic.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.pubsub.v1.Topic() - ); - client.innerApiCalls.updateTopic = stubSimpleCall(expectedResponse); - const [response] = await client.updateTopic(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateTopic as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateTopic as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateTopic without error using callback', async () => { - const client = new publisherModule.v1.PublisherClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.UpdateTopicRequest() - ); - request.topic ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.UpdateTopicRequest', ['topic', 'name']); - request.topic.name = defaultValue1; - const expectedHeaderRequestParams = `topic.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.pubsub.v1.Topic() - ); - client.innerApiCalls.updateTopic = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateTopic( - request, - (err?: Error|null, result?: protos.google.pubsub.v1.ITopic|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateTopic as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateTopic as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateTopic with error', async () => { - const client = new publisherModule.v1.PublisherClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.UpdateTopicRequest() - ); - request.topic ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.UpdateTopicRequest', ['topic', 'name']); - request.topic.name = defaultValue1; - const expectedHeaderRequestParams = `topic.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateTopic = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateTopic(request), expectedError); - const actualRequest = (client.innerApiCalls.updateTopic as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateTopic as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateTopic with closed client', async () => { - const client = new publisherModule.v1.PublisherClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.UpdateTopicRequest() - ); - request.topic ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.UpdateTopicRequest', ['topic', 'name']); - request.topic.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.updateTopic(request), expectedError); - }); - }); - - describe('publish', () => { - it('invokes publish without error', async () => { - const client = new publisherModule.v1.PublisherClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.PublishRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.PublishRequest', ['topic']); - request.topic = defaultValue1; - const expectedHeaderRequestParams = `topic=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.pubsub.v1.PublishResponse() - ); - client.innerApiCalls.publish = stubSimpleCall(expectedResponse); - const [response] = await client.publish(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.publish as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.publish as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes publish without error using callback', async () => { - const client = new publisherModule.v1.PublisherClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.PublishRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.PublishRequest', ['topic']); - request.topic = defaultValue1; - const expectedHeaderRequestParams = `topic=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.pubsub.v1.PublishResponse() - ); - client.innerApiCalls.publish = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.publish( - request, - (err?: Error|null, result?: protos.google.pubsub.v1.IPublishResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.publish as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.publish as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes publish with error', async () => { - const client = new publisherModule.v1.PublisherClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.PublishRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.PublishRequest', ['topic']); - request.topic = defaultValue1; - const expectedHeaderRequestParams = `topic=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.publish = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.publish(request), expectedError); - const actualRequest = (client.innerApiCalls.publish as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.publish as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes publish with closed client', async () => { - const client = new publisherModule.v1.PublisherClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.PublishRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.PublishRequest', ['topic']); - request.topic = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.publish(request), expectedError); - }); - }); - - describe('getTopic', () => { - it('invokes getTopic without error', async () => { - const client = new publisherModule.v1.PublisherClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.GetTopicRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.GetTopicRequest', ['topic']); - request.topic = defaultValue1; - const expectedHeaderRequestParams = `topic=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.pubsub.v1.Topic() - ); - client.innerApiCalls.getTopic = stubSimpleCall(expectedResponse); - const [response] = await client.getTopic(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getTopic as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getTopic as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getTopic without error using callback', async () => { - const client = new publisherModule.v1.PublisherClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.GetTopicRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.GetTopicRequest', ['topic']); - request.topic = defaultValue1; - const expectedHeaderRequestParams = `topic=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.pubsub.v1.Topic() - ); - client.innerApiCalls.getTopic = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getTopic( - request, - (err?: Error|null, result?: protos.google.pubsub.v1.ITopic|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getTopic as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getTopic as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getTopic with error', async () => { - const client = new publisherModule.v1.PublisherClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.GetTopicRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.GetTopicRequest', ['topic']); - request.topic = defaultValue1; - const expectedHeaderRequestParams = `topic=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getTopic = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getTopic(request), expectedError); - const actualRequest = (client.innerApiCalls.getTopic as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getTopic as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getTopic with closed client', async () => { - const client = new publisherModule.v1.PublisherClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.GetTopicRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.GetTopicRequest', ['topic']); - request.topic = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getTopic(request), expectedError); - }); - }); - - describe('deleteTopic', () => { - it('invokes deleteTopic without error', async () => { - const client = new publisherModule.v1.PublisherClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.DeleteTopicRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.DeleteTopicRequest', ['topic']); - request.topic = defaultValue1; - const expectedHeaderRequestParams = `topic=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteTopic = stubSimpleCall(expectedResponse); - const [response] = await client.deleteTopic(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteTopic as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteTopic as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteTopic without error using callback', async () => { - const client = new publisherModule.v1.PublisherClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.DeleteTopicRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.DeleteTopicRequest', ['topic']); - request.topic = defaultValue1; - const expectedHeaderRequestParams = `topic=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteTopic = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteTopic( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteTopic as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteTopic as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteTopic with error', async () => { - const client = new publisherModule.v1.PublisherClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.DeleteTopicRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.DeleteTopicRequest', ['topic']); - request.topic = defaultValue1; - const expectedHeaderRequestParams = `topic=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteTopic = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteTopic(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteTopic as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteTopic as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteTopic with closed client', async () => { - const client = new publisherModule.v1.PublisherClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.DeleteTopicRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.DeleteTopicRequest', ['topic']); - request.topic = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.deleteTopic(request), expectedError); - }); - }); - - describe('detachSubscription', () => { - it('invokes detachSubscription without error', async () => { - const client = new publisherModule.v1.PublisherClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.DetachSubscriptionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.DetachSubscriptionRequest', ['subscription']); - request.subscription = defaultValue1; - const expectedHeaderRequestParams = `subscription=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.pubsub.v1.DetachSubscriptionResponse() - ); - client.innerApiCalls.detachSubscription = stubSimpleCall(expectedResponse); - const [response] = await client.detachSubscription(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.detachSubscription as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.detachSubscription as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes detachSubscription without error using callback', async () => { - const client = new publisherModule.v1.PublisherClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.DetachSubscriptionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.DetachSubscriptionRequest', ['subscription']); - request.subscription = defaultValue1; - const expectedHeaderRequestParams = `subscription=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.pubsub.v1.DetachSubscriptionResponse() - ); - client.innerApiCalls.detachSubscription = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.detachSubscription( - request, - (err?: Error|null, result?: protos.google.pubsub.v1.IDetachSubscriptionResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.detachSubscription as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.detachSubscription as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes detachSubscription with error', async () => { - const client = new publisherModule.v1.PublisherClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.DetachSubscriptionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.DetachSubscriptionRequest', ['subscription']); - request.subscription = defaultValue1; - const expectedHeaderRequestParams = `subscription=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.detachSubscription = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.detachSubscription(request), expectedError); - const actualRequest = (client.innerApiCalls.detachSubscription as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.detachSubscription as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes detachSubscription with closed client', async () => { - const client = new publisherModule.v1.PublisherClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.DetachSubscriptionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.DetachSubscriptionRequest', ['subscription']); - request.subscription = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.detachSubscription(request), expectedError); - }); - }); - - describe('listTopics', () => { - it('invokes listTopics without error', async () => { - const client = new publisherModule.v1.PublisherClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.ListTopicsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.ListTopicsRequest', ['project']); - request.project = defaultValue1; - const expectedHeaderRequestParams = `project=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.pubsub.v1.Topic()), - generateSampleMessage(new protos.google.pubsub.v1.Topic()), - generateSampleMessage(new protos.google.pubsub.v1.Topic()), - ]; - client.innerApiCalls.listTopics = stubSimpleCall(expectedResponse); - const [response] = await client.listTopics(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listTopics as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listTopics as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listTopics without error using callback', async () => { - const client = new publisherModule.v1.PublisherClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.ListTopicsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.ListTopicsRequest', ['project']); - request.project = defaultValue1; - const expectedHeaderRequestParams = `project=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.pubsub.v1.Topic()), - generateSampleMessage(new protos.google.pubsub.v1.Topic()), - generateSampleMessage(new protos.google.pubsub.v1.Topic()), - ]; - client.innerApiCalls.listTopics = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listTopics( - request, - (err?: Error|null, result?: protos.google.pubsub.v1.ITopic[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listTopics as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listTopics as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listTopics with error', async () => { - const client = new publisherModule.v1.PublisherClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.ListTopicsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.ListTopicsRequest', ['project']); - request.project = defaultValue1; - const expectedHeaderRequestParams = `project=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listTopics = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listTopics(request), expectedError); - const actualRequest = (client.innerApiCalls.listTopics as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listTopics as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listTopicsStream without error', async () => { - const client = new publisherModule.v1.PublisherClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.ListTopicsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.ListTopicsRequest', ['project']); - request.project = defaultValue1; - const expectedHeaderRequestParams = `project=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.pubsub.v1.Topic()), - generateSampleMessage(new protos.google.pubsub.v1.Topic()), - generateSampleMessage(new protos.google.pubsub.v1.Topic()), - ]; - client.descriptors.page.listTopics.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listTopicsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.pubsub.v1.Topic[] = []; - stream.on('data', (response: protos.google.pubsub.v1.Topic) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listTopics.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listTopics, request)); - assert( - (client.descriptors.page.listTopics.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listTopicsStream with error', async () => { - const client = new publisherModule.v1.PublisherClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.ListTopicsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.ListTopicsRequest', ['project']); - request.project = defaultValue1; - const expectedHeaderRequestParams = `project=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listTopics.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listTopicsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.pubsub.v1.Topic[] = []; - stream.on('data', (response: protos.google.pubsub.v1.Topic) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listTopics.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listTopics, request)); - assert( - (client.descriptors.page.listTopics.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listTopics without error', async () => { - const client = new publisherModule.v1.PublisherClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.ListTopicsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.ListTopicsRequest', ['project']); - request.project = defaultValue1; - const expectedHeaderRequestParams = `project=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.pubsub.v1.Topic()), - generateSampleMessage(new protos.google.pubsub.v1.Topic()), - generateSampleMessage(new protos.google.pubsub.v1.Topic()), - ]; - client.descriptors.page.listTopics.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.pubsub.v1.ITopic[] = []; - const iterable = client.listTopicsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listTopics.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listTopics.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listTopics with error', async () => { - const client = new publisherModule.v1.PublisherClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.ListTopicsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.ListTopicsRequest', ['project']); - request.project = defaultValue1; - const expectedHeaderRequestParams = `project=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listTopics.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listTopicsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.pubsub.v1.ITopic[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listTopics.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listTopics.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listTopicSubscriptions', () => { - it('invokes listTopicSubscriptions without error', async () => { - const client = new publisherModule.v1.PublisherClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.ListTopicSubscriptionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.ListTopicSubscriptionsRequest', ['topic']); - request.topic = defaultValue1; - const expectedHeaderRequestParams = `topic=${defaultValue1}`;const expectedResponse = [new String(), new String(), new String()]; - client.innerApiCalls.listTopicSubscriptions = stubSimpleCall(expectedResponse); - const [response] = await client.listTopicSubscriptions(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listTopicSubscriptions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listTopicSubscriptions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listTopicSubscriptions without error using callback', async () => { - const client = new publisherModule.v1.PublisherClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.ListTopicSubscriptionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.ListTopicSubscriptionsRequest', ['topic']); - request.topic = defaultValue1; - const expectedHeaderRequestParams = `topic=${defaultValue1}`;const expectedResponse = [new String(), new String(), new String()]; - client.innerApiCalls.listTopicSubscriptions = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listTopicSubscriptions( - request, - (err?: Error|null, result?: string[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listTopicSubscriptions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listTopicSubscriptions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listTopicSubscriptions with error', async () => { - const client = new publisherModule.v1.PublisherClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.ListTopicSubscriptionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.ListTopicSubscriptionsRequest', ['topic']); - request.topic = defaultValue1; - const expectedHeaderRequestParams = `topic=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listTopicSubscriptions = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listTopicSubscriptions(request), expectedError); - const actualRequest = (client.innerApiCalls.listTopicSubscriptions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listTopicSubscriptions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listTopicSubscriptionsStream without error', async () => { - const client = new publisherModule.v1.PublisherClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.ListTopicSubscriptionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.ListTopicSubscriptionsRequest', ['topic']); - request.topic = defaultValue1; - const expectedHeaderRequestParams = `topic=${defaultValue1}`; - const expectedResponse = [new String(), new String(), new String()]; - client.descriptors.page.listTopicSubscriptions.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listTopicSubscriptionsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: string[] = []; - stream.on('data', (response: string) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listTopicSubscriptions.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listTopicSubscriptions, request)); - assert( - (client.descriptors.page.listTopicSubscriptions.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listTopicSubscriptionsStream with error', async () => { - const client = new publisherModule.v1.PublisherClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.ListTopicSubscriptionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.ListTopicSubscriptionsRequest', ['topic']); - request.topic = defaultValue1; - const expectedHeaderRequestParams = `topic=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listTopicSubscriptions.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listTopicSubscriptionsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: string[] = []; - stream.on('data', (response: string) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listTopicSubscriptions.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listTopicSubscriptions, request)); - assert( - (client.descriptors.page.listTopicSubscriptions.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listTopicSubscriptions without error', async () => { - const client = new publisherModule.v1.PublisherClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.ListTopicSubscriptionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.ListTopicSubscriptionsRequest', ['topic']); - request.topic = defaultValue1; - const expectedHeaderRequestParams = `topic=${defaultValue1}`; - const expectedResponse = [new String(), new String(), new String()]; - client.descriptors.page.listTopicSubscriptions.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: string[] = []; - const iterable = client.listTopicSubscriptionsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listTopicSubscriptions.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listTopicSubscriptions.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listTopicSubscriptions with error', async () => { - const client = new publisherModule.v1.PublisherClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.ListTopicSubscriptionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.ListTopicSubscriptionsRequest', ['topic']); - request.topic = defaultValue1; - const expectedHeaderRequestParams = `topic=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listTopicSubscriptions.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listTopicSubscriptionsAsync(request); - await assert.rejects(async () => { - const responses: string[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listTopicSubscriptions.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listTopicSubscriptions.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listTopicSnapshots', () => { - it('invokes listTopicSnapshots without error', async () => { - const client = new publisherModule.v1.PublisherClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.ListTopicSnapshotsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.ListTopicSnapshotsRequest', ['topic']); - request.topic = defaultValue1; - const expectedHeaderRequestParams = `topic=${defaultValue1}`;const expectedResponse = [new String(), new String(), new String()]; - client.innerApiCalls.listTopicSnapshots = stubSimpleCall(expectedResponse); - const [response] = await client.listTopicSnapshots(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listTopicSnapshots as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listTopicSnapshots as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listTopicSnapshots without error using callback', async () => { - const client = new publisherModule.v1.PublisherClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.ListTopicSnapshotsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.ListTopicSnapshotsRequest', ['topic']); - request.topic = defaultValue1; - const expectedHeaderRequestParams = `topic=${defaultValue1}`;const expectedResponse = [new String(), new String(), new String()]; - client.innerApiCalls.listTopicSnapshots = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listTopicSnapshots( - request, - (err?: Error|null, result?: string[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listTopicSnapshots as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listTopicSnapshots as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listTopicSnapshots with error', async () => { - const client = new publisherModule.v1.PublisherClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.ListTopicSnapshotsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.ListTopicSnapshotsRequest', ['topic']); - request.topic = defaultValue1; - const expectedHeaderRequestParams = `topic=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listTopicSnapshots = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listTopicSnapshots(request), expectedError); - const actualRequest = (client.innerApiCalls.listTopicSnapshots as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listTopicSnapshots as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listTopicSnapshotsStream without error', async () => { - const client = new publisherModule.v1.PublisherClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.ListTopicSnapshotsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.ListTopicSnapshotsRequest', ['topic']); - request.topic = defaultValue1; - const expectedHeaderRequestParams = `topic=${defaultValue1}`; - const expectedResponse = [new String(), new String(), new String()]; - client.descriptors.page.listTopicSnapshots.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listTopicSnapshotsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: string[] = []; - stream.on('data', (response: string) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listTopicSnapshots.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listTopicSnapshots, request)); - assert( - (client.descriptors.page.listTopicSnapshots.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listTopicSnapshotsStream with error', async () => { - const client = new publisherModule.v1.PublisherClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.ListTopicSnapshotsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.ListTopicSnapshotsRequest', ['topic']); - request.topic = defaultValue1; - const expectedHeaderRequestParams = `topic=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listTopicSnapshots.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listTopicSnapshotsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: string[] = []; - stream.on('data', (response: string) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listTopicSnapshots.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listTopicSnapshots, request)); - assert( - (client.descriptors.page.listTopicSnapshots.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listTopicSnapshots without error', async () => { - const client = new publisherModule.v1.PublisherClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.ListTopicSnapshotsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.ListTopicSnapshotsRequest', ['topic']); - request.topic = defaultValue1; - const expectedHeaderRequestParams = `topic=${defaultValue1}`; - const expectedResponse = [new String(), new String(), new String()]; - client.descriptors.page.listTopicSnapshots.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: string[] = []; - const iterable = client.listTopicSnapshotsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listTopicSnapshots.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listTopicSnapshots.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listTopicSnapshots with error', async () => { - const client = new publisherModule.v1.PublisherClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.ListTopicSnapshotsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.ListTopicSnapshotsRequest', ['topic']); - request.topic = defaultValue1; - const expectedHeaderRequestParams = `topic=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listTopicSnapshots.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listTopicSnapshotsAsync(request); - await assert.rejects(async () => { - const responses: string[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listTopicSnapshots.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listTopicSnapshots.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - describe('getIamPolicy', () => { - it('invokes getIamPolicy without error', async () => { - const client = new publisherModule.v1.PublisherClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); - const response = await client.getIamPolicy(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes getIamPolicy without error using callback', async () => { - const client = new publisherModule.v1.PublisherClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.getIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getIamPolicy( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0)); - }); - it('invokes getIamPolicy with error', async () => { - const client = new publisherModule.v1.PublisherClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getIamPolicy(request, expectedOptions), expectedError); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('setIamPolicy', () => { - it('invokes setIamPolicy without error', async () => { - const client = new publisherModule.v1.PublisherClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); - const response = await client.setIamPolicy(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes setIamPolicy without error using callback', async () => { - const client = new publisherModule.v1.PublisherClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.setIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setIamPolicy( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0)); - }); - it('invokes setIamPolicy with error', async () => { - const client = new publisherModule.v1.PublisherClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setIamPolicy(request, expectedOptions), expectedError); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('testIamPermissions', () => { - it('invokes testIamPermissions without error', async () => { - const client = new publisherModule.v1.PublisherClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsResponse() - ); - client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); - const response = await client.testIamPermissions(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes testIamPermissions without error using callback', async () => { - const client = new publisherModule.v1.PublisherClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsResponse() - ); - client.iamClient.testIamPermissions = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.testIamPermissions( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.TestIamPermissionsResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0)); - }); - it('invokes testIamPermissions with error', async () => { - const client = new publisherModule.v1.PublisherClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.testIamPermissions = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.testIamPermissions(request, expectedOptions), expectedError); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - - describe('Path templates', () => { - - describe('project', () => { - const fakePath = "/rendered/path/project"; - const expectedParameters = { - project: "projectValue", - }; - const client = new publisherModule.v1.PublisherClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.projectPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectPath', () => { - const result = client.projectPath("projectValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectName', () => { - const result = client.matchProjectFromProjectName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectTopic', () => { - const fakePath = "/rendered/path/projectTopic"; - const expectedParameters = { - project: "projectValue", - topic: "topicValue", - }; - const client = new publisherModule.v1.PublisherClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.projectTopicPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectTopicPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectTopicPath', () => { - const result = client.projectTopicPath("projectValue", "topicValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectTopicPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectTopicName', () => { - const result = client.matchProjectFromProjectTopicName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectTopicPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTopicFromProjectTopicName', () => { - const result = client.matchTopicFromProjectTopicName(fakePath); - assert.strictEqual(result, "topicValue"); - assert((client.pathTemplates.projectTopicPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('schema', () => { - const fakePath = "/rendered/path/schema"; - const expectedParameters = { - project: "projectValue", - schema: "schemaValue", - }; - const client = new publisherModule.v1.PublisherClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.schemaPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.schemaPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('schemaPath', () => { - const result = client.schemaPath("projectValue", "schemaValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.schemaPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSchemaName', () => { - const result = client.matchProjectFromSchemaName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.schemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSchemaFromSchemaName', () => { - const result = client.matchSchemaFromSchemaName(fakePath); - assert.strictEqual(result, "schemaValue"); - assert((client.pathTemplates.schemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('snapshot', () => { - const fakePath = "/rendered/path/snapshot"; - const expectedParameters = { - project: "projectValue", - snapshot: "snapshotValue", - }; - const client = new publisherModule.v1.PublisherClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.snapshotPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.snapshotPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('snapshotPath', () => { - const result = client.snapshotPath("projectValue", "snapshotValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.snapshotPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSnapshotName', () => { - const result = client.matchProjectFromSnapshotName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.snapshotPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSnapshotFromSnapshotName', () => { - const result = client.matchSnapshotFromSnapshotName(fakePath); - assert.strictEqual(result, "snapshotValue"); - assert((client.pathTemplates.snapshotPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('subscription', () => { - const fakePath = "/rendered/path/subscription"; - const expectedParameters = { - project: "projectValue", - subscription: "subscriptionValue", - }; - const client = new publisherModule.v1.PublisherClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.subscriptionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.subscriptionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('subscriptionPath', () => { - const result = client.subscriptionPath("projectValue", "subscriptionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.subscriptionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSubscriptionName', () => { - const result = client.matchProjectFromSubscriptionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.subscriptionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSubscriptionFromSubscriptionName', () => { - const result = client.matchSubscriptionFromSubscriptionName(fakePath); - assert.strictEqual(result, "subscriptionValue"); - assert((client.pathTemplates.subscriptionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/v1/test/gapic_schema_service_v1.ts b/owl-bot-staging/v1/test/gapic_schema_service_v1.ts deleted file mode 100644 index 2ac9b09fc..000000000 --- a/owl-bot-staging/v1/test/gapic_schema_service_v1.ts +++ /dev/null @@ -1,2076 +0,0 @@ -// 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 -// -// https://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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import * as protos from '../protos/protos'; -import * as assert from 'assert'; -import * as sinon from 'sinon'; -import {SinonStub} from 'sinon'; -import {describe, it} from 'mocha'; -import * as schemaserviceModule from '../src'; - -import {PassThrough} from 'stream'; - -import {protobuf, IamProtos} from 'google-gax'; - -// Dynamically loaded proto JSON is needed to get the type information -// to fill in default values for request objects -const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); - -// eslint-disable-next-line @typescript-eslint/no-unused-vars -function getTypeDefaultValue(typeName: string, fields: string[]) { - let type = root.lookupType(typeName) as protobuf.Type; - for (const field of fields.slice(0, -1)) { - type = type.fields[field]?.resolvedType as protobuf.Type; - } - return type.fields[fields[fields.length - 1]]?.defaultValue; -} - -function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message) - .toObject(instance as protobuf.Message, {defaults: true}); - return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; -} - -function stubSimpleCall(response?: ResponseType, error?: Error) { - return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); -} - -function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { - return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); -} - -function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { - const pagingStub = sinon.stub(); - if (responses) { - for (let i = 0; i < responses.length; ++i) { - pagingStub.onCall(i).callsArgWith(2, null, responses[i]); - } - } - const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; - const mockStream = new PassThrough({ - objectMode: true, - transform: transformStub, - }); - // trigger as many responses as needed - if (responses) { - for (let i = 0; i < responses.length; ++i) { - setImmediate(() => { mockStream.write({}); }); - } - setImmediate(() => { mockStream.end(); }); - } else { - setImmediate(() => { mockStream.write({}); }); - setImmediate(() => { mockStream.end(); }); - } - return sinon.stub().returns(mockStream); -} - -function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { - let counter = 0; - const asyncIterable = { - [Symbol.asyncIterator]() { - return { - async next() { - if (error) { - return Promise.reject(error); - } - if (counter >= responses!.length) { - return Promise.resolve({done: true, value: undefined}); - } - return Promise.resolve({done: false, value: responses![counter++]}); - } - }; - } - }; - return sinon.stub().returns(asyncIterable); -} - -describe('v1.SchemaServiceClient', () => { - describe('Common methods', () => { - it('has apiEndpoint', () => { - const client = new schemaserviceModule.v1.SchemaServiceClient(); - const apiEndpoint = client.apiEndpoint; - assert.strictEqual(apiEndpoint, 'pubsub.googleapis.com'); - }); - - it('has universeDomain', () => { - const client = new schemaserviceModule.v1.SchemaServiceClient(); - const universeDomain = client.universeDomain; - assert.strictEqual(universeDomain, "googleapis.com"); - }); - - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - it('throws DeprecationWarning if static servicePath is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const servicePath = schemaserviceModule.v1.SchemaServiceClient.servicePath; - assert.strictEqual(servicePath, 'pubsub.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - - it('throws DeprecationWarning if static apiEndpoint is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const apiEndpoint = schemaserviceModule.v1.SchemaServiceClient.apiEndpoint; - assert.strictEqual(apiEndpoint, 'pubsub.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - } - it('sets apiEndpoint according to universe domain camelCase', () => { - const client = new schemaserviceModule.v1.SchemaServiceClient({universeDomain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'pubsub.example.com'); - }); - - it('sets apiEndpoint according to universe domain snakeCase', () => { - const client = new schemaserviceModule.v1.SchemaServiceClient({universe_domain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'pubsub.example.com'); - }); - - if (typeof process === 'object' && 'env' in process) { - describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { - it('sets apiEndpoint from environment variable', () => { - const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; - const client = new schemaserviceModule.v1.SchemaServiceClient(); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'pubsub.example.com'); - if (saved) { - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; - } else { - delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - } - }); - - it('value configured in code has priority over environment variable', () => { - const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; - const client = new schemaserviceModule.v1.SchemaServiceClient({universeDomain: 'configured.example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'pubsub.configured.example.com'); - if (saved) { - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; - } else { - delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - } - }); - }); - } - it('does not allow setting both universeDomain and universe_domain', () => { - assert.throws(() => { new schemaserviceModule.v1.SchemaServiceClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); - }); - - it('has port', () => { - const port = schemaserviceModule.v1.SchemaServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new schemaserviceModule.v1.SchemaServiceClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new schemaserviceModule.v1.SchemaServiceClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new schemaserviceModule.v1.SchemaServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.schemaServiceStub, undefined); - await client.initialize(); - assert(client.schemaServiceStub); - }); - - it('has close method for the initialized client', done => { - const client = new schemaserviceModule.v1.SchemaServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - assert(client.schemaServiceStub); - client.close().then(() => { - done(); - }); - }); - - it('has close method for the non-initialized client', done => { - const client = new schemaserviceModule.v1.SchemaServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.schemaServiceStub, undefined); - client.close().then(() => { - done(); - }); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new schemaserviceModule.v1.SchemaServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); - const result = await client.getProjectId(); - assert.strictEqual(result, fakeProjectId); - assert((client.auth.getProjectId as SinonStub).calledWithExactly()); - }); - - it('has getProjectId method with callback', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new schemaserviceModule.v1.SchemaServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); - const promise = new Promise((resolve, reject) => { - client.getProjectId((err?: Error|null, projectId?: string|null) => { - if (err) { - reject(err); - } else { - resolve(projectId); - } - }); - }); - const result = await promise; - assert.strictEqual(result, fakeProjectId); - }); - }); - - describe('createSchema', () => { - it('invokes createSchema without error', async () => { - const client = new schemaserviceModule.v1.SchemaServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.CreateSchemaRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.CreateSchemaRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.pubsub.v1.Schema() - ); - client.innerApiCalls.createSchema = stubSimpleCall(expectedResponse); - const [response] = await client.createSchema(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createSchema as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createSchema as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createSchema without error using callback', async () => { - const client = new schemaserviceModule.v1.SchemaServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.CreateSchemaRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.CreateSchemaRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.pubsub.v1.Schema() - ); - client.innerApiCalls.createSchema = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createSchema( - request, - (err?: Error|null, result?: protos.google.pubsub.v1.ISchema|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createSchema as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createSchema as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createSchema with error', async () => { - const client = new schemaserviceModule.v1.SchemaServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.CreateSchemaRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.CreateSchemaRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createSchema = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createSchema(request), expectedError); - const actualRequest = (client.innerApiCalls.createSchema as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createSchema as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createSchema with closed client', async () => { - const client = new schemaserviceModule.v1.SchemaServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.CreateSchemaRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.CreateSchemaRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createSchema(request), expectedError); - }); - }); - - describe('getSchema', () => { - it('invokes getSchema without error', async () => { - const client = new schemaserviceModule.v1.SchemaServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.GetSchemaRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.GetSchemaRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.pubsub.v1.Schema() - ); - client.innerApiCalls.getSchema = stubSimpleCall(expectedResponse); - const [response] = await client.getSchema(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getSchema as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getSchema as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getSchema without error using callback', async () => { - const client = new schemaserviceModule.v1.SchemaServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.GetSchemaRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.GetSchemaRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.pubsub.v1.Schema() - ); - client.innerApiCalls.getSchema = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getSchema( - request, - (err?: Error|null, result?: protos.google.pubsub.v1.ISchema|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getSchema as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getSchema as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getSchema with error', async () => { - const client = new schemaserviceModule.v1.SchemaServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.GetSchemaRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.GetSchemaRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getSchema = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getSchema(request), expectedError); - const actualRequest = (client.innerApiCalls.getSchema as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getSchema as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getSchema with closed client', async () => { - const client = new schemaserviceModule.v1.SchemaServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.GetSchemaRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.GetSchemaRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getSchema(request), expectedError); - }); - }); - - describe('commitSchema', () => { - it('invokes commitSchema without error', async () => { - const client = new schemaserviceModule.v1.SchemaServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.CommitSchemaRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.CommitSchemaRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.pubsub.v1.Schema() - ); - client.innerApiCalls.commitSchema = stubSimpleCall(expectedResponse); - const [response] = await client.commitSchema(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.commitSchema as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.commitSchema as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes commitSchema without error using callback', async () => { - const client = new schemaserviceModule.v1.SchemaServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.CommitSchemaRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.CommitSchemaRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.pubsub.v1.Schema() - ); - client.innerApiCalls.commitSchema = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.commitSchema( - request, - (err?: Error|null, result?: protos.google.pubsub.v1.ISchema|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.commitSchema as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.commitSchema as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes commitSchema with error', async () => { - const client = new schemaserviceModule.v1.SchemaServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.CommitSchemaRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.CommitSchemaRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.commitSchema = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.commitSchema(request), expectedError); - const actualRequest = (client.innerApiCalls.commitSchema as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.commitSchema as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes commitSchema with closed client', async () => { - const client = new schemaserviceModule.v1.SchemaServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.CommitSchemaRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.CommitSchemaRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.commitSchema(request), expectedError); - }); - }); - - describe('rollbackSchema', () => { - it('invokes rollbackSchema without error', async () => { - const client = new schemaserviceModule.v1.SchemaServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.RollbackSchemaRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.RollbackSchemaRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.pubsub.v1.Schema() - ); - client.innerApiCalls.rollbackSchema = stubSimpleCall(expectedResponse); - const [response] = await client.rollbackSchema(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.rollbackSchema as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.rollbackSchema as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes rollbackSchema without error using callback', async () => { - const client = new schemaserviceModule.v1.SchemaServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.RollbackSchemaRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.RollbackSchemaRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.pubsub.v1.Schema() - ); - client.innerApiCalls.rollbackSchema = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.rollbackSchema( - request, - (err?: Error|null, result?: protos.google.pubsub.v1.ISchema|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.rollbackSchema as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.rollbackSchema as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes rollbackSchema with error', async () => { - const client = new schemaserviceModule.v1.SchemaServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.RollbackSchemaRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.RollbackSchemaRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.rollbackSchema = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.rollbackSchema(request), expectedError); - const actualRequest = (client.innerApiCalls.rollbackSchema as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.rollbackSchema as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes rollbackSchema with closed client', async () => { - const client = new schemaserviceModule.v1.SchemaServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.RollbackSchemaRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.RollbackSchemaRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.rollbackSchema(request), expectedError); - }); - }); - - describe('deleteSchemaRevision', () => { - it('invokes deleteSchemaRevision without error', async () => { - const client = new schemaserviceModule.v1.SchemaServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.DeleteSchemaRevisionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.DeleteSchemaRevisionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.pubsub.v1.Schema() - ); - client.innerApiCalls.deleteSchemaRevision = stubSimpleCall(expectedResponse); - const [response] = await client.deleteSchemaRevision(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteSchemaRevision as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteSchemaRevision as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteSchemaRevision without error using callback', async () => { - const client = new schemaserviceModule.v1.SchemaServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.DeleteSchemaRevisionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.DeleteSchemaRevisionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.pubsub.v1.Schema() - ); - client.innerApiCalls.deleteSchemaRevision = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteSchemaRevision( - request, - (err?: Error|null, result?: protos.google.pubsub.v1.ISchema|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteSchemaRevision as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteSchemaRevision as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteSchemaRevision with error', async () => { - const client = new schemaserviceModule.v1.SchemaServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.DeleteSchemaRevisionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.DeleteSchemaRevisionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteSchemaRevision = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteSchemaRevision(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteSchemaRevision as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteSchemaRevision as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteSchemaRevision with closed client', async () => { - const client = new schemaserviceModule.v1.SchemaServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.DeleteSchemaRevisionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.DeleteSchemaRevisionRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.deleteSchemaRevision(request), expectedError); - }); - }); - - describe('deleteSchema', () => { - it('invokes deleteSchema without error', async () => { - const client = new schemaserviceModule.v1.SchemaServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.DeleteSchemaRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.DeleteSchemaRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteSchema = stubSimpleCall(expectedResponse); - const [response] = await client.deleteSchema(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteSchema as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteSchema as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteSchema without error using callback', async () => { - const client = new schemaserviceModule.v1.SchemaServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.DeleteSchemaRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.DeleteSchemaRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteSchema = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteSchema( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteSchema as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteSchema as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteSchema with error', async () => { - const client = new schemaserviceModule.v1.SchemaServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.DeleteSchemaRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.DeleteSchemaRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteSchema = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteSchema(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteSchema as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteSchema as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteSchema with closed client', async () => { - const client = new schemaserviceModule.v1.SchemaServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.DeleteSchemaRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.DeleteSchemaRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.deleteSchema(request), expectedError); - }); - }); - - describe('validateSchema', () => { - it('invokes validateSchema without error', async () => { - const client = new schemaserviceModule.v1.SchemaServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.ValidateSchemaRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.ValidateSchemaRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.pubsub.v1.ValidateSchemaResponse() - ); - client.innerApiCalls.validateSchema = stubSimpleCall(expectedResponse); - const [response] = await client.validateSchema(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.validateSchema as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.validateSchema as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes validateSchema without error using callback', async () => { - const client = new schemaserviceModule.v1.SchemaServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.ValidateSchemaRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.ValidateSchemaRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.pubsub.v1.ValidateSchemaResponse() - ); - client.innerApiCalls.validateSchema = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.validateSchema( - request, - (err?: Error|null, result?: protos.google.pubsub.v1.IValidateSchemaResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.validateSchema as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.validateSchema as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes validateSchema with error', async () => { - const client = new schemaserviceModule.v1.SchemaServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.ValidateSchemaRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.ValidateSchemaRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.validateSchema = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.validateSchema(request), expectedError); - const actualRequest = (client.innerApiCalls.validateSchema as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.validateSchema as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes validateSchema with closed client', async () => { - const client = new schemaserviceModule.v1.SchemaServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.ValidateSchemaRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.ValidateSchemaRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.validateSchema(request), expectedError); - }); - }); - - describe('validateMessage', () => { - it('invokes validateMessage without error', async () => { - const client = new schemaserviceModule.v1.SchemaServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.ValidateMessageRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.ValidateMessageRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.pubsub.v1.ValidateMessageResponse() - ); - client.innerApiCalls.validateMessage = stubSimpleCall(expectedResponse); - const [response] = await client.validateMessage(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.validateMessage as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.validateMessage as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes validateMessage without error using callback', async () => { - const client = new schemaserviceModule.v1.SchemaServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.ValidateMessageRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.ValidateMessageRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.pubsub.v1.ValidateMessageResponse() - ); - client.innerApiCalls.validateMessage = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.validateMessage( - request, - (err?: Error|null, result?: protos.google.pubsub.v1.IValidateMessageResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.validateMessage as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.validateMessage as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes validateMessage with error', async () => { - const client = new schemaserviceModule.v1.SchemaServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.ValidateMessageRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.ValidateMessageRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.validateMessage = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.validateMessage(request), expectedError); - const actualRequest = (client.innerApiCalls.validateMessage as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.validateMessage as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes validateMessage with closed client', async () => { - const client = new schemaserviceModule.v1.SchemaServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.ValidateMessageRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.ValidateMessageRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.validateMessage(request), expectedError); - }); - }); - - describe('listSchemas', () => { - it('invokes listSchemas without error', async () => { - const client = new schemaserviceModule.v1.SchemaServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.ListSchemasRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.ListSchemasRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.pubsub.v1.Schema()), - generateSampleMessage(new protos.google.pubsub.v1.Schema()), - generateSampleMessage(new protos.google.pubsub.v1.Schema()), - ]; - client.innerApiCalls.listSchemas = stubSimpleCall(expectedResponse); - const [response] = await client.listSchemas(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listSchemas as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listSchemas as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listSchemas without error using callback', async () => { - const client = new schemaserviceModule.v1.SchemaServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.ListSchemasRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.ListSchemasRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.pubsub.v1.Schema()), - generateSampleMessage(new protos.google.pubsub.v1.Schema()), - generateSampleMessage(new protos.google.pubsub.v1.Schema()), - ]; - client.innerApiCalls.listSchemas = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listSchemas( - request, - (err?: Error|null, result?: protos.google.pubsub.v1.ISchema[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listSchemas as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listSchemas as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listSchemas with error', async () => { - const client = new schemaserviceModule.v1.SchemaServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.ListSchemasRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.ListSchemasRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listSchemas = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listSchemas(request), expectedError); - const actualRequest = (client.innerApiCalls.listSchemas as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listSchemas as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listSchemasStream without error', async () => { - const client = new schemaserviceModule.v1.SchemaServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.ListSchemasRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.ListSchemasRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.pubsub.v1.Schema()), - generateSampleMessage(new protos.google.pubsub.v1.Schema()), - generateSampleMessage(new protos.google.pubsub.v1.Schema()), - ]; - client.descriptors.page.listSchemas.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listSchemasStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.pubsub.v1.Schema[] = []; - stream.on('data', (response: protos.google.pubsub.v1.Schema) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listSchemas.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listSchemas, request)); - assert( - (client.descriptors.page.listSchemas.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listSchemasStream with error', async () => { - const client = new schemaserviceModule.v1.SchemaServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.ListSchemasRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.ListSchemasRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listSchemas.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listSchemasStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.pubsub.v1.Schema[] = []; - stream.on('data', (response: protos.google.pubsub.v1.Schema) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listSchemas.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listSchemas, request)); - assert( - (client.descriptors.page.listSchemas.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listSchemas without error', async () => { - const client = new schemaserviceModule.v1.SchemaServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.ListSchemasRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.ListSchemasRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.pubsub.v1.Schema()), - generateSampleMessage(new protos.google.pubsub.v1.Schema()), - generateSampleMessage(new protos.google.pubsub.v1.Schema()), - ]; - client.descriptors.page.listSchemas.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.pubsub.v1.ISchema[] = []; - const iterable = client.listSchemasAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listSchemas.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listSchemas.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listSchemas with error', async () => { - const client = new schemaserviceModule.v1.SchemaServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.ListSchemasRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.ListSchemasRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listSchemas.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listSchemasAsync(request); - await assert.rejects(async () => { - const responses: protos.google.pubsub.v1.ISchema[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listSchemas.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listSchemas.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listSchemaRevisions', () => { - it('invokes listSchemaRevisions without error', async () => { - const client = new schemaserviceModule.v1.SchemaServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.ListSchemaRevisionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.ListSchemaRevisionsRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.pubsub.v1.Schema()), - generateSampleMessage(new protos.google.pubsub.v1.Schema()), - generateSampleMessage(new protos.google.pubsub.v1.Schema()), - ]; - client.innerApiCalls.listSchemaRevisions = stubSimpleCall(expectedResponse); - const [response] = await client.listSchemaRevisions(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listSchemaRevisions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listSchemaRevisions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listSchemaRevisions without error using callback', async () => { - const client = new schemaserviceModule.v1.SchemaServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.ListSchemaRevisionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.ListSchemaRevisionsRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.pubsub.v1.Schema()), - generateSampleMessage(new protos.google.pubsub.v1.Schema()), - generateSampleMessage(new protos.google.pubsub.v1.Schema()), - ]; - client.innerApiCalls.listSchemaRevisions = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listSchemaRevisions( - request, - (err?: Error|null, result?: protos.google.pubsub.v1.ISchema[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listSchemaRevisions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listSchemaRevisions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listSchemaRevisions with error', async () => { - const client = new schemaserviceModule.v1.SchemaServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.ListSchemaRevisionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.ListSchemaRevisionsRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listSchemaRevisions = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listSchemaRevisions(request), expectedError); - const actualRequest = (client.innerApiCalls.listSchemaRevisions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listSchemaRevisions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listSchemaRevisionsStream without error', async () => { - const client = new schemaserviceModule.v1.SchemaServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.ListSchemaRevisionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.ListSchemaRevisionsRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.pubsub.v1.Schema()), - generateSampleMessage(new protos.google.pubsub.v1.Schema()), - generateSampleMessage(new protos.google.pubsub.v1.Schema()), - ]; - client.descriptors.page.listSchemaRevisions.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listSchemaRevisionsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.pubsub.v1.Schema[] = []; - stream.on('data', (response: protos.google.pubsub.v1.Schema) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listSchemaRevisions.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listSchemaRevisions, request)); - assert( - (client.descriptors.page.listSchemaRevisions.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listSchemaRevisionsStream with error', async () => { - const client = new schemaserviceModule.v1.SchemaServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.ListSchemaRevisionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.ListSchemaRevisionsRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listSchemaRevisions.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listSchemaRevisionsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.pubsub.v1.Schema[] = []; - stream.on('data', (response: protos.google.pubsub.v1.Schema) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listSchemaRevisions.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listSchemaRevisions, request)); - assert( - (client.descriptors.page.listSchemaRevisions.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listSchemaRevisions without error', async () => { - const client = new schemaserviceModule.v1.SchemaServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.ListSchemaRevisionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.ListSchemaRevisionsRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.pubsub.v1.Schema()), - generateSampleMessage(new protos.google.pubsub.v1.Schema()), - generateSampleMessage(new protos.google.pubsub.v1.Schema()), - ]; - client.descriptors.page.listSchemaRevisions.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.pubsub.v1.ISchema[] = []; - const iterable = client.listSchemaRevisionsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listSchemaRevisions.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listSchemaRevisions.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listSchemaRevisions with error', async () => { - const client = new schemaserviceModule.v1.SchemaServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.ListSchemaRevisionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.ListSchemaRevisionsRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listSchemaRevisions.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listSchemaRevisionsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.pubsub.v1.ISchema[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listSchemaRevisions.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listSchemaRevisions.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - describe('getIamPolicy', () => { - it('invokes getIamPolicy without error', async () => { - const client = new schemaserviceModule.v1.SchemaServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); - const response = await client.getIamPolicy(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes getIamPolicy without error using callback', async () => { - const client = new schemaserviceModule.v1.SchemaServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.getIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getIamPolicy( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0)); - }); - it('invokes getIamPolicy with error', async () => { - const client = new schemaserviceModule.v1.SchemaServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getIamPolicy(request, expectedOptions), expectedError); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('setIamPolicy', () => { - it('invokes setIamPolicy without error', async () => { - const client = new schemaserviceModule.v1.SchemaServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); - const response = await client.setIamPolicy(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes setIamPolicy without error using callback', async () => { - const client = new schemaserviceModule.v1.SchemaServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.setIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setIamPolicy( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0)); - }); - it('invokes setIamPolicy with error', async () => { - const client = new schemaserviceModule.v1.SchemaServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setIamPolicy(request, expectedOptions), expectedError); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('testIamPermissions', () => { - it('invokes testIamPermissions without error', async () => { - const client = new schemaserviceModule.v1.SchemaServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsResponse() - ); - client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); - const response = await client.testIamPermissions(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes testIamPermissions without error using callback', async () => { - const client = new schemaserviceModule.v1.SchemaServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsResponse() - ); - client.iamClient.testIamPermissions = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.testIamPermissions( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.TestIamPermissionsResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0)); - }); - it('invokes testIamPermissions with error', async () => { - const client = new schemaserviceModule.v1.SchemaServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.testIamPermissions = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.testIamPermissions(request, expectedOptions), expectedError); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - - describe('Path templates', () => { - - describe('project', () => { - const fakePath = "/rendered/path/project"; - const expectedParameters = { - project: "projectValue", - }; - const client = new schemaserviceModule.v1.SchemaServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.projectPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectPath', () => { - const result = client.projectPath("projectValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectName', () => { - const result = client.matchProjectFromProjectName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectTopic', () => { - const fakePath = "/rendered/path/projectTopic"; - const expectedParameters = { - project: "projectValue", - topic: "topicValue", - }; - const client = new schemaserviceModule.v1.SchemaServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.projectTopicPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectTopicPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectTopicPath', () => { - const result = client.projectTopicPath("projectValue", "topicValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectTopicPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectTopicName', () => { - const result = client.matchProjectFromProjectTopicName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectTopicPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTopicFromProjectTopicName', () => { - const result = client.matchTopicFromProjectTopicName(fakePath); - assert.strictEqual(result, "topicValue"); - assert((client.pathTemplates.projectTopicPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('schema', () => { - const fakePath = "/rendered/path/schema"; - const expectedParameters = { - project: "projectValue", - schema: "schemaValue", - }; - const client = new schemaserviceModule.v1.SchemaServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.schemaPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.schemaPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('schemaPath', () => { - const result = client.schemaPath("projectValue", "schemaValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.schemaPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSchemaName', () => { - const result = client.matchProjectFromSchemaName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.schemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSchemaFromSchemaName', () => { - const result = client.matchSchemaFromSchemaName(fakePath); - assert.strictEqual(result, "schemaValue"); - assert((client.pathTemplates.schemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('snapshot', () => { - const fakePath = "/rendered/path/snapshot"; - const expectedParameters = { - project: "projectValue", - snapshot: "snapshotValue", - }; - const client = new schemaserviceModule.v1.SchemaServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.snapshotPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.snapshotPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('snapshotPath', () => { - const result = client.snapshotPath("projectValue", "snapshotValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.snapshotPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSnapshotName', () => { - const result = client.matchProjectFromSnapshotName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.snapshotPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSnapshotFromSnapshotName', () => { - const result = client.matchSnapshotFromSnapshotName(fakePath); - assert.strictEqual(result, "snapshotValue"); - assert((client.pathTemplates.snapshotPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('subscription', () => { - const fakePath = "/rendered/path/subscription"; - const expectedParameters = { - project: "projectValue", - subscription: "subscriptionValue", - }; - const client = new schemaserviceModule.v1.SchemaServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.subscriptionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.subscriptionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('subscriptionPath', () => { - const result = client.subscriptionPath("projectValue", "subscriptionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.subscriptionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSubscriptionName', () => { - const result = client.matchProjectFromSubscriptionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.subscriptionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSubscriptionFromSubscriptionName', () => { - const result = client.matchSubscriptionFromSubscriptionName(fakePath); - assert.strictEqual(result, "subscriptionValue"); - assert((client.pathTemplates.subscriptionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/v1/test/gapic_subscriber_v1.ts b/owl-bot-staging/v1/test/gapic_subscriber_v1.ts deleted file mode 100644 index 73fc01c96..000000000 --- a/owl-bot-staging/v1/test/gapic_subscriber_v1.ts +++ /dev/null @@ -1,2697 +0,0 @@ -// 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 -// -// https://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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import * as protos from '../protos/protos'; -import * as assert from 'assert'; -import * as sinon from 'sinon'; -import {SinonStub} from 'sinon'; -import {describe, it} from 'mocha'; -import * as subscriberModule from '../src'; - -import {PassThrough} from 'stream'; - -import {protobuf, IamProtos} from 'google-gax'; - -// Dynamically loaded proto JSON is needed to get the type information -// to fill in default values for request objects -const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); - -// eslint-disable-next-line @typescript-eslint/no-unused-vars -function getTypeDefaultValue(typeName: string, fields: string[]) { - let type = root.lookupType(typeName) as protobuf.Type; - for (const field of fields.slice(0, -1)) { - type = type.fields[field]?.resolvedType as protobuf.Type; - } - return type.fields[fields[fields.length - 1]]?.defaultValue; -} - -function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message) - .toObject(instance as protobuf.Message, {defaults: true}); - return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; -} - -function stubSimpleCall(response?: ResponseType, error?: Error) { - return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); -} - -function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { - return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); -} - -function stubBidiStreamingCall(response?: ResponseType, error?: Error) { - const transformStub = error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); - const mockStream = new PassThrough({ - objectMode: true, - transform: transformStub, - }); - return sinon.stub().returns(mockStream); -} - -function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { - const pagingStub = sinon.stub(); - if (responses) { - for (let i = 0; i < responses.length; ++i) { - pagingStub.onCall(i).callsArgWith(2, null, responses[i]); - } - } - const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; - const mockStream = new PassThrough({ - objectMode: true, - transform: transformStub, - }); - // trigger as many responses as needed - if (responses) { - for (let i = 0; i < responses.length; ++i) { - setImmediate(() => { mockStream.write({}); }); - } - setImmediate(() => { mockStream.end(); }); - } else { - setImmediate(() => { mockStream.write({}); }); - setImmediate(() => { mockStream.end(); }); - } - return sinon.stub().returns(mockStream); -} - -function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { - let counter = 0; - const asyncIterable = { - [Symbol.asyncIterator]() { - return { - async next() { - if (error) { - return Promise.reject(error); - } - if (counter >= responses!.length) { - return Promise.resolve({done: true, value: undefined}); - } - return Promise.resolve({done: false, value: responses![counter++]}); - } - }; - } - }; - return sinon.stub().returns(asyncIterable); -} - -describe('v1.SubscriberClient', () => { - describe('Common methods', () => { - it('has apiEndpoint', () => { - const client = new subscriberModule.v1.SubscriberClient(); - const apiEndpoint = client.apiEndpoint; - assert.strictEqual(apiEndpoint, 'pubsub.googleapis.com'); - }); - - it('has universeDomain', () => { - const client = new subscriberModule.v1.SubscriberClient(); - const universeDomain = client.universeDomain; - assert.strictEqual(universeDomain, "googleapis.com"); - }); - - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - it('throws DeprecationWarning if static servicePath is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const servicePath = subscriberModule.v1.SubscriberClient.servicePath; - assert.strictEqual(servicePath, 'pubsub.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - - it('throws DeprecationWarning if static apiEndpoint is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const apiEndpoint = subscriberModule.v1.SubscriberClient.apiEndpoint; - assert.strictEqual(apiEndpoint, 'pubsub.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - } - it('sets apiEndpoint according to universe domain camelCase', () => { - const client = new subscriberModule.v1.SubscriberClient({universeDomain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'pubsub.example.com'); - }); - - it('sets apiEndpoint according to universe domain snakeCase', () => { - const client = new subscriberModule.v1.SubscriberClient({universe_domain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'pubsub.example.com'); - }); - - if (typeof process === 'object' && 'env' in process) { - describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { - it('sets apiEndpoint from environment variable', () => { - const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; - const client = new subscriberModule.v1.SubscriberClient(); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'pubsub.example.com'); - if (saved) { - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; - } else { - delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - } - }); - - it('value configured in code has priority over environment variable', () => { - const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; - const client = new subscriberModule.v1.SubscriberClient({universeDomain: 'configured.example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'pubsub.configured.example.com'); - if (saved) { - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; - } else { - delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - } - }); - }); - } - it('does not allow setting both universeDomain and universe_domain', () => { - assert.throws(() => { new subscriberModule.v1.SubscriberClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); - }); - - it('has port', () => { - const port = subscriberModule.v1.SubscriberClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new subscriberModule.v1.SubscriberClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new subscriberModule.v1.SubscriberClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new subscriberModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.subscriberStub, undefined); - await client.initialize(); - assert(client.subscriberStub); - }); - - it('has close method for the initialized client', done => { - const client = new subscriberModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - assert(client.subscriberStub); - client.close().then(() => { - done(); - }); - }); - - it('has close method for the non-initialized client', done => { - const client = new subscriberModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.subscriberStub, undefined); - client.close().then(() => { - done(); - }); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new subscriberModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); - const result = await client.getProjectId(); - assert.strictEqual(result, fakeProjectId); - assert((client.auth.getProjectId as SinonStub).calledWithExactly()); - }); - - it('has getProjectId method with callback', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new subscriberModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); - const promise = new Promise((resolve, reject) => { - client.getProjectId((err?: Error|null, projectId?: string|null) => { - if (err) { - reject(err); - } else { - resolve(projectId); - } - }); - }); - const result = await promise; - assert.strictEqual(result, fakeProjectId); - }); - }); - - describe('createSubscription', () => { - it('invokes createSubscription without error', async () => { - const client = new subscriberModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.Subscription() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.Subscription', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.pubsub.v1.Subscription() - ); - client.innerApiCalls.createSubscription = stubSimpleCall(expectedResponse); - const [response] = await client.createSubscription(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createSubscription as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createSubscription as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createSubscription without error using callback', async () => { - const client = new subscriberModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.Subscription() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.Subscription', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.pubsub.v1.Subscription() - ); - client.innerApiCalls.createSubscription = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createSubscription( - request, - (err?: Error|null, result?: protos.google.pubsub.v1.ISubscription|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createSubscription as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createSubscription as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createSubscription with error', async () => { - const client = new subscriberModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.Subscription() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.Subscription', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createSubscription = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createSubscription(request), expectedError); - const actualRequest = (client.innerApiCalls.createSubscription as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createSubscription as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createSubscription with closed client', async () => { - const client = new subscriberModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.Subscription() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.Subscription', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createSubscription(request), expectedError); - }); - }); - - describe('getSubscription', () => { - it('invokes getSubscription without error', async () => { - const client = new subscriberModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.GetSubscriptionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.GetSubscriptionRequest', ['subscription']); - request.subscription = defaultValue1; - const expectedHeaderRequestParams = `subscription=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.pubsub.v1.Subscription() - ); - client.innerApiCalls.getSubscription = stubSimpleCall(expectedResponse); - const [response] = await client.getSubscription(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getSubscription as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getSubscription as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getSubscription without error using callback', async () => { - const client = new subscriberModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.GetSubscriptionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.GetSubscriptionRequest', ['subscription']); - request.subscription = defaultValue1; - const expectedHeaderRequestParams = `subscription=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.pubsub.v1.Subscription() - ); - client.innerApiCalls.getSubscription = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getSubscription( - request, - (err?: Error|null, result?: protos.google.pubsub.v1.ISubscription|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getSubscription as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getSubscription as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getSubscription with error', async () => { - const client = new subscriberModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.GetSubscriptionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.GetSubscriptionRequest', ['subscription']); - request.subscription = defaultValue1; - const expectedHeaderRequestParams = `subscription=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getSubscription = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getSubscription(request), expectedError); - const actualRequest = (client.innerApiCalls.getSubscription as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getSubscription as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getSubscription with closed client', async () => { - const client = new subscriberModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.GetSubscriptionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.GetSubscriptionRequest', ['subscription']); - request.subscription = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getSubscription(request), expectedError); - }); - }); - - describe('updateSubscription', () => { - it('invokes updateSubscription without error', async () => { - const client = new subscriberModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.UpdateSubscriptionRequest() - ); - request.subscription ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.UpdateSubscriptionRequest', ['subscription', 'name']); - request.subscription.name = defaultValue1; - const expectedHeaderRequestParams = `subscription.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.pubsub.v1.Subscription() - ); - client.innerApiCalls.updateSubscription = stubSimpleCall(expectedResponse); - const [response] = await client.updateSubscription(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateSubscription as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateSubscription as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateSubscription without error using callback', async () => { - const client = new subscriberModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.UpdateSubscriptionRequest() - ); - request.subscription ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.UpdateSubscriptionRequest', ['subscription', 'name']); - request.subscription.name = defaultValue1; - const expectedHeaderRequestParams = `subscription.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.pubsub.v1.Subscription() - ); - client.innerApiCalls.updateSubscription = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateSubscription( - request, - (err?: Error|null, result?: protos.google.pubsub.v1.ISubscription|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateSubscription as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateSubscription as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateSubscription with error', async () => { - const client = new subscriberModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.UpdateSubscriptionRequest() - ); - request.subscription ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.UpdateSubscriptionRequest', ['subscription', 'name']); - request.subscription.name = defaultValue1; - const expectedHeaderRequestParams = `subscription.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateSubscription = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateSubscription(request), expectedError); - const actualRequest = (client.innerApiCalls.updateSubscription as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateSubscription as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateSubscription with closed client', async () => { - const client = new subscriberModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.UpdateSubscriptionRequest() - ); - request.subscription ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.UpdateSubscriptionRequest', ['subscription', 'name']); - request.subscription.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.updateSubscription(request), expectedError); - }); - }); - - describe('deleteSubscription', () => { - it('invokes deleteSubscription without error', async () => { - const client = new subscriberModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.DeleteSubscriptionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.DeleteSubscriptionRequest', ['subscription']); - request.subscription = defaultValue1; - const expectedHeaderRequestParams = `subscription=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteSubscription = stubSimpleCall(expectedResponse); - const [response] = await client.deleteSubscription(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteSubscription as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteSubscription as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteSubscription without error using callback', async () => { - const client = new subscriberModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.DeleteSubscriptionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.DeleteSubscriptionRequest', ['subscription']); - request.subscription = defaultValue1; - const expectedHeaderRequestParams = `subscription=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteSubscription = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteSubscription( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteSubscription as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteSubscription as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteSubscription with error', async () => { - const client = new subscriberModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.DeleteSubscriptionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.DeleteSubscriptionRequest', ['subscription']); - request.subscription = defaultValue1; - const expectedHeaderRequestParams = `subscription=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteSubscription = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteSubscription(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteSubscription as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteSubscription as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteSubscription with closed client', async () => { - const client = new subscriberModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.DeleteSubscriptionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.DeleteSubscriptionRequest', ['subscription']); - request.subscription = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.deleteSubscription(request), expectedError); - }); - }); - - describe('modifyAckDeadline', () => { - it('invokes modifyAckDeadline without error', async () => { - const client = new subscriberModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.ModifyAckDeadlineRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.ModifyAckDeadlineRequest', ['subscription']); - request.subscription = defaultValue1; - const expectedHeaderRequestParams = `subscription=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.modifyAckDeadline = stubSimpleCall(expectedResponse); - const [response] = await client.modifyAckDeadline(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.modifyAckDeadline as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.modifyAckDeadline as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes modifyAckDeadline without error using callback', async () => { - const client = new subscriberModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.ModifyAckDeadlineRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.ModifyAckDeadlineRequest', ['subscription']); - request.subscription = defaultValue1; - const expectedHeaderRequestParams = `subscription=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.modifyAckDeadline = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.modifyAckDeadline( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.modifyAckDeadline as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.modifyAckDeadline as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes modifyAckDeadline with error', async () => { - const client = new subscriberModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.ModifyAckDeadlineRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.ModifyAckDeadlineRequest', ['subscription']); - request.subscription = defaultValue1; - const expectedHeaderRequestParams = `subscription=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.modifyAckDeadline = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.modifyAckDeadline(request), expectedError); - const actualRequest = (client.innerApiCalls.modifyAckDeadline as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.modifyAckDeadline as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes modifyAckDeadline with closed client', async () => { - const client = new subscriberModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.ModifyAckDeadlineRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.ModifyAckDeadlineRequest', ['subscription']); - request.subscription = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.modifyAckDeadline(request), expectedError); - }); - }); - - describe('acknowledge', () => { - it('invokes acknowledge without error', async () => { - const client = new subscriberModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.AcknowledgeRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.AcknowledgeRequest', ['subscription']); - request.subscription = defaultValue1; - const expectedHeaderRequestParams = `subscription=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.acknowledge = stubSimpleCall(expectedResponse); - const [response] = await client.acknowledge(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.acknowledge as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.acknowledge as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes acknowledge without error using callback', async () => { - const client = new subscriberModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.AcknowledgeRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.AcknowledgeRequest', ['subscription']); - request.subscription = defaultValue1; - const expectedHeaderRequestParams = `subscription=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.acknowledge = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.acknowledge( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.acknowledge as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.acknowledge as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes acknowledge with error', async () => { - const client = new subscriberModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.AcknowledgeRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.AcknowledgeRequest', ['subscription']); - request.subscription = defaultValue1; - const expectedHeaderRequestParams = `subscription=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.acknowledge = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.acknowledge(request), expectedError); - const actualRequest = (client.innerApiCalls.acknowledge as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.acknowledge as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes acknowledge with closed client', async () => { - const client = new subscriberModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.AcknowledgeRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.AcknowledgeRequest', ['subscription']); - request.subscription = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.acknowledge(request), expectedError); - }); - }); - - describe('pull', () => { - it('invokes pull without error', async () => { - const client = new subscriberModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.PullRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.PullRequest', ['subscription']); - request.subscription = defaultValue1; - const expectedHeaderRequestParams = `subscription=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.pubsub.v1.PullResponse() - ); - client.innerApiCalls.pull = stubSimpleCall(expectedResponse); - const [response] = await client.pull(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.pull as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.pull as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes pull without error using callback', async () => { - const client = new subscriberModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.PullRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.PullRequest', ['subscription']); - request.subscription = defaultValue1; - const expectedHeaderRequestParams = `subscription=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.pubsub.v1.PullResponse() - ); - client.innerApiCalls.pull = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.pull( - request, - (err?: Error|null, result?: protos.google.pubsub.v1.IPullResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.pull as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.pull as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes pull with error', async () => { - const client = new subscriberModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.PullRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.PullRequest', ['subscription']); - request.subscription = defaultValue1; - const expectedHeaderRequestParams = `subscription=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.pull = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.pull(request), expectedError); - const actualRequest = (client.innerApiCalls.pull as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.pull as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes pull with closed client', async () => { - const client = new subscriberModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.PullRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.PullRequest', ['subscription']); - request.subscription = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.pull(request), expectedError); - }); - }); - - describe('modifyPushConfig', () => { - it('invokes modifyPushConfig without error', async () => { - const client = new subscriberModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.ModifyPushConfigRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.ModifyPushConfigRequest', ['subscription']); - request.subscription = defaultValue1; - const expectedHeaderRequestParams = `subscription=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.modifyPushConfig = stubSimpleCall(expectedResponse); - const [response] = await client.modifyPushConfig(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.modifyPushConfig as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.modifyPushConfig as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes modifyPushConfig without error using callback', async () => { - const client = new subscriberModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.ModifyPushConfigRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.ModifyPushConfigRequest', ['subscription']); - request.subscription = defaultValue1; - const expectedHeaderRequestParams = `subscription=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.modifyPushConfig = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.modifyPushConfig( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.modifyPushConfig as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.modifyPushConfig as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes modifyPushConfig with error', async () => { - const client = new subscriberModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.ModifyPushConfigRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.ModifyPushConfigRequest', ['subscription']); - request.subscription = defaultValue1; - const expectedHeaderRequestParams = `subscription=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.modifyPushConfig = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.modifyPushConfig(request), expectedError); - const actualRequest = (client.innerApiCalls.modifyPushConfig as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.modifyPushConfig as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes modifyPushConfig with closed client', async () => { - const client = new subscriberModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.ModifyPushConfigRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.ModifyPushConfigRequest', ['subscription']); - request.subscription = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.modifyPushConfig(request), expectedError); - }); - }); - - describe('getSnapshot', () => { - it('invokes getSnapshot without error', async () => { - const client = new subscriberModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.GetSnapshotRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.GetSnapshotRequest', ['snapshot']); - request.snapshot = defaultValue1; - const expectedHeaderRequestParams = `snapshot=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.pubsub.v1.Snapshot() - ); - client.innerApiCalls.getSnapshot = stubSimpleCall(expectedResponse); - const [response] = await client.getSnapshot(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getSnapshot as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getSnapshot as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getSnapshot without error using callback', async () => { - const client = new subscriberModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.GetSnapshotRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.GetSnapshotRequest', ['snapshot']); - request.snapshot = defaultValue1; - const expectedHeaderRequestParams = `snapshot=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.pubsub.v1.Snapshot() - ); - client.innerApiCalls.getSnapshot = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getSnapshot( - request, - (err?: Error|null, result?: protos.google.pubsub.v1.ISnapshot|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getSnapshot as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getSnapshot as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getSnapshot with error', async () => { - const client = new subscriberModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.GetSnapshotRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.GetSnapshotRequest', ['snapshot']); - request.snapshot = defaultValue1; - const expectedHeaderRequestParams = `snapshot=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getSnapshot = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getSnapshot(request), expectedError); - const actualRequest = (client.innerApiCalls.getSnapshot as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getSnapshot as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getSnapshot with closed client', async () => { - const client = new subscriberModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.GetSnapshotRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.GetSnapshotRequest', ['snapshot']); - request.snapshot = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getSnapshot(request), expectedError); - }); - }); - - describe('createSnapshot', () => { - it('invokes createSnapshot without error', async () => { - const client = new subscriberModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.CreateSnapshotRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.CreateSnapshotRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.pubsub.v1.Snapshot() - ); - client.innerApiCalls.createSnapshot = stubSimpleCall(expectedResponse); - const [response] = await client.createSnapshot(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createSnapshot as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createSnapshot as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createSnapshot without error using callback', async () => { - const client = new subscriberModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.CreateSnapshotRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.CreateSnapshotRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.pubsub.v1.Snapshot() - ); - client.innerApiCalls.createSnapshot = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createSnapshot( - request, - (err?: Error|null, result?: protos.google.pubsub.v1.ISnapshot|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createSnapshot as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createSnapshot as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createSnapshot with error', async () => { - const client = new subscriberModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.CreateSnapshotRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.CreateSnapshotRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createSnapshot = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createSnapshot(request), expectedError); - const actualRequest = (client.innerApiCalls.createSnapshot as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createSnapshot as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createSnapshot with closed client', async () => { - const client = new subscriberModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.CreateSnapshotRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.CreateSnapshotRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createSnapshot(request), expectedError); - }); - }); - - describe('updateSnapshot', () => { - it('invokes updateSnapshot without error', async () => { - const client = new subscriberModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.UpdateSnapshotRequest() - ); - request.snapshot ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.UpdateSnapshotRequest', ['snapshot', 'name']); - request.snapshot.name = defaultValue1; - const expectedHeaderRequestParams = `snapshot.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.pubsub.v1.Snapshot() - ); - client.innerApiCalls.updateSnapshot = stubSimpleCall(expectedResponse); - const [response] = await client.updateSnapshot(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateSnapshot as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateSnapshot as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateSnapshot without error using callback', async () => { - const client = new subscriberModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.UpdateSnapshotRequest() - ); - request.snapshot ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.UpdateSnapshotRequest', ['snapshot', 'name']); - request.snapshot.name = defaultValue1; - const expectedHeaderRequestParams = `snapshot.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.pubsub.v1.Snapshot() - ); - client.innerApiCalls.updateSnapshot = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateSnapshot( - request, - (err?: Error|null, result?: protos.google.pubsub.v1.ISnapshot|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateSnapshot as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateSnapshot as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateSnapshot with error', async () => { - const client = new subscriberModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.UpdateSnapshotRequest() - ); - request.snapshot ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.UpdateSnapshotRequest', ['snapshot', 'name']); - request.snapshot.name = defaultValue1; - const expectedHeaderRequestParams = `snapshot.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateSnapshot = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateSnapshot(request), expectedError); - const actualRequest = (client.innerApiCalls.updateSnapshot as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateSnapshot as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateSnapshot with closed client', async () => { - const client = new subscriberModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.UpdateSnapshotRequest() - ); - request.snapshot ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.UpdateSnapshotRequest', ['snapshot', 'name']); - request.snapshot.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.updateSnapshot(request), expectedError); - }); - }); - - describe('deleteSnapshot', () => { - it('invokes deleteSnapshot without error', async () => { - const client = new subscriberModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.DeleteSnapshotRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.DeleteSnapshotRequest', ['snapshot']); - request.snapshot = defaultValue1; - const expectedHeaderRequestParams = `snapshot=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteSnapshot = stubSimpleCall(expectedResponse); - const [response] = await client.deleteSnapshot(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteSnapshot as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteSnapshot as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteSnapshot without error using callback', async () => { - const client = new subscriberModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.DeleteSnapshotRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.DeleteSnapshotRequest', ['snapshot']); - request.snapshot = defaultValue1; - const expectedHeaderRequestParams = `snapshot=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteSnapshot = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteSnapshot( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteSnapshot as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteSnapshot as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteSnapshot with error', async () => { - const client = new subscriberModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.DeleteSnapshotRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.DeleteSnapshotRequest', ['snapshot']); - request.snapshot = defaultValue1; - const expectedHeaderRequestParams = `snapshot=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteSnapshot = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteSnapshot(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteSnapshot as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteSnapshot as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteSnapshot with closed client', async () => { - const client = new subscriberModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.DeleteSnapshotRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.DeleteSnapshotRequest', ['snapshot']); - request.snapshot = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.deleteSnapshot(request), expectedError); - }); - }); - - describe('seek', () => { - it('invokes seek without error', async () => { - const client = new subscriberModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.SeekRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.SeekRequest', ['subscription']); - request.subscription = defaultValue1; - const expectedHeaderRequestParams = `subscription=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.pubsub.v1.SeekResponse() - ); - client.innerApiCalls.seek = stubSimpleCall(expectedResponse); - const [response] = await client.seek(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.seek as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.seek as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes seek without error using callback', async () => { - const client = new subscriberModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.SeekRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.SeekRequest', ['subscription']); - request.subscription = defaultValue1; - const expectedHeaderRequestParams = `subscription=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.pubsub.v1.SeekResponse() - ); - client.innerApiCalls.seek = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.seek( - request, - (err?: Error|null, result?: protos.google.pubsub.v1.ISeekResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.seek as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.seek as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes seek with error', async () => { - const client = new subscriberModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.SeekRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.SeekRequest', ['subscription']); - request.subscription = defaultValue1; - const expectedHeaderRequestParams = `subscription=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.seek = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.seek(request), expectedError); - const actualRequest = (client.innerApiCalls.seek as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.seek as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes seek with closed client', async () => { - const client = new subscriberModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.SeekRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.SeekRequest', ['subscription']); - request.subscription = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.seek(request), expectedError); - }); - }); - - describe('streamingPull', () => { - it('invokes streamingPull without error', async () => { - const client = new subscriberModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.StreamingPullRequest() - ); - - const expectedResponse = generateSampleMessage( - new protos.google.pubsub.v1.StreamingPullResponse() - ); - client.innerApiCalls.streamingPull = stubBidiStreamingCall(expectedResponse); - const stream = client.streamingPull(); - const promise = new Promise((resolve, reject) => { - stream.on('data', (response: protos.google.pubsub.v1.StreamingPullResponse) => { - resolve(response); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - stream.write(request); - stream.end(); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.streamingPull as SinonStub) - .getCall(0).calledWith(null)); - assert.deepStrictEqual(((stream as unknown as PassThrough) - ._transform as SinonStub).getCall(0).args[0], request); - }); - - it('invokes streamingPull with error', async () => { - const client = new subscriberModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.StreamingPullRequest() - ); - const expectedError = new Error('expected'); - client.innerApiCalls.streamingPull = stubBidiStreamingCall(undefined, expectedError); - const stream = client.streamingPull(); - const promise = new Promise((resolve, reject) => { - stream.on('data', (response: protos.google.pubsub.v1.StreamingPullResponse) => { - resolve(response); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - stream.write(request); - stream.end(); - }); - await assert.rejects(promise, expectedError); - assert((client.innerApiCalls.streamingPull as SinonStub) - .getCall(0).calledWith(null)); - assert.deepStrictEqual(((stream as unknown as PassThrough) - ._transform as SinonStub).getCall(0).args[0], request); - }); - }); - - describe('listSubscriptions', () => { - it('invokes listSubscriptions without error', async () => { - const client = new subscriberModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.ListSubscriptionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.ListSubscriptionsRequest', ['project']); - request.project = defaultValue1; - const expectedHeaderRequestParams = `project=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.pubsub.v1.Subscription()), - generateSampleMessage(new protos.google.pubsub.v1.Subscription()), - generateSampleMessage(new protos.google.pubsub.v1.Subscription()), - ]; - client.innerApiCalls.listSubscriptions = stubSimpleCall(expectedResponse); - const [response] = await client.listSubscriptions(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listSubscriptions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listSubscriptions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listSubscriptions without error using callback', async () => { - const client = new subscriberModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.ListSubscriptionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.ListSubscriptionsRequest', ['project']); - request.project = defaultValue1; - const expectedHeaderRequestParams = `project=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.pubsub.v1.Subscription()), - generateSampleMessage(new protos.google.pubsub.v1.Subscription()), - generateSampleMessage(new protos.google.pubsub.v1.Subscription()), - ]; - client.innerApiCalls.listSubscriptions = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listSubscriptions( - request, - (err?: Error|null, result?: protos.google.pubsub.v1.ISubscription[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listSubscriptions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listSubscriptions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listSubscriptions with error', async () => { - const client = new subscriberModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.ListSubscriptionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.ListSubscriptionsRequest', ['project']); - request.project = defaultValue1; - const expectedHeaderRequestParams = `project=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listSubscriptions = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listSubscriptions(request), expectedError); - const actualRequest = (client.innerApiCalls.listSubscriptions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listSubscriptions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listSubscriptionsStream without error', async () => { - const client = new subscriberModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.ListSubscriptionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.ListSubscriptionsRequest', ['project']); - request.project = defaultValue1; - const expectedHeaderRequestParams = `project=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.pubsub.v1.Subscription()), - generateSampleMessage(new protos.google.pubsub.v1.Subscription()), - generateSampleMessage(new protos.google.pubsub.v1.Subscription()), - ]; - client.descriptors.page.listSubscriptions.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listSubscriptionsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.pubsub.v1.Subscription[] = []; - stream.on('data', (response: protos.google.pubsub.v1.Subscription) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listSubscriptions.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listSubscriptions, request)); - assert( - (client.descriptors.page.listSubscriptions.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listSubscriptionsStream with error', async () => { - const client = new subscriberModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.ListSubscriptionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.ListSubscriptionsRequest', ['project']); - request.project = defaultValue1; - const expectedHeaderRequestParams = `project=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listSubscriptions.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listSubscriptionsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.pubsub.v1.Subscription[] = []; - stream.on('data', (response: protos.google.pubsub.v1.Subscription) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listSubscriptions.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listSubscriptions, request)); - assert( - (client.descriptors.page.listSubscriptions.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listSubscriptions without error', async () => { - const client = new subscriberModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.ListSubscriptionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.ListSubscriptionsRequest', ['project']); - request.project = defaultValue1; - const expectedHeaderRequestParams = `project=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.pubsub.v1.Subscription()), - generateSampleMessage(new protos.google.pubsub.v1.Subscription()), - generateSampleMessage(new protos.google.pubsub.v1.Subscription()), - ]; - client.descriptors.page.listSubscriptions.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.pubsub.v1.ISubscription[] = []; - const iterable = client.listSubscriptionsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listSubscriptions.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listSubscriptions.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listSubscriptions with error', async () => { - const client = new subscriberModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.ListSubscriptionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.ListSubscriptionsRequest', ['project']); - request.project = defaultValue1; - const expectedHeaderRequestParams = `project=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listSubscriptions.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listSubscriptionsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.pubsub.v1.ISubscription[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listSubscriptions.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listSubscriptions.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listSnapshots', () => { - it('invokes listSnapshots without error', async () => { - const client = new subscriberModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.ListSnapshotsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.ListSnapshotsRequest', ['project']); - request.project = defaultValue1; - const expectedHeaderRequestParams = `project=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.pubsub.v1.Snapshot()), - generateSampleMessage(new protos.google.pubsub.v1.Snapshot()), - generateSampleMessage(new protos.google.pubsub.v1.Snapshot()), - ]; - client.innerApiCalls.listSnapshots = stubSimpleCall(expectedResponse); - const [response] = await client.listSnapshots(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listSnapshots as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listSnapshots as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listSnapshots without error using callback', async () => { - const client = new subscriberModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.ListSnapshotsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.ListSnapshotsRequest', ['project']); - request.project = defaultValue1; - const expectedHeaderRequestParams = `project=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.pubsub.v1.Snapshot()), - generateSampleMessage(new protos.google.pubsub.v1.Snapshot()), - generateSampleMessage(new protos.google.pubsub.v1.Snapshot()), - ]; - client.innerApiCalls.listSnapshots = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listSnapshots( - request, - (err?: Error|null, result?: protos.google.pubsub.v1.ISnapshot[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listSnapshots as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listSnapshots as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listSnapshots with error', async () => { - const client = new subscriberModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.ListSnapshotsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.ListSnapshotsRequest', ['project']); - request.project = defaultValue1; - const expectedHeaderRequestParams = `project=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listSnapshots = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listSnapshots(request), expectedError); - const actualRequest = (client.innerApiCalls.listSnapshots as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listSnapshots as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listSnapshotsStream without error', async () => { - const client = new subscriberModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.ListSnapshotsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.ListSnapshotsRequest', ['project']); - request.project = defaultValue1; - const expectedHeaderRequestParams = `project=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.pubsub.v1.Snapshot()), - generateSampleMessage(new protos.google.pubsub.v1.Snapshot()), - generateSampleMessage(new protos.google.pubsub.v1.Snapshot()), - ]; - client.descriptors.page.listSnapshots.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listSnapshotsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.pubsub.v1.Snapshot[] = []; - stream.on('data', (response: protos.google.pubsub.v1.Snapshot) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listSnapshots.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listSnapshots, request)); - assert( - (client.descriptors.page.listSnapshots.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listSnapshotsStream with error', async () => { - const client = new subscriberModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.ListSnapshotsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.ListSnapshotsRequest', ['project']); - request.project = defaultValue1; - const expectedHeaderRequestParams = `project=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listSnapshots.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listSnapshotsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.pubsub.v1.Snapshot[] = []; - stream.on('data', (response: protos.google.pubsub.v1.Snapshot) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listSnapshots.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listSnapshots, request)); - assert( - (client.descriptors.page.listSnapshots.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listSnapshots without error', async () => { - const client = new subscriberModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.ListSnapshotsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.ListSnapshotsRequest', ['project']); - request.project = defaultValue1; - const expectedHeaderRequestParams = `project=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.pubsub.v1.Snapshot()), - generateSampleMessage(new protos.google.pubsub.v1.Snapshot()), - generateSampleMessage(new protos.google.pubsub.v1.Snapshot()), - ]; - client.descriptors.page.listSnapshots.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.pubsub.v1.ISnapshot[] = []; - const iterable = client.listSnapshotsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listSnapshots.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listSnapshots.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listSnapshots with error', async () => { - const client = new subscriberModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.pubsub.v1.ListSnapshotsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.pubsub.v1.ListSnapshotsRequest', ['project']); - request.project = defaultValue1; - const expectedHeaderRequestParams = `project=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listSnapshots.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listSnapshotsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.pubsub.v1.ISnapshot[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listSnapshots.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listSnapshots.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - describe('getIamPolicy', () => { - it('invokes getIamPolicy without error', async () => { - const client = new subscriberModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); - const response = await client.getIamPolicy(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes getIamPolicy without error using callback', async () => { - const client = new subscriberModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.getIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getIamPolicy( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0)); - }); - it('invokes getIamPolicy with error', async () => { - const client = new subscriberModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getIamPolicy(request, expectedOptions), expectedError); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('setIamPolicy', () => { - it('invokes setIamPolicy without error', async () => { - const client = new subscriberModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); - const response = await client.setIamPolicy(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes setIamPolicy without error using callback', async () => { - const client = new subscriberModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.setIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setIamPolicy( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0)); - }); - it('invokes setIamPolicy with error', async () => { - const client = new subscriberModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setIamPolicy(request, expectedOptions), expectedError); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('testIamPermissions', () => { - it('invokes testIamPermissions without error', async () => { - const client = new subscriberModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsResponse() - ); - client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); - const response = await client.testIamPermissions(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes testIamPermissions without error using callback', async () => { - const client = new subscriberModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsResponse() - ); - client.iamClient.testIamPermissions = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.testIamPermissions( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.TestIamPermissionsResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0)); - }); - it('invokes testIamPermissions with error', async () => { - const client = new subscriberModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.testIamPermissions = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.testIamPermissions(request, expectedOptions), expectedError); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - - describe('Path templates', () => { - - describe('project', () => { - const fakePath = "/rendered/path/project"; - const expectedParameters = { - project: "projectValue", - }; - const client = new subscriberModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.projectPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectPath', () => { - const result = client.projectPath("projectValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectName', () => { - const result = client.matchProjectFromProjectName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectTopic', () => { - const fakePath = "/rendered/path/projectTopic"; - const expectedParameters = { - project: "projectValue", - topic: "topicValue", - }; - const client = new subscriberModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.projectTopicPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectTopicPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectTopicPath', () => { - const result = client.projectTopicPath("projectValue", "topicValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectTopicPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectTopicName', () => { - const result = client.matchProjectFromProjectTopicName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectTopicPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTopicFromProjectTopicName', () => { - const result = client.matchTopicFromProjectTopicName(fakePath); - assert.strictEqual(result, "topicValue"); - assert((client.pathTemplates.projectTopicPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('schema', () => { - const fakePath = "/rendered/path/schema"; - const expectedParameters = { - project: "projectValue", - schema: "schemaValue", - }; - const client = new subscriberModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.schemaPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.schemaPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('schemaPath', () => { - const result = client.schemaPath("projectValue", "schemaValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.schemaPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSchemaName', () => { - const result = client.matchProjectFromSchemaName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.schemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSchemaFromSchemaName', () => { - const result = client.matchSchemaFromSchemaName(fakePath); - assert.strictEqual(result, "schemaValue"); - assert((client.pathTemplates.schemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('snapshot', () => { - const fakePath = "/rendered/path/snapshot"; - const expectedParameters = { - project: "projectValue", - snapshot: "snapshotValue", - }; - const client = new subscriberModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.snapshotPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.snapshotPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('snapshotPath', () => { - const result = client.snapshotPath("projectValue", "snapshotValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.snapshotPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSnapshotName', () => { - const result = client.matchProjectFromSnapshotName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.snapshotPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSnapshotFromSnapshotName', () => { - const result = client.matchSnapshotFromSnapshotName(fakePath); - assert.strictEqual(result, "snapshotValue"); - assert((client.pathTemplates.snapshotPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('subscription', () => { - const fakePath = "/rendered/path/subscription"; - const expectedParameters = { - project: "projectValue", - subscription: "subscriptionValue", - }; - const client = new subscriberModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.subscriptionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.subscriptionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('subscriptionPath', () => { - const result = client.subscriptionPath("projectValue", "subscriptionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.subscriptionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSubscriptionName', () => { - const result = client.matchProjectFromSubscriptionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.subscriptionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSubscriptionFromSubscriptionName', () => { - const result = client.matchSubscriptionFromSubscriptionName(fakePath); - assert.strictEqual(result, "subscriptionValue"); - assert((client.pathTemplates.subscriptionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/v1/tsconfig.json b/owl-bot-staging/v1/tsconfig.json deleted file mode 100644 index c78f1c884..000000000 --- a/owl-bot-staging/v1/tsconfig.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "extends": "./node_modules/gts/tsconfig-google.json", - "compilerOptions": { - "rootDir": ".", - "outDir": "build", - "resolveJsonModule": true, - "lib": [ - "es2018", - "dom" - ] - }, - "include": [ - "src/*.ts", - "src/**/*.ts", - "test/*.ts", - "test/**/*.ts", - "system-test/*.ts" - ] -} diff --git a/owl-bot-staging/v1/webpack.config.js b/owl-bot-staging/v1/webpack.config.js deleted file mode 100644 index 3575e0eba..000000000 --- a/owl-bot-staging/v1/webpack.config.js +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2021 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 -// -// https://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. - -const path = require('path'); - -module.exports = { - entry: './src/index.ts', - output: { - library: 'pubsub', - filename: './pubsub.js', - }, - node: { - child_process: 'empty', - fs: 'empty', - crypto: 'empty', - }, - resolve: { - alias: { - '../../../package.json': path.resolve(__dirname, 'package.json'), - }, - extensions: ['.js', '.json', '.ts'], - }, - module: { - rules: [ - { - test: /\.tsx?$/, - use: 'ts-loader', - exclude: /node_modules/ - }, - { - test: /node_modules[\\/]@grpc[\\/]grpc-js/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]grpc/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]retry-request/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]https?-proxy-agent/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]gtoken/, - use: 'null-loader' - }, - ], - }, - mode: 'production', -}; diff --git a/protos/google/pubsub/v1/pubsub.proto b/protos/google/pubsub/v1/pubsub.proto index 8546dacf9..b70bda11a 100644 --- a/protos/google/pubsub/v1/pubsub.proto +++ b/protos/google/pubsub/v1/pubsub.proto @@ -1168,6 +1168,10 @@ message CloudStorageConfig { // data (for example, an ordering_key, if present) are added as entries in // the attributes map. bool write_metadata = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. When true, the output Cloud Storage file will be serialized + // using the topic schema, if it exists. + bool use_topic_schema = 2 [(google.api.field_behavior) = OPTIONAL]; } // Possible states for a Cloud Storage subscription. @@ -1188,6 +1192,10 @@ message CloudStorageConfig { // Cannot write to the destination because enforce_in_transit is set to true // and the destination locations are not in the allowed regions. IN_TRANSIT_LOCATION_RESTRICTION = 4; + + // Cannot write to the Cloud Storage bucket due to an incompatibility + // between the topic schema and subscription settings. + SCHEMA_MISMATCH = 5; } // Required. User-provided name for the Cloud Storage bucket. diff --git a/protos/protos.d.ts b/protos/protos.d.ts index 17d730c34..19956f26c 100644 --- a/protos/protos.d.ts +++ b/protos/protos.d.ts @@ -3979,6 +3979,9 @@ export namespace google { /** AvroConfig writeMetadata */ writeMetadata?: (boolean|null); + + /** AvroConfig useTopicSchema */ + useTopicSchema?: (boolean|null); } /** Represents an AvroConfig. */ @@ -3993,6 +3996,9 @@ export namespace google { /** AvroConfig writeMetadata. */ public writeMetadata: boolean; + /** AvroConfig useTopicSchema. */ + public useTopicSchema: boolean; + /** * Creates a new AvroConfig instance using the specified properties. * @param [properties] Properties to set @@ -4077,7 +4083,8 @@ export namespace google { ACTIVE = 1, PERMISSION_DENIED = 2, NOT_FOUND = 3, - IN_TRANSIT_LOCATION_RESTRICTION = 4 + IN_TRANSIT_LOCATION_RESTRICTION = 4, + SCHEMA_MISMATCH = 5 } } diff --git a/protos/protos.js b/protos/protos.js index 65103b824..b439f7b68 100644 --- a/protos/protos.js +++ b/protos/protos.js @@ -8986,6 +8986,7 @@ case 2: case 3: case 4: + case 5: break; } if (message.serviceAccountEmail != null && message.hasOwnProperty("serviceAccountEmail")) @@ -9065,6 +9066,10 @@ case 4: message.state = 4; break; + case "SCHEMA_MISMATCH": + case 5: + message.state = 5; + break; } if (object.serviceAccountEmail != null) message.serviceAccountEmail = String(object.serviceAccountEmail); @@ -9338,6 +9343,7 @@ * @memberof google.pubsub.v1.CloudStorageConfig * @interface IAvroConfig * @property {boolean|null} [writeMetadata] AvroConfig writeMetadata + * @property {boolean|null} [useTopicSchema] AvroConfig useTopicSchema */ /** @@ -9363,6 +9369,14 @@ */ AvroConfig.prototype.writeMetadata = false; + /** + * AvroConfig useTopicSchema. + * @member {boolean} useTopicSchema + * @memberof google.pubsub.v1.CloudStorageConfig.AvroConfig + * @instance + */ + AvroConfig.prototype.useTopicSchema = false; + /** * Creates a new AvroConfig instance using the specified properties. * @function create @@ -9389,6 +9403,8 @@ writer = $Writer.create(); if (message.writeMetadata != null && Object.hasOwnProperty.call(message, "writeMetadata")) writer.uint32(/* id 1, wireType 0 =*/8).bool(message.writeMetadata); + if (message.useTopicSchema != null && Object.hasOwnProperty.call(message, "useTopicSchema")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.useTopicSchema); return writer; }; @@ -9427,6 +9443,10 @@ message.writeMetadata = reader.bool(); break; } + case 2: { + message.useTopicSchema = reader.bool(); + break; + } default: reader.skipType(tag & 7); break; @@ -9465,6 +9485,9 @@ if (message.writeMetadata != null && message.hasOwnProperty("writeMetadata")) if (typeof message.writeMetadata !== "boolean") return "writeMetadata: boolean expected"; + if (message.useTopicSchema != null && message.hasOwnProperty("useTopicSchema")) + if (typeof message.useTopicSchema !== "boolean") + return "useTopicSchema: boolean expected"; return null; }; @@ -9482,6 +9505,8 @@ var message = new $root.google.pubsub.v1.CloudStorageConfig.AvroConfig(); if (object.writeMetadata != null) message.writeMetadata = Boolean(object.writeMetadata); + if (object.useTopicSchema != null) + message.useTopicSchema = Boolean(object.useTopicSchema); return message; }; @@ -9498,10 +9523,14 @@ if (!options) options = {}; var object = {}; - if (options.defaults) + if (options.defaults) { object.writeMetadata = false; + object.useTopicSchema = false; + } if (message.writeMetadata != null && message.hasOwnProperty("writeMetadata")) object.writeMetadata = message.writeMetadata; + if (message.useTopicSchema != null && message.hasOwnProperty("useTopicSchema")) + object.useTopicSchema = message.useTopicSchema; return object; }; @@ -9543,6 +9572,7 @@ * @property {number} PERMISSION_DENIED=2 PERMISSION_DENIED value * @property {number} NOT_FOUND=3 NOT_FOUND value * @property {number} IN_TRANSIT_LOCATION_RESTRICTION=4 IN_TRANSIT_LOCATION_RESTRICTION value + * @property {number} SCHEMA_MISMATCH=5 SCHEMA_MISMATCH value */ CloudStorageConfig.State = (function() { var valuesById = {}, values = Object.create(valuesById); @@ -9551,6 +9581,7 @@ values[valuesById[2] = "PERMISSION_DENIED"] = 2; values[valuesById[3] = "NOT_FOUND"] = 3; values[valuesById[4] = "IN_TRANSIT_LOCATION_RESTRICTION"] = 4; + values[valuesById[5] = "SCHEMA_MISMATCH"] = 5; return values; })(); diff --git a/protos/protos.json b/protos/protos.json index e37e3bd25..6497622c4 100644 --- a/protos/protos.json +++ b/protos/protos.json @@ -1389,6 +1389,13 @@ "options": { "(google.api.field_behavior)": "OPTIONAL" } + }, + "useTopicSchema": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, @@ -1398,7 +1405,8 @@ "ACTIVE": 1, "PERMISSION_DENIED": 2, "NOT_FOUND": 3, - "IN_TRANSIT_LOCATION_RESTRICTION": 4 + "IN_TRANSIT_LOCATION_RESTRICTION": 4, + "SCHEMA_MISMATCH": 5 } } } From 92508d53ad1e4623add615ccc1bed0ccd5f265b2 Mon Sep 17 00:00:00 2001 From: feywind <57276408+feywind@users.noreply.github.com> Date: Wed, 10 Jul 2024 16:40:04 -0400 Subject: [PATCH 5/5] build: more updates to help owlbot --- .eslintignore | 1 + owlbot.py | 4 +++- samples/.gitignore | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 samples/.gitignore diff --git a/.eslintignore b/.eslintignore index c4a0963e9..a5e47c7e7 100644 --- a/.eslintignore +++ b/.eslintignore @@ -3,6 +3,7 @@ test/fixtures build/ docs/ +owl-bot-staging/ protos/ samples/generated/ system-test/**/fixtures diff --git a/owlbot.py b/owlbot.py index 10dfd88ea..f3e6252cc 100644 --- a/owlbot.py +++ b/owlbot.py @@ -27,5 +27,7 @@ node.owlbot_main(templates_excludes=[ 'src/index.ts', '.github/PULL_REQUEST_TEMPLATE.md', - '.github/release-please.yml' + '.github/release-please.yml', + '.github/header-checker-lint.yaml', + '.eslintignore' ]) diff --git a/samples/.gitignore b/samples/.gitignore new file mode 100644 index 000000000..567609b12 --- /dev/null +++ b/samples/.gitignore @@ -0,0 +1 @@ +build/